結果
| 問題 |
No.514 宝探し3
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-04 20:18:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 346 bytes |
| コンパイル時間 | 2,022 ms |
| コンパイル使用メモリ | 190,892 KB |
| 最終ジャッジ日時 | 2025-01-10 06:30:24 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 10 |
コンパイルメッセージ
main.cpp: In function ‘int ask(int, int)’:
main.cpp:10:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | int res; scanf("%d",&res);
| ~~~~~^~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int ask(int x,int y){
printf("%d %d\n",x,y);
fflush(stdout);
int res; scanf("%d",&res);
if(res==0) exit(0);
return res;
}
int main(){
int a,b,x,y;
a=ask(0,0);
b=ask(1e5,0);
x=(1e5+a-b)/2;
b=ask(0,1e5);
y=(1e5+a-b)/2;
ask(x,y);
return 0;
}