結果
| 問題 | No.3750 Mischievous Resident (Easy) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-02 21:45:46 |
| 言語 | D (dmd 2.113.0) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 852 bytes |
| 記録 | |
| コンパイル時間 | 4,613 ms |
| コンパイル使用メモリ | 171,276 KB |
| 実行使用メモリ | 17,484 KB |
| 最終ジャッジ日時 | 2026-10-02 21:46:02 |
| 合計ジャッジ時間 | 10,491 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 23 WA * 12 |
ソースコード
import std;
void main () {
int caseNum = readln.chomp.to!int;
auto ans = new bool[](caseNum);
foreach (caseId; 0 .. caseNum) {
int N, M;
readln.read(N, M);
auto S = readln.split.to!(int[]);
auto G = readln.split.to!(int[]);
auto ord = iota(M).array;
ord.sort!((a, b) => G[a] < G[b]);
ans[caseId] = true;
foreach (i; 0 .. M - 1) {
int a = ord[i];
int b = ord[i + 1];
if (S[b] < S[a]) {
ans[caseId] = false;
}
}
}
foreach (i; 0 .. caseNum) {
writeln(ans[i] ? "Yes" : "No");
}
}
void read (T...) (string S, ref T args) {
import std.conv : to;
import std.array : split;
auto buf = S.split;
foreach (i, ref arg; args) {
arg = buf[i].to!(typeof(arg));
}
}