結果

問題 No.513 宝探し2
ユーザー Yasufu12Yasufu12
提出日時 2017-05-05 23:27:07
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 362 ms
コンパイル使用メモリ 51,192 KB
実行使用メモリ 24,276 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 01:08:09
合計ジャッジ時間 1,450 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
23,964 KB
testcase_01 AC 21 ms
23,304 KB
testcase_02 AC 21 ms
23,976 KB
testcase_03 AC 20 ms
24,276 KB
testcase_04 AC 22 ms
23,448 KB
testcase_05 AC 18 ms
23,436 KB
testcase_06 AC 20 ms
23,556 KB
testcase_07 AC 21 ms
23,964 KB
testcase_08 AC 20 ms
23,340 KB
testcase_09 AC 20 ms
23,976 KB
testcase_10 AC 19 ms
23,688 KB
testcase_11 AC 19 ms
23,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

int dis[2], ansx = 0, ansy = 0;

int main(){
	cout << 0 << " " << 0 << endl;
	cin >> dis[0];
	cout << 100000 << " " << 0 << endl;
	cin >> dis[1];

	for (int i = 0; i <= 100000; i++){
		if (dis[0] + dis[1] - i * 2 == 100000){
			ansy = i;
			break;
		}
	}

	ansx = dis[0] - ansy;

	cout << ansx << " " << ansy << endl;

	return 0;
}
0