結果

問題 No.35 タイパー高橋
ユーザー Y_SY_S
提出日時 2020-07-27 05:55:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 575 bytes
コンパイル時間 653 ms
コンパイル使用メモリ 74,696 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-11 05:38:52
合計ジャッジ時間 1,210 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>	//cin, cout
#include <vector>	//vector
#include <algorithm> //sort,min,max
#include <string>	//string
#include <ios>		//fixed
#include <iomanip>	//setprecision
#include <utility> //swap

using namespace std;

int main() {

	int N, T;
	string S;

	unsigned int temp = 0;
	unsigned int  ok = 0, ng = 0;

	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> T >> S;
		temp = T * 12 / 1000;
		if (S.length() <= T * 12 / 1000) {
			ok += S.length();
		}
		else {
			ok += temp;
			ng += S.length() - temp;
		}
	}

	cout << ok << " " << ng << endl;

	return 0;

}
0