結果
| 問題 |
No.35 タイパー高橋
|
| コンテスト | |
| ユーザー |
kichirb3
|
| 提出日時 | 2018-03-01 22:20:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 5,000 ms |
| コード長 | 830 bytes |
| コンパイル時間 | 614 ms |
| コンパイル使用メモリ | 67,584 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-26 00:41:23 |
| 合計ジャッジ時間 | 1,273 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
// No.35 タイパー高橋
// https://yukicoder.me/problems/no/35
//
#include <iostream>
#include <algorithm>
using namespace std;
pair<unsigned int, unsigned int> do_type(unsigned int N);
int main() {
unsigned int N;
cin >> N;
pair<unsigned int, unsigned int> ans = do_type(N);
cout << ans.first << " " << ans.second << endl;
}
pair<unsigned int, unsigned int> do_type(unsigned int N) {
unsigned int typed = 0;
unsigned int missed = 0;
for (auto i = 0; i < N; ++i) {
unsigned int limit;
string s;
cin >> limit >> s;
unsigned int can_type = min(static_cast<unsigned int>(s.size()), limit * 12 / 1000);
if (can_type < s.size()) {
missed += s.size() - can_type;
}
typed += can_type;
}
return make_pair(typed, missed);
}
kichirb3