Submission

Status:

[PPTSSSSSSSS]

Subtask/Task Score:

{0/100}

Score: 0

User: comprogslayer

Problemset: A.Six Zero

Language: python

Time: 3.089 second

Submitted On: 2025-12-26 21:48:26

import math
n = int(input())
zero_c = 0
ans = 0
for i in range(1,n+1) :
    s = input()
    zero_c = 0
    ans = 0
    for e in range(len(s)) :
        if s[e] == '6' :
            for d in s[e+1:] :
                if d == '0' :
                    zero_c += 1
            if zero_c >= 2 :
                ans += math.factorial(zero_c)//(math.factorial(zero_c-2)*math.factorial(2))
                zero_c = 0
    print(ans)