結果
| 問題 | No.1593 Perfect Distance |
| コンテスト | |
| ユーザー |
chacoder1
|
| 提出日時 | 2021-07-26 19:55:49 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 329 bytes |
| 記録 | |
| コンパイル時間 | 1,045 ms |
| コンパイル使用メモリ | 211,672 KB |
| 実行使用メモリ | 11,296 KB |
| 最終ジャッジ日時 | 2026-06-22 03:48:35 |
| 合計ジャッジ時間 | 6,826 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 12 TLE * 1 -- * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
signed main(){
int n;
cin>>n;
int cnt=0;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(i*i+j*j>n*n) break;
if(i*i+j*j==n*n) cnt++;
}
}
cout<<cnt<<endl;
return 0;
}
chacoder1