답안 #625474

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
625474 2022-08-10T12:16:21 Z Stavab Aliens (IOI07_aliens) C++14
20 / 100
2 ms 220 KB
#include <iostream>
 
using namespace std;
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 
    int n, x0, y0;
    cin >> n >> x0 >> y0;
    
    
    int t = 1;
    while(1)
    {
        if(x0 - t > 0)
            cout << "examine " << x0 - t << " " << y0 << endl;
        else
            break;
        
        string s;
        cin >> s;
        
        if(s == "true")
            t *= 2;
        else
            break;
    }
    int low = max(x0 - t, 0);
    int high = x0;
    while(high - low > 1)
    {
        int middle = (low + high) / 2;
        
        cout << "examine " << middle << " " << y0 << endl;
        
        string s;
        cin >> s;
        
        if(s == "true")
            high = middle;
        else
            low = middle;
    }
    int xL = high;
    
    t = 1;
    while(1)
    {
        if(x0 + t <= n)
            cout << "examine " << x0 + t << " " << y0 << endl;
        else
            break;
        
        string s;
        cin >> s;
        
        if(s == "true")
            t *= 2;
        else
            break;
    }
    low = x0;
    high = min(x0 + t, n + 1);
    while(high - low > 1)
    {
        int middle = (low + high) / 2;
        
        cout << "examine " << middle << " " << y0 << endl;
        
        string s;
        cin >> s;
        
        if(s == "true")
            low = middle;
        else
            high = middle;
    }
    int xR = low;
 
    int m = xR - xL + 1;
 
    t = 1;
    while(1)
    {
        if(y0 + t <= n)
            cout << "examine " << x0 << " " << y0 + t << endl;
        else
            break;
        
        string s;
        cin >> s;
        
        if(s == "true")
            t *= 2;
        else
            break;
    }
    low = y0;
    high = min(y0 + t, n + 1);
    while(high - low > 1)
    {
        int middle = (low + high) / 2;
        
        cout << "examine " << x0 << " " << middle << endl;
        
        string s;
        cin >> s;
        
        if(s == "true")
            low = middle;
        else
            high = middle;
    }
    int yU = low;
    
    int yD = yU - m + 1;
    
    int middleX = (xR + xL) / 2;
    int middleY = (yU + yD) / 2;
    
    int cornerX = middleX;
    string s;
    while(1)
    {
        if(cornerX + 2*m < n)
            cout << "examine " << cornerX + 2*m << " " << middleY << endl;
        else
            break;
            
        cin >> s;
        if(s == "true")
            cornerX += 2*m;
        else
            break;
    }
    int cornerY = middleY;
    while(1)
    {
        if(cornerY + 2*m < n)
            cout << "examine " << middleX << " " << cornerY + 2*m << endl;
        else
            break;
            
        cin >> s;
        if(s == "true")
            cornerY += 2*m;
        else
            break;
    }
    
    cout << "solution " << cornerX - 2*m << " " << cornerY - 2*m << endl;
    
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 1 ms 208 KB Incorrect
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 1 ms 208 KB Incorrect
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Incorrect 1 ms 208 KB Incorrect
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Incorrect 1 ms 208 KB Incorrect
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 208 KB Output is correct
2 Incorrect 2 ms 208 KB Incorrect
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 208 KB Output is correct
2 Incorrect 1 ms 220 KB Incorrect
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 208 KB Output is correct
2 Incorrect 1 ms 208 KB Incorrect
3 Halted 0 ms 0 KB -