結果
| 問題 |
No.35 タイパー高橋
|
| コンテスト | |
| ユーザー |
mosmos_21
|
| 提出日時 | 2016-10-04 23:06:05 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 450 bytes |
| コンパイル時間 | 167 ms |
| コンパイル使用メモリ | 20,992 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-21 16:58:16 |
| 合計ジャッジ時間 | 575 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / 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);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#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;
}
mosmos_21