結果
問題 | No.152 貯金箱の消失 |
ユーザー |
![]() |
提出日時 | 2015-07-07 19:21:06 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 13 ms / 5,000 ms |
コード長 | 348 bytes |
コンパイル時間 | 1,057 ms |
コンパイル使用メモリ | 158,292 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 01:31:14 |
合計ジャッジ時間 | 1,577 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
ソースコード
#include <bits/stdc++.h>using namespace std;int gcd(int a,int b){int ans=a%b;if(ans==0) return b;else return gcd(b,ans);}int main(){int l; cin>>l; l/=4;int ans=0;int m,n;for(m=2;m*m<l;m++){for(n=(m%2)+1;n<m;n+=2){if(2*m*(m+n)>l) break;if(gcd(m,n)!=1) continue;ans++;}}cout<<ans%1000003<<endl;return 0;}