結果

問題 No.35 タイパー高橋
ユーザー deltdelt
提出日時 2019-03-04 21:52:10
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 467 bytes
コンパイル時間 424 ms
コンパイル使用メモリ 63,020 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 18:33:47
合計ジャッジ時間 868 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int main(void){
  int n;
  cin >> n;
  int t[n];
  string s[n];
  for(int i = 0; i < n; i++) cin >> t[i] >> s[i];
  int c = 0;
  int m = 0;
  for(int i = 0; i < n; i++){
    int num = (12 * t[i]) / 1000;
    if(num >= s[i].length()) c += s[i].length();
    else{
      c += num;
      m += s[i].length() - num;
    }
  }
  cout << c << " " << m << endl;
  return 0;
}
0