結果
問題 |
No.2551 2, 3, 5, 7 Game
|
ユーザー |
![]() |
提出日時 | 2023-11-25 14:42:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 515 bytes |
コンパイル時間 | 636 ms |
コンパイル使用メモリ | 64,632 KB |
実行使用メモリ | 814,720 KB |
最終ジャッジ日時 | 2024-09-26 10:46:07 |
合計ジャッジ時間 | 4,472 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | MLE * 1 -- * 9 |
ソースコード
#include<iostream> using namespace std; int N; int d[4]={2,3,5,7}; int dfs(int num,int stat); int main(){ int t; cin>>t; for(int i=0;i<t;i++){ cin>>N; if(dfs(1,1)==1){ cout<<"sepa"<<endl; }else{ cout<<"ryota"<<endl; } } return(0); } int dfs(int num,int stat){ if(num>=N){ return(stat); } bool success=false; for(int i=0;i<4;i++){ if(dfs(num*d[i],stat^1)==stat){ success=true; } } if(success){ return(stat); } return(stat^1); }