Submission #104361

# Submission time Handle Problem Language Result Execution time Memory
104361 2019-04-05T16:48:21 Z IVIosab Carnival (CEOI14_carnival) C++17
20 / 100
92 ms 412 KB
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define mp make_pair
#define ll long long

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    int vis[n],res[n];
    memset(vis,0,sizeof vis);
    memset(res,0, sizeof res);
    int cnt=0;
    for(int i=0;i<n;i++){
        if(vis[i]){
            continue;
        }
        cnt++;
        vis[i]=1;
        res[i]=cnt;
        for(int j=i+1;j<n;j++){
            if(vis[j]){
                continue;
            }
            cout<<2<<" "<<i+1<<" "<<j+1<<endl;
            int a;
            cin>>a;
            if(a==1){
                res[j]=cnt;
                vis[j]=1;
            }
        }
    }
    cout<<0<<" ";
    for(int i=0;i<n;i++){
        cout<<res[i]<<" ";
    }
    cout<<endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 8 ms 256 KB Output is correct
2 Correct 18 ms 256 KB Output is correct
3 Partially correct 43 ms 256 KB Partially correct
4 Partially correct 43 ms 384 KB Partially correct
5 Correct 4 ms 256 KB Output is correct
6 Correct 3 ms 256 KB Output is correct
7 Correct 15 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 9 ms 256 KB Output is correct
3 Partially correct 32 ms 276 KB Partially correct
4 Partially correct 58 ms 256 KB Partially correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 6 ms 256 KB Output is correct
7 Correct 8 ms 412 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 256 KB Output is correct
2 Correct 8 ms 384 KB Output is correct
3 Partially correct 35 ms 304 KB Partially correct
4 Partially correct 92 ms 384 KB Partially correct
5 Correct 4 ms 304 KB Output is correct
6 Correct 11 ms 256 KB Output is correct
7 Correct 31 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 256 KB Output is correct
2 Correct 8 ms 256 KB Output is correct
3 Partially correct 44 ms 384 KB Partially correct
4 Partially correct 74 ms 384 KB Partially correct
5 Correct 14 ms 412 KB Output is correct
6 Correct 14 ms 256 KB Output is correct
7 Correct 26 ms 404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB Output is correct
2 Correct 7 ms 384 KB Output is correct
3 Partially correct 46 ms 256 KB Partially correct
4 Partially correct 43 ms 256 KB Partially correct
5 Correct 15 ms 284 KB Output is correct
6 Partially correct 47 ms 384 KB Partially correct
7 Partially correct 86 ms 256 KB Partially correct