結果
| 問題 |
No.513 宝探し2
|
| コンテスト | |
| ユーザー |
kotamanegi
|
| 提出日時 | 2017-05-05 22:53:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,620 bytes |
| コンパイル時間 | 635 ms |
| コンパイル使用メモリ | 85,984 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 5.67 |
| 最終ジャッジ日時 | 2024-07-16 13:04:06 |
| 合計ジャッジ時間 | 3,608 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 11 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
using namespace std;
#define eps 0.000000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
int judged[1000][1000] = {};
int judge(int a, int b) {
if (judged[a][b] != 0) return judged[a][b] - 1;
cout << a << " " << b << endl;
int hoge;
cin >> hoge;
return judged[a][b] = hoge+1;
}
int main() {
int x = 0;
int x_top = 3,x_bot = 0;
while (x_top - x_bot > 2) {
int right= (double)(x_top - x_bot) / (GOLD + 1.0) + x_bot;
int left = (double)(x_top - x_bot) / GOLD + x_bot;
if (judge(0,left) > judge(0,right)) {
x_bot = left;
}
else {
x_top = right;
}
}
if (judge(0, x_bot) < judge(0, x_bot + 1)) {
x = x_bot;
}
else {
if (judge(0, x_bot + 1) < judge(0, x_bot + 2)) {
x = x_bot + 1;
}
else {
x = x_bot + 2;
}
}
int y_top = 3, y_bot = 0;
while (y_top - y_bot > 2) {
int right = (double)(y_top - y_bot) / (GOLD + 1.0) + y_bot;
int left = (double)(y_top - y_bot) / GOLD + y_bot;
if (judge(left,x) > judge(right,x)) {
y_bot = left;
}
else {
y_top = right;
}
}
for (int i = 0;i < 3;++i) {
judge(y_bot + i, x);
}
return 0;
}
kotamanegi