Submission #172683

# Submission time Handle Problem Language Result Execution time Memory
172683 2020-01-02T11:18:31 Z nafis_shifat Carnival (CEOI14_carnival) C++14
68 / 100
59 ms 400 KB
#include<bits/stdc++.h>
#define pii pair<int,int>
#define ll long long
using namespace std;
const int mxn=160;
int main()
{
	int n;
	cin>>n;

	cout<<n<<" ";
	for(int i=1;i<=n;i++)cout<<i<<" ";
	cout<<endl;
    int lst;
    cin>>lst;

    vector<int> baps;
    baps.push_back(1);
    
    int dn[mxn]={};
    dn[1]=1;

    for(int i=n-1;i>0;i--)
    {
    	cout<<i<<" ";
    	for(int j=1;j<=i;j++)cout<<j<<" ";
    	cout<<endl;
        int t;
        cin>>t;

        if(t!=lst)
        {
        
        	baps.push_back(i+1);
        	dn[i+1]=1;

        }
        lst=t;
    }
    
  
    vector<int> p[mxn];

    for(int i=0;i<baps.size();i++)
    {
    	for(int j=1;j<=n;j++)
    	{
    		if(dn[j]==0)
    		{
    			cout<<"2 "<<baps[i]<<" "<<j<<endl;

    			int k;
    			cin>>k;
    			if(k==1)
    			{
    				p[baps[i]].push_back(j);
    				dn[j]=1;
    			}
    		}
    	}
    }

    int res[mxn];



    for(int i=0;i<baps.size();i++)
    {
    	res[baps[i]]=i+1;
    	for(int j=0;j<p[baps[i]].size();j++)
    	{
    		res[p[baps[i]][j]]=i+1;
    	}
    }
    cout<<"0 ";
    for(int i=1;i<=n;i++)cout<<res[i]<<" ";
    cout<<endl;

	return 0;
}

Compilation message

carnival.cpp: In function 'int main()':
carnival.cpp:44:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<baps.size();i++)
                 ~^~~~~~~~~~~~
carnival.cpp:67:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<baps.size();i++)
                 ~^~~~~~~~~~~~
carnival.cpp:70:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      for(int j=0;j<p[baps[i]].size();j++)
                  ~^~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 11 ms 296 KB Output is correct
2 Correct 29 ms 248 KB Output is correct
3 Correct 33 ms 380 KB Output is correct
4 Correct 9 ms 248 KB Output is correct
5 Correct 5 ms 248 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Correct 15 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 376 KB Output is correct
2 Correct 19 ms 376 KB Output is correct
3 Correct 16 ms 296 KB Output is correct
4 Correct 9 ms 248 KB Output is correct
5 Correct 19 ms 248 KB Output is correct
6 Correct 6 ms 376 KB Output is correct
7 Correct 19 ms 248 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 380 KB Output is correct
2 Correct 10 ms 376 KB Output is correct
3 Correct 16 ms 316 KB Output is correct
4 Correct 7 ms 400 KB Output is correct
5 Correct 12 ms 376 KB Output is correct
6 Correct 6 ms 248 KB Output is correct
7 Correct 39 ms 248 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 376 KB Output is correct
2 Correct 10 ms 248 KB Output is correct
3 Correct 25 ms 380 KB Output is correct
4 Correct 8 ms 376 KB Output is correct
5 Correct 25 ms 248 KB Output is correct
6 Partially correct 59 ms 376 KB Partially correct
7 Correct 28 ms 248 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 248 KB Output is correct
2 Correct 17 ms 248 KB Output is correct
3 Correct 23 ms 316 KB Output is correct
4 Correct 18 ms 248 KB Output is correct
5 Partially correct 49 ms 376 KB Partially correct
6 Correct 5 ms 248 KB Output is correct
7 Correct 8 ms 316 KB Output is correct