結果
| 問題 |
No.2185 平方数の下6桁
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-01-13 22:09:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 202 ms / 2,000 ms |
| コード長 | 369 bytes |
| コンパイル時間 | 964 ms |
| コンパイル使用メモリ | 79,308 KB |
| 最終ジャッジ日時 | 2025-02-10 02:37:18 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 37 |
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <set>
using namespace std;
int main(){
string s;
cin >> s;
set<long long> st;
long long mod = 1000000;
for (long long i = 1; i <= 1000000;i++){
st.insert((i*i)%mod);
}
long long x = stoll(s);
if (st.count(x)){
cout << "YES\n";
}
else cout << "NO\n";
return 0;
}