結果

問題 No.152 貯金箱の消失
ユーザー kotatsugamekotatsugame
提出日時 2019-07-21 05:46:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 232 bytes
コンパイル時間 551 ms
コンパイル使用メモリ 64,228 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-08-31 00:01:23
合計ジャッジ時間 7,399 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,616 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:5:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    5 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
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+=gcd(n-m,2*n*m)==1;
	}
	cout<<ans<<endl;
}
0