結果

問題 No.3115 One Power One Kill
ユーザー Mistletoe
提出日時 2025-04-19 11:59:36
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,603 bytes
コンパイル時間 2,171 ms
コンパイル使用メモリ 192,988 KB
実行使用メモリ 26,252 KB
平均クエリ数 22.00
最終ジャッジ日時 2025-04-19 11:59:43
合計ジャッジ時間 6,143 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

const int MOD = 1e9+7;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    // Initial guess
    long long A = 2;        // initial A guess
    long long B = 1000;     // initial B guess
    
    // Output the initial A and B
    cout << A << " " << B << "\n" << flush;
    
    // Read the response K
    long long K;
    cin >> K;
    
    // Read the current guessed X'
    long long X_prime;
    cin >> X_prime;
    
    // Read the result code
    int ret;
    cin >> ret;
    
    // For demonstration:
    // A simple loop to adjust guesses based on previous K.
    // In a real scenario, you might implement a more intelligent method.
    
    for (int attempt = 0; attempt < 20; attempt++) {
        // Based on previous K, attempt to narrow down X.
        // For simplicity, keep A fixed and iterate B.
        B += 1000; // increase B for new attempt; in practice, choose adaptively
        
        cout << A << " " << B << "\n" << flush;
        cin >> K;
        cin >> X_prime;
        cin >> ret;
        
        if (ret == 1) {
            // Guess is correct, can terminate
            break;
        }
        // Otherwise, continue guessing...
        // Implement further logic here to refine guesses based on K
        // For example, if K divides some candidate values, narrow down.
    }
    
    // After guesses, output your final guess for X'
    // (or, in a real scenario, attempt to derive X from collected info)
    // Here, just output the last X' obtained
    cout << X_prime << "\n" << flush;
}
0