QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#516674 | #5459. Goose, goose, DUCK? | no_RED_no_DEAD | WA | 0ms | 3784kb | C++20 | 708b | 2024-08-12 20:20:15 | 2024-08-12 20:20:15 |
Judging History
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);
}
詳細信息
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'