結果
| 問題 | No.152 貯金箱の消失 |
| コンテスト | |
| ユーザー |
albicilla
|
| 提出日時 | 2015-06-05 21:26:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 750 bytes |
| コンパイル時間 | 596 ms |
| コンパイル使用メモリ | 79,504 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-06 14:19:38 |
| 合計ジャッジ時間 | 1,835 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 12 |
ソースコード
#include <iostream>
#include <sstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <numeric>
using namespace std;
typedef long long ll;
long long gcd(long long a, long long b) {
if (b == 0)
return a;
return gcd(b, a%b);
};
int main(){
int L;
cin>>L;
int a,b,c;
int ans=0;
for(int i=1;i*i<L;i++){
for(int j=1;j<i;j++){
if(i%2==j%2&&gcd(i,j)>1) continue;
a=i*i-j*j;
b=2*i*j;
c=i*i+j*j;
if(j*j+i*i<L)ans++;
}
}
cout<<ans<<endl;
return 0;
}
albicilla