#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv){
cin.tie(0);
ios::sync_with_stdio(false);
int a,b,c;
while(cin>>a>>b>>c){
int d[a],f[a]={0},h=0;
for(int e=0;e<a;e++)
cin>>d[e];
for(int e=0;e<a;e++)
for(int g=e;g<e+b;g++)
f[e]=f[e]+d[g%a];
for(int e=0;e<a;e++)
if(f[e]==c)
h=1;
if(h==1)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
}
能問一下測資嗎?
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv){
cin.tie(0);
ios::sync_with_stdio(false);
int a,b,c;
while(cin>>a>>b>>c){
int d[a],f[a]={0},h=0;
for(int e=0;e<a;e++)
cin>>d[e];
for(int e=0;e<a;e++)
for(int g=e;g<e+b;g++)
f[e]=f[e]+d[g%a];
for(int e=0;e<a;e++)
if(f[e]==c)
h=1;
if(h==1)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
}
能問一下測資嗎?
錢袋不一定要拿連續的阿><