QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#272249#7877. Balanced Arrayucup-team1321#WA 1ms3620kbC++201.0kb2023-12-02 16:38:512023-12-02 16:39:14

Judging History

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

  • [2023-12-02 16:39:14]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3620kb
  • [2023-12-02 16:38:51]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

const int N = 2e6 + 5;
int a[N];

int digit(char a) {
    if ('0' <= a && a <= '9') return a - '0';
    if ('a' <= a && a <= 'z') return a - 'a' + 10;
    return a - 'A' + 36;
}
int read() {
    string s;
    cin >> s;
    int x = 0;
    for (char a : s)
        x = x * 62 + a;
    return x;
}

vector<int> avail;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) a[i] = read();
    cout << "00";
    for (int i = 3; i <= n; i++) {
        if ((i - 1) % 2 == 0) {
            avail.push_back((i - 1) / 2); 
        }
        vector<int> nv;
        for (int k : avail) {
            if (a[i] + a[i - 2 * k] == 2 * a[i - k]) {
                nv.push_back(k);
            }
        }
        avail.swap(nv);
        if (avail.size() > 100) avail.resize(100);
        if (avail.size()) {
            cout << 1;
        } else {
            cout << 0;
        }
    }
    
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
1 2 3

output:

001

result:

ok single line: '001'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

9
1 2 3 2 5 4 3 8 5

output:

001010111

result:

ok single line: '001010111'

Test #3:

score: -100
Wrong Answer
time: 1ms
memory: 3620kb

input:

9
1C 3f 4S 3h 88 6x 4W d1 8c

output:

000000000

result:

wrong answer 1st lines differ - expected: '001010111', found: '000000000'