2012-05-20から1日間の記事一覧

AOJ 1008 - What Color Is The Universe?

aoj

銀河鉄道の夜は読んだことがないです. 「僕達はどこへだって行ける気がしたんだ.」->オーバーフロー. 作品が違いますね. #include <iostream> #include <map> int main(){ int n; while(std::cin >> n, n){ std::map<long long int, int> stars; int max_num = 0, max_time = 0; for(int i=0</long></map></iostream>…

AOJ 1009 - Greatest Common Divisor

aoj

英語が読めるようになりたいです. #include <iostream> int main(){ int a, b; while(std::cin >> a >> b, !std::cin.eof()){ while(b){ int c = b; b = a % b, a = c; } std::cout << a << std::endl; } }</iostream>

AOJ 0565 - Lunch

aoj

いつかに解いた気がするのです. #include <iostream> #include <algorithm> int main(){ const int INF = 10000000; int min_p = INF, min_j = INF; for(int i=0;i<5;i++){ int n; std::cin >> n; if(i < 3) min_p = std::min(min_p, n); else min_j = std::min(min_j, n); } std</algorithm></iostream>…

AOJ 0522 - JOI and IOI

aoj

前作った関数が使えると思ったら無理でした. posを1つずつ動かすことで"IOIOI"のようなものに対応した. #include <iostream> int findText(std::string text, std::string oldText){ int times = 0, pos = 0; while(pos = text.find(oldText, pos), pos != std::stri</iostream>…