結果
問題 | No.2190 平方数の下12桁 |
ユーザー |
![]() |
提出日時 | 2023-01-13 21:45:33 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 335 ms / 2,000 ms |
コード長 | 519 bytes |
コンパイル時間 | 1,945 ms |
コンパイル使用メモリ | 194,116 KB |
最終ジャッジ日時 | 2025-02-10 02:23:26 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 41 |
ソースコード
#include<bits/stdc++.h>#include<atcoder/modint>using namespace std;using namespace atcoder;typedef modint998244353 mint;typedef long long ll;int main(){ll s; cin >> s;ll a = (ll)4096;ll b = (ll)244140625;ll x = s % a;ll y = s % b;ll ra = -1;ll rb = -1;for (ll i=0; i<a; i++){if (i * i % a == x){ra = i;break;}}for (ll i=0; i<b; i++){if (i * i % b == y){rb = i;break;}}if (ra == -1 || rb == -1){cout << "NO" << endl;return 0;}cout << "YES" << endl;}