結果
問題 | No.2822 Lights Up! (Tree Edition) |
ユーザー | FplusFplusF |
提出日時 | 2024-06-28 15:52:17 |
言語 | C++23 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,494 bytes |
コンパイル時間 | 4,532 ms |
コンパイル使用メモリ | 254,316 KB |
実行使用メモリ | 11,776 KB |
最終ジャッジ日時 | 2024-06-28 15:52:26 |
合計ジャッジ時間 | 7,642 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 34 ms
11,776 KB |
testcase_02 | WA | - |
testcase_03 | AC | 34 ms
11,264 KB |
testcase_04 | AC | 35 ms
11,392 KB |
testcase_05 | AC | 33 ms
10,672 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 32 ms
10,240 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 24 ms
7,908 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 3 ms
6,944 KB |
testcase_17 | WA | - |
testcase_18 | AC | 3 ms
6,940 KB |
testcase_19 | AC | 4 ms
6,940 KB |
testcase_20 | WA | - |
testcase_21 | AC | 4 ms
6,940 KB |
testcase_22 | AC | 4 ms
6,940 KB |
testcase_23 | AC | 3 ms
6,944 KB |
testcase_24 | WA | - |
testcase_25 | AC | 4 ms
6,940 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | AC | 3 ms
6,940 KB |
testcase_31 | AC | 5 ms
6,944 KB |
testcase_32 | AC | 5 ms
6,940 KB |
testcase_33 | WA | - |
testcase_34 | AC | 5 ms
6,940 KB |
testcase_35 | WA | - |
testcase_36 | AC | 5 ms
6,940 KB |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | AC | 5 ms
6,940 KB |
testcase_41 | AC | 5 ms
6,944 KB |
testcase_42 | AC | 5 ms
6,944 KB |
testcase_43 | AC | 5 ms
6,944 KB |
testcase_44 | AC | 6 ms
6,940 KB |
testcase_45 | AC | 5 ms
6,940 KB |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | WA | - |
testcase_49 | WA | - |
testcase_50 | AC | 2 ms
6,940 KB |
testcase_51 | AC | 2 ms
6,944 KB |
testcase_52 | WA | - |
testcase_53 | AC | 2 ms
6,940 KB |
testcase_54 | WA | - |
testcase_55 | AC | 2 ms
6,940 KB |
testcase_56 | AC | 2 ms
6,944 KB |
testcase_57 | AC | 3 ms
6,940 KB |
testcase_58 | AC | 2 ms
6,940 KB |
testcase_59 | AC | 3 ms
6,940 KB |
testcase_60 | WA | - |
testcase_61 | WA | - |
testcase_62 | AC | 2 ms
6,940 KB |
testcase_63 | AC | 2 ms
6,944 KB |
testcase_64 | AC | 2 ms
6,940 KB |
testcase_65 | WA | - |
testcase_66 | WA | - |
testcase_67 | WA | - |
testcase_68 | WA | - |
testcase_69 | WA | - |
testcase_70 | AC | 2 ms
6,944 KB |
testcase_71 | WA | - |
testcase_72 | WA | - |
testcase_73 | AC | 2 ms
6,940 KB |
testcase_74 | AC | 2 ms
6,940 KB |
testcase_75 | WA | - |
testcase_76 | WA | - |
testcase_77 | WA | - |
testcase_78 | AC | 2 ms
6,944 KB |
testcase_79 | WA | - |
testcase_80 | WA | - |
testcase_81 | AC | 2 ms
6,940 KB |
testcase_82 | WA | - |
testcase_83 | AC | 1 ms
6,940 KB |
testcase_84 | AC | 2 ms
6,940 KB |
testcase_85 | WA | - |
testcase_86 | WA | - |
testcase_87 | AC | 2 ms
6,940 KB |
testcase_88 | AC | 2 ms
6,944 KB |
testcase_89 | WA | - |
testcase_90 | WA | - |
testcase_91 | AC | 2 ms
6,944 KB |
testcase_92 | WA | - |
testcase_93 | WA | - |
testcase_94 | AC | 2 ms
6,944 KB |
testcase_95 | AC | 2 ms
6,940 KB |
testcase_96 | AC | 2 ms
6,944 KB |
testcase_97 | WA | - |
testcase_98 | AC | 2 ms
6,940 KB |
testcase_99 | WA | - |
testcase_100 | WA | - |
testcase_101 | WA | - |
testcase_102 | AC | 2 ms
6,944 KB |
testcase_103 | AC | 2 ms
6,940 KB |
testcase_104 | WA | - |
testcase_105 | WA | - |
testcase_106 | WA | - |
testcase_107 | WA | - |
testcase_108 | WA | - |
testcase_109 | WA | - |
testcase_110 | WA | - |
testcase_111 | AC | 2 ms
6,944 KB |
testcase_112 | AC | 2 ms
6,940 KB |
testcase_113 | WA | - |
testcase_114 | WA | - |
testcase_115 | AC | 2 ms
6,944 KB |
testcase_116 | AC | 2 ms
6,940 KB |
testcase_117 | WA | - |
testcase_118 | AC | 2 ms
6,940 KB |
testcase_119 | WA | - |
testcase_120 | WA | - |
testcase_121 | WA | - |
testcase_122 | AC | 2 ms
6,944 KB |
testcase_123 | WA | - |
testcase_124 | WA | - |
testcase_125 | AC | 2 ms
6,944 KB |
testcase_126 | WA | - |
testcase_127 | AC | 2 ms
6,944 KB |
testcase_128 | WA | - |
testcase_129 | WA | - |
testcase_130 | WA | - |
testcase_131 | WA | - |
testcase_132 | AC | 2 ms
6,940 KB |
testcase_133 | AC | 2 ms
6,944 KB |
testcase_134 | WA | - |
testcase_135 | AC | 2 ms
6,940 KB |
testcase_136 | WA | - |
testcase_137 | AC | 2 ms
6,944 KB |
testcase_138 | AC | 2 ms
6,944 KB |
testcase_139 | AC | 2 ms
6,940 KB |
testcase_140 | AC | 2 ms
6,940 KB |
testcase_141 | AC | 3 ms
6,940 KB |
testcase_142 | WA | - |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=long long; using ull=unsigned long long; using pll=pair<ll,ll>; using tll=tuple<ll,ll,ll>; using ld=long double; const ll INF=(1ll<<60); #define rep(i,n) for (ll i=0;i<(ll)(n);i++) #define replr(i,l,r) for (ll i=(ll)(l);i<(ll)(r);i++) #define all(v) v.begin(),v.end() #define len(v) ((ll)v.size()) template<class T> inline bool chmin(T &a,T b){ if(a>b){ a=b; return true; } return false; } template<class T> inline bool chmax(T &a,T b){ if(a<b){ a=b; return true; } return false; } vector<vector<ll>> g; vector<ll> now; void dfs(ll x,ll p){ for(auto i:g[x]){ if(i==p) continue; dfs(i,x); if(now[i]==1){ now[i]^=1; now[x]^=1; } } } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll n; cin >> n; g.resize(n); vector<ll> p(n,-1); replr(i,1,n){ cin >> p[i]; p[i]--; } string s(n,'x'); replr(i,1,n) cin >> s[i]; ll q; cin >> q; vector<ll> u(q),v(q); rep(i,q){ cin >> u[i] >> v[i]; u[i]--; v[i]--; g[u[i]].push_back(v[i]); g[v[i]].push_back(u[i]); } now.assign(n,-1); replr(i,1,n){ if(s[i]=='.') now[i]=0; else now[i]=1; } rep(i,n){ //dfs(i,-1); if(now[i]==1){ cout << "No\n"; return 0; } } cout << "Yes\n"; }