QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#377326 | #7986. 游戏 | RainbowX# | WA | 1ms | 5728kb | C++20 | 1.8kb | 2024-04-05 12:31:52 | 2024-04-05 12:31:52 |
Judging History
answer
#pragma GCC optimize(3)
#include <bits/stdc++.h>
#define f(i, n, m) for (long long i = n; i <= m; ++i)
#define unf(i, n, m) for (long long i = n; i >= m; --i)
#define kong NULL
#define debug cout << "sss" << endl;
using ll = long long;
using ull = unsigned long long;
using point_t = double; // 计算几何的默认类型
const double e = exp(1.0);
const double pi = acos(-1.0);
constexpr ll inf = 0x3f3f3f3f3f3f3f3f;
constexpr ll maxx = 0x3f3f3f3f3f3f3f3f;
constexpr ll minn = 0xc0c0c0c0c0c0c0c0;
#define endl '\n'
constexpr char blank = ' ';
constexpr ll mod = (ll)998244353;
constexpr size_t N = (size_t)1e6 + 6;
#ifdef _DEBUG
#define Crash(...) (__debugbreak(), 0)
#define Debug(...) (__debugbreak(), 0)
#else
#define Crash(...) (exit(-1), 0)
#define Debug(...) ((void)0)
#endif // _DEBUG
#define ensure(expression) (void)(!!(expression) || Crash())
inline void setaccuracy(const std::streamsize &accuracy)
{
std::cout << std::fixed << std::setprecision(accuracy);
}
#define int long long
using namespace std;
ll inde[N], outde[N];
void solve()
{
int n;
std::cin >> n;
for (int i = 1; i < n; i++)
{
ll u, v;
std::cin >> u >> v;
outde[u]++;
inde[v]++;
}
if (outde[1] == 1)
{
std::cout << "You win, temporarily." << endl;
return;
}
for (int i = 1; i <= n; i++)
{
if (outde[i] < 2 and outde[i] != 0)
{
std::cout << "Wasted." << endl;
return;
}
}
std::cout << "You win, temporarily." << endl;
// std::cout<< minn<<endl;
}
signed main()
{
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout.tie(nullptr);
int T = 1;
// cin >> T;
// scanf(" %d", &T);
// std::cin >> T;
// for (int q = 1; q <= T; q++) {
// while (T--) {
solve();
// }
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 5604kb
input:
6 1 2 2 3 2 4 1 5 5 6
output:
Wasted.
result:
ok single line: 'Wasted.'
Test #2:
score: 0
Accepted
time: 1ms
memory: 5728kb
input:
7 1 2 2 3 2 4 1 5 5 6 5 7
output:
You win, temporarily.
result:
ok single line: 'You win, temporarily.'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3680kb
input:
1
output:
You win, temporarily.
result:
wrong answer 1st lines differ - expected: 'Wasted.', found: 'You win, temporarily.'