結果
| 問題 |
No.513 宝探し2
|
| コンテスト | |
| ユーザー |
lunnear
|
| 提出日時 | 2019-02-18 05:47:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 2,000 ms |
| コード長 | 516 bytes |
| コンパイル時間 | 123 ms |
| コンパイル使用メモリ | 24,448 KB |
| 実行使用メモリ | 25,220 KB |
| 平均クエリ数 | 2.83 |
| 最終ジャッジ日時 | 2024-07-17 02:07:20 |
| 合計ジャッジ時間 | 1,197 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
コンパイルメッセージ
main.cpp: In function ‘s8 q(s8, s8)’:
main.cpp:8:14: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘s8’ {aka ‘long long int’} [-Wformat=]
8 | printf("%d %d\n", x, y);
| ~^ ~
| | |
| int s8 {aka long long int}
| %lld
main.cpp:8:17: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘s8’ {aka ‘long long int’} [-Wformat=]
8 | printf("%d %d\n", x, y);
| ~^ ~
| | |
| int s8 {aka long long int}
| %lld
main.cpp:12:13: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘s8*’ {aka ‘long long int*’} [-Wformat=]
12 | scanf("%d", &ret);
| ~^ ~~~~
| | |
| | s8* {aka long long int*}
| int*
| %lld
main.cpp:12:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d", &ret);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
typedef long long s8;
s8 q(s8 x, s8 y)
{
printf("%d %d\n", x, y);
fflush(0);
s8 ret;
scanf("%d", &ret);
return ret;
}
int main()
{
const s8 MAX = 1000000000;
s8 d[2];
d[0] = q(0, 0);
if(d[0] == 0)
return 0;
d[1] = q(MAX, 0);
if(d[1] == 0)
return 0;
s8 x, y;
x = d[0] - (MAX - d[1]);
x = (MAX - d[1]) + x / 2;
y = abs(d[0] - x);
q(x, y);
return 0;
}
lunnear