結果
| 問題 |
No.513 宝探し2
|
| コンテスト | |
| ユーザー |
nanophoto12
|
| 提出日時 | 2017-08-17 20:32:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 2,000 ms |
| コード長 | 1,041 bytes |
| コンパイル時間 | 1,766 ms |
| コンパイル使用メモリ | 89,820 KB |
| 実行使用メモリ | 25,476 KB |
| 平均クエリ数 | 19.50 |
| 最終ジャッジ日時 | 2024-07-17 01:25:09 |
| 合計ジャッジ時間 | 2,225 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
#include <cmath>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <functional>
#include <queue>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdint>
#include <climits>
#include <unordered_set>
#include <sstream>
#include <stack>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef tuple<int,int,int> t3;
int process(int x, int y)
{
cout << x << " " << y << endl;
int d;
cin>>d;
return d;
}
int mid(int l, int r)
{
return (l + r)/2;
}
int main(){
int lx = 0;
int rx = 100000;
int ld = process(lx, 0);
int rd = process(rx, 0);
while(rx - lx > 1)
{
if(ld < rd)
{
rx = mid(lx, rx);
rd = process(rx, 0);
}
else
{
lx = mid(lx, rx);
ld = process(lx, 0);
}
}
if(ld < rd)
{
process(lx, ld);
}
else
{
process(rx, rd);
}
return 0;
}
nanophoto12