結果

問題 No.35 タイパー高橋
ユーザー Elk
提出日時 2018-05-26 16:47:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 470 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 23,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-28 18:12:11
合計ジャッジ時間 517 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%d\n", &N);
      |     ~~~~~^~~~~~~~~~~~
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%d %s\n", &lim[i], str[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <string.h>

int main(){
    int N, i, len, suc = 0, fail = 0, lim[1000];
    char str[1000][100];

    scanf("%d\n", &N);
    for(i = 0; i < N; i++){
        scanf("%d %s\n", &lim[i], str[i]);
        len = strlen(str[i]);
        if(12*lim[i]/1000 >= len){
            suc += len;
        }else{
            suc += 12*lim[i]/1000;
            fail += len - 12*lim[i]/1000;
        }
    }

    printf("%d %d\n", suc, fail);

    return 0;
}
0