QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#252160#6784. Problem PreparationYcfhnndWA 0ms3592kbC++20753b2023-11-15 16:06:282023-11-15 16:06:28

Judging History

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

  • [2023-11-15 16:06:28]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3592kb
  • [2023-11-15 16:06:28]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

void solve(){
    int n;
    cin >> n;
    vector<int>a(n);
    for (int i = 0;i < n;i ++){
        cin >> a[i];
    }
    sort(a.begin(),a.end());
    if (n <= 9 || n > 13){
        cout << "No\n";
        return;
    }
    if (a[0] != 1 || a[1] != 1){
        cout << "No\n";
        return;
    }

    for (int i = 1;i < n;i ++){
        if (i != n - 1){
            if (a[i] - a[i - 1] > 2){
                cout << "No\n";
            }
        }
    }
    cout << "Yes\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);  

    int T = 1;
    cin >> T;
    while (T --){
        solve();
    }
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3592kb

input:

8
9
1 2 3 4 5 6 7 8 9
10
1 2 3 4 5 6 7 8 9 10
11
999 1 1 2 3 4 5 6 7 8 9
11
999 1 3 5 7 9 11 13 17 19 21
10
15 1 13 17 1 7 9 5 3 11
13
1 1 1 1 1 1 1 1 1 1 1 1 2
10
2 3 4 5 6 7 8 9 10 11
10
15 1 13 3 6 5 4 7 1 14

output:

No
No
Yes
No
Yes
Yes
No
No
Yes

result:

wrong output format Extra information in the output file