結果

問題 No.35 タイパー高橋
コンテスト
ユーザー atn112323
提出日時 2016-05-08 08:52:29
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 355 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 482 ms
コンパイル使用メモリ 73,720 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-20 23:38:44
合計ジャッジ時間 1,235 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 4
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:18:24: warning: 'cnt[1]' may be used uninitialized [-Wmaybe-uninitialized]
   18 |                 cnt[1] += max(0, (int)S.length() - ma);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:13:13: note: 'cnt[1]' was declared here
   13 |         int cnt[2];
      |             ^~~
main.cpp:17:24: warning: 'cnt[0]' may be used uninitialized [-Wmaybe-uninitialized]
   17 |                 cnt[0] += min(ma, (int)S.length());
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:13:13: note: 'cnt[0]' was declared here
   13 |         int cnt[2];
      |             ^~~

ソースコード

diff #
raw source code

#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