結果
問題 | No.152 貯金箱の消失 |
ユーザー |
![]() |
提出日時 | 2015-02-15 23:36:27 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 20 ms / 5,000 ms |
コード長 | 343 bytes |
コンパイル時間 | 401 ms |
コンパイル使用メモリ | 34,524 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 20:25:06 |
合計ジャッジ時間 | 1,038 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d", &L); | ~~~~~^~~~~~~~~~
ソースコード
#include <cstdio> #include <algorithm> int main(){ int L; scanf("%d", &L); int res = 0; for(int s=1;s<=10000;s+=2){ for(int t=1;t<s;t+=2){ if(4 * s * (s + t) > L){continue;} if(std::__gcd(s, t) != 1){continue;} res = (res + 1) % 1000003; } } printf("%d\n", res); }