QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#449513#8583. 팰린드롬 판별하기thangthang100 ✓1ms3876kbC++202.5kb2024-06-21 13:17:512024-06-21 13:17:52

Judging History

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

  • [2024-06-21 13:17:52]
  • 评测
  • 测评结果:100
  • 用时:1ms
  • 内存:3876kb
  • [2024-06-21 13:17:51]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

extern int count_pair(int, int, int);
extern int find_character(int, std::vector<int>);
//
//extern int guess_palindromicity(int);
//int count_pair(int, int, int);
//int find_character(int, std::vector<int>);
//std::vector<std::vector<int>> shuffle(std::vector<std::vector<int>>) ;
//
//static int N, cnt1, cnt2;
//static int S[5002];
//
//void assertion(bool x, std::string msg) {
//    if (x) return;
//    printf("Wrong : %s", msg.c_str());
//    exit(0);
//}
//
//int count_pair(int x, int y, int z) {
//    ++cnt1;
//    assertion(x != y && y != z && x != z, "Invalid Query c1");
//    assertion(0 <= x && 0 <= y && 0 <= z &&
//            x < N && y < N && z < N, "Invalid Query c2");
//
//    int ret = 0;
//    if(S[x] == S[y]) ++ret;
//    if(S[y] == S[z]) ++ret;
//    if(S[z] == S[x]) ++ret;
//
//    return ret;
//}
//
//int find_character(int x, std::vector<int> Y) {
//    ++cnt2;
//    assertion(0 <= x && x < N, "Invalid Query f");
//    for(int y : Y) {
//        assertion(0 <= y && y < N, "Invalid Query f");
//    }
//    for(int y : Y) {
//        if(S[x] == S[y]) return 1;
//    }
//    return 0;
//}

int guess_palindromicity(int n){
    vector <int> n1, n2;

    for (int i = 1; i < n / 2; ++ i){
        int gg = count_pair(0, i, n - 1 - i);
        if (!gg) return 0;
        if (gg == 1) n1.push_back(i);
        else n2.push_back(i);
    }

    //cout << n1.back() << endl;

    vector <int> dhs = n1;
    for (int i : n1) dhs.push_back(n - i - 1);

    if (find_character(0, dhs)) return 0;

    if (n2.size()){
        int i = n2.back();
        if (count_pair(n - 1, n - 1 - i, i) == 1) return 0;
        return 1;
    }
    int i = n1.back();
    int gg = count_pair(0, n - 1, i);
    if (!gg) return 0;
    if (gg == 3) return 1;
    if (count_pair(n - 1, i, n - i - 1) == 3) return 0;
    return 1;
}
//
//void solve() {
//    assertion(scanf("%d", &N) == 1, "Wrong Input");
//    for(int i=0;i<N;i++) assertion(scanf("%d", &S[i]) == 1, "Wrong Input");
//    for(int i=0;i<N;i++) assertion(1 <= S[i] && S[i] <= 5000, "Wrong Input");
//
//    cnt1 = 0, cnt2 = 0;
//
//    int res = guess_palindromicity(N);
//    //cout << res << endl;
//    int ans = 1;
//    for(int i=0;i<N/2;i++) if(S[i] != S[N-1-i]) ans = 0;
//
//    assertion(res == ans, "Wrong Guess");
//    printf("Correct: %d %d", cnt1, cnt2);
//}
//
//int main(){
//    int t = 1;
//    while (t --) solve();
//}

詳細信息

Subtask #1:

score: 100
Accepted

Test #1:

score: 100
Accepted
time: 1ms
memory: 3772kb

input:

wHBDO4-INPUT-K2FZ4z
1
10
1 1 1 1 1 1 1 2 1 1

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #2:

score: 100
Accepted
time: 1ms
memory: 3624kb

input:

wHBDO4-INPUT-K2FZ4z
500
10
1 1 1 1 1 1 2 1 1 1
10
1 1 1 2 1 1 1 1 1 1
10
1 1 1 1 1 1 1 1 1 2
10
1 1 2 1 1 1 1 1 1 1
10
1 1 2 1 1 1 1 1 1 1
10
1 1 1 1 1 1 1 2 1 1
10
1 1 1 1 1 2 1 1 1 1
10
1 1 1 1 1 1 2 1 1 1
10
1 1 2 1 1 1 1 1 1 1
10
1 1 1 1 1 2 1 1 1 1
10
1 1 1 2 1 1 1 1 1 1
10
1 2 1 1 1 1 1 1 1 1
...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #3:

score: 100
Accepted
time: 1ms
memory: 3540kb

input:

wHBDO4-INPUT-K2FZ4z
500
10
2 1 1 1 1 1 1 1 1 1
10
1 1 1 2 1 1 1 1 1 1
10
1 1 1 1 2 1 1 1 1 1
10
1 1 1 1 1 2 1 1 1 1
10
1 1 1 1 2 1 1 1 1 1
10
2 1 1 1 1 1 1 1 1 1
10
1 2 1 1 1 1 1 1 1 1
10
1 1 1 1 1 1 1 1 2 1
10
1 1 2 1 1 1 1 1 1 1
10
1 1 1 1 1 1 1 2 1 1
10
1 1 2 1 1 1 1 1 1 1
10
1 1 1 2 1 1 1 1 1 1
...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #4:

score: 100
Accepted
time: 1ms
memory: 3600kb

input:

wHBDO4-INPUT-K2FZ4z
250
20
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
20
1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
20
1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1
20
1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1
20
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1
20
1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1
20
1 1 1 1 1 1 1 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #5:

score: 100
Accepted
time: 1ms
memory: 3484kb

input:

wHBDO4-INPUT-K2FZ4z
250
20
1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
20
1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1
20
1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
20
1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1
20
1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1
20
1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
20
1 1 1 1 1 1 1 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #6:

score: 100
Accepted
time: 1ms
memory: 3800kb

input:

wHBDO4-INPUT-K2FZ4z
1000
5
1 1 1 2 1
5
2 1 1 1 1
5
1 1 1 1 2
5
1 1 1 2 1
5
1 1 2 1 1
5
1 1 1 1 2
5
1 1 1 2 1
5
1 1 1 1 2
5
1 1 1 1 2
5
1 2 1 1 1
5
1 1 1 1 2
5
2 1 1 1 1
5
1 1 2 1 1
5
1 1 1 2 1
5
1 2 1 1 1
5
2 1 1 1 1
5
1 1 1 1 2
5
1 1 1 2 1
5
1 2 1 1 1
5
1 1 1 1 2
5
2 1 1 1 1
5
1 1 2 1 1
5
1 1 2 1 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #7:

score: 100
Accepted
time: 1ms
memory: 3560kb

input:

wHBDO4-INPUT-K2FZ4z
500
10
1 1 1 3 1 1 2 1 1 1
10
1 1 1 2 1 1 3 1 1 1
10
3 1 1 1 1 1 1 1 1 2
10
1 1 2 1 1 1 1 3 1 1
10
1 1 2 1 1 1 1 3 1 1
10
1 1 3 1 1 1 1 2 1 1
10
1 1 1 1 3 2 1 1 1 1
10
1 1 1 3 1 1 2 1 1 1
10
1 1 2 1 1 1 1 3 1 1
10
1 1 1 1 3 2 1 1 1 1
10
1 1 1 2 1 1 3 1 1 1
10
1 2 1 1 1 1 1 1 3 1
...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #8:

score: 100
Accepted
time: 1ms
memory: 3556kb

input:

wHBDO4-INPUT-K2FZ4z
500
10
2 1 1 1 1 1 1 1 1 3
10
1 1 1 2 1 1 3 1 1 1
10
1 1 1 1 2 3 1 1 1 1
10
1 1 1 1 3 2 1 1 1 1
10
1 1 1 1 2 3 1 1 1 1
10
2 1 1 1 1 1 1 1 1 3
10
1 2 1 1 1 1 1 1 3 1
10
1 3 1 1 1 1 1 1 2 1
10
1 1 2 1 1 1 1 3 1 1
10
1 1 3 1 1 1 1 2 1 1
10
1 1 2 1 1 1 1 3 1 1
10
1 1 1 2 1 1 3 1 1 1
...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #9:

score: 100
Accepted
time: 1ms
memory: 3552kb

input:

wHBDO4-INPUT-K2FZ4z
1000
5
3 3 1 3 3
5
2 2 1 1 2
5
3 3 1 3 1
5
1 2 3 2 1
5
3 1 1 1 3
5
2 3 1 3 2
5
1 2 2 2 1
5
2 3 1 3 1
5
3 2 3 2 1
5
1 2 2 2 3
5
3 3 2 3 3
5
1 3 1 3 1
5
1 1 3 1 3
5
1 2 2 2 1
5
1 3 3 3 1
5
3 2 2 3 3
5
2 3 1 3 1
5
1 2 3 2 2
5
1 1 1 1 1
5
1 1 1 1 1
5
1 1 1 1 2
5
1 1 3 1 3
5
1 2 2 2 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #10:

score: 100
Accepted
time: 1ms
memory: 3832kb

input:

wHBDO4-INPUT-K2FZ4z
1000
5
3 5 1 5 3
5
3 1 5 5 3
5
4 5 1 5 4
5
4 3 3 3 5
5
3 1 5 1 3
5
1 5 3 5 1
5
5 2 3 2 5
5
4 4 5 4 4
5
4 1 4 1 4
5
3 5 1 5 4
5
3 1 1 2 3
5
4 2 1 2 4
5
4 5 1 5 4
5
2 5 2 5 2
5
1 2 3 5 1
5
3 5 5 1 3
5
5 2 3 2 5
5
2 1 3 5 2
5
2 2 2 2 1
5
3 1 4 1 3
5
4 3 4 3 4
5
1 2 4 4 1
5
1 1 1 1 3...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #11:

score: 100
Accepted
time: 1ms
memory: 3832kb

input:

wHBDO4-INPUT-K2FZ4z
1000
5
2 5 1 5 5
5
5 4 3 4 5
5
3 5 3 3 3
5
1 5 2 4 1
5
1 3 3 3 3
5
3 2 4 2 3
5
4 4 1 4 1
5
3 3 5 3 3
5
1 4 4 1 1
5
2 2 2 2 1
5
5 4 5 4 5
5
4 3 2 3 2
5
4 2 5 5 4
5
1 2 2 2 2
5
5 5 4 5 2
5
3 2 2 2 3
5
4 3 4 3 1
5
5 3 4 4 5
5
5 1 3 5 5
5
3 2 5 4 3
5
3 2 3 3 3
5
5 4 2 3 5
5
4 1 3 2 4...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #12:

score: 100
Accepted
time: 0ms
memory: 3624kb

input:

wHBDO4-INPUT-K2FZ4z
833
6
1 1 2 2 1 1
6
1 2 1 2 2 1
6
2 1 1 2 2 2
6
1 2 1 1 2 1
6
1 1 1 2 2 1
6
1 2 1 2 1 1
6
1 2 1 2 1 1
6
2 1 2 1 2 1
6
1 2 2 1 1 1
6
2 2 1 2 1 1
6
2 1 2 2 2 2
6
2 1 1 1 1 1
6
2 2 2 2 2 2
6
2 2 2 1 1 1
6
1 2 2 1 1 1
6
2 2 1 1 2 1
6
2 1 2 2 2 1
6
2 1 2 1 1 2
6
2 2 2 1 2 1
6
2 1 1 1 ...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #13:

score: 100
Accepted
time: 1ms
memory: 3540kb

input:

wHBDO4-INPUT-K2FZ4z
833
6
2 1 2 2 3 3
6
2 3 2 1 2 1
6
3 1 2 1 1 1
6
2 2 3 3 2 3
6
3 3 1 2 3 1
6
3 1 2 3 2 3
6
2 3 2 3 2 1
6
3 1 3 1 1 1
6
3 3 1 2 1 2
6
1 2 1 3 2 2
6
2 2 1 3 1 3
6
3 1 1 2 3 2
6
2 1 3 3 3 3
6
3 2 1 2 3 3
6
3 2 1 1 1 3
6
1 1 2 2 1 2
6
1 1 1 1 1 2
6
2 2 1 1 2 1
6
2 1 2 2 1 2
6
2 2 3 2 ...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #14:

score: 100
Accepted
time: 1ms
memory: 3832kb

input:

wHBDO4-INPUT-K2FZ4z
833
6
3 2 3 2 2 1
6
3 2 2 1 1 2
6
3 3 3 4 3 1
6
1 3 2 2 3 2
6
1 3 1 2 3 1
6
1 3 3 1 1 3
6
1 2 2 1 1 2
6
2 4 2 2 3 1
6
3 1 2 1 2 1
6
1 4 4 2 1 3
6
3 1 4 3 4 3
6
4 4 1 3 2 3
6
4 3 1 4 2 4
6
4 1 1 1 3 1
6
2 4 3 2 1 1
6
2 3 3 1 4 3
6
3 4 4 4 2 3
6
4 1 1 3 4 4
6
3 1 3 1 1 4
6
2 1 4 2 ...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #15:

score: 100
Accepted
time: 1ms
memory: 3860kb

input:

wHBDO4-INPUT-K2FZ4z
50
99
1 1 1 2 1 2 1 2 1 1 1 1 1 2 1 1 1 2 2 1 1 1 2 1 1 1 1 1 2 2 1 1 2 1 1 1 2 1 1 1 2 1 2 2 2 1 1 2 1 1 1 1 1 2 1 1 1 1 2 2 1 1 2 1 2 2 1 1 2 2 2 1 2 1 1 2 1 2 2 2 2 1 1 2 1 1 1 2 2 2 1 2 1 2 2 2 2 2 2
99
2 1 1 2 1 1 2 2 1 2 1 1 1 2 2 2 1 2 1 2 2 1 1 1 2 1 1 2 1 1 1 1 1 1 2 1 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #16:

score: 100
Accepted
time: 1ms
memory: 3548kb

input:

wHBDO4-INPUT-K2FZ4z
25
199
1 2 2 1 1 2 2 1 2 2 2 1 1 2 2 2 2 1 2 1 1 2 1 2 1 2 2 1 1 1 2 2 1 2 2 1 2 1 2 2 1 1 1 1 2 1 1 1 1 1 1 2 2 1 1 2 2 1 2 1 1 2 1 1 1 1 1 2 1 1 2 2 1 1 2 2 1 2 2 2 1 2 1 1 2 2 2 2 2 2 1 1 1 2 2 2 2 2 2 1 1 2 1 2 1 2 2 1 2 2 2 1 2 1 1 2 1 2 2 2 2 1 1 1 1 1 2 1 2 1 1 2 1 2 2 1 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #17:

score: 100
Accepted
time: 1ms
memory: 3800kb

input:

wHBDO4-INPUT-K2FZ4z
10
499
1 2 3 3 2 1 1 3 2 2 3 1 2 1 3 3 2 2 2 2 1 2 1 3 1 3 2 3 2 3 1 3 1 1 1 1 2 1 1 3 3 2 2 2 3 3 1 2 1 1 2 2 1 3 1 2 1 2 3 2 3 1 2 1 2 3 3 2 3 2 2 1 3 1 3 2 1 3 1 2 1 1 1 1 3 3 1 3 1 3 2 3 3 2 1 2 1 1 3 1 1 3 1 1 2 1 3 1 1 3 1 3 1 2 3 3 1 3 2 2 3 3 3 2 1 2 3 1 2 3 2 3 2 2 2 2 3...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #18:

score: 100
Accepted
time: 1ms
memory: 3616kb

input:

wHBDO4-INPUT-K2FZ4z
50
100
1 1 1 1 2 1 1 1 1 1 2 2 1 1 2 1 2 1 1 1 2 1 1 2 1 2 1 1 2 2 2 1 1 2 1 1 1 2 2 2 1 1 1 2 1 2 2 1 2 1 1 2 2 1 2 1 2 1 2 2 1 1 1 2 1 1 2 1 2 1 2 2 2 1 2 1 2 2 2 1 2 2 1 1 1 1 2 2 2 2 2 2 2 1 1 1 2 1 2 1
100
1 2 1 1 2 1 2 1 1 2 1 1 1 1 2 1 2 1 2 2 1 1 2 1 1 2 2 1 2 1 1 2 2 2 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #19:

score: 100
Accepted
time: 0ms
memory: 3572kb

input:

wHBDO4-INPUT-K2FZ4z
10
500
2 2 1 2 1 2 1 1 2 1 1 2 1 1 2 2 2 2 2 2 1 1 2 2 1 2 2 1 2 2 1 1 2 1 2 1 2 1 2 1 2 2 2 2 1 2 1 1 1 2 2 2 2 1 1 1 2 2 2 2 2 2 2 1 2 1 2 1 2 1 1 1 1 1 2 2 2 2 1 2 1 1 2 1 2 2 1 2 1 2 2 1 1 1 1 1 1 2 2 1 1 1 2 2 1 1 2 1 1 1 2 1 2 2 2 2 2 1 2 2 1 1 2 1 1 2 1 1 2 2 2 1 1 1 2 1 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #20:

score: 100
Accepted
time: 1ms
memory: 3680kb

input:

wHBDO4-INPUT-K2FZ4z
5
1000
1 2 1 2 2 1 2 1 2 1 2 1 2 2 1 1 2 1 2 1 1 1 2 1 1 2 1 1 2 1 2 2 1 1 2 2 2 1 2 1 1 2 1 2 2 1 1 1 2 1 2 2 1 2 2 2 2 1 1 2 2 1 2 1 2 2 2 1 2 1 2 2 1 2 1 2 1 2 2 1 1 2 2 2 1 1 2 1 2 2 1 2 1 1 1 1 1 2 2 2 2 2 1 1 1 1 1 1 1 1 1 2 2 2 2 1 1 2 2 2 1 1 2 2 1 2 1 2 1 1 1 2 1 2 1 2 2...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #21:

score: 100
Accepted
time: 1ms
memory: 3612kb

input:

wHBDO4-INPUT-K2FZ4z
1
5000
2 2 1 2 2 2 2 1 1 1 2 1 1 1 1 1 2 1 2 1 2 1 1 1 1 2 2 1 2 1 2 1 1 1 2 1 2 2 2 2 2 1 1 2 1 1 2 2 2 2 1 1 2 2 1 1 1 1 2 2 2 2 2 1 1 2 1 2 1 1 1 1 2 1 2 2 2 1 1 1 2 2 2 2 1 1 1 2 2 1 1 1 2 2 1 2 2 1 2 2 2 2 1 1 1 2 1 1 2 2 2 2 2 2 2 1 1 2 1 1 1 1 2 1 2 1 2 2 2 1 1 1 2 1 2 1 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #22:

score: 100
Accepted
time: 1ms
memory: 3848kb

input:

wHBDO4-INPUT-K2FZ4z
1
5000
2 1 2 1 2 1 1 1 1 1 2 1 1 2 2 1 2 2 2 1 1 1 1 2 2 2 1 2 2 1 2 2 2 1 1 1 2 1 1 1 1 2 2 2 2 1 1 2 2 1 1 1 1 2 1 1 2 2 1 1 1 1 1 1 2 1 2 2 2 1 1 1 1 1 2 2 2 2 2 2 2 1 2 2 2 1 1 1 2 2 1 2 2 1 1 2 2 2 2 2 1 2 2 2 1 2 2 2 1 1 2 1 1 2 2 2 1 1 2 1 2 2 2 1 1 1 2 1 1 1 1 1 2 1 2 1 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #23:

score: 100
Accepted
time: 1ms
memory: 3600kb

input:

wHBDO4-INPUT-K2FZ4z
1
5000
2 1 2 1 1 2 1 1 2 1 1 1 2 2 1 2 1 2 2 2 1 2 2 1 1 2 2 1 1 2 2 2 1 1 2 1 2 2 1 1 1 2 2 1 2 2 1 2 2 2 1 2 2 2 1 2 2 1 2 1 2 2 2 2 1 1 1 1 1 1 2 2 2 2 1 1 2 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 2 2 2 1 1 2 2 2 2 1 1 1 2 1 1 2 2 1 2 1 1 2 1 2 1 2 1 2 2 2 1 1 1 2 1 1 1 1 1 2 2 1 2 2...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #24:

score: 100
Accepted
time: 1ms
memory: 3856kb

input:

wHBDO4-INPUT-K2FZ4z
50
100
1 2 1 2 2 1 1 1 1 1 2 2 2 2 2 1 1 2 2 1 1 2 2 2 2 1 2 1 1 2 2 2 2 1 1 1 1 1 2 1 2 2 2 1 2 2 2 1 2 1 1 2 1 2 2 2 1 2 2 2 1 2 1 1 1 1 1 2 2 2 2 1 1 2 1 2 2 2 2 1 1 2 2 1 1 2 2 2 2 2 1 1 1 1 1 2 2 1 2 1
100
1 2 2 1 1 1 2 1 1 1 1 2 2 2 1 2 1 2 1 2 2 1 1 1 1 2 2 2 2 1 1 1 2 2 2...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #25:

score: 100
Accepted
time: 1ms
memory: 3636kb

input:

wHBDO4-INPUT-K2FZ4z
50
100
1 2 2 2 2 1 1 1 1 1 1 2 2 1 1 2 1 1 2 1 2 2 1 1 1 2 1 1 1 1 2 2 1 1 2 1 1 2 2 2 1 2 1 2 1 2 2 1 2 1 1 2 1 2 2 1 2 1 2 1 2 2 2 1 1 2 1 1 2 2 1 1 1 1 2 1 1 1 2 2 1 2 1 1 1 1 1 2 2 1 1 1 1 1 1 2 2 2 2 1
100
2 2 1 2 1 2 1 1 1 1 2 2 1 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 1 2 1 2 1 2 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #26:

score: 100
Accepted
time: 1ms
memory: 3620kb

input:

wHBDO4-INPUT-K2FZ4z
50
100
1 2 2 2 1 2 2 1 2 1 1 2 1 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 2 2 1 2 1 1 2 1 1 1 2 1 1 2 2 2 1 2 1 2 2 2 2 1 2 1 2 2 2 1 1 2 1 1 1 2 1 1 2 1 2 1 1 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 1 2 1 1 2 1 2 2 1 2 2 2 1
100
1 2 1 2 2 1 2 1 2 2 1 2 2 1 1 2 1 2 1 1 1 2 1 2 1 2 2 2 1 2 2 2 2 2 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #27:

score: 100
Accepted
time: 1ms
memory: 3600kb

input:

wHBDO4-INPUT-K2FZ4z
1
5000
2 2 1 2 2 2 2 1 1 1 2 1 1 1 1 1 2 1 2 1 2 1 1 1 1 2 2 1 2 1 2 1 1 1 2 1 2 2 2 2 2 1 1 2 1 1 2 2 2 2 1 1 2 2 1 1 1 1 2 2 2 2 2 1 1 2 1 2 1 1 1 1 2 1 2 2 2 1 1 1 2 2 2 2 1 1 1 2 2 1 1 1 2 2 1 2 2 1 2 2 2 2 1 1 1 2 1 1 2 2 2 2 2 2 2 1 1 2 1 1 1 1 2 1 2 1 2 2 2 1 1 1 2 1 2 1 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #28:

score: 100
Accepted
time: 1ms
memory: 3668kb

input:

wHBDO4-INPUT-K2FZ4z
1
5000
2 1 2 1 2 1 1 1 1 1 2 1 1 2 2 1 2 2 2 1 1 1 1 2 2 2 1 2 2 1 2 2 2 1 1 1 2 1 1 1 1 2 2 2 2 1 1 2 2 1 1 1 1 2 1 1 2 2 1 1 1 1 1 1 2 1 2 2 2 1 1 1 1 1 2 2 2 2 2 2 2 1 2 2 2 1 1 1 2 2 1 2 2 1 1 2 2 2 2 2 1 2 2 2 1 2 2 2 1 1 2 1 1 2 2 2 1 1 2 1 2 2 2 1 1 1 2 1 1 1 1 1 2 1 2 1 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #29:

score: 100
Accepted
time: 0ms
memory: 3728kb

input:

wHBDO4-INPUT-K2FZ4z
1
5000
2 1 2 1 1 2 1 1 2 1 1 1 2 2 1 2 1 2 2 2 1 2 2 1 1 2 2 1 1 2 2 2 1 1 2 1 2 2 1 1 1 2 2 1 2 2 1 2 2 2 1 2 2 2 1 2 2 1 2 1 2 2 2 2 1 1 1 1 1 1 2 2 2 2 1 1 2 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 2 2 2 1 1 2 2 2 2 1 1 1 2 1 1 2 2 1 2 1 1 2 1 2 1 2 1 2 2 2 1 1 1 2 1 1 1 1 1 2 2 1 2 2...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #30:

score: 100
Accepted
time: 1ms
memory: 3644kb

input:

wHBDO4-INPUT-K2FZ4z
5
999
16 11 2 16 10 16 10 2 1 7 5 16 15 6 5 1 14 3 9 15 12 3 13 14 9 5 7 8 4 20 14 15 2 6 6 6 10 10 5 20 15 11 13 4 18 2 12 7 1 12 7 9 12 10 3 16 12 16 7 7 15 18 7 1 10 1 3 4 19 19 14 10 7 19 19 11 1 14 20 16 9 9 6 14 14 12 11 18 17 1 3 6 11 11 18 2 3 16 9 12 6 19 12 19 20 2 11 5...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #31:

score: 100
Accepted
time: 1ms
memory: 3616kb

input:

wHBDO4-INPUT-K2FZ4z
5
999
4 15 16 14 12 5 13 10 20 13 8 19 6 7 20 2 20 5 11 8 4 20 10 17 6 14 8 9 1 10 12 9 9 3 15 6 16 5 3 11 8 14 18 2 18 10 11 11 7 11 20 1 2 6 15 11 19 17 14 19 7 3 3 3 1 7 4 7 10 13 19 12 2 15 7 1 1 17 13 12 4 9 12 14 13 20 2 4 18 16 1 19 19 16 11 8 11 7 11 16 7 17 13 2 19 8 1 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #32:

score: 100
Accepted
time: 1ms
memory: 3820kb

input:

wHBDO4-INPUT-K2FZ4z
5
999
8 19 6 15 5 2 12 18 16 15 16 19 16 20 3 11 15 16 9 9 13 18 19 17 3 6 10 6 13 4 18 20 17 3 19 15 6 20 16 6 9 8 7 17 7 14 19 11 1 14 14 5 11 19 11 5 6 18 9 12 10 16 18 16 16 20 4 7 9 7 8 3 17 6 6 15 2 4 18 20 6 1 19 18 8 8 6 11 16 18 19 15 10 1 9 2 7 14 5 1 20 3 14 17 13 14 2...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #33:

score: 100
Accepted
time: 1ms
memory: 3564kb

input:

wHBDO4-INPUT-K2FZ4z
5
1000
17 11 9 3 7 4 7 1 20 19 19 3 18 7 12 14 11 20 19 13 10 12 20 12 20 3 3 10 16 11 4 13 15 5 20 13 13 10 9 17 2 10 14 9 13 9 1 7 17 13 10 14 7 6 11 2 10 14 7 2 7 2 6 12 20 6 4 16 1 16 10 1 7 19 11 7 19 12 16 20 13 16 4 20 14 5 5 4 5 11 17 18 12 16 10 7 4 13 15 16 3 11 4 14 17...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #34:

score: 100
Accepted
time: 1ms
memory: 3556kb

input:

wHBDO4-INPUT-K2FZ4z
5
1000
1 3 7 4 8 13 7 9 19 1 2 3 8 4 3 11 14 18 1 18 18 6 1 3 17 19 20 7 8 1 18 11 6 17 8 14 6 5 7 16 15 5 3 4 14 13 16 7 19 12 4 6 16 14 7 16 16 15 2 10 18 15 13 2 16 12 17 20 20 14 14 8 2 10 6 18 19 19 1 8 16 12 10 7 13 17 8 11 19 13 11 15 3 1 19 13 12 4 9 12 13 1 5 1 12 13 5 5...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #35:

score: 100
Accepted
time: 1ms
memory: 3564kb

input:

wHBDO4-INPUT-K2FZ4z
5
1000
5 8 17 2 2 9 6 1 15 3 18 7 18 17 10 20 8 12 19 19 7 15 11 6 18 11 1 8 9 8 4 17 2 9 17 2 8 16 4 3 20 19 8 18 3 20 12 11 17 19 2 18 5 15 3 15 7 16 5 14 1 4 8 19 15 17 6 4 11 12 3 2 9 2 5 8 8 2 14 12 10 4 17 11 8 5 16 17 8 16 9 19 14 2 8 15 20 15 15 16 2 7 6 8 6 19 16 8 9 5 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #36:

score: 100
Accepted
time: 1ms
memory: 3672kb

input:

wHBDO4-INPUT-K2FZ4z
5
1000
9 8 10 19 15 2 9 5 10 6 18 18 13 19 1 17 15 10 1 12 11 13 20 5 15 19 6 5 1 14 3 8 13 2 10 2 18 11 6 9 12 18 9 17 12 16 3 11 11 14 12 6 15 15 15 9 10 17 20 6 12 1 3 17 6 14 11 8 10 6 16 4 20 10 1 18 8 9 7 8 1 4 7 15 3 13 8 4 10 19 7 16 1 3 17 2 16 7 13 13 3 2 19 15 13 5 10 ...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #37:

score: 100
Accepted
time: 1ms
memory: 3820kb

input:

wHBDO4-INPUT-K2FZ4z
1
5000
83 26 2 90 49 32 8 65 51 59 80 97 61 86 97 60 21 35 22 9 57 20 66 81 76 63 72 44 97 18 88 21 56 27 12 21 47 45 88 21 95 54 46 31 28 15 39 29 68 23 60 78 85 24 90 30 66 85 19 47 70 86 18 75 90 79 87 75 74 41 64 11 7 79 33 95 67 86 53 55 4 66 43 44 37 87 58 34 41 77 49 100 4...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #38:

score: 100
Accepted
time: 1ms
memory: 3876kb

input:

wHBDO4-INPUT-K2FZ4z
1
5000
11 71 59 68 3 97 79 53 6 41 23 37 55 15 12 81 40 97 44 50 9 98 79 60 33 71 93 5 9 88 14 95 55 64 21 17 77 16 29 35 84 68 35 89 25 99 54 69 82 82 70 30 70 45 94 65 57 6 66 55 78 3 57 53 13 44 75 2 64 75 13 97 26 91 12 25 16 73 98 71 46 18 69 72 80 59 30 84 94 99 87 12 59 81...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #39:

score: 100
Accepted
time: 1ms
memory: 3592kb

input:

wHBDO4-INPUT-K2FZ4z
1
5000
31 19 13 45 64 74 66 41 66 28 59 89 46 49 35 90 62 48 66 3 58 75 88 44 94 87 10 70 30 59 32 74 47 96 25 30 7 87 63 42 84 79 20 36 14 86 62 9 1 49 88 77 63 73 90 3 44 27 21 67 89 8 96 38 48 1 48 22 63 9 57 83 41 2 80 55 76 60 55 79 1 78 8 92 11 23 6 27 44 18 25 29 58 46 6 2...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #40:

score: 100
Accepted
time: 1ms
memory: 3832kb

input:

wHBDO4-INPUT-K2FZ4z
50
100
1 2 1 2 2 1 1 1 1 1 2 2 2 2 2 1 1 2 2 1 1 2 2 2 2 1 2 1 1 2 2 2 2 1 1 1 1 1 2 1 2 2 2 1 2 2 2 1 2 1 1 2 1 2 2 2 1 2 2 2 1 2 1 1 1 1 1 2 2 2 2 1 1 2 1 2 2 2 2 1 1 2 2 1 1 2 2 2 2 2 1 1 1 1 1 2 2 1 2 1
100
2 2 1 2 2 1 1 1 2 1 1 1 1 2 2 2 1 2 1 2 1 2 2 1 1 1 1 2 2 2 2 1 1 1 2...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #41:

score: 100
Accepted
time: 1ms
memory: 3624kb

input:

wHBDO4-INPUT-K2FZ4z
50
100
1 2 2 2 2 1 1 1 1 1 1 2 2 1 1 1 1 1 2 1 2 2 1 1 1 2 1 1 1 1 2 2 1 1 2 1 1 2 2 2 1 2 1 2 1 2 2 1 2 1 1 2 1 2 2 1 2 1 2 1 2 2 2 1 1 2 1 1 2 2 1 1 1 1 2 1 1 1 2 2 1 2 1 1 1 1 1 2 2 1 1 1 1 1 1 2 2 2 2 1
100
2 2 2 2 1 2 1 2 1 1 1 1 2 2 1 2 2 2 2 2 2 2 2 2 2 1 1 1 1 2 1 2 1 2 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #42:

score: 100
Accepted
time: 1ms
memory: 3656kb

input:

wHBDO4-INPUT-K2FZ4z
1
5000
22 8 23 46 41 29 30 46 45 31 25 48 50 46 40 9 41 12 6 50 22 40 25 49 3 43 35 47 50 36 13 1 39 8 22 47 26 34 37 11 7 22 21 27 26 36 25 30 48 36 11 6 20 20 36 14 25 15 20 8 45 42 21 9 49 49 27 41 12 13 31 46 11 9 13 50 20 41 20 11 41 16 7 18 14 45 39 27 13 23 25 34 5 49 10 3...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #43:

score: 100
Accepted
time: 1ms
memory: 3656kb

input:

wHBDO4-INPUT-K2FZ4z
1
5000
50 2 27 28 3 44 10 30 5 17 18 42 40 37 9 26 17 20 24 41 20 17 34 33 10 6 6 4 17 6 39 21 30 40 26 1 10 5 29 22 4 33 6 24 15 20 37 24 12 44 29 8 5 36 32 49 16 36 25 25 3 5 6 37 30 14 8 14 11 47 34 32 22 17 35 30 22 28 23 27 46 26 34 41 49 9 11 23 17 42 8 1 21 14 19 34 5 29 3...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #44:

score: 100
Accepted
time: 1ms
memory: 3672kb

input:

wHBDO4-INPUT-K2FZ4z
5
999
16 11 2 16 10 16 10 2 1 7 5 16 15 6 5 1 14 3 9 15 12 3 13 14 9 5 7 8 4 20 14 15 2 6 6 6 10 10 5 20 15 11 13 4 18 2 12 7 1 12 7 9 12 10 3 16 12 16 7 7 15 18 7 1 10 1 3 4 19 19 14 10 7 19 19 11 1 14 20 16 9 9 6 14 14 12 11 18 17 1 3 6 11 11 18 2 3 16 9 12 6 19 12 19 20 2 11 5...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #45:

score: 100
Accepted
time: 1ms
memory: 3628kb

input:

wHBDO4-INPUT-K2FZ4z
5
999
4 15 16 14 12 5 13 10 20 13 8 19 6 7 20 2 20 5 11 8 4 20 10 17 6 14 8 9 1 10 12 9 9 3 15 6 16 5 3 11 8 14 18 2 18 10 11 11 7 11 20 1 2 6 15 11 19 17 14 19 7 3 3 3 1 7 4 7 10 13 19 12 2 15 7 1 1 17 13 12 4 9 12 14 13 20 2 4 18 16 1 19 19 16 11 8 11 7 11 16 7 17 13 2 19 8 1 1...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #46:

score: 100
Accepted
time: 1ms
memory: 3636kb

input:

wHBDO4-INPUT-K2FZ4z
1
4999
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 ...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct

Test #47:

score: 100
Accepted
time: 1ms
memory: 3648kb

input:

wHBDO4-INPUT-K2FZ4z
1
5000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 ...

output:

ppme3h-OUTPUT-dzfJFL
100

result:

ok Correct