結果
| 問題 | No.3750 Mischievous Resident (Easy) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-06 10:05:43 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 704 bytes |
| 記録 | |
| コンパイル時間 | 1,280 ms |
| コンパイル使用メモリ | 224,664 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-10-02 20:50:51 |
| 合計ジャッジ時間 | 4,227 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 14 WA * 21 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int Q;
cin >> Q;
while (Q--) {
int N, M;
cin >> N >> M;
vector<pair<int, int>> A(M);
for (auto& [s, g] : A) cin >> s;
for (auto& [s, g] : A) cin >> g;
stable_sort(A.begin(), A.end(),
[](const auto& a, const auto& b) {
return a.first < b.first;
});
bool ok = true;
for (int i = 1; i < M; ++i) {
if (A[i - 1].second > A[i].second) {
ok = false;
}
}
cout << (ok ? "Yes\n" : "No\n");
}
}