結果
| 問題 | No.152 貯金箱の消失 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-21 05:50:02 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 11 ms / 5,000 ms |
| + 249µs | |
| コード長 | 256 bytes |
| 記録 | |
| コンパイル時間 | 270 ms |
| コンパイル使用メモリ | 75,036 KB |
| 実行使用メモリ | 9,904 KB |
| 最終ジャッジ日時 | 2026-10-10 09:40:00 |
| 合計ジャッジ時間 | 1,269 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 long
using 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;
}