# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
155647 | karma | Lottery (CEOI18_lot) | C++14 | 1899 ms | 41364 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define Task "test"
#define pb emplace_back
using namespace std;
const int N = int(1e4) + 1;
int f[N][N], pre[N], a[N];
int n, l, lim, q, k;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
if(fopen(Task".inp", "r")) {
freopen(Task".inp", "r", stdin);
freopen(Task".out", "w", stdout);
}
cin >> n >> l; lim = n - l + 1;
for(int i = 1; i <= n; ++i) cin >> a[i];
for(int j = 1; j <= lim; ++j) {
for(int i = 1; i <= n; ++i) {
if(i + j > n) break;
if(a[i] != a[i + j]) pre[i] = pre[i - 1] + 1;
else pre[i] = pre[i - 1];
}
for(int i = 0; i < lim; ++i) {
if(i + j + l > n) break;
++f[i + 1][pre[i + l] - pre[i]];
++f[i + j + 1][pre[i + l] - pre[i]];
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |