# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
895776 | 2023-12-30T19:36:26 Z | Isam | Izbori (COCI22_izbori) | C++17 | 3000 ms | 1112 KB |
#include<bits/stdc++.h> using namespace std; constexpr int sz = 500005; signed main(){ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int N; cin >> N; vector<int> A(N); for(int &a : A) cin >> a; auto chk = [&](int l, int r){ map<int, int> mp; for(register int i = l; i <= r; ++i) mp[A[i]]++; int that(0); for(auto &toto : mp) that = max(that, toto.second); return (that << 1) > (r - l + 1); }; int ans(0); for(register int i = 0; i < N; ++i){ for(register int j = i; j < N; ++j){ ans += chk(i, j); } } cout << ans << '\n'; /* 2 2 1 2 3 2; 2; 1; 2; 3; 2 2; 2 2 1; 2 1 2; 2 2 1 2; 2 2 1 2 3; */ return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 2 ms | 348 KB | Output is correct |
3 | Correct | 31 ms | 348 KB | Output is correct |
4 | Correct | 27 ms | 348 KB | Output is correct |
5 | Correct | 27 ms | 452 KB | Output is correct |
6 | Correct | 11 ms | 456 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 2 ms | 348 KB | Output is correct |
3 | Correct | 31 ms | 348 KB | Output is correct |
4 | Correct | 27 ms | 348 KB | Output is correct |
5 | Correct | 27 ms | 452 KB | Output is correct |
6 | Correct | 11 ms | 456 KB | Output is correct |
7 | Execution timed out | 3051 ms | 348 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3009 ms | 1112 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 2 ms | 348 KB | Output is correct |
3 | Correct | 31 ms | 348 KB | Output is correct |
4 | Correct | 27 ms | 348 KB | Output is correct |
5 | Correct | 27 ms | 452 KB | Output is correct |
6 | Correct | 11 ms | 456 KB | Output is correct |
7 | Execution timed out | 3051 ms | 348 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |