Submission #574773

# Submission time Handle Problem Language Result Execution time Memory
574773 2022-06-09T11:49:03 Z m_fenais Carnival (CEOI14_carnival) C++14
0 / 100
121 ms 304 KB
#include <bits/stdc++.h>
//#define endl '\n'
#define mk make_pair
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
typedef long long ll;
using namespace std;

const int N = 1e6 + 10;
const int mod = 1e9 + 7;
map<int, int> mp;
map<int, int> ans;
int main()
{
   FAST;
   int n;
   cin>>n;
   for(int i=1; i<=n; i++)
    mp[i] = i;
   for(int i=1; i<n; i++)
   {
     for(int j=i+1; j<=n; j++)
     {
       if(i != j){
        cout<<2<<' '<<i<<' '<<j<<endl;
        int x;
        cin>>x;
        if(x == 1)
        {
          mp[j] = mp[i];
        }
      }
     }
   }
   int cnt = 1;
   for(int i=1; i<=n; i++)
   {
     for(int j=i+1; j<=n; j++)
     {
       if(mp[j] == mp[i])
        ans[j] = cnt;
     }
     if(ans[i] == 0){
      ans[i] = cnt;
      cnt++;
    }
   }
   cout<<0<<' ';
   for(int i=1; i<=n; i++)
   {
     cout<<mp[i]<<' ';
   }
   return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 77 ms 304 KB Integer 19 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 121 ms 300 KB Integer 6 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 72 ms 300 KB Partially correct
2 Incorrect 94 ms 300 KB Integer 11 violates the range [1, 8]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 93 ms 300 KB Integer 5 violates the range [1, 4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 79 ms 304 KB Partially correct
2 Incorrect 115 ms 304 KB Integer 20 violates the range [1, 17]
3 Halted 0 ms 0 KB -