/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 12ms 2.723 MiB
#2 Wrong Answer 11ms 2.75 MiB
#3 Wrong Answer 14ms 2.902 MiB
#4 Accepted 14ms 2.91 MiB
#5 Wrong Answer 16ms 2.703 MiB
#6 Accepted 102ms 3.633 MiB
#7 Accepted 13ms 2.812 MiB

Code

for _ in range(int(input())):
    n = int(input())
    arr = list(map(int, input().split()))
    count = 0
    for i in arr:
        if i%3 == 0:
            count += 1
            arr.remove(i)
    if sum(arr)%3 == 0:
        count += len(arr)
    elif sum(arr)%3 == 1:
        if 1 in arr:
            count += (len(arr)-1)
        else:
            count += 0
    elif sum(arr)%3==2:
        if  2 in arr:
            count += (len(arr)-1)
        elif arr.count(1)>=2:
            count += (len(arr)-2)
    print(count)

Information

Submit By
Type
Submission
Problem
P1013 Divisible by 3
Language
Python 3 (Python 3.12.3)
Submit At
2024-01-06 16:14:25
Judged At
2024-01-06 16:14:25
Judged By
Score
50
Total Time
102ms
Peak Memory
3.633 MiB