Submission #574860

# Submission time Handle Problem Language Result Execution time Memory
574860 2022-06-09T12:37:46 Z m_fenais Carnival (CEOI14_carnival) C++17
100 / 100
21 ms 336 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> use;
int main()
{
   FAST;
   int n;
   cin>>n;
   int prev = 1, cnt = 2;
   use[1] = 1;
   mp[1] = 1;
   for(int i=2; i<=n; i++)
   {
     cout<<i<<' ';
     for(int j=1; j<=i; j++)
     {
       cout<<j<<' ';
     }
     cout<<endl;
     int x; cin>>x;
     if(x != prev){
        mp[i] = cnt;
        use[i] = 1;
        cnt++;
     }
     prev = x;
   }
   for(int i=1; i<=n; i++)
   {
     if(mp[i] == 0)
     {
       for(int j=1; j<i; j++)
       {
         if(use[j])
         {
           cout<<2<<' '<<i<<' '<<j<<endl;
           int x;
           cin>>x;
           if(x == 1){
             mp[i] = mp[j];
             break;
           }
         }
       }
     }
   }
   cout<<0<<' ';
   for(int i=1; i<=n; i++)
   {
     cout<<mp[i]<<' ';
   }
   return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 11 ms 332 KB Output is correct
2 Correct 13 ms 316 KB Output is correct
3 Correct 7 ms 316 KB Output is correct
4 Correct 5 ms 320 KB Output is correct
5 Correct 4 ms 312 KB Output is correct
6 Correct 4 ms 312 KB Output is correct
7 Correct 9 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 336 KB Output is correct
2 Correct 19 ms 208 KB Output is correct
3 Correct 13 ms 208 KB Output is correct
4 Correct 7 ms 312 KB Output is correct
5 Correct 4 ms 316 KB Output is correct
6 Correct 4 ms 316 KB Output is correct
7 Correct 10 ms 316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 316 KB Output is correct
2 Correct 7 ms 208 KB Output is correct
3 Correct 21 ms 324 KB Output is correct
4 Correct 5 ms 316 KB Output is correct
5 Correct 5 ms 316 KB Output is correct
6 Correct 4 ms 208 KB Output is correct
7 Correct 13 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 320 KB Output is correct
2 Correct 8 ms 316 KB Output is correct
3 Correct 9 ms 208 KB Output is correct
4 Correct 5 ms 208 KB Output is correct
5 Correct 3 ms 208 KB Output is correct
6 Correct 6 ms 320 KB Output is correct
7 Correct 14 ms 320 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 208 KB Output is correct
2 Correct 10 ms 208 KB Output is correct
3 Correct 16 ms 324 KB Output is correct
4 Correct 20 ms 208 KB Output is correct
5 Correct 5 ms 320 KB Output is correct
6 Correct 4 ms 324 KB Output is correct
7 Correct 7 ms 208 KB Output is correct