結果

問題 No.110 しましまピラミッド
ユーザー evawenisevawenis
提出日時 2020-07-09 01:38:49
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 560 bytes
コンパイル時間 2,111 ms
コンパイル使用メモリ 205,260 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-07-28 03:28:03
合計ジャッジ時間 3,987 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

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

int solve(vector<int>&a,vector<int>&b){
	int ans=0;
	for(int i=0,j=0,bb=21;i<a.size()&&b.size();++i){
		if(a.at(i)>=bb)continue;
		++ans;
		while(j<b.size()&&a.at(i)<=b.at(j))bb=b.at(j),++j;
		if(j<b.size())++ans,bb=b.at(j);
	}
	return ans;
}

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int nw; cin>>nw;
	vector<int>w(nw); for(auto&&i:w)cin>>i;
	int nb; cin>>nb;
	vector<int>b(nb); for(auto&&i:b)cin>>i;
	sort(w.rbegin(),w.rend()); sort(b.rbegin(),b.rend());
	cout<<max(solve(w,b),solve(b,w))<<"\n"s;
}
0