結果
| 問題 |
No.2422 regisys?
|
| コンテスト | |
| ユーザー |
LaFolia13
|
| 提出日時 | 2023-07-29 19:20:45 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,257 bytes |
| コンパイル時間 | 1,977 ms |
| コンパイル使用メモリ | 179,268 KB |
| 実行使用メモリ | 15,744 KB |
| 最終ジャッジ日時 | 2024-10-08 06:34:48 |
| 合計ジャッジ時間 | 12,244 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 53 WA * 8 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:28:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
28 | for (auto &[A, B]: ab) {
| ^
main.cpp:31:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
31 | for (auto &[A, B]: ab) {
| ^
main.cpp:47:13: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
47 | for (auto [a, b]: ab) {
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;
#define ALL(x) x.begin(), x.end()
constexpr llong mod = 1e9+7;
constexpr llong inf = mod * mod;
struct AB {
llong A;
llong B;
const bool operator<(const AB &ri) const {
return max(A, B) < max(ri.A, ri.B);
}
};
int main() {
llong N, M;
vector<AB> ab;
set<llong> ippan, buin;
cin >> N >> M;
ab.resize(N);
for (auto &[A, B]: ab) {
cin >> A;
}
for (auto &[A, B]: ab) {
cin >> B;
}
for (int i = 0; i < M; i++) {
llong T, C;
cin >> T >> C;
if (T == 0) {
ippan.insert(C);
}
else {
buin.insert(C);
}
}
sort(ALL(ab));
reverse(ALL(ab));
int cnt = 0;
for (auto [a, b]: ab) {
auto it1 = ippan.lower_bound(a);
auto it2 = buin.lower_bound(b);
if (it1 == ippan.end() && it2 == buin.end()) {
continue;
}
else if (it2 == buin.end()) {
cnt++;
ippan.erase(it1);
}
else if (it1 == ippan.end()) {
cnt++;
buin.erase(it2);
}
else if (*it1 < *it2) {
cnt++;
ippan.erase(it1);
}
else {
cnt++;
buin.erase(it2);
}
}
cout << N - cnt << endl;
return 0;
}
LaFolia13