結果

問題 No.200 カードファイト!
ユーザー kyuridenamidakyuridenamida
提出日時 2015-04-29 00:30:47
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 868 bytes
コンパイル時間 1,462 ms
コンパイル使用メモリ 152,888 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-18 14:36:23
合計ジャッジ時間 2,609 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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];
	sort(b.begin(),b.end());
	multiset<int> xx;
	int answer = 0;
	for(int k = 0 ; k < b.size() ; k++){
		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);
			}
		}
		answer = max(answer,ans);
		rotate(b.begin(),b.begin()+1,b.end());
	}
	cout << answer << endl;
	
	
}
0