結果
| 問題 |
No.726 Tree Game
|
| コンテスト | |
| ユーザー |
sumeragifseiei
|
| 提出日時 | 2018-08-24 22:54:02 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 839 bytes |
| コンパイル時間 | 558 ms |
| コンパイル使用メモリ | 59,356 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-23 08:41:44 |
| 合計ジャッジ時間 | 1,483 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 5 |
ソースコード
#include <iostream>
#include <math.h>
using namespace std;
typedef long long ll;
ll x, y, ans;
int main(void){
// Your code here!
cin >> x >> y;
bool G = true;
for (ll i = 2; i <= sqrt(x); i++){
if (x % i == 0) G = false;
}
for (ll i = 2; i <= sqrt(y); i++){
if (y % i == 0) G = false;
}
if (G){
cout << "First" << endl;
return 0;
}
while(true){
x++, ans++;
bool sosu = true;
for (ll i = 2; i <= sqrt(x); i++){
if (x % i == 0) sosu = false;
}
if (sosu) break;
}
while(true){
y++, ans++;
bool sosu = true;
for (ll i = 2; i <= sqrt(y); i++){
if (y % i == 0) sosu = false;
}
if (sosu) break;
}
cout << (ans % 2 == 0 ? "Second" : "First") << endl;
}
sumeragifseiei