TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
import math

def eratosthenes():
    erat = [0 for _ in range(max(a)+1)]
    lim = int(math.sqrt(max(set_a)))
    for i in range(2, lim+1):
        cnt = 0
        if not erat[i]:
            for res in range(i, max(set_a)+1, i):
                if res in set_a:
                    cnt += 1
                erat[i] = i
                if cnt > 2:
                    break
        else:
            continue
        break
    return cnt


n = int(input())
a = [int(x) for x in input().split()]
set_a = set(a)

ans = eratosthenes()

if max(ans.values()) == 1 and len(set_a) == n:
    print('pairwise coprime')
else:
    res = a[0]
    for i in range(n):
        res = math.gcd(res, a[i])
    if res == 1:
        print('setwise coprime')
    else:
        print('not coprime')

import math

def eratosthenes():
    erat = [0 for _ in range(max_a+1)]
    lim = int(math.sqrt(max_a))
    pair = True
    for i in range(2, lim+1):
        cnt = 0
        if not erat[i]:
            for res in range(i, max_a+1, i):
                if res in set_a:
                    cnt += 1
                erat[res] = i
                if cnt > 1:
                    pair = False
                    break
        if not pair:
            break
    return pair


n = int(input())
a = [int(x) for x in input().split()]
max_a = max(a)
set_a = set(a)

if eratosthenes() and len(set_a) == n - (a.count(1)-1):
    print('pairwise coprime')
else:
    res = a[0]
    for i in range(n):
        res = math.gcd(res, a[i])
    if res == 1:
        print('setwise coprime')
    else:
        print('not coprime')

import math

def eratosthenes():
    erat = [0 for _ in range(max_a+1)]
    
    pair = True
    
    for i in range(2, max_a+1):
        cnt = 0
        if not erat[i]:
            for res in range(i, max_a+1, i):
                if res in set_a:
                    cnt += 1
                erat[res] = i
                if cnt > 1:
                    pair = False
                    break
        if not pair:
            break
    return pair


n = int(input())
a = [int(x) for x in input().split()]
max_a = max(a)
set_a = set(a)

if eratosthenes() and len(set_a) == n - max(0, a.count(1)-1):
    print('pairwise coprime')
else:
    res = a[0]
    for i in range(n):
        res = math.gcd(res, a[i])
    if res == 1:
        print('setwise coprime')
    else:
        print('not coprime')


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
import sys
import math


N_MAX = 200000 + 5
INF = 10**9 + 7
sys.setrecursionlimit(N_MAX)
MOD = 10**9 + 7


def eatosthenes(N):
    prime = []
    D = [1] * (N + 1)

    for i in range(2, N + 1):
        if D[i] != 1:
            continue
        for j in range(N // i + 1):
            if D[i * j] == 1:
                D[i * j] = i
        prime.append(i)

def main():
    N = int(sys.stdin.readline().rstrip())
    A = [int(x) for x in sys.stdin.readline().rstrip().split()]

    maxA = max(A)
    primelist = eatosthenes(maxA)

    
    C = [0] * (maxA + 1)
    for a in A:
        C[a] += 1

    pc = True

    
    for p in primelist:
        cnt = 0
        for k in range(maxA // p + 1):
            cnt += C[k * p]

        
        if cnt > 1:
            pc = False

    if pc:
        print("pairwise coprime")
        return

    GCD = A[0]
    for i in range(1, N):
        GCD = math.gcd(GCD, A[i])

    if GCD == 1:
        print("setwise coprime")
        return

    print("not coprime")


main()


import sys
import math


N_MAX = 200000 + 5
INF = 10**9 + 7
sys.setrecursionlimit(N_MAX)
MOD = 10**9 + 7


def eatosthenes(N):
    prime = []
    D = [1] * (N + 1)

    for i in range(2, N + 1):
        if D[i] != 1:
            continue
        for j in range(N // i + 1):
            if D[i * j] == 1:
                D[i * j] = i
        prime.append(i)

    return prime


def main():
    N = int(sys.stdin.readline().rstrip())
    A = [int(x) for x in sys.stdin.readline().rstrip().split()]

    maxA = max(A)
    primelist = eatosthenes(maxA)

    
    C = [0] * (maxA + 1)
    for a in A:
        C[a] += 1

    pc = True

    
    for p in primelist:
        cnt = 0
        for k in range(maxA // p + 1):
            cnt += C[k * p]

        
        if cnt > 1:
            pc = False

    if pc:
        print("pairwise coprime")
        return

    GCD = A[0]
    for i in range(1, N):
        GCD = math.gcd(GCD, A[i])

    if GCD == 1:
        print("setwise coprime")
        return

    print("not coprime")


main()


Verdicts: Runtime Error

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
n=int(input())
1/(n>3)

n=int(input())
1/(n>2)

c=[m:=0]*6**8
n,a=open(0)
for a in a.split():c[int(a)]+=1
print(('not','psaeitr'[any((m:=max(m,sum(c[i::i])))>1for i in range(2,6**8))::2]+'wise')[m<int(n)],'coprime')

print(('not','psaeitr'[any(c:=[max(0,sum(c[i::i])-1)for i in range(2,6**8)])::2]+'wise')[max(c)+1<int(n)],'coprime')

1/(max(c)+1==m)

n=int(input())
1/(n>1)

c=[0]*6**8
for a in[*open(0)][1].split():c[int(a)]+=1
m=max(sum(c[i::i])for i in range(2,6**8))
print(m<sum(c)and'psaeitr'[m>1::2]+'wise'or'not','coprime')

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
def gcd(x, y):
    if x < y:
        x, y = y, x
    while x % y != 0:
        x, y = y, x % y
    return y


def gcd3(ll):
    ans = ll[0]
    for i in range(1, len(ll)):
        ans = gcd(ans, ll[i])
    return ans


D = {}
def prime_div(n, A):
    if len(D) == 0:
        for a in range(2, A + 1, 2):
            D[a] = 2
        for a in range(3, A + 1):
            if a in D:
                continue
            now = a
            while now <= A:
                if now not in D:
                    D[now] = a
                now += a * 2
    result = []
    while n > 1:
        result.append(D[n])
        n = n // D[n]
    return result
    

def checkPairwise(ll):
    dic = {}
    for n in ll:
        primes = prime_div(n, 1000000)
        for p in primes:
            if p not in dic:
                dic[p] = 1
            else:
                return False
    return True


def main():
    N = int(input())
    A = [int(n) for n in input().split(" ")]
    a1 = checkPairwise(A)
    if a1:
        print("pairwise coprime")
    else:
        a2 = gcd3(A)
        if a2 == 1:
            print("setwise coprime")
        else:
            print("not coprime")


if __name__ == "__main__":
    main()

def gcd(x, y):
    if x < y:
        x, y = y, x
    while x % y != 0:
        x, y = y, x % y
    return y


def gcd3(ll):
    ans = ll[0]
    for i in range(1, len(ll)):
        ans = gcd(ans, ll[i])
    return ans


D = {}
def prime_div(n, A):
    if len(D) == 0:
        for a in range(2, A + 1, 2):
            D[a] = 2
        for a in range(3, A + 1):
            if a in D:
                continue
            now = a
            while now <= A:
                if now not in D:
                    D[now] = a
                now += a * 2
    result = []
    while n > 1:
        result.append(D[n])
        n = n // D[n]
    return result
    

def checkPairwise(ll):
    dic = {}
    for n in ll:
        primes = list(set(prime_div(n, 1000000)))
        
        for p in primes:
            if p not in dic:
                dic[p] = 1
            else:
                return False
    return True


def main():
    N = int(input())
    A = [int(n) for n in input().split(" ")]
    a1 = checkPairwise(A)
    if a1:
        print("pairwise coprime")
    else:
        a2 = gcd3(A)
        if a2 == 1:
            print("setwise coprime")
        else:
            print("not coprime")


if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
import math
N = int(input())
A = list(map(int, input().split()))

maxA = max(A) + 1

C = [0] * maxA

g = 0

for a in A:
    C[a] += 1
    g = math.gcd(g, a)

pairwise = True

for i in range(2, maxA):
    cnt = 0
    for j in range(i, maxA, i):
        cnt += C[j]

    if cnt > 1:
        pairwise = False

if pairwise:
    print("pairwise comrime")
    exit()

if g == 1:
    print("setwise coprime")

else:
    print("not coprime")

import math
N = int(input())
A = list(map(int, input().split()))

maxA = max(A) + 1

C = [0] * maxA

g = 0

for a in A:
    C[a] += 1
    g = math.gcd(g, a)

pairwise = True

is_prime = [True] * maxA

for i in range(2, maxA):
    if is_prime[i]:
        cnt = 0
        for j in range(i, maxA, i):
            cnt += C[j]
            is_prime[j] = False

        if cnt > 1:
            pairwise = False

if pairwise:
    print("pairwise coprime")
    exit()

if g == 1:
    print("setwise coprime")

else:
    print("not coprime")

Verdicts: Wrong Answer

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
import numpy as np
from math import gcd
from functools import reduce

PC = True
SC = True

N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)

p = reduce(gcd, A)
if p != 1:
  for i in range(N):
    for j in range(N-1, i, -1):
      if A[i] < np.sqrt(A[j]):
        break
      if gcd(A[i],A[j]) != 1:
        PC = False
        break
else:
  PC = False
  SC = False
      
if PC == True:
  print('pairwise coprime')
else:
  if SC == True:
    print('setwise coprime')
  else:
    print('not coprime')

from math import gcd
from functools import reduce
import numpy as np

PC = True

N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)

MAX = A[0]+1
mp = [0]*MAX

for i in A:
  mp[i] += 1
print(mp)
for i in range(2,int(np.sqrt(MAX))+1):
  if sum(mp[i::i])>1:
    PC = False
    break

if PC:
  print('pairwise coprime')
else:
  if reduce(gcd, A) == 1:
    print('setwise coprime')
  else:
    print('not coprime')

import numpy as np

def calc_gcd(a,b):
  r = a % b
  while r != 0:
    a, b = b, r
    r = a % b
  return b

PC = True
AC = True
glst = []

N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)

for i in range(N):
  for j in range(N-1, i, -1):
    if A[i] < np.sqrt(A[j]):
      break
    gcd = calc_gcd(A[i],A[j])
    glst.append(gcd)
    if gcd != 1:
      PC = False
      if glst.count(gcd) != 1:
        AC = False
        break
      
if PC == True:
  print('pairwaise coprime')
else:
  if AC == True:
    print('setwise coprime')
  else:
    print('not coprime')

from math import gcd
from functools import reduce
import numpy as np

PC = True

N = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)

MAX = A[0]+1
mp = [0]*MAX

for i in A:
  mp[i] += 1

for i in range(2,MAX):
  if sum(mp[i::i])>1:
    PC = False
    break

if PC:
  print('pairwise coprime')
else:
  if reduce(gcd, A) == 1:
    print('setwise coprime')
  else:
    print('not coprime')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
import sys
def input(): return sys.stdin.readline().rstrip()
class Sieve: 
    def __init__(self,n): 
        self.primes=[]
        self.f=[0]*(n+1) 
        self.f[0]=self.f[1]=-1
        self.f_lis = [0]*(n+1)
        self.max_f_lis = 0
        for i in range(2,n+1): 
            if self.f[i]: continue
            self.primes.append(i)
            self.f[i]=i
            for j in range(i*i,n+1,i):
                if not self.f[j]:
                    self.f[j]=i  
    def prime_fact(self,A): 
        for x in A:
            while x!=1:
                p=self.f[x]
                x//=p
                if x % p > 0:
                    self.f_lis[p] += 1
                    self.max_f_lis = max(self.max_f_lis, self.f_lis[p])

import math
from functools import reduce
def gcd_all(*numbers):#gcd(*A)
    return reduce(math.gcd, numbers)

def main():
    n = int(input())
    A = list(map(int,input().split())) 
    if gcd_all(A) == 1:
        print("pairwise coprime")
    else:
        Sieve_a = Sieve(max(A)+1)
        Sieve_a.prime_fact(A)
        lis = Sieve_a.f_lis
        max_lis = Sieve_a.max_f_lis
        if max_lis == n:
            print("not coprime")
        else:
            print("setwise coprime")

if __name__=='__main__':
    main()

import sys
def input(): return sys.stdin.readline().rstrip()
class Sieve: 
    def __init__(self,n): 
        self.primes=[]
        self.f=[0]*(n+1) 
        self.f[0]=self.f[1]=-1
        self.f_lis = [0]*(n+1)
        for i in range(2,n+1): 
            if self.f[i]: continue
            self.primes.append(i)
            self.f[i]=i
            for j in range(i*i,n+1,i):
                if not self.f[j]:
                    self.f[j]=i  
    def prime_fact(self,A): 
        for x in A:
            while x!=1:
                p=self.f[x]
                x//=p
                if x % p > 0:
                    if self.f_lis[p] > 0: return False
                    self.f_lis[p] += 1
        return True

import math
from functools import reduce
def gcd_all(numbers):#gcd(A)
    return reduce(math.gcd, numbers)

def main():
    n = int(input())
    A = list(map(int,input().split())) 
    Sieve_a = Sieve(max(A)+1)
    if Sieve_a.prime_fact(A):
        print("pairwise coprime")
    elif gcd_all(A) == 1:
        
        print("setwise coprime")   
    else:
        print("not coprime")

if __name__=='__main__':
    main()

Verdicts: Wrong Answer

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
n=int(input()) 
c=list(map(int, input().split()))
ans = 1

import math
from functools import reduce
import fractions
def gcd_list(numbers):
    return reduce(math.gcd, numbers)

for i in range(n-1):
    f=fractions.gcd(c[i],c[i+1])
    ans = max(ans,f)

Ans = gcd_list(c)

if ans == 1 and Ans == 1:
    print('pairwise coprime')
if ans != 1 and Ans == 1:
    print('setwise coprime')
else:
    print('not coprime')

n=int(input()) 
c=list(map(int, input().split()))
ans = 1
 
import math
from functools import reduce
import fractions
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
 
for i in range(1,n-1):
    f=fractions.gcd(c[i],c[i+1])
    t = fractions.gcd(c[i-1],c[i+1])
    ans = max(ans,max(f,t))
 
Ans = gcd_list(c)
 
if ans == 1:
    print('pairwise coprime')
if ans > Ans and Ans == 1:
    print('setwise coprime')
if Ans > 1:
    print('not coprime')

n=int(input()) 
c=list(map(int, input().split()))
ans = 1
 
import math
from functools import reduce
import fractions
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
 
for i in range(n-1):
    f=fractions.gcd(c[i],c[i+1])
    ans = max(ans,f)
 
Ans = gcd_list(c)
 
if ans == 1:
    print('pairwise coprime')
if ans > Ans and Ans == 1:
    print('setwise coprime')
if Ans > 1:
    print('not coprime')

n=int(input()) 
c=list(map(int, input().split()))
ans = 1

import math
from functools import reduce
import fractions
def gcd_list(numbers):
    return reduce(math.gcd, numbers)

for i in range(n-1):
    f=fractions.gcd(c[i],c[i+1])
    ans = max(ans,f)

Ans = gcd_list(c)

if ans == 1:
    print('pairwise coprime')
if ans > 1 and Ans == 1:
    print('setwise coprime')
if ans > 1 and Ans > 1:
    print('not coprime')

from math import gcd
from functools import reduce
 
 
def facs(n):
    yield 2
    for x in range(3, n, 2):
        yield x
 
 
def main():
    input()  # N
    array = [int(x) for x in input().split()]
    MAX_A = 10 ** 6 + 1
    histogram = [0] * MAX_A
    for x in array:
        histogram[int(x)] += 1
 
    for divider in facs(MAX_A):
        count = sum(histogram[divider::divider])
        if count > 1:
            break
    else:
        return 'pairwise coprime'
 
    gcd_total = reduce(gcd, array)
    if gcd_total == 1:
        return 'setwise coprime'
    else:
        return 'not coprime'
 
 
if __name__ == '__main__':
    print(main())

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
def main():
    import sys
    input = sys.stdin.buffer.readline
    from math import gcd
    N = int(input())
    A = list(map(int, input().split()))
    g = A[0]

    S = 1
    for x in A:
        S *= x

    def factorization(n):
        ret = set()
        temp = n
        for i in range(2, int(-(-n**0.5//1))+1):
            if temp % i == 0:
                cnt = 0
                while temp % i == 0:
                    cnt += 1
                    temp //= i
                ret.add(i)

        if temp != 1:
            ret.add(temp)

        if len(ret) == 0 and n != 1:
            ret.add(n)

        return ret

    flag = False
    for i, x in enumerate(A[::-1]):
        g = gcd(g, x)
        S //= x
        if flag and gcd(x, S) > 1:
            flag = False

    if flag:
        print("pairwise coprime")
    elif g == 1:
        print("setwise coprime")

    else:
        print("not coprime")


main()


def main():
    import sys
    input = sys.stdin.buffer.readline
    from math import gcd
    N = int(input())
    A = list(map(int, input().split()))
    g = A[0]
    M = max(A)
    X = [i for i in range(M+1)]
    S = [True for i in range(M+1)]
    S[0] = False
    S[1] = False

    for i in range(1, M+1):
        if S[i]:
            for j in range(i, M+1, i):
                if S[j]:
                    S[j] = False
                    X[j] = i
    flag = True
    s = set()
    ls = 0
    for x in A:
        tmp = set()
        while(X[x] != 1):
            tmp.add(X[x])
            x //= X[x]
        l = len(tmp)
        s |= tmp
        if len(s) == ls + l:
            ls += l
            continue
        else:
            flag = False
            break

    if flag:
        print("pairwise coprime")
    else:
        for x in A[1:]:
            g = gcd(g, x)
        if g == 1:
            print("setwise coprime")

        else:
            print("not coprime")


main()


Verdicts: Wrong Answer

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
"""E."""

import math
import sys
from typing import List


def input() -> str:  
    """Input."""
    return sys.stdin.readline()[:-1]


RESULT_A = 'pairwise coprime'
RESULT_B = 'setwise coprime'
RESULT_C = 'not coprime'

n = int(input())

a_list = list(map(int, input().split(' ')))


def get_all_gcd(l: List[int]) -> List[int]:
    result = []
    for i, v1 in enumerate(l[:-1]):
        for v2 in l[i + 1:]:
            result.append(math.gcd(v1, v2))
    return result


gcds = get_all_gcd(a_list)

print(gcds)

if [1] * len(gcds) == gcds:
    print(RESULT_A)
    exit(0)

if [1] * len(gcds) == get_all_gcd(gcds):
    print(RESULT_B)
    exit(0)

print(RESULT_C)


"""E."""

import sys


def input() -> str:  
    """Input."""
    return sys.stdin.readline()[:-1]


RESULT_TEXT = {
    1: 'pairwise coprime',
    2: 'setwise coprime',
    3: 'not coprime',
}

n = int(input())

a_list = list(map(int, input().split(' ')))

ans = 0

MAX = 1000000 + 1
counts = [0] * MAX
for a in a_list:
    counts[a] += 1

max_count = 0

for i in range(2, MAX):
    max_count = max(max_count, sum(counts[i::i]))

if max_count == n:
    ans = 3
elif max_count >= 2:
    ans = 2
else:
    ans = 1

print(RESULT_TEXT[ans])


Verdicts: Wrong Answer

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))

def divisors(n):
	div = [1, n]
	
	for i in range(2, int(n**0.5)+1):
		if n % i == 0:
			div.append(i)
			if i != n//i:
				div.append(n//i)
	
	return div

flag = False
inter = set(divisors(A[0]))
union = set(divisors(A[0]))
s = len(set(divisors(A[0])))
for i in range(1,N):
    div = set(divisors(A[i]))
    s += len(div)
    inter &=  div
    union |= div
    print(s,inter,union)
if len(union) == s - N + 1:
    print('pairwise coprime')
elif inter == {1}:
    print('setwise coprime')
else:
    print('not coprime')

import numpy as np
N = int(input())
A = list(map(int,input().split()))
cnt = [0] * (10**6 + 1)
for i in range(N):
    cnt[A[i]] += 1

maxcount = 0
for i in range(2,10**6+1):
    maxcount = max(maxcount,sum(cnt[i::i]))

if np.gcd.reduce(A) != 1:
    print('not coprime')
elif maxcount <= 1:
    print('pairwise coprime')
else:
    print('setwise coprime')

Verdicts: Runtime Error

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
from math import gcd

N = int(input())
A = list([int(x) for x in input().split()])

max_a = 10**6 + 1

before = 0
result = [0 for _ in range(max_a + 1)]

for i in A:
    before = gcd(before, i)
    result[i] += 1

is_pairwise = True
for i in range(2, max_a + 1):
    cnt = 0
    for j in range(i, max_a + 1, i):
        cnt += result[j]

    if cnt > 1:
        is_pairwise = False
        break

if is_pairwise:
    print('pairwise coprime')
    exit()

if before == 1:
    print('setwise coprime')
else:
    print('not coprime')


from math import gcd

N = int(input())
A = list([int(x) for x in input().split()])

max_a = max(A)

before = 0
result = [0 for _ in range(max_a + 1)]

for i in A:
    before = gcd(before, i)
    result[i] += 1

is_pairwise = True

for i in range(2, max_a + 1):
    cnt = 0
    for j in range(i, max_a + 1, i):
        cnt += result[j]
    if cnt > 1:
        is_pairwise = False
        break

if is_pairwise:
    print('pairwise coprime')
    exit()
if before == 1:
    print('setwise coprime')
else:
    print('not coprime')


Verdicts: Time Limit Exceeded

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
from math import gcd
import numpy as np

n = int(input())
a = list(map(int, input().split()))
MAX = 10 ** 6

g = a[0]
for e in a:
    g = gcd(g, e)

if g != 1:
    print("not coprime")
    exit()

nums = np.zeros(MAX + 1, np.int64)
for e in a:
    nums[e] += 1
for i in range(2, MAX + 1):
    if nums[i::i].sum() > 1:
        print("setwise coprime")
        exit()

print("pairwise coprime")



import numpy as np
from numba import njit

n = int(input())
a = list(map(int, input().split()))
MAX = 10 ** 6

nums = np.zeros(MAX + 1, np.int64)
for e in a:
    nums[e] += 1


@njit
def solve(nums):
    mx = 0
    for i in range(2, MAX + 1):
        cnt = nums[i::i].sum()
        mx = max(mx, cnt)

    return mx


mx = solve(nums)

if nums[1] == n:
    ans = "pairwise"
elif mx == n:
    ans = "not"
elif mx == 1:
    ans = "pairwise"
else:
    ans = "setwise"

ans += " coprime"

print(ans)


Verdicts: Time Limit Exceeded

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
import math

MAX=10**6+3
table = list(range(MAX))
i=2
n=MAX
while i<=n:
    table[i] = 2
    i+=2

p=3
while p*p<=n:
    if table[p]<p:
        continue
    x=p
    while x<=n:
        table[x]=p
        x+=p
    p+=2

def primeFactorSet(n):
    result = set()
    while table[n]!=1:
        result.add(table[n])
        n //= table[n]
    return result
    

n = int(input())
A = list(map(int,input().split()))
pairwise = True
flags = [False for _ in range(MAX)]

for i in range(n):
    a=A[i]
    if pairwise:
        t = primeFactorSet(a)
        for p in t:
            if flags[p]:
                pairwise = False
                break
            flags[p]=True
    if i==0:
        g=a
    else:
        g=math.gcd(g,a)
    
if g>1:
    print("not coprime")
elif pairwise:
    print("pairwise coprime")
else:
    print("setwise coprime")


import math

MAX=10**6+3
table = list(range(MAX))
i=2
n=MAX
while i<=n:
    table[i] = 2
    i+=2

p=3
while p*p<=n:
    if table[p]<p:
        continue
    x=p
    while x<=n:
        table[x]=p
        x+=p

def primeFactorSet(n):
    result = set()
    while table[n]!=1:
        result.add(table[n])
        n //= table[n]
    return result
    

n = int(input())
A = list(map(int,input().split()))
pairwise = True
flags = [False for _ in range(MAX)]

for i in range(n):
    a=A[i]
    if pairwise:
        t = primeFactorSet(a)
        for p in t:
            if flags[p]:
                pairwise = False
                break
            flags[p]=True
    if i==0:
        g=a
    else:
        g=math.gcd(g,a)
    
if g>1:
    print("not coprime")
elif pairwise:
    print("pairwise coprime")
else:
    print("setwise coprime")


import math

MAX=10**6+3
table = list(range(MAX))
i=2
n=MAX
while i<n:
    table[i] = 2
    i+=2
p=3
while p*p<=n:
    if table[p]<p:
        p+=2
        continue
    x=p
    while x<=n:
        table[x]=p
        x+=p
    p+=2


def primeFactorSet(n):
    result = set()
    while table[n]!=1:
        result.add(table[n])
        n //= table[n]
    return result
    

n = int(input())
A = list(map(int,input().split()))
pairwise = True
flags = [False for _ in range(MAX)]

for i in range(n):
    a=A[i]
    if pairwise:
        t = primeFactorSet(a)
        for p in t:
            if flags[p]:
                pairwise = False
                break
            flags[p]=True
    if i==0:
        g=a
    else:
        g=math.gcd(g,a)
    
if g>1:
    print("not coprime")
elif pairwise:
    print("pairwise coprime")
else:
    print("setwise coprime")

Verdicts: Time Limit Exceeded

Time Limit Exceeded

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
from math import gcd
def g(a):
    al=len(a)
    if al==2:
        return gcd(a[0],a[1])
    elif al==1:
        return a[0]
    return gcd(g(a[al//2:]),g(a[:al//2+1]))
n=int(input())
a=list(map(int,input().split()))
if g(a)!=1:
    print("not coprime")

import numpy as np
n=int(input())
a=list(map(int,input().split()))
g=np.gcd.reduce(a)
if g>1:
    print("not coprime")
    exit()
c=[0]*(10**6+1)
for i in a:
    c[i]+=1
if np.all([sum(c[i::i])<=1 for i in range(2,10**6+1)]):
    print("pairwise coprime")
else:
    print("setwise coprime")

Verdicts: Wrong Answer

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
import math as mt
n=int(input())
l=list(map(int,input().split()))
gd=l[0]
sv=[0]*(10**6+1)
for i in range(2,len(sv)+1):
  if not sv[i]:
    sv[i]=i
    for j in range(2*i,len(sv),i):
      sv[j]=i
an="not coprime"
for i in range(n):
      gd=mt.gcd(gd,l[i])
if gd!=1:
	print(an)
else:
    an="setwise coprime"
    pos=1
    vis=[0]*(10**6+2)
    for i in range(n):
      cr=l[i]
      while cr>1:
          dv=sv[cr]
          if vis[dv]:
            pos=0;break
          while cr%dv==0:
            cr//=dv
          vis[dv]=1
    if pos:
      an="pairwise coprime"
    print(an)


import math as mt
n=int(input())
l=list(map(int,input().split()))
gd=l[0]
sv=[0]*(10**6+1)
for i in range(2,len(sv)):
  if not sv[i]:
    sv[i]=i
    for j in range(2*i,len(sv),i):
      sv[j]=i
an="not coprime"
for i in range(n):
      gd=mt.gcd(gd,l[i])
if gd!=1:
	print(an)
else:
    an="setwise coprime"
    pos=1
    vis=[0]*(10**6+2)
    for i in range(n):
      cr=l[i]
      while cr>1:
          dv=sv[cr]
          if vis[dv]:
            pos=0;break
          while cr%dv==0:
            cr//=dv
          vis[dv]=1
    if pos:
      an="pairwise coprime"
    print(an)


Verdicts: Runtime Error

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
import numpy as np

N = int(input())
A = list(map(int, input().split()))
exist = np.zeros(10**6+1, dtype=int)
for a in A:
    exist[a] += 1

if np.gcd.reduce(A) != 1:
    print('not coprime')
elif np.all([exist[i::i].sum() <= 1 for i in range(2, 10**6+1)]):
    print('pairwise coprime')
else:
    print('setwise coprime')

import numpy as np

N = int(input())
A = np.array(list(map(int, input().split())))
exist = np.zeros(10**6+1, dtype=int)
exist[A] = 1

if np.gcd.reduce(A) != 1:
    print('not coprime')
elif np.all([exist[i::i].sum() <= 1 for i in range(2, 10**6+1)]):
    print('pairwise coprime')
else:
    print('setwise coprime')

import numpy as np

N = int(input())
A = list(map(int, input().split()))
exist = [0] * (10**6 + 1)
for a in A:
    exist[a] += 1

if np.gcd.reduce(A) != 1:
    print('not coprime')
elif np.all([sum(exist[i::i]) <= 1 for i in range(2, 10**6+1)]):
    print('pairwise coprime')
else:
    print('setwise coprime')

Verdicts: Time Limit Exceeded

Time Limit Exceeded

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
n = int(input())
A = list(map(int, input().split()))

maxV = (10 ** 6 + 1)

sieve = [i for i in range(maxV)]
p = 2

while p*p < maxV:
    if sieve[p] == p:
        for q in range(p*2, maxV, p):
            if sieve[q] == q:
                sieve[q] = p
    p += 1

from math import gcd

g = 0
primes = set()
for a in A:
    g = gcd(g, A)

    v = a
    while a > 1:
        prime = sieve[a]
        if prime in primes:
            print('')
        primes.add(prime)
        a = a // prime


if g > 1:
    print('not coprime')

for a in A:
    while a > 1:
        prime = sieve[a]
        if prime in primes:
            print('pairwise coprime')
            exit()
        primes.add(prime)
        a = a // prime

print('setwise coprime')

n = int(input())
A = list(map(int, input().split()))

maxV = (10 ** 6 + 1)

sieve = [i for i in range(maxV)]
p = 2

while p*p < maxV:
    if sieve[p] == p:
        for q in range(p*2, maxV, p):
            if sieve[q] == q:
                sieve[q] = p
    p += 1

from math import gcd

g = 0
primes = set()
for a in A:
    g = gcd(g, a)

    v = a


if g > 1:
    print('not coprime')
    exit()

for a in A:
    while a > 1:
        prime = sieve[a]
        if prime in primes:
            print('setwise coprime')
            exit()
        primes.add(prime)
        a = a // prime

print('pairwise coprime')

n = int(input())
A = list(map(int, input().split()))

maxV = (10 ** 6 + 1)

sieve = [i for i in range(maxV)]
p = 2

while p*p < maxV:
    if sieve[p] == p:
        for q in range(p*2, maxV, p):
            if sieve[q] == q:
                sieve[q] = p
    p += 1

from math import gcd

g = 0
primes = set()
for a in A:
    g = gcd(g, a)

    v = a


if g > 1:
    print('not coprime')
    exit()

for a in A:
    temp_prime = set()
    while a > 1:
        prime = sieve[a]
        temp_prime.add(prime)
        a = a // prime

    for t in temp_prime:
        if t in primes:
            print('setwise coprime')
            exit()
        primes.add(t)

print('pairwise coprime')

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have N integers. The i-th number is A_i.  \\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\leq i < j \leq N.  \\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\ldots,A_N)=1.  Determine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.  Here, GCD(\ldots) denotes greatest common divisor.

Submission attempts (in order):
import math
from collections import deque
Answer = 'not coprime'
N = int(input())
Alist = list(map(int,input().split()))
sign = math.gcd(Alist[0],Alist[1])
for i in range(1,N):
    sign = math.gcd(sign,Alist[i])
if sign == 1:
    Answer = 'setwise coprime'
Aset = set()
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
Alist = deque(Alist)
sig =1
if Answer == 'setwise coprime':
    for _ in range(len(Alist)):
        if sig ==0:
            break
        A = Alist.popleft()
        An =  factorization(A)
        for i in range(len(An)):
            if An[i][0] not in Aset:
                Aset.add(An[i][0])
            else:
                sig = 0
    if len(Alist) == 0 and sig == 1:
        Answer = 'pairwise corprime'
print(Answer)


import math
N = int(input())
Alist = list(map(int,input().split()))
box = [0]*(10**6+1)
sign = math.gcd(Alist[0],Alist[1])
Amax = max(Alist[0],Alist[1])
for i in range(0,len(Alist)):
    A = Alist[i]
    sign = math.gcd(sign, A)
    Amax = max(Amax, A)
    box[A] += 1
setwise = (sign == 1)
pairwise = (sign == 1)
Amax = math.sqrt(Amax)+1
for i in range(2,10**6+1):
    if sum(box[i::i]) >1:
        pairwise = False
        break
if setwise:
    if pairwise:
        print('pairwise coprime')
    else:
        print('setwise coprime')
else:
    print('not coprime')

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
a,b,c=map(int,input().split())
d=a//c
print(d*c+c)

a,b,c=map(int,input().split())
if a%b==0:
  d=a//b
else:
  d=a//b+1
print(d*c)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
n, x, t = map(int, input().split())
print((n+x-1)/x*t)

n, x, t = map(int, input().split())
print((n+x-1)//x*t)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
n,x,t = map(int,input().split())
if n % x == 0:
  print(n / x * t)
else:
  print(n / x * t + t)

n,x,t = map(int,input().split())
if n % x == 0:
  print(n / x * t)
else:
  print(n / x * t + 1)


n,x,t = map(int,input().split())
if n % x == 0:
  print(n // x * t)
else:
  print(n // x * t + t)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
n, x, t = map(int, input().split())
if n%x==0:
  print(n*t/x)
else:
  print(((math.floot(n/x))+1)*t)

n, x, t = map(int, input().plist())
print(((math.floot(n/x))+1)*t)

n, x, t = map(int, input().split())
if n%x==0:
  print(n*t/x)
else:
  print(((int(n/x)+1)*t)

n, x, t = map(int, input().plist())
if n%x==0:
  print(((math.floot(n/x))+1)*t)
else print(n*t/x)

n, x, t = map(int, input().plist())
if n%x==0:
  print(n*t/x)
else:
  print(((math.floot(n/x))+1)*t)

n, x, t = map(int(i) for in input().split())
if n%x==0:
  print(n/x*t)
else:
  print( (int(n/x)+1)*t )

n, x, t = map(int, input().split())
if n%x==0:
  print(n/x*t)
else:
  print(((int(n/x)+1)*t)


n, x, t = map(int, input().split())
if n%x == 0:
  print(n*t/x)
else:
  print(((int(n/x)+1)*t)

n, x, t = map(int, input().split())
if n%x==0:
  print((n//x)*t)
else:
  print( ((n//x)+1)*t )

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
#!/usr/bin/env python3
import sys


def solve(N: int, X: int, T: int):
    i = 0
    A = 0
    while:
        if A < 0:
            break
        A = N - X*i
        i+=1

    return print(i*T)


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    solve(N, X, T)

if __name__ == '__main__':
    main()
~                 

#!/usr/bin/env python3
import sys


def solve(N: int, X: int, T: int):
    i = 1
    A = 0
    while(True):
        A = N - X*i

        if A <= 0:
            break

        i+=1

    return print(i*T)


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    solve(N, X, T)

if __name__ == '__main__':
    main()

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
a,b,c=map(int,input().split())
print((a//b)*c)

a,b,c=map(int,input().split())
d=0
if a%b!=0:
  d=1
print((d+a//b)*c)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
n,x,t=map(int,input().split())
p= n//x+1 if n%x!=0 else n//x
print(x*p)


n,x,t=map(int,input().split())
p= n//x+1 if n%x!=0 else n//x
print(t*p)


Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
n,k,t = map(int,input().split())
count = 0
while n<0:
  n-=k
  count+=1
print(count*t)

# n = int(input())
# ans = (n*(n-1))//2
# print(ans)

n,k,t = map(int,input().split())
count = 0
while n>0:
    n-=k
    count+=1
print(count*t)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
n, x, t = list(map(int, input().split()))

def tako(n, x, t):
    time = 0
    while n > 0:
        n -= x
        time += t
    return time

n, x, t = list(map(int, input().split()))

def tako(n, x, t):
    time = 0
    while n > 0:
        n -= x
        time += t
    return time

print(tako(n, x, t))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
import math
N, X, T = map(float, input().split())

ans = N / X

ans = math.ceil(ans)

time = ans * T

print(time)

N =int(input())
lst = []

N = str(N)

list_num = list(N)

N = [int(s) for s in list_num]
ans = sum(N)

if ans % 9 == 0:
  print("Yes")
else:
  print("No")

import math
N, X, T = map(float, input().split())

ans = N / X

ans = math.ceil(ans)

time = ans * T

print(int(time))

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
N,X,T= map(int, input().split())
if N%X==0:
  print((N/X)*T)
else:
  print(N/X +1)*T)

N,X,T= map(int, input().split())
if N%X==0:
  print((N/X)*T)
else:
  print(((N/X)+1)*T)

N,X,T=int(input())
if  N%X==0:
  print((N/X)*T)
else:
  print((N/X +1)*T)

N,X,T= map(int, input().split())
if N%X==0:
  print((N/X)*T)
else:
  print((N/X +1)*T)

N,X,T= map(int, input().split())
if N%X==0:
  print((N//X)*T)
else:
  print(((N//X)+1)*T)


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
n, x, t = map(int, input())

if n % x == 0:
  print(t * (n // x))
else:
  print(t * ((n // x) + 1))
  

n, x, t = map(int, input().split())

if n % x == 0:
  print(t * (n // x))
else:
  print(t * ((n // x) + 1))
  

Verdicts: Runtime Error

Accepted
Problem: Takahashi loves takoyaki - a ball-shaped snack.  With a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.  How long does it take to make N takoyaki?

Submission attempts (in order):
H,W,M=map(int,input().split())
MX=[0]*H
MY=[0]*W
MA=[0]*M

for i in range(M):
  x,y=map(int,input().split())
  x-=1
  y-=1
  MX[x]+=1
  MY[y]+=1
  MA[i]=(x,y)
xmax=max(MX)
ymax=max(MY)
ix=[x[0] for x in enumerate(MX) if x[1]==xmax]
iy=[x[0] for x in enumerate(MY) if x[1]==ymax]

i=0
j=0
for x,y in MA:
  if x in ix or y in iy:
    pass
  else:
    i+=1
  
  j+=1
  
  if len(ix)*len(iy)-j>M-i:
    print(xmax+ymax)
else:
  print(xmax+ymax-1)


import numpy as np

H,W,M=input().split()
H=int(H)
W=int(W)
M=int(M)
MA=np.zeros((H,W),dtype=int64)
MX=[0]*H
MY=[0]*W
for i in range(M):
  x,y=input().split()
  MA[int(x)-1,int(y)-1]=1

MX=np.sum(MA,axis=1)
MY=np.sum(MA,axis=0)

xmax=max(MX)
ymax=max(MY)
ix=[x[0] for x in enumerate(MX) if x[1]==xmax]
iy=[x[0] for x in enumerate(MY) if x[1]==ymax]

ii=min([MA[x,y] for x in ix for y in iy])

print(xmax+ymax-ii)


N,X,T=input().split()

print(((int(N)-1)//int(X)+1)*int(T))


Verdicts: Runtime Error

Runtime Error

Accepted