結果

問題 No.35 タイパー高橋
ユーザー kachipankachipan
提出日時 2023-06-30 09:59:55
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 828 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 29,108 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 04:11:09
合計ジャッジ時間 745 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main()
{
	char str[101] = "";
	double  writeTime = (double)1 / 12 * 1000; // 1文字辺りにかかる時間
	int gameNum = 0;	// ゲーム回数
	int timeLimit = 0;
	int writeNum = 0;		// 打てた文字数
	int strCnt = 0;			// 総文字数

	scanf("%d", &gameNum);

	for (int i = 0;i < gameNum;i++)
	{
		scanf("%d", &timeLimit);
		scanf("%s", str);
		int j = 0;
		int tmp_write = 0;
		for (;str[j] != '\0';j++);

		if (timeLimit > writeTime)
		{
			// 割り算の答えが書いた文字数の値になる。
			tmp_write += (double)timeLimit / writeTime;

			if (tmp_write >= j)
			{
				writeNum += j;
			}
			else
			{
				writeNum += tmp_write;
			}
		}

		strCnt += j;
	}

	printf("%d %d\n", writeNum, strCnt-writeNum);



	return 0;
}
0