codechef March Cook-Off 2014 Dividing Stamps editorial: http://discuss.codechef.com/questions/40353/dividing-editorial
codechef March Cook-Off 2014 Dividing Stamps solution: http://ideone.com/HuRk2m
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
long long int n, a, cnt;
cnt=0;
scanf("%lld", &n);
for(int i=0; i<n; i++) scanf("%lld", &a), cnt+=a;
if(n*(n+1)/2==cnt) printf("YES\n");
else printf("NO\n");
return 0;
}
No comments:
Post a Comment