답안 #580722

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
580722 2022-06-21T17:23:33 Z groshi Nizovi (COI14_nizovi) C++17
10 / 100
193 ms 280 KB
#include<iostream>

using namespace std;

int main()
{
    //cin.tie(0);
    //cout.tie(0);
    //ios_base::sync_with_stdio(0);
    int a,b;
    cin>>a>>b;
    int pocz_a=1;
    int ile_b=b;
    for(int i=1;i<=a && ile_b;i++)
    {
        int pocz=pocz_a+a-i+1;
        cout<<"cmp "<<pocz_a<<" "<<pocz<<"\n";
        int x;
        cin>>x;
        if(x==-1)
        {
            pocz_a++;
            continue;
        }
        int kon=a+b,sre,ostd=pocz;
        int ile=-pocz;
        while(pocz<kon)
        {
            sre=(pocz+kon+1)/2;
            cout<<"cmp "<<pocz_a<<" "<<sre<<"\n";
            int x;
            cin>>x;
            if(x==-1)
                kon=sre-1;
            else{
                pocz=sre;
                ostd=sre;
            }
        }
        if(pocz_a<ostd)
        {
            //cout<<flush;
            cout<<"reverse "<<pocz_a<<" "<<ostd<<"\n";
        }
        ile+=ostd;
        ile_b-=ile+1;
        if(pocz_a<pocz_a+ile-1)
        {
            //cout<<flush;
            cout<<"reverse "<<pocz_a<<" "<<pocz_a+ile<<"\n";
        }
        if(pocz_a+ile<ostd)
        {
            //cout<<flush;
            cout<<"reverse "<<pocz_a+ile+1<<" "<<ostd<<"\n";
        }
        pocz_a+=ile+2;
    }
    cout<<"end\n";
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 208 KB Incorrect
2 Incorrect 2 ms 208 KB Incorrect
3 Incorrect 2 ms 208 KB Incorrect
4 Incorrect 28 ms 208 KB Incorrect
5 Incorrect 10 ms 208 KB Incorrect
6 Incorrect 12 ms 208 KB Incorrect
7 Incorrect 148 ms 208 KB Incorrect
8 Incorrect 182 ms 208 KB Incorrect
9 Correct 148 ms 208 KB Output is correct
10 Runtime error 193 ms 280 KB Execution killed with signal 13