結果

問題 No.35 タイパー高橋
ユーザー atn112323atn112323
提出日時 2016-05-08 08:52:29
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 355 bytes
コンパイル時間 477 ms
コンパイル使用メモリ 56,712 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 13:46:47
合計ジャッジ時間 906 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:20:27: warning: ‘cnt[0]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   20 |         cout << cnt[0] << " " << cnt[1] << endl;
      |                           ^~~
main.cpp:20:39: warning: ‘cnt[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   20 |         cout << cnt[0] << " " << cnt[1] << endl;
      |                                       ^

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <string>

using namespace std;

int N;
int T;
string S;

int main() {
	cin >> N;
	int cnt[2];
	for (int i = 0; i < N; i++) {
		cin >> T >> S;
		int ma = T * 12 / 1000;
		cnt[0] += min(ma, (int)S.length());
		cnt[1] += max(0, (int)S.length() - ma);
	}
	cout << cnt[0] << " " << cnt[1] << endl;
	return 0;
}
0