답안 #526689

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
526689 2022-02-16T01:42:06 Z joelau Izbori (COCI22_izbori) C++14
25 / 110
3000 ms 840 KB
#include <bits/stdc++.h>
using namespace std;

int N,A[200005];
map<int,int> mp;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> A[i];
    long long ans = 0;
    for (int i = 0; i < N; ++i) {
        mp.clear();
        int most = 0;
        for (int j = i; j < N; ++j) {
            most = max(most,++mp[A[j]]);
            if (most * 2 > j-i+1) ans++;
        }
    }
    cout << ans;

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 1 ms 324 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 1 ms 324 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 47 ms 360 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 38 ms 328 KB Output is correct
10 Correct 36 ms 332 KB Output is correct
11 Correct 35 ms 324 KB Output is correct
12 Correct 36 ms 332 KB Output is correct
13 Correct 35 ms 332 KB Output is correct
14 Correct 40 ms 332 KB Output is correct
15 Correct 38 ms 332 KB Output is correct
16 Correct 36 ms 324 KB Output is correct
17 Correct 7 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3045 ms 840 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 320 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 1 ms 324 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 47 ms 360 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 38 ms 328 KB Output is correct
10 Correct 36 ms 332 KB Output is correct
11 Correct 35 ms 324 KB Output is correct
12 Correct 36 ms 332 KB Output is correct
13 Correct 35 ms 332 KB Output is correct
14 Correct 40 ms 332 KB Output is correct
15 Correct 38 ms 332 KB Output is correct
16 Correct 36 ms 324 KB Output is correct
17 Correct 7 ms 332 KB Output is correct
18 Execution timed out 3045 ms 840 KB Time limit exceeded
19 Halted 0 ms 0 KB -