結果

問題 No.35 タイパー高橋
ユーザー sora410_tsora410_t
提出日時 2020-04-02 18:17:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 669 bytes
コンパイル時間 3,785 ms
コンパイル使用メモリ 77,100 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-11 00:44:13
合計ジャッジ時間 1,565 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <climits>
#include <numeric>
#include <iterator>
#include <cmath>
#include <set>
#include <bitset>
#include <cassert>
#include <cstdlib>
using namespace std;

inline int can(const int m) noexcept {
	return floor(12 * m / 1000);
}

void solve() {
	int N;
	cin >> N;

	int cnt  {0};
	int wcnt {0};
	for (int i = 0; i < N; ++i) {
		string s;
		int t;
		cin >> t >> s;

		const auto length {s.size()};
		if (can(t) >= length) {
			cnt += length;
		} else {
			cnt += can(t);
			wcnt += length - can(t);
		}
	}

	cout << cnt << ' ' << wcnt << endl;
}

int main() {
	solve();
	return 0;
}
0