結果
| 問題 | 
                            No.361 門松ゲーム2
                             | 
                    
| コンテスト | |
| ユーザー | 
                             kurenai3110
                         | 
                    
| 提出日時 | 2016-09-14 00:50:01 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 109 ms / 2,000 ms | 
| コード長 | 457 bytes | 
| コンパイル時間 | 649 ms | 
| コンパイル使用メモリ | 64,164 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-17 05:14:41 | 
| 合計ジャッジ時間 | 1,913 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 28 | 
ソースコード
#include <iostream>
#include <set>
using namespace std;
int L, D;
int gr[501];
int main()
{
	cin >> L >> D;
	for (int i = 1; i <= L; i++) {
		set<int> s;
		for (int j = 1; j <= i; j++) {
			for (int k = j + 1; i-j-k>k; k++) {
				int r = i - j - k;
				if (r - j > D)continue;
				s.insert(gr[j]^gr[k]^gr[r]);
			}
		}
		while(s.count(gr[i])) gr[i]++;
	}
	if (gr[L]) {
		cout << "kado" << endl;
	}
	else {
		cout << "matsu" << endl;
	}
    
	return		0;
}
            
            
            
        
            
kurenai3110