結果
| 問題 |
No.35 タイパー高橋
|
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2016-08-25 23:14:07 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 339 bytes |
| コンパイル時間 | 154 ms |
| コンパイル使用メモリ | 20,864 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-08 03:15:04 |
| 合計ジャッジ時間 | 618 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:10:28: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘char (*)[101]’ [-Wformat=]
10 | scanf("%d %s", &t, &s);
| ~^ ~~
| | |
| char * char (*)[101]
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d", &n);
| ^~~~~~~~~~~~~~~
main.c:10:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d %s", &t, &s);
| ^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main() {
char s[101];
int n, t, c = 0, w = 0, i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d %s", &t, &s);
if (strlen(s) <= 12 * t / 1000) {
c += strlen(s);
}
else {
c += 12 * t / 1000;
w += strlen(s) - 12 * t / 1000;
}
}
printf("%d %d\n", c, w);
return 0;
}
くれちー