結果
| 問題 | No.200 カードファイト! |
| コンテスト | |
| ユーザー |
startcpp
|
| 提出日時 | 2026-08-12 21:03:05 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 900 bytes |
| 記録 | |
| コンパイル時間 | 749 ms |
| コンパイル使用メモリ | 109,468 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-12 21:03:08 |
| 合計ジャッジ時間 | 2,368 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 5 |
ソースコード
#include <iostream>
#include <algorithm>
#include <functional>
#include <atcoder/maxflow>
#define rep(i, n) for(i = 0; i < n; i++)
#define int long long
using namespace std;
using namespace atcoder;
const int INF = 1e+9;
int n, a;
int b[50];
int c;
int d[50];
signed main() {
int i, j;
cin >> n >> a;
rep(i, a) cin >> b[i];
cin >> c;
rep(i, c) cin >> d[i];
sort(b, b + a, greater<int>());
sort(d, d + c);
mf_graph<int> g(a + c + 2);
int s = a + c, t = s + 1;
rep(i, a) {
int x = n / a;
if (i < n % a) x++;
g.add_edge(s, i, x);
}
rep(i, c) {
int x = n / c;
if (i < n % c) x++;
g.add_edge(a + i, t, x);
}
rep(i, a) {
rep(j, c) {
if (b[i] > d[j]) {
g.add_edge(i, a + j, INF);
}
}
}
cout << g.flow(s, t) << endl;
return 0;
}
startcpp