QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#820484#4486. Bragging DiceSGColinAC ✓27ms3684kbC++20831b2024-12-18 21:35:382024-12-18 21:35:39

Judging History

你现在查看的是最新测评结果

  • [2024-12-18 21:35:39]
  • 评测
  • 测评结果:AC
  • 用时:27ms
  • 内存:3684kb
  • [2024-12-18 21:35:38]
  • 提交

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;
}

詳細信息

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