結果

問題 No.2551 2, 3, 5, 7 Game
ユーザー cho435cho435
提出日時 2023-11-28 22:22:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 677 bytes
コンパイル時間 7,075 ms
コンパイル使用メモリ 311,928 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-11-28 22:22:21
合計ジャッジ時間 13,400 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 434 ms
6,676 KB
testcase_01 AC 509 ms
6,676 KB
testcase_02 AC 431 ms
6,676 KB
testcase_03 AC 416 ms
6,676 KB
testcase_04 AC 484 ms
6,676 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using mint = atcoder::modint998244353;

ll n;
unordered_map<ll,int> mp;
int dfs(ll x){
	if(x>=n) return 1;
	if(mp.count(x)) return mp.at(x);
	set<int>st={0,1,2,3,4};
	st.erase(dfs(x*2));
	st.erase(dfs(x*3));
	st.erase(dfs(x*5));
	st.erase(dfs(x*7));
	return mp[x]=*st.begin();
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int t;
	cin>>t;
	rep(Ti,t){
		cin>>n;
		mp.clear();
		int rt=dfs(1);
		cout<<(rt?"sepa\n":"ryota\n");
	}
}
0