結果
| 問題 |
No.200 カードファイト!
|
| コンテスト | |
| ユーザー |
Lepton_s
|
| 提出日時 | 2015-04-28 23:52:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,076 bytes |
| コンパイル時間 | 569 ms |
| コンパイル使用メモリ | 84,100 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 05:11:01 |
| 合計ジャッジ時間 | 1,543 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 9 |
ソースコード
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<25;
typedef pair<int,int> P;
typedef long long ll;
typedef unsigned long long ull;
#define M 60
int N, A, B, a[M], a2[M], b[M];
int main(){
cin>>N;
cin>>A;
for(int i = 0; i < A; i++) cin>>a[i];
cin>>B;
for(int i = 0; i < B; i++) cin>>b[i];
sort(a, a+A); sort(b, b+B);
int res = 0;
memcpy(a2, a, sizeof(a));
for(int i = N-1; i >= 0; i--){
if(!(i%A)) memcpy(a2, a, sizeof(a));
int c = b[i%B];
int pos = -1;
for(int j = 0; j <= A; j++){
if(j==A){
a2[pos] = 0;
break;
}
if(pos<0 && a2[j]) pos = j;
if(a2[j]>c){
a2[j] = 0;
res++;
break;
}
}
}
cout<<res<<endl;
return 0;
}
Lepton_s