結果

問題 No.35 タイパー高橋
ユーザー くれちーくれちー
提出日時 2016-08-25 23:14:07
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 339 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 21,120 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-25 16:06:46
合計ジャッジ時間 619 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 1 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |                 ^~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#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;
}
0