結果
| 問題 | 
                            No.726 Tree Game
                             | 
                    
| コンテスト | |
| ユーザー | 
                             annin256
                         | 
                    
| 提出日時 | 2018-08-26 22:39:56 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 383 bytes | 
| コンパイル時間 | 194 ms | 
| コンパイル使用メモリ | 31,744 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-01 04:00:58 | 
| 合計ジャッジ時間 | 1,018 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 23 WA * 2 | 
ソースコード
#include <stdio.h>
bool prime(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return n >= 2;
}
int next_prime(int x) {
  x++;
  while (!prime(x)) x++;
  return x;
}
int main(void) {
  int y, x;
  scanf("%d %d", &y, &x);
  int dy = next_prime(y) - y;
  int dx = next_prime(x) - x;
  puts((dy + dx) % 2 == 1 ? "First" : "Second");
  return 0;
}
            
            
            
        
            
annin256