結果

問題 No.35 タイパー高橋
ユーザー ut0sut0s
提出日時 2019-09-07 08:21:05
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 728 bytes
コンパイル時間 1,554 ms
コンパイル使用メモリ 167,768 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-08 08:55:26
合計ジャッジ時間 2,154 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 #

/**
  @file 035.cpp
  @title  No.35 タイパー高橋 - yukicoder
  @url https://yukicoder.me/problems/no/35
**/

#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)

int main() {
  int N;
  cin >> N;
  vector<pair<int, string>> TS(N);
  REP(i, N) {
    cin >> TS[i].first >> TS[i].second;
  }

  LL can    = 0;
  LL cannot = 0;

  REP(i, N) {
    ;
    LL limit = (12 * TS[i].first) / 1000;
    if (limit > (LL)TS[i].second.size()) {
      can += (LL)TS[i].second.size();
    } else {
      can += limit;
      cannot += (TS[i].second.size() - limit);
    }
  }

  cout << can << " " << cannot << endl;
  return 0;
}
0