結果

問題 No.35 タイパー高橋
ユーザー kichirb3kichirb3
提出日時 2018-03-01 22:20:55
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 830 bytes
コンパイル時間 630 ms
コンパイル使用メモリ 67,320 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-26 21:46:54
合計ジャッジ時間 1,302 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

// 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);
}
0