QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#781397#9794. ICPC Shenyang in NEU, the Tenth Consecutive YeartryandtryagainWA 2ms9316kbC++142.2kb2024-11-25 16:00:562024-11-25 16:00:59

Judging History

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

  • [2024-11-25 16:00:59]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:9316kb
  • [2024-11-25 16:00:56]
  • 提交

answer

/*
author tryandtryagain(codeforces,atcoder,codechef)
nowcowid 觅者
luoguid zkystudent2027
*/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<cstring>
#include<string>
#include<iomanip>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<utility>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<cstdint>
#include<unordered_map>
#include<unordered_set>
#include<bitset>
using namespace std;
template<class G> inline void read(G& x)
{
    bool f; char ch = getchar();
    for (f = 0; !isdigit(ch); ch = getchar())if (ch == '-')f = 1;
    for (x = 0; isdigit(ch); x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar());
    x *= f == 1 ? -1 : 1;
}
template<class G>inline void write(G x) {
    if (x > 9) write(x / 10);
    putchar(x % 10 + '0');
}
template <typename T1>istream& operator>>(istream& cin, vector<T1>& a) {
    for (auto& x : a)
        cin >> x;
    return cin;
}
#define int long long
#define ll long long 
#define INF 0x3f3f3f
#define f(i,s,e) for(int i=s;i<e;++i)
#define cf(i,s,e) for(int i=s;i<=e;++i)
#define rf(i,e,s) for(int i=e;i>s;--i)
#define pb push_back
#define db double
#define pii pair<int,int>
#define fstdio ios_base::sync_with_stdio(false);cin.tie(0); cout.tie(0)
#define endl '\n'
#define lowbit(x) (x & (-x));
#define vi vector<int>
#define vii vector<vi>
const double Pi = acos(-1.0);
constexpr int MOD = 1e9 + 7;
inline int gcd(int x, int y) {
    return y ? gcd(y, x % y) : x;
}
inline int qpow(int x, int y) {
    int res = 1;
    while (y) {
        if (y & 1) {
            res = (res * x) % MOD;
        }
        x = (x * x) % MOD;
        y /= 2;
    }
    return res;
}
inline int inv(int x) {
    return qpow(x, MOD - 2);
}
constexpr int N = 2e5 + 10;
int T;
int a[N];
vector<pii>edge[N];
signed main() {
    cin >> T;
    while (T--) {
        int l = 1923, r = 2023;
        cf(i, l, r - 1) {
            cout << "? " << i << endl;
            int ans;
            cin >> ans;
            if (ans == 1) {
                cout << "! " << i << endl;
                return 0;
            }
        }
        cout << "! " << r << endl;
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1

output:

? 1923
? 1924
? 1925
? 1926
? 1927
? 1928
? 1929
? 1930
? 1931
? 1932
? 1933
? 1934
? 1935
? 1936
? 1937
? 1938
? 1939
? 1940
? 1941
? 1942
? 1943
? 1944
? 1945
? 1946
? 1947
? 1948
? 1949
? 1950
? 1951
? 1952
? 1953
? 1954
? 1955
? 1956
? 1957
? 1958
? 1959
? 1960
? 1961
? 1962
? 1963
? 1964
? 1965...

result:

ok correct! (1 test case)

Test #2:

score: -100
Wrong Answer
time: 2ms
memory: 9316kb

input:

100
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1

output:

? 1923
? 1924
? 1925
? 1926
? 1927
? 1928
? 1929
? 1930
? 1931
? 1932
? 1933
? 1934
? 1935
? 1936
? 1937
? 1938
? 1939
? 1940
? 1941
? 1942
? 1943
? 1944
! 1944

result:

wrong answer format  Unexpected end of file - token expected (test case 2)