結果
問題 |
No.1593 Perfect Distance
|
ユーザー |
|
提出日時 | 2021-07-18 12:59:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 350 bytes |
コンパイル時間 | 527 ms |
コンパイル使用メモリ | 69,376 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 06:34:36 |
合計ジャッジ時間 | 7,721 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 WA * 5 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main(){ int n; cin >> n; vector<int> c; int a = 1; while(a*a<n*n){ c.push_back(a*a); a++; } int ans = 0; for(int i=0; i<c.size(); i++) for(int j=0; j<c.size(); j++) if(i != j and c[i] + c[j] == n*n) ans++; cout << ans << endl; }