結果

問題 No.361 門松ゲーム2
ユーザー yaoshimax
提出日時 2016-04-18 00:26:47
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 658 bytes
コンパイル時間 580 ms
コンパイル使用メモリ 70,484 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 12:14:58
合計ジャッジ時間 1,928 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <climits>
#include <vector>
#include <cstdio>
#include <cstring>
using namespace std;

int main(){
   int L,D;
   cin >> L >> D;
   vector<int> grundy(L+1,0);
   for( int i = 6; i <=L; i++ ){
      for( int x=1; x<=L; x++ ){
         for( int y=x+1; y<=L; y++ ){
            int z = L-x-y;
            if( z <= y ) continue;
            if( z-x >D ) continue;
            int cur = grundy[x]^grundy[y]^grundy[z];
            if( cur == 0 ){
               grundy[i]=1;
            }
         }
      }
   }
   if( grundy[L] == 0){
      cout << "matsu"<<endl;
   }
   else{
      cout <<"kado"<<endl;
   }
   return 0;        
}
0