結果

問題 No.35 タイパー高橋
ユーザー koturnkoturn
提出日時 2016-02-10 05:49:31
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 612 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 63,620 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 20:38:42
合計ジャッジ時間 886 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cmath>
#include <cstdlib>
#include <iostream>


int
main()
{
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);

  int n;
  std::cin >> n;

  std::string::size_type cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < n; i++) {
    std::string::size_type t;
    std::string s;
    std::cin >> t >> s;
    std::string::size_type nType = static_cast<std::string::size_type>(std::floor(12 * t / 1000));
    if (nType < s.length()) {
      cnt1 += nType;
      cnt2 += s.length() - nType;
    } else {
      cnt1 += s.length();
    }
  }
  std::cout << cnt1 << ' ' << cnt2 << std::endl;

  return EXIT_SUCCESS;
}
0