QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#203850#7531. Hacking the Project275307894aTL 0ms0kbC++141.3kb2023-10-06 21:10:442023-10-06 21:10:45

Judging History

你现在查看的是最新测评结果

  • [2023-10-06 21:10:45]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2023-10-06 21:10:44]
  • 提交

answer

#include<bits/stdc++.h>
#define Gc() getchar() 
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
#define d(x,y) ((m)*(x-1)+(y))
#define R(n) (rnd()%(n)+1)
#define Pc(x) putchar(x)
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
using namespace std;using ll=long long;using db=double;using lb=long db;using ui=unsigned;using ull=unsigned long long;using pii=pair<int,int>;using LL=__int128;
const int N=1e4+1,M=100+1,K=600+5,mod=1e9+7,Mod=mod-1;const db eps=1e-6;const ll INF=1e18+7;mt19937 rnd(263082);
int n;map<string,int> f;
void calc(vector<char> s){
	if(s.empty()) return;
	if(s.size()==1){
		cout<<s[0]<<' '<<n-f.size()<<endl;
		int x;cin>>x;while(x--) {string c;cin>>c;f[c]=1;}
		return;
	}
	int Le=(n-f.size())/s.size()+1;
	vector<char> t;
	for(auto i:s) {
		cout<<i<<' '<<Le<<endl;
		int x;cin>>x;
		int flag=0;
		if(x>=Le) t.emplace_back(i),flag=1;
		while(x--) {string c;cin>>c;if(!flag) f[c]=1;}
	}
	calc(t);
}
void Solve(){
	int i,j;cin>>n;f.clear();
	vector<char> s;
	for(int i=0;i<26;i++) s.emplace_back(i+'a');
	calc(s);
	cout<<"answer ";
	for(auto i:f) cout<<i.fi<<' ';cout<<endl;
}
int main(){
	// freopen("1.in","r",stdin);
	int t=1;
	cin>>t;
	while(t--) Solve();
	cerr<<clock()*1.0/CLOCKS_PER_SEC<<'\n';
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Time Limit Exceeded

input:

1
4

output:

a 1

result: