結果
| 問題 |
No.1593 Perfect Distance
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-10 00:17:57 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 282 bytes |
| コンパイル時間 | 1,992 ms |
| コンパイル使用メモリ | 196,804 KB |
| 最終ジャッジ日時 | 2025-01-22 23:09:20 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin>>n;
set<int> st;
for (int i = 1; i <= n; ++i) st.insert(i*i);
int ans = 0;
for (int i = 0; i <= n; ++i) {
ans += st.find(n*n-i*i) != st.end();
}
cout << ans << endl;
}