# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
516361 | amunduzbaev | JOIRIS (JOI16_joiris) | C++14 | 1 ms | 340 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.
#include "bits/stdc++.h"
using namespace std;
#define ar array
const int mod = 2020;
signed main(){
ios::sync_with_stdio(0); cin.tie(0);
int n, k; cin>>n>>k;
vector<int> a(n);
for(int i=0;i<n;i++) cin>>a[i];
vector<int> b(k);
for(int i=0;i<n;i++){
b[i%k] = (b[i%k] + a[i]) % k;
}
for(int i=1;i<n%k;i++){
if(b[i] != b[i-1]) {
cout<<-1<<"\n";
return 0;
}
}
for(int i=n%k+1;i<k;i++){
if(b[i] != b[i-1]){
cout<<-1<<"\n";
return 0;
}
# | 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... |