QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#779153 | #7986. 游戏 | ygl | WA | 1ms | 3780kb | C++20 | 816b | 2024-11-24 17:41:38 | 2024-11-24 17:41:39 |
Judging History
answer
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
using i64 = long long;
typedef pair<i64, i64> PII;
constexpr int inf = 0x3f3f3f3f, V = 2000001;
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<vector<int>> e(n);
for (int i = 0; i < n - 1; i ++ ){
int u, v;
cin >> u >> v;
u --, v --;
e[u].push_back(v);
}
auto dfs = [&](auto self, int u) -> bool{
if (e[u].empty()){
return true;
}
int cnt = 0;
for (auto v: e[u]){
cnt += self(self, v);
}
return cnt > 1;
};
cout << (dfs(dfs, 0) && n != 1 ? "You win, temporarily" : "Wasted") << "\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3780kb
input:
6 1 2 2 3 2 4 1 5 5 6
output:
Wasted
result:
wrong answer 1st lines differ - expected: 'Wasted.', found: 'Wasted'