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 <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <utility>
#include <queue>
#include <map>
#include <iomanip>
#include <stack>
using namespace std;
vector<int> paint(int n) {
int pintar[1001]={0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,0,1,0,0,1,1,1,1,1,1,0,0,1,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,0,1,1,0,0,1,1,1,1,1,0,1,0,1,0,1,1,1,1,1,0,1,0,0,0,1,1,1,1,1,0,0,1,1,0,1,1,1,1,1,0,0,1,0,0,1,1,1,1,1,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,0,1,1,1,1,0,1,1,1,0,0,1,1,1,1,0,1,1,0,1,0,1,1,1,1,0,1,1,0,0,0,1,1,1,1,0,1,0,1,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,1,0,1,0,0,1,0,1,1,1,1,0,1,0,0,0,0,1,1,1,1,0,0,1,1,1,0,1,1,1,1,0,0,1,1,0,0,1,1,1,1,0,0,1,0,1,0,1,1,1,1,0,0,1,0,0,0,1,1,1,1,0,0,0,1,1,0,1,1,1,1,0,0,0,1,0,0,1,1,1,1,0,0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,0,0,0,1,1,1,0,1,1,0,1,1,0,1,1,1,0,1,1,0,1,0,0,1,1,1,0,1,1,0,0,1,0,1,1,1,0,1,1,0,0,0,0,1,1,1,0,1,0,1,1,0,0,1,1,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,0,0,1,1,1,0,1,0,0,1,1,0,1,1,1,0,1,0,0,1,0,0,1,1,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0,1,0,0,1,0,1,0,1,0,0,0,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0,0,0,0,1,0,0,1,0,1,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0};
vector<int> labels(n + 1, 1);
for(int i=0;i<n;i++)
labels[i]=pintar[i];
int x=0;
for(int i=0;i<10;i++){
if(c[i]==-1){
x++;
}
}
if(x>0||n==10){
return n-10+x;
}
else{
vector<int>a(10);
for(int i=0;i<n;i++){
for(int k=0;k<10;k++){
a[k]=labels[i+k];
}
if(a==c){
x=i;
break;
}
}
return x;
}
}
# | 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... |