QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#96348#5156. Going in CirclesZuqa#WA 1ms3400kbC++201.5kb2023-04-13 20:08:242023-04-13 20:08:25

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-13 20:08:25]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3400kb
  • [2023-04-13 20:08:24]
  • 提交

answer

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

#define el '\n'
#define FIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef complex<ld> pt;
typedef unsigned long long ull;

template<typename T, typename X>
using hashTable = gp_hash_table<T, X>;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

// mt19937_64 for long long
mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count());

void doWork()
{
    int flipped;
    cin >> flipped;
    int n = 0;
    int lst = 0;
    int op = 0;
    for(int i = 1; i < min(n * 3, 9) + 501; ++i)
    {
        if(lst == flipped && i > 1)
        {
            cout << "? flip" << endl;
            cin >> lst;
            op++;
        }
        else
        {
            int mnwr;
            cout << "? left" << endl;
            cin >> mnwr;
            if(mnwr == flipped)
            {
                n = i - op;
            }
            else if(n == 0)
                n = i;
            lst = mnwr;
        }
    }
    cout << "! " << n << endl;
}

signed main()
{
    FIO
    int T = 1;
//    cin >> T;
    for(int i = 1; i <= T; i++)
        doWork();
}

详细

Test #1:

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

input:

0
1
0
1
1
0
1
1
0
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1
0
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
1
1
1
1
1
1
0
1
1
0
1
0
1
1
1
1
1
1
0
1
1
0
1
1
0
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
1
0
1
0
1
1
0
1
1
0
1
1
0
1
1
0
1
1
1
1
1
1
1
1
0
1
1
0
1
0
1
1
1
1
1
1
0
1
1
0
1
1
0
1
0
1
1
0
1
1
...

output:

? left
? left
? flip
? left
? left
? flip
? left
? left
? flip
? left
? left
? left
? flip
? left
? flip
? left
? flip
? left
? flip
? left
? flip
? left
? flip
? left
? flip
? left
? left
? flip
? left
? flip
? left
? left
? flip
? left
? left
? flip
? left
? left
? flip
? left
? left
? flip
? left...

result:

wrong answer Wrong answer: incorrect guess 345 (ans: 5000). Queries used: 509