結果

問題 No.35 タイパー高橋
ユーザー neeetneeet
提出日時 2017-06-16 18:32:53
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 469 bytes
コンパイル時間 538 ms
コンパイル使用メモリ 21,376 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-08 13:46:19
合計ジャッジ時間 1,240 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |   scanf("%hd", &n);
      |   ^~~~~~~~~~~~~~~~
main.c:11:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |     scanf("%hd %s", &t, s);
      |     ^~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void){
  short n, t, correct, miss;
  char s[100];
  float h = (float)1000 / 12;
  short i, j;

  scanf("%hd", &n);
  for(i = 0; i < n; i++){
    scanf("%hd %s", &t, s);
    for(j = 0; s[j]; j++);
    if(t / h > j)
      correct += j;
    else
      correct += t / h;
    if(9 - (t / h) > 0){
      miss += j - (t / h);
      if(j - (t / h) - (int)(j - (t / h)))
        miss++;
    }
  }
  printf("%hd %hd\n", correct, miss);
  return 0;
}
0