1 solutions
-
0
Guest MOD
-
0
#include<bits/stdc++.h> using namespace std; int main(){ char a[1000001]; cin>>a; int k=1; int b[1000001]; for(int i=0;i<16;i++,k++){ if(a[i]=='-'){ i++; } b[k]=((int) a[i]-48); } int q=((b[1]+b[3]+b[5]+b[7]+b[9]+b[11])+(b[2]+b[4]+b[6]+b[8]+b[10]+b[12])*3)%10; if(q==0&&b[13]==0){ cout<<"YES"; }else if(b[13]==10-q){ cout<<"YES"; }else{ cout<<"NO"; } }
- 1
Information
- ID
- 741
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 8
- Tags
- # Submissions
- 50
- Accepted
- 6
- Uploaded By