結果
| 問題 |
No.1593 Perfect Distance
|
| コンテスト | |
| ユーザー |
ripity
|
| 提出日時 | 2021-12-18 15:33:45 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 84 ms / 2,000 ms |
| コード長 | 279 bytes |
| コンパイル時間 | 1,699 ms |
| コンパイル使用メモリ | 196,776 KB |
| 最終ジャッジ日時 | 2025-01-27 03:18:58 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(void){
long N;
int ans = 0;
cin >> N;
set<long> s;
for( long i = 1; i < N; i++ ) {
s.insert(i*i);
}
for( long i : s ) {
if( s.count(N*N-i) ) ans++;
}
cout << ans << endl;
}
ripity