結果
| 問題 | No.1218 Something Like a Theorem |
| コンテスト | |
| ユーザー |
misora192
|
| 提出日時 | 2020-11-06 20:45:01 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 615 bytes |
| 記録 | |
| コンパイル時間 | 1,461 ms |
| コンパイル使用メモリ | 166,100 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-22 11:56:12 |
| 合計ジャッジ時間 | 2,125 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 WA * 3 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)
using namespace std;
typedef long long ll;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n, z;
cin >> n >> z;
if(n >= 3){
cout << "No" << endl;
exit(0);
}
for(int x = 1; x * x <= z * z; x++){
for(int y = 1; y * y <= z * z; y++){
if(x * x + y * y == z * z){
cout << "Yes" << endl;
exit(0);
}
}
}
cout << "No" << endl;
}
misora192