QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#606945#5556. Diabolic Doofenshmirtzwhale_island#WA 1ms3724kbC++202.3kb2024-10-03 13:09:512024-10-03 13:09:52

Judging History

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

  • [2024-10-03 13:09:52]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3724kb
  • [2024-10-03 13:09:51]
  • 提交

answer

//   __________________
//  | ________________ |
//  ||          ____  ||
//  ||   /\    |      ||
//  ||  /__\   |      ||
//  || /    \  |____  ||
//  ||________________||
//  |__________________|
//  \###################\
//   \###################\
//    \        ____       \
//     \_______\___\_______\
// An AC a day keeps the doctor away.
//#pragma GCC optimize("O3,unroll-loops")
//#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>
#define hutao_my_wife ios_base::sync_with_stdio(0);
#define forcalors_so_cute cin.tie(0);
/*

struct A {
	public: [[nodiscard]] virtual const unsigned long long reference operator bitor (const unsigned long long reference a) const noexcept;

};

struct B: public A{

	public: [[nodiscard]] virtual const unsigned long long reference operator bitor (const unsigned long long reference a) const noexcept override final {

	
	}

};

inline char readchar() noexcept {
    static char buffer[BUFSIZ], * now = buffer + BUFSIZ, * end = buffer + BUFSIZ;
    if (now == end)
    {
        if (end < buffer + BUFSIZ)
            return EOF;
        end = (buffer + fread(buffer, 1, BUFSIZ, stdin));
        now = buffer;
    }
    return *now++;
}
inline int nextint() noexcept {
    int x = 0, c = readchar(), neg = 0;
    while(('0' > c || c > '9') && c!='-' && c!=EOF) c = readchar();
    if(c == '-') neg = true, c = readchar();
    while('0' <= c && c <= '9') x = (x<<3) + (x<<1) + (c^'0'), c = readchar();
    if(neg) x = -x;
    return x; // returns 0 if EOF
}

//fast io cin>>a 改成 a = nextint();
*/
#define ll long long
//#define int long long
#define pii pair<int,int>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define ALL(v) v.begin(), v.end()
#define bug(A) cout<<A<<" hi\n";
using namespace std;

const ll M = 200005;

void solve(){
    ll l = 0, r = 1e12, mid;
    while(r - l > 1){
        mid = (r + l)/2;
        cout<<"? "<<mid<<endl;
        ll ret;
        cin>>ret;
        if(ret < mid){
            r = mid;
        }else{
            l = mid;
        }
    }
    cout<<"! "<<r<<endl;
}

signed main(){
//    hutao_my_wife    forcalors_so_cute

    int t = 1;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3724kb

input:

32

output:

? 500000000000
? 250000000000

result:

wrong answer Integer 250000000000 violates the range [500000000001, 1000000000000000001]