結果
問題 | No.305 鍵(2) |
ユーザー |
![]() |
提出日時 | 2015-11-27 23:18:59 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 24 ms / 2,000 ms |
コード長 | 401 bytes |
コンパイル時間 | 203 ms |
コンパイル使用メモリ | 22,912 KB |
実行使用メモリ | 25,220 KB |
平均クエリ数 | 52.08 |
最終ジャッジ日時 | 2024-07-16 21:49:56 |
合計ジャッジ時間 | 1,332 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
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; break; }} k *= 10;}printf("%010lld\n", z); fflush(stdout);return 0;}