結果

問題 No.2551 2, 3, 5, 7 Game
ユーザー cho435cho435
提出日時 2023-11-28 22:28:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 790 bytes
コンパイル時間 8,091 ms
コンパイル使用メモリ 330,008 KB
実行使用メモリ 22,948 KB
最終ジャッジ日時 2023-11-28 22:28:17
合計ジャッジ時間 14,142 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
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;

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

ll n;
gp_hash_table<ll,int> mp;
int dfs(ll x){
	if(x>=n) return 1;
	auto itr=mp.find(x);
	if(itr!=mp.end()) return itr->second;
	vector<int>v={0,0,0,0,0};
	v[dfs(x*2)]++;
	v[dfs(x*3)]++;
	v[dfs(x*5)]++;
	v[dfs(x*7)]++;
	rep(i,5){
		if(!v[i]){
			return mp[x]=i;
		}
	}
	assert(1);
	return -1;
}

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