結果

問題 No.35 タイパー高橋
コンテスト
ユーザー mosmos_21
提出日時 2016-10-04 23:06:05
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 450 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 146 ms
コンパイル使用メモリ 29,640 KB
最終ジャッジ日時 2026-02-23 22:29:19
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #
raw source code

#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