結果
問題 |
No.152 貯金箱の消失
|
ユーザー |
![]() |
提出日時 | 2015-07-07 19:19:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 346 bytes |
コンパイル時間 | 1,048 ms |
コンパイル使用メモリ | 157,952 KB |
実行使用メモリ | 8,576 KB |
最終ジャッジ日時 | 2024-07-08 01:31:02 |
合計ジャッジ時間 | 10,673 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 1 TLE * 1 -- * 5 |
ソースコード
#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<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; }