QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#820484 | #4486. Bragging Dice | SGColin | AC ✓ | 27ms | 3684kb | C++20 | 831b | 2024-12-18 21:35:38 | 2024-12-18 21:35:39 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
inline int rd() {
int x = 0;
bool f = 0;
char c = getchar();
for (; !isdigit(c); c = getchar()) f |= (c == '-');
for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
return f ? -x : x;
}
int cnt[7];
inline void work() {
memset(cnt, 0, sizeof(cnt));
int n = rd();
for (int i = 1; i <= n; ++i) ++cnt[rd()];
int mx = 0;
for (int i = 1; i <= 6; ++i) mx = max(mx, cnt[i]);
if (mx <= 1) memset(cnt, 0, sizeof(cnt));
for (int i = 1; i <= n; ++i) ++cnt[rd()];
mx = 0;
for (int i = 1; i <= 6; ++i) mx = max(mx, cnt[i]);
if (mx <= 1) {puts("Just a game of chance."); return;}
puts("Win!");
}
int main() {
for (int t = rd(); t; --t) work();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 27ms
memory: 3684kb
input:
30 5 4 6 4 1 2 3 6 6 2 3 5 6 4 5 1 2 5 2 4 6 4 10 6 4 6 3 5 3 1 6 4 5 6 4 3 1 3 4 5 1 6 2 10 3 4 6 3 4 6 3 5 6 4 6 3 5 1 3 2 5 5 6 3 100000 1 6 4 4 2 6 5 1 4 3 4 5 1 4 6 3 1 3 4 5 1 1 5 3 3 6 5 4 6 6 3 1 2 5 6 3 2 3 1 3 3 2 1 1 4 6 4 6 6 3 4 3 2 3 1 3 1 1 1 5 4 5 3 1 2 3 3 6 2 5 6 5 5 3 4 2 2 5 4 5 ...
output:
Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win! Win!
result:
ok 30 lines