結果

問題 No.35 タイパー高橋
ユーザー masamasa
提出日時 2015-01-30 16:39:06
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 524 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 64,392 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 08:22:20
合計ジャッジ時間 1,061 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <cmath>

using namespace std;

int main() {
	int n, t;
	string str;

	cin >> n;
	int success = 0;
	int failure = 0;
	int nc, maxtype;
	for (int i = 0; i < n; i++) {
		cin >> t >> str;
		nc = str.size();
		maxtype = floor(12.0 * t / 1000);
		if (maxtype >= nc) {
			success += nc;
		} else {
			success += maxtype;
			failure += nc - maxtype;
		}
	}

	printf("%d %d\n", success, failure);
	return 0;
}
0