s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s586459340 | p03962 | u566574814 | 1551663964 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 57 | n, k = map(int, input().split())
print(k * pow(k-1, n-1)) |
s673934627 | p03962 | u690536347 | 1548788047 | Python | PyPy3 (2.4.0) | py | Runtime Error | 180 | 38256 | 29 | print(len({input().split()})) |
s727065077 | p03962 | u369752439 | 1548096318 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3188 | 864 | def compute_current_score(previous_t_score, previous_a_score, current_t_ratio, current_a_ratio):
initial_divisor = max(previous_t_score // current_t_ratio, previous_a_score // current_a_ratio)
current_t_score = 0
current_a_score = 0
while(True):
current_t_score = initial_divisor * current_t_ratio
current_a_score = initial_divisor * current_a_ratio
if((current_t_score >= previous_t_score) and (current_a_score >= previous_a_score)):
break
initial_divisor += 1
return current_t_score, current_a_score
t_list = []
a_list = []
N = int(input())
t_score, a_score = list(map(int, input().strip().split()))
for n in range(N-1):
t_ratio, a_ratio = list(map(int, input().strip().split()))
t_score, a_score = compute_current_score(t_score, a_score, t_ratio, a_ratio)
print(t_score + a_score) |
s262058054 | p03962 | u813098295 | 1547684591 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 445 | #!/usr/bin/env python3
N = int(input())
ans = 0
T, A = [0] * 1001, [0] * 1001
for i in range(N):
T[i], A[i] = map(int, input().split())
if i != 0 and T[i-1] >= T[i] or A[i-1] >= A[i]:
t = T[i-1] // T[i] if T[i-1] % T[i] == 0 else T[i-1] // T[i] + 1
s = A[i-1] // A[i] if A[i-1] % A[i] == 0 else A[i-1] // A[i] + 1
m = max(t, s)
T[i] *= m
A[i] *= m
ans = sum([T[i], A[i]])
print (ans)
|
s335590784 | p03962 | u231647664 | 1547419134 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 65 | a = list(map(int, input().split())
a = list(set(a))
print(len(a)) |
s396653115 | p03962 | u586149955 | 1546299578 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 58 | i = lambda: int(input())
print(len(set([i(), i(), i()])))
|
s639419753 | p03962 | u920299620 | 1543281764 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 124 | a,b,c = map(int,input().split())
if(a==b and b==c):
print(1)
else if( a!=b and b!=c and c!=a):
print(3)
else:
print(2) |
s831006021 | p03962 | u168906897 | 1542375179 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 71 | n,k = map(int,input().split(" "))
goukei = k*(k-1)**(n-1)
print(goukei) |
s257674821 | p03962 | u168906897 | 1542375132 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 71 | n,k = map(int,input().split(" "))
goukei = k*(k-1)**(n-1)
print(goukei) |
s931153329 | p03962 | u669770658 | 1542044648 | Python | Python (3.4.3) | py | Runtime Error | 19 | 2940 | 166 | # -*- coding: utf-8 -*-
def abc046_b():
n, k = map(int, input().split())
return k * ((k - 1) ** (n - 1))
if __name__ == '__main__':
print(abc046_b())
|
s820451735 | p03962 | u297109012 | 1541124712 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 451 | def solve(N, TAs):
T, A = 1, 1
for t, a in TAs:
m = (t * A) % a
y = max(0, (T * a - t * A) // t)
while True:
if (m + (y * t)) % a == 0:
break
y += 1
x = (t * A + t * y) // a - T
T += x
A += y
return T + A
if __name__ == "__main__":
N = int(input())
TAs = [(tuple)(map(int, input().split(" "))) for l in range(N)]
print(solve(N, TAs))
|
s311672192 | p03962 | u920299620 | 1540952970 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 52 | N,K=map(int,input().split())
print(K*((K-1)**(N-1))) |
s468432271 | p03962 | u240793404 | 1540825783 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 47 | a = list(input().split)
a = set()
print(len(a)) |
s536086471 | p03962 | u518042385 | 1540693407 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 140 | n=int(input())
l=0
p=0
for i in range(1,n+1):
b,m=map(int,input().split())
if l!=b+m:
l=(l//(b+m)+1)*(b+m)
else:
pass
print(l) |
s275554448 | p03962 | u131405882 | 1540428583 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 133 | nums = list(map(int, input().split()))
n = 1
if nums[0] != nums[1]:
n++
if nums[1] != nums[2] and nums[0] != nums[2]:
n++
print(n)
|
s631729522 | p03962 | u295961023 | 1540198914 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 193 | def main():
N, K = map(int, input().split())
res = 0
if N == 1:
res = K
else:
res = K * (K - 1) * (N - 1)
print(res)
if __name__ == "__main__":
main() |
s191683948 | p03962 | u328755070 | 1540138285 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 109 | a, b, c = list(map(int, input().split()))
ans = (a!=b) + (b!=c) + (c!=a)
ans = 1 if ans == 0
print(ans)
|
s694272953 | p03962 | u371763408 | 1539373682 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 56 | a,b,c = map(int,input())
a = set([a,b,c])
print(len(a))
|
s989315571 | p03962 | u484856305 | 1538832527 | Python | Python (3.4.3) | py | Runtime Error | 16 | 2940 | 97 | a,b,c=map(int,input().split())
if a==b==c:
print(1)
elif a=!b=!=!c:
print(3)
else:
print(2) |
s025873920 | p03962 | u399261731 | 1534829035 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 172 | #include<cstdio>
using namespace std;
int main(){
int a,b,c,cnt=1;
scanf("%d %d %d",&a,&b,&c);
if(a!=b)
cnt++;
if(a!=c&&b!=c)
cnt++;
printf("%d\n",cnt);
} |
s967436177 | p03962 | u399261731 | 1534828967 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 173 | #include <iostream>
using namespace std;
int main(void){
// Your code here!
int a,b,c,cnt=1;
cin >> a>>b>>c;
if(a!=b) cnt++;
if(a!=c&&b!=c) cnt++;
cout<<cnt;
} |
s114376845 | p03962 | u399261731 | 1534828246 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 247 | #include <iostream>
using namespace std;
int main(void){
// Your code here!
int a,b,c,count=0;
cin >>a>>b>>c;
if(a!=b) count++;
if(b!=c) count++;
if(c!=a) count++;
if(count != 0) cout << count;
else cout<<1;
}
|
s799436802 | p03962 | u399261731 | 1534828086 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 214 | #include <iostream>
using namespace std;
int main(void){
// Your code here!
int a,b,c,count=0;
cin >>a>>b>>c;
if(a!=b) count++;
if(b!=c) count++;
if(c!=a) count++;
cout << count;
}
|
s802043030 | p03962 | u275934251 | 1534265225 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 125 | a, b, c = int(input().split())
if a == b == c:
print(1)
elif a == b or a == c or b == c:
print(2)
else:
print(3) |
s969836592 | p03962 | u931636178 | 1530877516 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 37 | s = input().split()
print(len(set(s)) |
s335338828 | p03962 | u982517812 | 1530569783 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 180 | a, b, c = map(int, input().split())
if a == b:
if a == c:
print(1)
else: print(2)
elif a == c:
print(2)
else: print(3)
elif b == c:
print(2)
else: print(3) |
s343314101 | p03962 | u982517812 | 1530569447 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 139 | a, b, c = map(int, input().split())
if a == b:
if a == c:
print(1)
else: print(2)
elif a == c:
print(2)
else: print(3) |
s942086078 | p03962 | u333139319 | 1529860312 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 128 | [n,k]=[int(i) for i in input().split()]
a=k
if n==1:
print(k)
else:
for i in range(n-1):
a=a*(k-1)
print(a)
|
s352215807 | p03962 | u933019427 | 1529526000 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 89 | N, K = map(int, input().split())
Ans=K
for i in range(0, N-1):
Ans*=(K-1)
print(Ans) |
s506945222 | p03962 | u863370423 | 1529221178 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1027 | #!/usr/bin/env python3
#
# FILE: 2138-AtCoDeer_and_Paint_Cans.py
#
# @author: Arafat Hasan Jenin <opendoor.arafat[at]gmail[dot]com>
#
# LINK: https://abc046.contest.atcoder.jp/tasks/abc046_a?lang=en
#
# DATE CREATED: 17-06-18 00:09:52 (+06)
# LAST MODIFIED: 17-06-18 00:19:32 (+06)
#
# VERDICT: Accepted
#
# DEVELOPMENT HISTORY:
# Date Version Description
# --------------------------------------------------------------------
# 17-06-18 1.0 Deleted code is debugged code.
#
# _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
# _/ _/ _/_/ _/ _/ _/_/ _/
# _/ _/_/_/ _/ _/ _/ _/ _/ _/ _/
# _/ _/ _/ _/ _/_/ _/ _/ _/_/
# _/_/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
#
##############################################################################
print(len(set(map(int, input().split())))) |
s176925017 | p03962 | u026788530 | 1528647718 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 381 | import math
N = int(input())
def ceil(x,y):
if x % y == 0:
return x // y
else:
return x // y + 1
t=1
a=1
for i in range(N):
T , A = [int(i) for i in input().split(' ')]
# print(T,A)
n1 = ceil(t , T)
n2 = ceil(a , A)
n = max(n1,n2)
#while T*n <= t and A*n <= a:
# n += 1
t = T*n
a = A*n
# print(t,a)
print(t+a)
|
s713041085 | p03962 | u075689098 | 1528490994 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 221 | #!C:\Users\daichi\Anaconda3/python.exe
# -*- coding: utf-8 -*-
C = input().split()
a = C[0]
b = C[1]
c = C[1]
if(a == b and a == c):
k = 3
if(a == c and a != b):
k = 2
if(a != b and c != b):
k = 1
print(k) |
s270168819 | p03962 | u894440853 | 1528478480 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 30 | print(len(set(input.split()))) |
s203915277 | p03962 | u288087195 | 1527896489 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 211 | a = [int(i) for i in input().split()]
sum = 0
if (a[0] == a[1]):
if (a[0] == a[2]):
sum = 1
else:
sum = 2
elif (a[0] === a[2]):
sum = 1
elif (a[1] === a[2]):
sum = 1
else:
sum = 0
print(sum) |
s604889679 | p03962 | u218843509 | 1524781821 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 30 | print(len(set(input.split()))) |
s291107083 | p03962 | u143536664 | 1524528572 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 235 | #include <stdio.h>
#include "stdafx.h"
int main() {
int a, b, c ,dd = 0;
scanf_s("%d %d %d", &a, &b, &c);
if (a == b)dd++;
if (a == c)dd++;
if (b == c)dd++;
if (dd == 3) dd = 2;
printf("%d", 3 - dd);
return 0;
} |
s581170198 | p03962 | u143536664 | 1524527404 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 235 | #include <stdio.h>
#include "stdafx.h"
int main() {
int a, b, c ,dd = 0;
scanf_s("%d %d %d", &a, &b, &c);
if (a == b)dd++;
if (a == c)dd++;
if (b == c)dd++;
if (dd == 3) dd = 2;
printf("%d", 3 - dd);
return 0;
} |
s808962117 | p03962 | u281303342 | 1523933201 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 171 | from math import ceil
N = int(input())
T,A = 1,1
for i in range(N):
Ti,Ai = map(int,input().split())
r = max(ceil(T/Ti),ceil(A/Ai))
T,A = Ti*r,Ai*r
print(T+A)
|
s464096164 | p03962 | u667024514 | 1523926484 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 246 | lis = list(input())
cou = 0
ans = 0
for i in range(len(lis)):
if lis[i] == "g":
if cou > 0:
cou -= 1
ans += 1
else:
cou += 1
else:
if cou > 0:
cou -= 1
else:
cou += 1
ans -= 1
print(max(0,ans))
|
s986476078 | p03962 | u479060428 | 1522087028 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 182 | a,b,c=map(int,input().split())
if a=b=c :
print(1)
elif a=b and not b=c:
print(2)
elif b=c and not a=c :
print(2)
elif c=a and not a=b :
print(2)
else :
print(3)
|
s208052194 | p03962 | u941884460 | 1520875813 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 127 | a,b,c=map(int,input())
color = [a]
if b not in color:
color.append(b)
if c not in color:
color.append(c)
print(len(color))
|
s146179198 | p03962 | u941884460 | 1520875751 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 121 | a,b,c=map(int,input())
color = [a]
if b not in color:
color.append(b)
if c not in color:
color.append(c)
print(color) |
s560099049 | p03962 | u586577600 | 1514858300 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 131 | l = sort(map(int, input().split()))
if l[0] == l[1] == l[2]:
print('1')
elif l[0] == l[1]:
print('2')
else:
print('3')
|
s300224247 | p03962 | u854627522 | 1514233279 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 215 | import sys
nums = [for i in map(int, sys.stdin.readline().split())]
counted = []
cnt = 0
for item in nums:
if item in counted:
continue
else:
cnt += 1
counted.append(item)
print(cnt) |
s707893021 | p03962 | u825528847 | 1512680953 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 61 | a, b, c = map(int, input().split())
print(len(set(a, b, c)))
|
s743570297 | p03962 | u667024514 | 1510288986 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 174 | a = int(input())
b = int(input())
c = int(input())
if a == b and b== c:
print("1")
elif a == b:
print("2")
elif b == c:
print("2")
elif a==c:
print("2")
else:
print("3") |
s030086077 | p03962 | u667024514 | 1510288895 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 145 | a = int(input())
b = int(input())
c = int(input())
if a == b and b== c:
print("1")
elif a == b or b ==c or a == c:
print("2")
else:
print("3") |
s620588063 | p03962 | u667024514 | 1510288861 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 139 | a = int(input())
b = int(input())
c = int(input())
if a == b == c:
print("1")
elif a == b or b ==c or a ==c:
print("2")
else:
print("3") |
s240907338 | p03962 | u996252264 | 1500180880 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 181 | def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def ris(): return list(input())
def pli(): return "".join(list(map(str, ans)))
print(len(set(rli())) |
s631079674 | p03962 | u502149531 | 1497856253 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 127 | a = [int(i) for i in input().split()]
if a == b == c :
print (1)
elif a == b or b == c :
print (2)
else :
print (3) |
s711112358 | p03962 | u820351940 | 1495481317 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 31 | print len(set(input().split())) |
s606740594 | p03962 | u946386741 | 1495481010 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 31 | print(len(set(input().split())) |
s400442194 | p03962 | u976966750 | 1490130235 | Python | PyPy2 (5.6.0) | py | Runtime Error | 35 | 27884 | 160 | l=map(int,raw_input().split())
c=3
for i in l:
if l.count(i)==3:
c= 1
break
elif l.count(i)==2:
c= 2
break
print c
vvvvv |
s959342725 | p03962 | u348405655 | 1486687993 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 316 | import math
N = int(input())
T = []
A = []
Nb = 0
for i in range(N):
a, b = map(int,input().split())
T.append(a)
A.append(b)
Tn = T[0]
An = A[0]
for i in range(N):
tmp = math.ceil(max(Tn / T[i], An / A[i]))
Nb = (T[i] + A[i])*tmp
Tn = T[i] * tmp
An = A[i] * tmp
print(Nb) |
s878896347 | p03962 | u107077660 | 1485320324 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 44 | print(len(set([int(i) in input().split()]))) |
s043165920 | p03962 | u815524843 | 1483557866 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 67 | a = input()
b = input()
c = input()
s = set([a, b, c])
print len(s) |
s824097776 | p03962 | u815524843 | 1483557811 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 67 | a = input()
b = input()
c = input()
s = set([a, b, c]]
print len(s) |
s479331466 | p03962 | u504419796 | 1483222176 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 135 | a,b,c == list(map(int,input().split()))
if a == b == c:
print(1)
elif a == b or a == c or b == c:
print(2)
else:
print(3)
|
s271406476 | p03962 | u504419796 | 1483221996 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 131 | a,b,c == (map(int,input().split()))
if a == b == c:
print(1)
elif a == b or a == c or b == c:
print(2)
else:
print(3)
|
s213607888 | p03962 | u188011210 | 1479795421 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 164 | n = int(input())
t = 1
a = 1
for i in range(n):
T, A = map(int, input().split())
k = max(1, ~-t//T + 1, ~-a//A + 1)
t = k * T
a = k * A
print(t + a) |
s016609765 | p03962 | u597792534 | 1479240265 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 65 | #coding:utf-8
N,K=map(int,input().split())
print(K*(K-1)**(N-1))
|
s411653236 | p03962 | u597792534 | 1479240070 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 71 | #coding:utf-8
N,K=list(map(int,input().split()))
print(K*(K-1)**(N-1))
|
s758695120 | p03962 | u338686846 | 1478726818 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 59 | N, K = map(int, raw_input().split())
print ((K-1)**(N-1))*K |
s920893601 | p03962 | u405509847 | 1478407380 | Python | Python (2.7.6) | py | Runtime Error | 306 | 19644 | 293 | import numpy as np
import math
N=input()
T=[]
A=[]
for i in range(N):
Ti,Ai=map(int,raw_input().split())
T.append(Ti)
A.append(Ai)
Tn=1
An=1
dp = np.zeros(N)
dp[0] = 1
for i in range(1,N):
dp[i] = math.ceil(max(A[i]/A[i-1],T[i]/T[i-1])*dp[i-1])
print (T[-1]+A[-1])*dp[-1] |
s269900583 | p03962 | u628514564 | 1478218956 | Python | Python (2.7.6) | py | Runtime Error | 280 | 19292 | 408 | from sys import setrecursionlimit
from numpy import ceil
def _main():
setrecursionlimit(1100)
print int(sum(election(1.0, 1.0, input())))
def election(t_prev, a_prev, n):
if n == 0:
return t_prev, a_prev
t, a = map(int, raw_input().split())
mlt = max(ceil(t_prev / t), ceil(a_prev / a), 1)
return election(t * mlt, a * mlt, n - 1)
if __name__ == '__main__':
_main() |
s901064851 | p03962 | u054556734 | 1478004418 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 62 | n, k=map(int, input().split())
ans=k*(k-1)**(n-1)
print(ans) |
s810577467 | p03962 | u054556734 | 1478004343 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 62 | n, k=map(int, input().split())
ans=(k-1)**(n-1)
print(ans*k) |
s861961463 | p03962 | u054556734 | 1478004300 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 62 | n, k=map(int, input().split())
ans=k*(k-1)**(n-1)
print(ans) |
s529390276 | p03962 | u054556734 | 1478004250 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 63 |
n, k=mat(int, input().split())
ans=(k-1)**(n-1)
print(ans*k) |
s083754086 | p03962 | u054556734 | 1478004210 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 62 |
n,k=mat(int, input().split())
ans=k*(k-1)**(n-1)
print(ans) |
s602170362 | p03962 | u054556734 | 1478004055 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 65 |
n, k=map(int, input().split())
ans=k*((k-1)**(n-1))
print(ans) |
s778729616 | p03962 | u054556734 | 1478003970 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 65 |
n, k=mat(int, input().split())
ans=k*((k-1)**(n-1))
print(ans) |
s155063362 | p03962 | u054556734 | 1478003824 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 94 | def penki(n, k):
return k*(k-1)**(n-1)
n, k=mat(int, input().split())
print(penki(n, k)) |
s990698213 | p03962 | u054556734 | 1477969108 | Python | Python (3.4.3) | py | Runtime Error | 22 | 2940 | 521 | シカのAtCoDeerくんはペンキをこれまでに3つ買いました。おととい買ったペンキの色は a , 昨日買ったペンキの色は b , 今日買ったペンキの色は c です。各ペンキの色は1以上100以下の整数で表されます。 AtCoDeerくんはわすれんぼうなため、同じ色のペンキを買ってしまっていることがあります。AtCoDeerくんが買ったペンキの色の種類の個数を教えてあげてください。
a,b,c=map(int, input().split())
|
s966475889 | p03962 | u272496669 | 1477843399 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 236 | list = str(input()).split()
if int(list[0]) = int(list[1]):
if int(list[1]) = int(list[2]):
print(1)
else print(2)
elif int(list[0]) = int(list[2]):
print(2)
elif int(list[1]) = int(list[2]):
print(2)
else:
print(3) |
s684902928 | p03962 | u386349298 | 1477490246 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 147 | item_list = [0]*100
cnt = 0
a = map(int, input().split())
for i in a:
if not item_list[i]:
item_list[i] = 1
cnt += 1
print(cnt) |
s782636979 | p03962 | u425448230 | 1477427726 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3444 | 87 | from collections import Counter
print(len(Counter([int(input()) for i in range(3)])))
|
s497690610 | p03962 | u145790740 | 1477243775 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 88 | # -*- coding: utf-8 -*-
n, k = map(int, raw_input().split())
print k * (k-1) ** (n-1)
|
s714618835 | p03962 | u564902833 | 1477234252 | Python | Python (2.7.3) | py | Runtime Error | 16 | 2568 | 93 | # -*- coding: utf-8 -*-
a, b, c = map(int, input().split())
ans = len({a, b, c})
print(ans)
|
s138731055 | p03962 | u564902833 | 1477233151 | Python | Python (2.7.3) | py | Runtime Error | 17 | 2568 | 93 | # -*- coding: utf-8 -*-
a, b, c = map(int, input().split())
ans = len({a, b, c})
print(ans)
|
s865653039 | p03962 | u022488946 | 1477177647 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 42 | print len({map(int, raw_input().split())}) |
s412720515 | p03962 | u897328009 | 1477170589 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 383 | import math
n = int(input())
c_t = 0
c_a = 0
for i in range(n):
t, a = [int(x) for x in input().split(" ")]
#print(min(c_t / t, c_a / a))
init = int(math.floor(max(c_t / t, c_a / a, 1)))
for j in range(init,10**18):
if t*j >= c_t and a*j >= c_a:
c_t = t*j
c_a = a*j
#print("->" + str(j))
break
print(c_t + c_a)
|
s445455678 | p03962 | u104418672 | 1476927990 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 50 | n,k=map(int,input().split())
print(k*(k-1)**(n-1)) |
s537824991 | p03962 | u886545507 | 1476794472 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 66 | #ABC046B
n,k=map(int,raw_input().split())
print k*((k-1)**(n-1))
|
s616798751 | p03962 | u840684628 | 1476728223 | Python | Python (3.4.3) | py | Runtime Error | 60 | 5588 | 340 | # coding: utf-8
import math
from decimal import Decimal
N = int(input())
votes = []
for _ in range(N):
votes.append([Decimal(n) for n in input().split()])
befa = 1
befb = 1
for a, b in votes:
kakeru = Decimal(max(math.ceil(befa / a), math.ceil(befb / b)))
befa = a * kakeru
befb = b * kakeru
print(int(befa)+int(befb)) |
s797185513 | p03962 | u831695469 | 1476726666 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 1140 | import math
N = input()
t = []
a = []
for i in range(int(N)):
t_n, a_n = input().split()
t.append(int(t_n))
a.append(int(a_n))
t_ans = 0
a_ans = 0
for t_n, a_n in zip(t, a):
k = max(math.ceil(t_ans/t_n), math.ceil(a_ans/a_n))
if not k:
k = 1
t_ans = int(k*t_n)
a_ans = int(k*a_n)
print(t_ans+a_ans)
|
s713626258 | p03962 | u831695469 | 1476714967 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 138 | a = []
for i in range(3):
a.append(input())
s = set(a)
print(len(s))
|
s161242620 | p03962 | u747569281 | 1476670612 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 37 | n, k = map(int, raw_input().split())
|
s164855327 | p03962 | u747569281 | 1476670582 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 60 | n, k = map(int, raw_input().split())
print(k * (k-1)**(n-1)) |
s019688259 | p03962 | u747569281 | 1476670549 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 61 | n, k = map(int, raw_input().split())
print(k * (k-1)**(n-1))
|
s085895877 | p03962 | u747569281 | 1476670439 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 60 | n, k = map(int, raw_input().split())
print(k * (k-1)**(n-1)) |
s108768791 | p03962 | u747569281 | 1476670333 | Python | Python (2.7.6) | py | Runtime Error | 17 | 2568 | 60 | n, k = map(int, raw_input().split())
print(k * (k-1)**(n-1)) |
s163462097 | p03962 | u747569281 | 1476669924 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 56 | a, b, c = map(int, raw_input())
print(len(set([a,b,c]))) |
s399359465 | p03962 | u592453979 | 1476585038 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 59 | cans = set(map(int, raw_input().split()))
return len(cans)
|
s834411180 | p03962 | u994720641 | 1476584532 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2696 | 467 | N = int(raw_input())
t = [[0,0] for i in range(N)]
for i in range(N):
l = []
l = raw_input().split()
t[i][0] = int(l[0])
t[i][1] = int(l[1])
min_ = [0,0]
min_[0] = t[0][0]
min_[1]= t[0][1]
for i in range(1,N):
if min_[0] > min_[1]:
large_index = 0
else:
large_index = 1
cnt = 1
while cnt*t[i][large_index]<min_[large_index]:
cnt = cnt+1
min_[0] = cnt*t[i][0]
min_[1] = cnt*t[i][1]
print min_[0]+min_[1]
|
s351367670 | p03962 | u048744861 | 1476584431 | Python | Python (2.7.6) | py | Runtime Error | 16 | 2568 | 489 | def solve(t,a,tp,ap):
if t/a == tp/ap:
return t,a
next_t=0
next_a=0
num_a = max( int(a/ap) , int(t/tp) )
next_t = num_a*tp
next_a = num_a*ap
while not(next_t > t and next_a > a):
next_t += tp
next_a += ap
return next_t,next_a
N = int(raw_input())
l = []
for i in range(N):
l.append( map(float,raw_input().split()) )
t = 1.0
a = 1.0
while len(l):
tp,ap = l.pop(0)
t,a = solve(t,a,tp,ap)
print int(t+a)
|
s127919110 | p03962 | u140672616 | 1476583825 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 60 | n,k = map(int, input().split())
print(k * ((k-1) ** (n-1))) |
s496330598 | p03962 | u019840400 | 1476582829 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 351 | import sys
def input_num():
num = input().split()
return num
def num_serch(num):
penki_num = len(num)
for j, i in enumerate(num):
if i == num[j+1]:
penki_num = penki_num - 1
if j == penki_num - 1:
break
print(penki_num)
if __name__ == '__main__':
num = input_num()
num_serch(num) |
s463380632 | p03962 | u095672454 | 1476582349 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 138 | n = map(int, input().split())
i = 3
if n[0] == n[1] :
i -= 1
if n[0] == n[2] :
i -= 1
elif n[1] == n[2] :
i -= 1
print(i)
|
s188758781 | p03962 | u418260963 | 1476582005 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3064 | 164 | result = 0
N, K = map(int, input().split())
if N == 1:
result = K
else:
result = K
for i in range(N-1):
result = result * (K - 1)
print(result)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.