結果

問題 No.35 タイパー高橋
ユーザー mosmos_21mosmos_21
提出日時 2016-10-04 23:06:05
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 450 bytes
コンパイル時間 439 ms
コンパイル使用メモリ 20,736 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 12:34:47
合計ジャッジ時間 738 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int count(char *str){
  int i = 0;
  while(str[i++] != '\0');
  return --i;
}
int main(){
  int N, time;
  int suc = 0, fai = 0;
  int i;
  char str[101];
  scanf("%d", &N);

  for(i = 0; i < N; i++){
    scanf("%d %s", &time, str);
    suc += (12*time/1000) > count(str) ? count(str) : (12 * time/1000);
    fai += (12*time/1000) > count(str) ? 0 : count(str) - (12 * time/1000);
  }
  printf("%d %d\n", suc, fai);
  return 0;
}
0