結果

問題 No.514 宝探し3
ユーザー fura
提出日時 2020-05-04 20:23:31
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 2,593 ms
コンパイル使用メモリ 190,240 KB
最終ジャッジ日時 2025-01-10 06:30:59
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘lint ask(lint, lint)’:
main.cpp:11:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         lint res; scanf("%lld",&res);
      |                   ~~~~~^~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;
using lint=long long;

lint ask(lint x,lint y){
	printf("%lld %lld\n",x,y);
	fflush(stdout);
	lint res; scanf("%lld",&res);
	if(res==0) exit(0);
	return res;
}

int main(){
	lint a=ask(0,0);
	lint b=ask(1e9,0);
	ask((a-b+1e9)/2,(a+b-1e9)/2);
	return 0;
}
0