結果

問題 No.200 カードファイト!
ユーザー kyuridenamidakyuridenamida
提出日時 2015-04-29 00:27:17
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 722 bytes
コンパイル時間 1,303 ms
コンパイル使用メモリ 151,928 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-18 14:35:03
合計ジャッジ時間 2,513 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 1 ms
4,376 KB
testcase_27 WA -
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
	int N;
	cin >> N;
	int A,B;
	cin >> A;
	vector<int> a(A);
	for(int i = 0 ; i < A ; i++) cin >> a[i];
	cin >> B;
	vector<int> b(B);
	for(int i = 0 ; i < B ; i++) cin >> b[i];
	
	multiset<int> xx;
	sort(b.begin(),b.end());
	int ans = 0;
	for(int i = 0 ; i < N ; i++){
		if( xx.size() == 0 ){
			for(int j = 0 ; j < a.size() ; j++)
				xx.insert(a[j]);
		}
		auto it = xx.upper_bound(b[i%b.size()]);
		//cout << "(" << xx.size() << ")";
		//cout << b[i%b.size()] << " vs ";
		if( it == xx.end() ){
			//cout << *xx.begin() << endl;
			xx.erase(xx.begin());
		}else{
			//cout << *it << " win!" << endl;
			ans++;
			xx.erase(it);
		}
	}
	cout << ans << endl;
	
	
}
0