QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#781404#9794. ICPC Shenyang in NEU, the Tenth Consecutive YeartryandtryagainAC ✓11ms9372kbC++142.2kb2024-11-25 16:01:592024-11-25 16:02:01

Judging History

This is the latest submission verdict.

  • [2024-11-25 16:02:01]
  • Judged
  • Verdict: AC
  • Time: 11ms
  • Memory: 9372kb
  • [2024-11-25 16:01:59]
  • Submitted

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];
inline void ac() {
    int l = 1923, r = 2023;
    cf(i, l, r - 1) {
        cout << "? " << i << endl;
        int ans;
        cin >> ans;
        if (ans == 1) {
            cout << "! " << i << endl;
            return;
        }
    }
    cout << "! " << r << endl;
}
signed main() {
    cin >> T;
    while (T--) {
        ac();
    }
}

詳細信息

Test #1:

score: 100
Accepted
time: 3ms
memory: 8320kb

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: 0
Accepted
time: 11ms
memory: 9372kb

input:

100
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
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
...

output:

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

result:

ok correct! (100 test cases)

Extra Test:

score: 0
Extra Test Passed