답안 #608936

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
608936 2022-07-27T11:20:03 Z sword060 사육제 (CEOI14_carnival) C++17
100 / 100
21 ms 336 KB
#include <bits/stdc++.h>
using namespace std;
int ask(int l,int r){
  cout<<r-l+1<<" ";
  for(int i=l;i<=r;i++)cout<<i<<" ";
  cout<<endl;
  int p;cin>>p;
  return p;
}
int main(){
  ios::sync_with_stdio(0); cin.tie(0);
  int x;cin>>x;
  map<int,int>mp;
  vector<int>ans;
  int lst=0;
  for(int i=1;i<=x;i++){
    int z=ask(1,i);
    if(z>lst){
      lst=z;mp[z]=i;
      ans.push_back(z);
    }else{
      int m;
      for(int j=1;j<=lst;j++){
        cout<<"2 "<<mp[j]<<" "<<i<<endl;
        int p;cin>>p;
        if(p==1){m=j;break;}
      }
      ans.push_back(m);
    }
  }
  cout<<"0 ";
  for(auto i:ans)cout<<i<<" ";
  cout<<endl;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 208 KB Output is correct
2 Correct 16 ms 208 KB Output is correct
3 Correct 17 ms 300 KB Output is correct
4 Correct 4 ms 208 KB Output is correct
5 Correct 3 ms 208 KB Output is correct
6 Correct 4 ms 208 KB Output is correct
7 Correct 10 ms 316 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 208 KB Output is correct
2 Correct 19 ms 208 KB Output is correct
3 Correct 9 ms 208 KB Output is correct
4 Correct 8 ms 320 KB Output is correct
5 Correct 3 ms 208 KB Output is correct
6 Correct 4 ms 208 KB Output is correct
7 Correct 7 ms 316 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 312 KB Output is correct
2 Correct 10 ms 208 KB Output is correct
3 Correct 21 ms 312 KB Output is correct
4 Correct 4 ms 208 KB Output is correct
5 Correct 3 ms 208 KB Output is correct
6 Correct 2 ms 316 KB Output is correct
7 Correct 13 ms 316 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 336 KB Output is correct
2 Correct 9 ms 308 KB Output is correct
3 Correct 11 ms 316 KB Output is correct
4 Correct 4 ms 316 KB Output is correct
5 Correct 3 ms 208 KB Output is correct
6 Correct 5 ms 208 KB Output is correct
7 Correct 12 ms 316 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 316 KB Output is correct
2 Correct 11 ms 316 KB Output is correct
3 Correct 17 ms 208 KB Output is correct
4 Correct 16 ms 308 KB Output is correct
5 Correct 4 ms 316 KB Output is correct
6 Correct 4 ms 324 KB Output is correct
7 Correct 7 ms 208 KB Output is correct