Submission #476289

# Submission time Handle Problem Language Result Execution time Memory
476289 2021-09-25T22:36:35 Z ShahdMohamed Carnival (CEOI14_carnival) C++17
0 / 100
66 ms 200 KB
///LW M4 ACC HAZ3L GAMED
///YARAB WALA...I MEAN YARAB ACC
#include<bits/stdc++.h>
#define ll long long
//#define endl "\n"
const ll mod = (ll) 1e9 + 7;
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    ll n,cnt,took=0,p=1;
    cin>>n;
    vector<ll>ans(n);
    cout<<n<<" ";
    for (ll i=1; i<=n; i++)
        cout<<i<<" ";
    cout<<endl;
    cin>>cnt;
    for (ll i=0; i<n; i++)
    {
        if (n-took==cnt)
        {
            for (ll j=0; j<n; j++)
            {
                if (ans[j]==0)
                {
                    ans[j]=p;
                    p++;
                }
            }
            break;
        }
        if (ans[i]==0)
        {
            ans[i]=p;
            took++;
            for (ll j=i+1; j<n; j++)
            {
                if (n-took==cnt)
                {
                    for (ll j=0; j<n; j++)
                    {
                        if (ans[j]==0)
                        {
                            ans[j]=p;
                            p++;
                        }
                    }
                    break;
                }
                if (ans[j]==0)
                {
                    cout<<"2 "<<i+1<<" "<<j+1<<endl;
                    ll x;
                    cin>>x;
                    if (x==1)
                    {
                        ans[j]=p;
                        took++;
                    }
                }
            }
            p++;
            cnt--;
        }
        if (n-took==cnt)
        {
            for (ll j=0; j<n; j++)
            {
                if (ans[j]==0)
                {
                    ans[j]=p;
                    p++;
                }
            }
            break;
        }
    }
    cout<<"0 ";
    for (auto i:ans)
        cout<<i<<" ";
    cout<<endl;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 9 ms 200 KB Output is correct
2 Incorrect 20 ms 200 KB Incorrect
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 200 KB Output is correct
2 Correct 14 ms 200 KB Output is correct
3 Incorrect 26 ms 200 KB Incorrect
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 200 KB Output is correct
2 Correct 5 ms 200 KB Output is correct
3 Incorrect 43 ms 200 KB Incorrect
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 200 KB Output is correct
2 Correct 3 ms 200 KB Output is correct
3 Incorrect 66 ms 200 KB Incorrect
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 200 KB Output is correct
2 Correct 8 ms 200 KB Output is correct
3 Incorrect 50 ms 200 KB Incorrect
4 Halted 0 ms 0 KB -