結果
| 問題 |
No.305 鍵(2)
|
| コンテスト | |
| ユーザー |
FF256grhy
|
| 提出日時 | 2015-11-27 23:16:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 404 bytes |
| コンパイル時間 | 210 ms |
| コンパイル使用メモリ | 23,040 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 85.69 |
| 最終ジャッジ日時 | 2024-07-16 06:42:44 |
| 合計ジャッジ時間 | 2,400 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 9 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:25: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long int*’ [-Wformat=]
12 | scanf("%d %s", &x, s);
| ~^ ~~
| | |
| int* long long int*
| %lld
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>
long long int x, y, z;
char s[100];
int main(void) {
long long int i, j, k = 1;
for(i = 0; i < 10; i++) {
for(j = 0; j < 10; j++) {
y = x;
printf("%010lld\n", j * k); fflush(stdout);
scanf("%d %s", &x, s);
if(x == 10) { return 0; }
if(j != 0 && x != y) { z += (y < x ? j : j - 1) * k; continue; }
} k *= 10;
}
printf("%010lld\n", z); fflush(stdout);
return 0;
}
FF256grhy