QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#516674#5459. Goose, goose, DUCK?no_RED_no_DEADWA 0ms3784kbC++20708b2024-08-12 20:20:152024-08-12 20:20:15

Judging History

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

  • [2024-08-12 20:20:15]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3784kb
  • [2024-08-12 20:20:15]
  • 提交

answer

#include "bits/stdc++.h"
using namespace std;
using ll = long long;

const ll N = 1e6 + 1;
const ll M = 1e9 + 7;

ll n, k;
ll a[N];

void doTest(ll testID) {
    cin >> n >> k;
    for (int i = 1; i <= n; i ++) cin >> a[i];

    ll res = 0;
    for (int i = 1; i <= n; i ++)
        for (int j = i; j <= n; j ++) {
            map<ll, ll> m;
            for (int k = i; k <= j; k ++) m[a[k]] ++;
            bool ok = 1;
            for (auto [x, y]: m) ok &= (y < k);
            res += ok;
        }
    cout << res;
}

signed main() {
    ios_base::sync_with_stdio(0); cin.tie(0);

    int test = 1; 
    // cin >> test;
    for (int _ = 1; _ <= test; _ ++) doTest(test);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

6 2
1 2 2 1 3 3

output:

10

result:

ok 1 number(s): "10"

Test #2:

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

input:

6 1
1 2 3 4 5 6

output:

0

result:

ok 1 number(s): "0"

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3752kb

input:

100 10
142826 764475 142826 986320 764475 142826 142826 986320 764475 986320 764475 764475 764475 142826 142826 986320 764475 986320 764475 764475 142826 764475 142826 764475 986320 986320 764475 142826 764475 764475 142826 764475 764475 986320 142826 142826 142826 142826 764475 986320 986320 764475...

output:

1943

result:

wrong answer 1st numbers differ - expected: '4309', found: '1943'