結果
問題 | No.361 門松ゲーム2 |
ユーザー |
|
提出日時 | 2020-03-04 14:35:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 109 ms / 2,000 ms |
コード長 | 367 bytes |
コンパイル時間 | 557 ms |
コンパイル使用メモリ | 73,272 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-14 00:14:37 |
合計ジャッジ時間 | 1,617 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() | ^~~~
ソースコード
#include<iostream>#include<set>using namespace std;int gr[501];int D,L;main(){cin>>L>>D;for(int i=1;i<=L;i++){set<int>S;for(int l1=1;l1*3<i;l1++)for(int l2=l1+1;l1+l2+l2<i;l2++){int l3=i-l1-l2;if(l3-l1<=D){S.insert(gr[l1]^gr[l2]^gr[l3]);}}while(S.find(gr[i])!=S.end())gr[i]++;}cout<<(gr[L]?"kado":"matsu")<<endl;}