競技プログラミング
ABC253 C - Max - Min Query で、解説を見たら、 例えば c++ なら std::multiset を用いることにより高速に処理できます とか言われて、??? となったので、調べた。 multiset とは cpprefjp.github.io 日本語だと、多重集合。 問題文にも書いてあった。 R…
Rubyのインスタンス変数的なやつをやりたかった。 use std::cell::Cell; struct S { n: usize, cnt: Cell<i64>, } impl S { fn f(&self) { for _ in 0..self.n { self.cnt.set(self.cnt.get() + 1); } } } fn main() { let s = S { n: 10, cnt: Cell::new(0), }; </i64>…
TLEになるので、入力に気をつけよう。 これとか。 atcoder.jp use proconio::input; use proconio::source::line::LineSource; use std::io::{stdin, BufReader}; fn main() { let stdin = stdin(); let mut source = LineSource::new(BufReader::new(stdin.…
みんなのデータ構造を読んで、ヒープを実装した。 みんなのデータ構造作者:Pat MorinラムダノートAmazon 数字以外の配列とかを要素にしたいときは、そのまま突っ込んで、compare を変更する。 AtCoder でいくつか提出してみた感じでは、使えるようだった。 B…
chokudaiさんが毎日一問問題を選んでくれる #chokudai今日の一問 4日目は 今日の一問は、ARC001より、リモコン!AtCoderはここから始まった。今の基準だと簡単目の300点くらいかな?解くことは出来るだろうけど、「5分で解いて」ってなると水色レベル。早解…
#chokudai今日の一問 3日目は, 今日の一門はPyramid!300点問題ながら参加者の多くを苦しめた一問。何度か言及してるので、解いてる人も多そうな問題かな。https://t.co/YQYRDqrt7t#chokudai今日の一問— chokudai(高橋 直大) (@chokudai) August 21, 2019 A…
#chokudai今日の一問 2日目は, 今日の一問!ABC026より、高橋君の給料。今だと300点くらい?これも昨日と同じく「実装出来てほしい」系の問題。緑の人の目標タイムが20分くらい、って感じ。https://t.co/Z2MuWxj8lp— chokudai(高橋 直大) (@chokudai) Augus…
いつの間にかできていた #chokudai今日の一問 記念すべき1問目は,多分これ. 緑の人がこの辺の問題を解けてないのを見ると、「こいつら実装力あるって言って大丈夫か」って思っちゃう部分もある。数学的な思考力があれば、実装力が全然なくても到達できちゃ…
出場はしてない A. +-x 問題文の通りに最大値を出力する. #include <algorithm> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <sstream> #include <string> using namespace std; void solve(int a, int b) { printf("%d\n", max({a + b, a - b, a * b})); } </string></sstream></queue></map></iostream></iomanip></cstdio></cmath></algorithm>…
最近は codeforces にも頑張って出ているが,こちらも出るたびにratingが下がっていく… しかし,codeforces 出ると AtCoder は使いやすいなぁと思う. Cまで開けたが,わからんかった. A. Choose Two Numbers 普通に総当たり n = int(input()) a = list(map…
D まで解いた. Dはpythonで再帰したら深さがアレでREになったっぽかったのでC++に書き直すか,と思ったら時間切れだった. しかし,最近出るたびにratingが下がっていく… A. Red or Not 普通に場合分け a = int(input()) if a >= 3200: print(input()) else…
A, B 1056 -> 1001 AtCoder #125 A - Biscuit Generator AtCoder ABC #125 B - Resale AtCoder ABC #125 C - GCD on Blackboard
A, B 1207 -> 1300 Codeforces #551 Div2 A - Serval and Bus Codeforces #551 Div2 B - Serval and Toy Bricks Codeforces #551 Div2 C - Serval and Parenthesis Se ...
A, B, C 1074 -> 1065 AtCoder ABC #124 A - Buttons AtCoder ABC #124 B - Great Ocean View AtCoder ABC #124 C - Coloring Colorfully AtCoder ABC #124 D - Handstand
A, B, C 1073-> 1074 AtCoder ABC #123 A - Five Antennas AtCoder ABC #123 B - Five Dishes AtCoder ABC #123 C - Five Transportations AtCoder ABC #123 D - Cake 123
A, B, C 1071-> 1073 AtCoder ABC #121 A - White Cells AtCoder ABC #121 B - Can you solve this? AtCoder ABC #121 C - Energy Drink Collector AtCoder ABC #121 D - XOR World
A, B, C 1047- > 1071 AtCoder ABC #120 A. Favorite Sound AtCoder ABC #120 B. K-th Common Divisor AtCoder ABC #120 C. Unification AtCoder ABC #120 D. Decayed Bridges
A, B 1042 -> 1047 AtCoder ABC #119 A. Still TBD AtCoder ABC #119 B. Digital Gifts AtCoder ABC #119 C. Synthetic Kadomatsu
400点埋め Q が大きいので,前計算しておく. D が同じなので累積和を使う. AtCoder ABC #089 D. Practical Skill Test
400点埋め 解説読んでもいまいちピンとこなかったので写経. AtCoder ABC #087 D. People on a Line
x を Array にしたら RE になったので Hash で. AtCoder AGC 028 A
400点埋め AtCoder ABC #085 D
400点埋め 最初問題を読み違えていたが,普通にループを回して間に合う. AtCoder ABC #080 D Recording
400点埋め この前書いた ダイクストラで AtCoder ABC #079 D
400点埋め AtCoder ABC #071 D
AtCoder ABC #110 D
C が解けなかった D は素因数分解やって組合せだろうな,というとこまでは考えたが… B のテストケースに問題があって Unrated になる可能性があるらしい. AtCoder ABC #110 C AtCoder ABC #110 B AtCoder ABC #110 A
1054 -> 1011 C で詰まって終了 久しぶりに解説放送見て C D 解いたけど,やっぱりわかりやすい. A A * B が偶数なら "No" で 奇数なら "Yes" AtCoder ABC #109 A B Hash に突っ込んでやったけど,2重ループ回すのでも余裕で間に合うみたい. AtCoder ABC #…
1015 -> 1054 A 偶数の個数と奇数の個数を数える. AtCoder ABC #108 A B 回転行列で. 45度回転させて √2 倍する. AtCoder ABC #108 B C a + b, b + c, c + a が kの倍数になるのは, a, b, c がkの倍数 a + b, b + c, c + a がkの倍数,つまり,a, b, c …
AtCoder ABC #090 D. Remainder Reminder