QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#736687#5134. Jagged Skylinenicksms#WA 1ms3616kbC++171.1kb2024-11-12 12:34:432024-11-12 12:34:44

Judging History

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

  • [2024-11-12 12:34:44]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3616kb
  • [2024-11-12 12:34:43]
  • 提交

answer

/**
 *      Author:  Nicholas Winschel
 *      Created: 11.11.2024 23:26:54
**/

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using db=long double;
template<class T> using V=vector<T>;
using vi = V<int>;
using vl = V<ll>;
using pi = pair<int,int>;
#define f first
#define s second
#define sz(x) (int)((x).size())
#define each(a,b) for (auto &a : b)

mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

int main() {
  cin.tie(0)->sync_with_stdio(0); // initialize fast I/O

  int w; ll h; cin >> w >> h;
  vi z(w);
  iota(z.begin(), z.end(), 1);
  shuffle(z.begin(), z.end(), rng);
  ll ci = 0, ch = 0;
  for (int i : z) {
    if (ch == h) continue;
    cout << "? " << i << " " << ch+1 << endl;
    string s; cin >> s;
    if (s == "building") {
      ll l = ch+1, r=h+1;
      while (r-l > 1) {
        ll m = (l+r)>>1;
        cout << "? " << i << " " << m << endl;
        cin >> s;
        if (s == "sky") {
          r = m;
        } else {
          l = m;
        }
      }
      ci = i;
      ch = l;
    }
  }

  cout << "! " << ci << " " << ch << "\n";

  return 0;
}

詳細信息

Test #1:

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

input:

1 1
sky

output:

? 1 1
! 0 0

result:

wrong answer Integer parameter [name=xans] equals to 0, violates the range [1, 1]