結果
| 問題 | No.3426 Mod K Graph Increments (Hard) |
| コンテスト | |
| ユーザー |
mentos_grape
|
| 提出日時 | 2026-01-11 14:58:47 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,233 bytes |
| 記録 | |
| コンパイル時間 | 5,886 ms |
| コンパイル使用メモリ | 311,824 KB |
| 実行使用メモリ | 13,812 KB |
| 最終ジャッジ日時 | 2026-01-11 14:58:54 |
| 合計ジャッジ時間 | 7,109 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 WA * 7 |
ソースコード
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
typedef long long ll;
const int INF = 1<<30;
const ll INFLL = 1LL<<60;
const ll MOD = 998244353;
const double INFD = 1.0E10;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, -1, 0, 1};
//const int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
//const int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
using Pair = pair<ll, ll>;
using Graph = vector<vector<ll>>;
using mint = atcoder::modint998244353;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
int T; cin >> T;
while (T--){
ll n, m, k; cin >> n >> m >> k;
Graph G(n);
for (int i = 0; i < m; i++){
int u, v; cin >> u >> v;
u--; v--;
G[u].push_back(v);
}
vector<ll> b(n);
for (int i = 0; i < n; i++) cin >> b[i];
if (k % 2) cout << "Yes" << '\n';
else{
ll total = 0;
for (int i = 0; i < n; i++){
total += b[i];
}
cout << (total % 2 == 0 ? "Yes" : "No") << '\n';
}
}
return 0;
}
mentos_grape