結果

問題 No.514 宝探し3
ユーザー TwizzTwizz
提出日時 2017-05-20 12:07:48
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 875 bytes
コンパイル時間 1,336 ms
コンパイル使用メモリ 144,448 KB
実行使用メモリ 24,396 KB
平均クエリ数 8.67
最終ジャッジ日時 2023-09-23 14:07:00
合計ジャッジ時間 2,561 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,412 KB
testcase_01 AC 23 ms
23,532 KB
testcase_02 AC 22 ms
24,360 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 24 ms
23,364 KB
testcase_06 AC 22 ms
23,640 KB
testcase_07 AC 23 ms
24,072 KB
testcase_08 AC 23 ms
24,024 KB
testcase_09 AC 22 ms
23,664 KB
testcase_10 AC 23 ms
23,664 KB
testcase_11 AC 23 ms
23,820 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:18:12: warning: overflow in conversion from ‘ll’ {aka ‘long long int’} to ‘int’ changes value from ‘10000000000’ to ‘1410065408’ [-Woverflow]
  int n,m = mod;
            ^~~
main.cpp:28:59: warning: ‘nowy’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   print(nowx + dx[i] * m / 2 << " " << nowy + dy[i] * m / 2);
                                                           ^
main.cpp:28:33: warning: ‘nowx’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   print(nowx + dx[i] * m / 2 << " " << nowy + dy[i] * m / 2);
                                 ^~~

ソースコード

diff #

#include"bits/stdc++.h"

//#include<bits/stdc++.h>
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
typedef long long ll;
const ll mod = 10000000000;

int main() {
	int max = 1000000000;
	int nowx, nowy;
	int dx[4] = { 1, 1, -1, -1 };
	int dy[4] = { 1, -1, 1, -1 };
	int now_dist;
	print(max / 2 << " " << max / 2);
	int n,m = mod;
	cin >> n;
	REP(i, 4) {
		print(max / 2 + dx[i] * n / 2 << " " << max / 2 + dy[i] * n / 2);
		cin >> now_dist;
		if (m > now_dist) {
			m = now_dist; nowx = max / 2 + dx[i] * n / 2; nowy = max / 2 + dy[i] * n / 2;
		}
	}
	REP(i, 4) {
		print(nowx + dx[i] * m / 2 << " " << nowy + dy[i] * m / 2);
		int d = 0;
		cin >> d;
		if (d == 0)return 0;
		print(nowx + dx[i] * m / 2 + 1<< " " << nowy + dy[i] * m / 2);
		cin >> d;
		if (d == 0)return 0;
	}
	
	return 0;
}
0