intさわだんのBlack History

刹那的レジェンドになりたい。

2014-09-25から1日間の記事一覧

AOJ 0009 Prime Number

エラトステネスの篩、生半可な知識で適当に実装してみたら一発で通ったのでらっきー。bool型の配列って全部初期化すること可能なんでしょうか。 #include <cstdio> #include <iostream> using namespace std; int main(){ int n; while(cin >> n){ bool d[1000000]; int ans = </iostream></cstdio>…

AOJ 0005

なんか進捗わるすぎてメンヘラ(仮)になってきたが簡単な問題だけでも解く 結局こういうときに頑張れるかor notで今後大きく変わってくるんだと思う。 #include <cstdio> #include <iostream> using namespace std; int gcd( int m, int n ) { if ( ( 0 == m ) || ( 0 == n ) </iostream></cstdio>…