Submission #113233

# Submission time Handle Problem Language Result Execution time Memory
113233 2019-05-24T11:39:15 Z brcode Carnival (CEOI14_carnival) C++14
0 / 100
4 ms 384 KB
#include <iostream>

using namespace std;
const int MAXN = 155;
int counter = 0;
int arr[MAXN];
void rec(int l,int r){
    
    if(l == r){
        arr[l] = counter;
        counter++;
        return;
    }
    cout<<(r-l+1)<<" ";
    for(int i=l;i<=r;i++){
        cout<<i<<" ";
    }
    cout<<endl;
    cout.flush();
    int sz;
    cin>>sz;
    
    if(sz == (r-l+1)){
        
        for(int i=l;i<=r;i++){
            arr[i] = counter;
            counter++;
        }
        return;
    }
    if(sz == 1){
        for(int i=l;i<=r;i++){
            arr[i] = counter;
            
        }
        counter++;
        return;
    }
    int mid = (l+r)/2;
    rec(l,mid);
    rec(mid+1,r);
}
int main(){
    int n;
    cin>>n;
 
  

    rec(1,n);
    cout<<0<<" ";
    for(int i=1;i<=n;i++){
        cout<<arr[i]<<" ";
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Integer 0 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 256 KB Integer 0 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Integer 0 violates the range [1, 1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 384 KB Integer 0 violates the range [1, 4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Integer 0 violates the range [1, 2]
2 Halted 0 ms 0 KB -