結果
| 問題 | No.513 宝探し2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-12-02 16:29:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 2,000 ms |
| コード長 | 345 bytes |
| 記録 | |
| コンパイル時間 | 238 ms |
| コンパイル使用メモリ | 22,528 KB |
| 実行使用メモリ | 25,476 KB |
| 平均クエリ数 | 3.00 |
| 最終ジャッジ日時 | 2024-07-17 01:33:09 |
| 合計ジャッジ時間 | 1,349 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d", &d1);
| ~~~~~^~~~~~~~~~~
main.cpp:13:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%d", &d2);
| ~~~~~^~~~~~~~~~~
ソースコード
#include<cstdio>
int main(void) {
int xx, yy;
printf("0 0\n");
fflush(stdout);
int d1, d2;
scanf("%d", &d1);
// x + y = d1
printf("100000 0\n");
fflush(stdout);
// 100000-x + y = d2
scanf("%d", &d2);
int x = (d1 - d2 + 100000)/2;
int y = d1 - x;
printf("%d %d\n", x, y);
fflush(stdout);
}