/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 328.0 KiB
#2 Wrong Answer 1ms 328.0 KiB
#3 Wrong Answer 2ms 436.0 KiB

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(samp[i]%3 == 0){
                sum = sum + 1;
                
            }
            else {
                flag = flag + samp[i];
            }
        }
        
        if(sum > 0){
            printf("%d\n",sum);
        }
        else if(yy1%3 == 0) {
            printf("%d\n",yy);
        }
    }
  
    
}

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 14:19:41
Judged At
2024-11-11 03:46:20
Judged By
Score
10
Total Time
2ms
Peak Memory
436.0 KiB