QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#203846 | #7531. Hacking the Project | 275307894a | TL | 0ms | 0kb | C++14 | 1.3kb | 2023-10-06 21:08:47 | 2023-10-06 21:08:47 |
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;scanf("%d",&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';
}
详细
Test #1:
score: 0
Time Limit Exceeded
input:
1 4
output:
a 1