結果

問題 No.35 タイパー高橋
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2019-01-06 17:57:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 493 bytes
コンパイル時間 605 ms
コンパイル使用メモリ 74,280 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-15 16:11:15
合計ジャッジ時間 1,103 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> T(n);
    vector<string> S(n);

    int hit = 0;
    int miss = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> T[i] >> S[i];
        int s_length = (int)S[i].size();
        int mini_hit = min(s_length, T[i] * 12 / 1000);
        miss += s_length - mini_hit;
        hit += mini_hit;
    }
    cout << hit << " " << miss << endl;
}
0