結果
問題 |
No.305 鍵(2)
|
ユーザー |
![]() |
提出日時 | 2015-11-27 23:07:51 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 453 bytes |
コンパイル時間 | 148 ms |
コンパイル使用メモリ | 22,656 KB |
実行使用メモリ | 25,476 KB |
平均クエリ数 | 85.69 |
最終ジャッジ日時 | 2024-07-16 06:41:44 |
合計ジャッジ時間 | 3,435 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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] = (x < y ? x : y); } 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; }