結果

問題 No.35 タイパー高橋
ユーザー SSRSSSRS
提出日時 2020-07-18 20:13:24
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 382 bytes
コンパイル時間 2,295 ms
コンパイル使用メモリ 165,168 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-20 22:07:59
合計ジャッジ時間 2,267 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  int ans1 = 0;
  int ans2 = 0;
  for (int i = 0; i < N; i++){
    int T;
    string S;
    cin >> T >> S;
    int cnt = T * 12 / 1000;
    int sz = S.size();
    if (cnt >= sz){
      ans1 += sz;
    } else {
      ans1 += cnt;
      ans2 += sz - cnt;
    }
  }
  cout << ans1 << ' ' << ans2 << endl;
}
0