結果
問題 | No.305 鍵(2) |
ユーザー |
|
提出日時 | 2017-01-10 12:57:36 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 508 bytes |
コンパイル時間 | 245 ms |
コンパイル使用メモリ | 21,120 KB |
実行使用メモリ | 25,220 KB |
平均クエリ数 | 52.38 |
最終ジャッジ日時 | 2024-07-17 00:44:35 |
合計ジャッジ時間 | 1,803 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:17:25: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%d%s",&r,d); | ^~~~~~~~~~~~~~~~~~ main.c:28:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 28 | scanf("%d%s",&r,d); | ^~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> void prans(int x[]){ int i; for(i = 1;i <= 10;i++){printf("%d",x[i]);} printf("\n"); } int main(void){ int t[16]={0},a[16]={0},i,j,r,c; char d[16]; for(i = 1;i <= 10;i++){ for(j = 0;j <= 9;j++){ t[i] = j; prans(t); fflush(stdout); scanf("%d%s",&r,d); if(r == 10){return 0;} if(j == 0){c = r;} else{ if(c > r){a[i] = 0;break;} if(c < r){a[i] = j;break;} } } } prans(a); fflush(stdout); scanf("%d%s",&r,d); if(r == 10){return 0;} return 0; }