結果
問題 |
No.305 鍵(2)
|
ユーザー |
|
提出日時 | 2016-06-03 18:47:56 |
言語 | C90 (gcc 12.3.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 531 bytes |
コンパイル時間 | 308 ms |
コンパイル使用メモリ | 21,760 KB |
実行使用メモリ | 33,584 KB |
最終ジャッジ日時 | 2024-07-16 23:56:16 |
合計ジャッジ時間 | 6,624 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 12 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:30:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 30 | scanf("%d %s",&a,b); | ^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <stdlib.h> int main(){ int answer[10]={-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; int a=0,result=0; char b[10]; int i=0,j; do{ if(a>result){ i++; if (i==10) i=0; result = a; answer[i]++; } else if (a<result){ answer[i]--; i++; if (i==10) i=0; } else{ answer[i]++; } for(j=0;j<10;j++){ printf("%d",answer[j]); } printf("\n"); fflush(stdout); scanf("%d %s",&a,b); }while(a!=10); return 0; }