結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
FF256grhy
|
| 提出日時 | 2015-11-27 23:10:45 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 457 bytes |
| コンパイル時間 | 257 ms |
| コンパイル使用メモリ | 22,784 KB |
| 実行使用メモリ | 25,476 KB |
| 平均クエリ数 | 85.69 |
| 最終ジャッジ日時 | 2024-07-16 06:41:59 |
| 合計ジャッジ時間 | 2,817 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d %s", &x, s);
| ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int x, y, z[10];
char s[100];
int main(void) {
int i, j, k = 1;
for(i = 0; i < 10; i++) {
for(j = 0; j < 10; j++) {
y = x;
printf("%010d\n", j * k); fflush(stdout);
scanf("%d %s", &x, s);
if(j != 0 && x != y) { z[i] = (y < x ? j : j - 1); }
if(x == 10) { return 0; }
} k *= 10;
}
int res = 0;
k = 1;
for(i = 0; i < 10; i++) {
res += k * z[i];
k*= 10;
}
printf("%010d\n", res); fflush(stdout);
return 0;
}
FF256grhy