結果
問題 |
No.726 Tree Game
|
ユーザー |
![]() |
提出日時 | 2023-04-11 12:25:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,080 bytes |
コンパイル時間 | 4,303 ms |
コンパイル使用メモリ | 251,500 KB |
最終ジャッジ日時 | 2025-02-12 05:01:15 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 WA * 2 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:48:12: warning: ‘yy’ may be used uninitialized [-Wmaybe-uninitialized] 48 | ll z=yy-y+xx-x-2; | ~~^~ main.cpp:13:8: note: ‘yy’ was declared here 13 | ll yy,xx; | ^~ main.cpp:48:14: warning: ‘xx’ may be used uninitialized [-Wmaybe-uninitialized] 48 | ll z=yy-y+xx-x-2; | ~~~~^~~ main.cpp:13:11: note: ‘xx’ was declared here 13 | ll yy,xx; | ^~
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll inf=144499999999994; ll mod=998244353; int main(){ ll y,x; cin >> y >> x; ll yy,xx; for (ll i = y+1; i >=0; i++) { bool ok=false; for (ll j = 2; j*j <=i; j++) { if (i%j==0) { ok=true; break; } } if (!ok) { yy=i; break; } } for (ll i = x+1; i >=0; i++) { bool ok=false; for (ll j = 2; j*j <=i; j++) { if (i%j==0) { ok=true; break; } } if (!ok) { xx=i; break; } } ll z=yy-y+xx-x-2; if (x==xx&&y==yy) { cout << "Second" << endl; return 0; } if (z%2) { cout << "First" << endl; }else{ cout << "Second"<< endl; } }