Wrong Answer
Code
#include <stdio.h>
int main(){
//SAYED AL MAMUN_LU
int t;
scanf("%d",&t);
while(t--){
int sum = 0,yy = 0,yy1 = 0;
int flag = 0;
int n;
scanf("%d",&n);
int samp[n];
for(int i = 0; i<n; i++){
scanf("%d",&samp[i]);
}
for(int i = 0; i<n; i++){
yy = yy + 1;
yy1 = yy1 + samp[i];
if(yy1%3 == 0){
flag = 1;
}
else {
flag = 0;
}
}
if(flag == 1) {
printf("%d\n",yy);
}
else {
printf("%d\n",1);
}
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1013 Divisible by 3
- Contest
- Brain booster - 1
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2023-12-31 16:29:05
- Judged At
- 2024-11-11 03:45:09
- Judged By
- Score
- 10
- Total Time
- 1ms
- Peak Memory
- 284.0 KiB