# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
82330 | wzy | Lottery (CEOI18_lot) | C++11 | 1488 ms | 11080 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
Fix one diagonal and use prefix sum of a boolean matrix such that the position (i,j) represents mismatch of i and j
is better to code if the diagonal is (i , 1) - > (i+1 , 2) -> (i+2 , 3) ...
*/
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
int n , l , q , a[10002] , k[101] , v[10002], r[10002][101] , pos[10002] , ans[10002][101], k2[101];
int32_t main(){
scanf("%d%d" , &n , &l);
for(int i = 1 ; i <= n;i ++) scanf("%d" , &a[i]);
scanf("%d" , &q);
for(int i = 1 ; i <= q ;i ++) scanf("%d" , &k[i]), k2[i] = k[i];
sort(k + 1 , k + 1 + q);
for(int i = 1 ; i <= q; i ++) pos[k[i]] = i;
// fix the diagonal
v[0] = 0;
for(int i = 1 ; i <= n; i ++){
pii curr = pii(i, 1);
int sz = 0;
while(curr.F <= n && curr.S <= n){
v[++sz] = (a[curr.F] != a[curr.S]);
Compilation message (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... |