# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
835006 |
2023-08-23T05:20:52 Z |
azik21 |
Bank (IZhO14_bank) |
C++17 |
|
1 ms |
212 KB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define nn "\n"
#define ex exit(0);
#define sz(s) (int)(s).size();
ll cnt , ans , bit , n , t , k ,x , a , b , res ,sum , r , l ;
char h;
vector<int>v;
int main(){
ios_base::sync_with_stdio(0) , cin.tie(0) , cout.tie(0);
cin>> t>> n ;
cin>> x ;
int m[n];
for(int i=0 ;i < n; i++){
cin>>m[i];
ans+=m[i];
if(ans==x){
res++;
}
if(ans>x){
while(ans>x){
ans-=m[l];
l++;
}
if(ans==x){
res++;
}
}
}
if(res>0){
cout<<"YES";
ex;
}
cout<<"NO";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |