QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#777068#9794. ICPC Shenyang in NEU, the Tenth Consecutive YearSkySummerAC ✓5ms3632kbC++20869b2024-11-23 22:32:502024-11-23 22:32:51

Judging History

你现在查看的是最新测评结果

  • [2024-11-23 22:32:51]
  • 评测
  • 测评结果:AC
  • 用时:5ms
  • 内存:3632kb
  • [2024-11-23 22:32:50]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define de(a) cout << #a << " = " << a << "\n"
#define deg(a) cout << #a << " = " << a << " "
const long double pi = acos(-1);
constexpr long double eps = 1e-12;
constexpr long long inf = 0x3f3f3f3f3f3f3f3f;
constexpr long long mod = 998244353;
constexpr int N = 1e6 + 10;
constexpr int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

void solve() {
    for (int i = 2023; i > 1923; i--) {
        cout << "? " << i << endl;
        int x;
        cin >> x;
        if (x) {
            cout << "! " << i << endl;
            return;
        }
    }
    cout << "! 1923" << endl;
}

signed main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);

    int T = 1;
    cin >> T, cin.get();
    while (T--) {
        solve();
    }

    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3608kb

input:

1
0
0
0
0
0
0
0
0
0
1

output:

? 2023
? 2022
? 2021
? 2020
? 2019
? 2018
? 2017
? 2016
? 2015
? 2014
! 2014

result:

ok correct! (1 test case)

Test #2:

score: 0
Accepted
time: 5ms
memory: 3632kb

input:

100
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

? 2023
? 2022
? 2021
? 2020
? 2019
? 2018
? 2017
? 2016
? 2015
? 2014
? 2013
? 2012
? 2011
? 2010
? 2009
? 2008
? 2007
? 2006
? 2005
? 2004
? 2003
? 2002
? 2001
? 2000
? 1999
? 1998
? 1997
? 1996
? 1995
? 1994
? 1993
? 1992
? 1991
? 1990
? 1989
? 1988
? 1987
? 1986
? 1985
? 1984
? 1983
? 1982
? 1981...

result:

ok correct! (100 test cases)

Extra Test:

score: 0
Extra Test Passed