結果
問題 | No.152 貯金箱の消失 |
ユーザー |
|
提出日時 | 2019-07-21 05:50:02 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 27 ms / 5,000 ms |
コード長 | 256 bytes |
コンパイル時間 | 669 ms |
コンパイル使用メモリ | 59,776 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-03 00:34:34 |
合計ジャッジ時間 | 1,415 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type] 6 | main() | ^~~~
ソースコード
#include<iostream>#define int longusing namespace std;int L,ans;int gcd(int a,int b){return b?gcd(b,a%b):a;}main(){cin>>L;L/=4;for(int n=1;2*n<=L;n++)for(int m=1;m<n&&2*n*(n+m)<=L;m++){ans+=n+m&1&&gcd(n-m,2*n*m)==1;}cout<<ans<<endl;}