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
s684849875
p03840
u969190727
1562725726
Python
Python (3.4.3)
py
Runtime Error
17
2940
188
i,o,t,j,l,s,z=map(int,input().split()) ans=0 if i==0 or j==0 or l==0: ans+=o+(i//2)*2+min(j,l)*2 else: ans+=o+(i//2)*2+min(j,l)*2 ans1=o+((i-1)//2)*2+max(0,min(j-1.l-1))*2 print(ans)
s091146586
p03840
u619819312
1555112276
Python
Python (3.4.3)
py
Runtime Error
23
3316
233
a=list(map(int,input().split())) k,h=b,b k+=a[0]-a[0]%2 k+=a[3]-a[3]%2 k+=a[4]-a[4]%2 if min(a[0],a[3],a[4])>0: h+=3 a[0],a[3],a[4]=a[0]-1,a[3]-1,a[4]-1 h+=a[0]-a[0]%2 h+=a[3]-a[3]%2 h+=a[4]-a[4]%2 print(max(k,h))
s353384065
p03840
u268977772
1555101985
Python
Python (3.4.3)
py
Runtime Error
17
2940
536
#include <bits/stdc++.h> #define INF (1<<30) #define MOD 1000000007 #define l_ength size using ll = long long; using namespace std; int main(){ ll i, o, t, j, l, s, z; cin >> i >> o >> t >> j >> l >> s >> z; ll ans1 = o + (i-i%2)+(j-j%2)+(l-l%2); ll cnt = i%2 + j%2 + l%2; if( cnt == 2 ){ ans1 += 1; } else if( cnt == 3 ){ ans1 += 3; } ll ans2 = 0; ans2 += (j-j%2) + (l-l%2) + o; j %= 2; l %= 2; if( j == 1 && l == 1 && i > 0 ){ --i; ans2 += 3; } ans2 += (i-i%2); cout << max(ans1, ans2) << endl; return 0; }
s576944784
p03840
u691018832
1554868325
Python
Python (3.4.3)
py
Runtime Error
18
3064
335
import math def xv(num): return 2 * math.floor(0.5 * num) a = list(map(int, input().split())) ans = 0 Que = xv(a[0]) + xv(a[3]) + xv(a[4]) if (a[3] or a[4]) == 0: pass else: a[0] = a[0] - 1 a[3] = a[3] - 1 a[4] = a[4] - 1 Qae = 3 + xv(a[0]) + xv(a[3]) + xv(a[4]) ans = ans + a[1] + max(Que,Qae) print(ans)
s691443228
p03840
u118642796
1552513011
Python
Python (3.4.3)
py
Runtime Error
18
3188
134
I,O,T,J,L,S,Z = map(int,input().split()) print(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3*(I>0*❨L>0❩*❨J>0❩,(I//2+J//2+L//2)*2+O))
s598697811
p03840
u118642796
1552511967
Python
PyPy3 (2.4.0)
py
Runtime Error
180
38384
298
I,O,T,J,L,S,Z = map(int,input().split()) if I==1 and J==1 and L==1: print(3) elif ((I-1)//2+(J-1)//2+(L-1)//2)*2+O==0 and (I//2+J//2+L//2)*2+O)==0): print(0) else: print(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3,(I//2+J//2+L//2)*2+O))
s863481000
p03840
u118642796
1552511929
Python
PyPy3 (2.4.0)
py
Runtime Error
168
38512
297
I,O,T,J,L,S,Z = map(int,input().split()) if I==1 and J==1 and L==1: print(3) elif ((I-1)//2+(J-1)//2+(L-1)//2)*2+O==0 and (I//2+J//2+L//2)*2+O)==0: print(0) else: print(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3,(I//2+J//2+L//2)*2+O))
s006841300
p03840
u118642796
1552511501
Python
PyPy3 (2.4.0)
py
Runtime Error
203
38384
198
I,O,T,J,L,S,Z = map(int,input().split()) if (I<2 and O=0 and J<2 and L<2) and (I != 1 or J != 1 or L!= 1): print(max(((I-1)//2+(J-1)//2+(L-1)//2)*2+O+3,(I//2+J//2+L//2)*2+O)) else: print(0)
s755721582
p03840
u729133443
1532320483
Python
Python (3.4.3)
py
Runtime Error
17
3060
127
i,o,t,j,l,s,z=map(int,input().split()) a=(i//2+j//2+l//2)*2 print([a,max(a,((i-1)//2+(j-1)//2+(l-1)//2)*2+3)][i and j and l]+o)
s667489646
p03840
u729133443
1532320327
Python
PyPy3 (2.4.0)
py
Runtime Error
187
40048
127
i,o,t,j,l,s,z=map(int,input().split()) a=(i//2+j//2+l//2)*2 print([a,max(a,((i-1)//2+(j-1)//2+(l-1)//2)*2+3)][i and j and l]+o)
s331671285
p03840
u272028993
1482735581
Python
PyPy2 (5.6.0)
py
Runtime Error
38
8944
391
n=int(raw_input()) x=map(int,raw_input().split()) ans=[-1]*(n**2+1) for i in xrange(n): if ans[x[i]]!=-1: print("No") exit() ans[x[i]]=i+1 cnt=n-1 for j in xrange(1,n**2+1): if cnt==0:break if ans[j]==-1: cnt-=1 ans[j]=i+1 if cnt>0: print("No") exit() print("Yes") print(" ".join(map(str,ans[1:])))
s248318475
p03840
u272028993
1482726440
Python
Python (2.7.6)
py
Runtime Error
16
2692
243
I,O,T,J,L,S,Z=map(int,raw_input().split()) ans=0 ans+=2*O ans1+=2*O ans+=4*(I/2) ans+=4*(J/2) ans+=4*(L/2) JL=min(J,L) if JL>=1 and I>=1: ans1+=6 J-=1 L-=1 I-=1 ans1+=4*(I/2) ans1+=4*(J/2) ans1+=4*(L/2) print(max(ans/2,ans1/2))
s549668466
p03840
u107077660
1482724441
Python
Python (3.4.3)
py
Runtime Error
23
3064
218
A = [int(i) for i in input().split()] ans = 0 ans += B[0] if min(B[1:]) == 0: for b in B[1:]: if b%2 == 0: ans += 2 elif not sum([i%2 for i in B[1:]])%3: ans += sum(B[1:]) else: ans += sum(B[1:])-1 print(ans)
s636453011
p03841
u539969758
1600562095
Python
Python (3.8.2)
py
Runtime Error
263
11736
1390
from collections import deque N = int(input()) x = [0] + list(map(int, input().split())) x2 = list() x3 = list() for i in range(N+1): x2.append([x[i], i, i-1]) #[期限, 値, 残] x3.append([x[i], i, (N-i)]) x2.sort() x3.sort(reverse= True) # print(x2) ans = [0]*(N**2 + 1) for i in range(1, N+1): ans[x[i]] = i # count = [0] * (N+1) ind = 1 rear_ind = 1 i = 1 Flag = False while True: if x2[ind][2] == 0: ind += 1 if ind == N+1: break if i >= len(ans): Flag = True break if ans[i] == 0: ans[i] = x2[ind][1] # count[ans[i]] += 1 x2[ind][2] -= 1 i += 1 i = N**2 while True: if x3[rear_ind][2] == 0: rear_ind += 1 if rear_ind == N: break if ans[i] == 0: ans[i] = x3[rear_ind][1] # count[ans[i]] += 1 x3[rear_ind][2] -= 1 i -= 1 def check(): count = [0]*(N+1) for i in range(1, N**2 + 1): count[ans[i]] += 1 if count[ans[i]] == ans[i]: if x[ans[i]] != i: return True for i in range(1, N+1): if count[i] != N: return True return False Flag = check() if Flag: print("No") # print(ans[:1002]) else: print("Yes") for i in range(1, N**2 + 1): print(ans[i] , end = " ") print()
s965654769
p03841
u539969758
1600561798
Python
Python (3.8.2)
py
Runtime Error
2206
11484
1469
from collections import deque N = int(input()) x = [0] + list(map(int, input().split())) x2 = list() x3 = list() for i in range(N+1): x2.append([x[i], i, i-1]) #[期限, 値, 残] x3.append([x[i], i, (N-i)]) x2.sort() x3.sort(reverse= True) # print(x2) ans = [0]*(N**2 + 1) for i in range(1, N+1): ans[x[i]] = i # count = [0] * (N+1) ind = 1 rear_ind = 1 i = 1 while True: if x2[ind][2] == 0: ind += 1 if ind == N+1: break if ans[i] == 0: ans[i] = x2[ind][1] # count[ans[i]] += 1 x2[ind][2] -= 1 i += 1 i = N**2 while True: if x3[rear_ind][2] == 0: rear_ind += 1 if rear_ind == N: break if ans[i] == 0: ans[i] = x3[rear_ind][1] # count[ans[i]] += 1 x3[rear_ind][2] -= 1 i -= 1 def check(): count = [0]*(N+1) for i in range(1, N**2 + 1): count[ans[i]] += 1 for i in range(1, N+1): if count[i] != N: return True for i in range(1, N+1): cnt = 0 for j in range(1, N**2 + 1): if ans[j] == i: cnt += 1 if cnt == i: if j != x[i]: return True break return False Flag = check() if Flag: print("No") # print(ans[:1002]) else: print("Yes") for i in range(1, N**2 + 1): print(ans[i] , end = " ") print()
s166831153
p03841
u651663683
1598664236
Python
Python (3.8.2)
py
Runtime Error
222
13712
694
n=int(input()) x=list(map(lambda x:int(x)-1,input().split())) sx=list(sorted([(x[i],i) for i in range(n)])) fu=[i for i in range(n)] su=[n-i-1 for i in range(n)] ar=[] xi=0 fui=1 sui=0 u=True f=True for i in range(n*n): if sx[xi][0]==i: if fui>xi: ar.append(sx[xi][1]) xi+=1 else: f=False break elif u: fu[sx[fui][1]]-=1 ar.append(sx[fui][1]) if fu[sx[fui][1]]==0: fui+=1 if fui==n: u=False else: if sui>=xi: f=False break su[sx[sui][1]]-=1 ar.append(sx[sui][1]) if su[sx[sui][1]]==0: sui+=1 if f: print("Yes") r="" for i in ar: r+=str(i+1)+" " print(r[:-1]) else: print("No")
s326451281
p03841
u651663683
1598664105
Python
Python (3.8.2)
py
Runtime Error
232
13752
677
n=int(input()) x=list(map(lambda x:int(x)-1,input().split())) sx=list(sorted([(x[i],i) for i in range(n)])) fu=[i for i in range(n)] su=[n-i-1 for i in range(n)] ar=[] xi=0 fui=1 sui=0 u=True f=True for i in range(n*n): if sx[xi][0]==i: if fui>xi: ar.append(sx[xi][1]) xi+=1 else: f=False break elif u: fu[sx[fui][1]]-=1 ar.append(sx[fui][1]) if fu[sx[fui][1]]==0: fui+=1 if fui==n: u=False else: if sui>=xi: f=False break su[sx[sui][1]]-=1 ar.append(sx[sui][1]) if su[sx[sui][1]]==0: sui+=1 if f: r="" for i in ar: r+=str(i+1)+" " print(r[:-1]) else: print(-1)
s827877633
p03841
u906428167
1592921307
Python
PyPy3 (7.3.0)
py
Runtime Error
103
99292
752
n = int(input()) x = [int(x)-i-1 for i, x in enumerate(input().split())] x = sorted(zip(x, range(1, n+1))) stack = [] for v, i in x[::-1]: for _ in range(i-1): stack.append(i) cur = 0 ans = [] res = [] cnt = [0]*(n+1) for i in range(n): for _ in range(x[i][0]-cur): if stack: nxt = stack.pop() elif res: nxt = res.pop() else: print('No') exit() ans.append(nxt) cnt[nxt] += 1 if cnt[x[i][1]] < x[i][1]-1: print('No') exit() ans.append(x[i][1]) for _ in range(n-x[i][1]): res.append(x[i][1]) cur += x[i][0] for v, i in x: if ans[v+i-1] != i: print('No') exit() print('Yes') print(*ans)
s912070870
p03841
u906428167
1592920902
Python
PyPy3 (7.3.0)
py
Runtime Error
106
99768
616
n = int(input()) x = [int(x)-i-1 for i, x in enumerate(input().split())] x = sorted(zip(x, range(1, n+1))) stack = [] for v, i in x[::-1]: for _ in range(i-1): stack.append(i) cur = 0 ans = [] res = [] cnt = [0]*(n+1) for i in range(n): for _ in range(x[i][0]-cur): if stack: nxt = stack.pop() else: nxt = res.pop() ans.append(nxt) cnt[nxt] += 1 if cnt[x[i][1]] < x[i][1]-1: print('No') exit() ans.append(x[i][1]) for _ in range(n-x[i][1]): res.append(x[i][1]) cur += x[i][0] print('Yes') print(*ans)
s421284286
p03841
u366886346
1590297930
Python
Python (3.4.3)
py
Runtime Error
441
23352
777
n=int(input()) x=list(map(int,input().split())) num=[] num2=[] ans=[] count=0 numcount=0 numcount2=0 yn=0 for i in range(2,n+1): num+=[i]*(i-1) for i in range(1,n): num2+=[i]*(n-i) for i in range(n*n): if x[count]==i+1: if numcount<((count+1)*count)//2: yn=1 break elif len(num2)-((n-count)*(n-count-1))//2<numcount2: yn=1 break else: ans+=str(count+1) count+=1 else: if numcount<len(num): ans+=str(num[numcount]) numcount+=1 elif numcount2<len(num2): ans+=str(num2[numcount2]) numcount2+=1 else: yn=1 break if yn==1: print("No") else: print("Yes") print(*ans)
s194713686
p03841
u366886346
1588650454
Python
Python (3.4.3)
py
Runtime Error
932
9904
749
n=int(input()) x=list(map(int,input().split())) a=[] b=[] ans=[] yn=0 count=1 count2=0 count3=0 for i in range(n): check=i*n+((n-i-1)*(n-i))//2 if check+i+1<x[i] or x[i]<((i+2)*(i+1))//2: yn+=1 break lena=len(a) if yn==1: print("No") else: print("Yes") for i in range(n): for j in range(i): a.append(i+1) for i in range(n): for j in range(n-i-1): b.append(i+1) for i in range(n*n): if x.count(i+1)==1: ans.append(count) count+=1 else: if count2<lena: ans.append(a[count2]) count2+=1 else: ans.append(b[count3]) count3+=1 print(*ans)
s927200009
p03841
u677523557
1580064649
Python
PyPy3 (2.4.0)
py
Runtime Error
188
41968
2752
# AOJ DSL_2_A "Range Minimum Query" # SegmantTreeの実装 # 初期化最大値 INF = (1 << 31) - 1 class SegmentTree: def __init__(self, N): self.N = 2**(N-1).bit_length() self.data = [[INF, -1] for _ in range(2*self.N-1)] # k番目の値(0-indexed)をaに変更 def update(self, k, a): self.data[k+self.N-1] = [a, k] k += self.N - 1 while k > 0: k = (k-1)//2 if self.data[2*k+1][0] < self.data[2*k+2][0]: self.data[k] = self.data[2*k+1][:] else: self.data[k] = self.data[2*k+2][:] # [l, r)の最小値取得 # kがNodeの番号、対応する区間が[a, b) def query_min(self, l, r): L = l + self.N R = r + self.N s = [INF, -1] while L < R: if R & 1: R -= 1 if s[0] > self.data[R-1][0]: s = self.data[R-1] if L & 1: if s[0] > self.data[L-1][0]: s = self.data[L-1] L += 1 L >>= 1; R >>= 1 return s import sys input = sys.stdin.readline from bisect import bisect_left N = int(input()) X = list(map(int, input().split())) sortedX = sorted(X) decided = [-1]*(N**2+1) for i, x in enumerate(X): decided[x] = i+1 marge = SegmentTree(N+1) remains = [0]*(N+1) alreadyUsed = [None]*(N+1) for i, x in enumerate(X): i += 1 alreadyused = bisect_left(sortedX, x) if i != 1: marge.update(i, x-alreadyused-i) alreadyUsed[i] = alreadyused remains[i] = i-1 def solve(): offset = 0 for n in range(1,N**2+1): if decided[n] != -1: decided_num = decided[n] if remains[decided_num] > 0: return False, None remain = N-decided_num if remain < 0: return False, None if remain == 0: marge.update(decided_num, INF) remains[decided_num] = 0 else: marge_now = (N**2-n)-(N-alreadyUsed[decided_num]-1)-remain+offset marge.update(decided_num, marge_now) remains[decided_num] = remain else: marge_now, num = marge.query_min(0, N**2+1) if marge_now-offset < 0 or marge_now == INF: return False, None remains[num] -= 1 if remains[num] == 0: marge.update(num, INF) else: marge.update(num, marge_now+1) decided[n] = num offset += 1 return True, decided[1:] if __name__ == "__main__": ok, ans = solve() if ok: print("Yes") print(*ans) else: print("No")
s000170407
p03841
u218843509
1579134796
Python
Python (3.4.3)
py
Runtime Error
339
12024
778
import sys n = int(input()) x = list(map(int, input().split())) s = sorted([[y-1, i+1] for i, y in enumerate(x)]) cur = 0 cnt = [0 for _ in range(n+1)] fill_cur = 0 ans = [] residual = [] for i in range(n*n): if i == s[cur][0] and cnt[s[cur][1]] != s[cur][1]-1: print("No") sys.exit() elif i == s[cur][0]: ans.append(s[cur][1]) cnt[s[cur][1]] += 1 residual += [s[cur][1]] * (n - s[cur][1]) cur += 1 fill_cur = max(fill_cur, cur) if cur == n: break elif fill_cur < n: if cnt[s[fill_cur][1]] == s[fill_cur][1]-1: fill_cur += 1 if fill_cur == n: ans.append(residual.pop()) continue fill_cur = max(fill_cur, cur) ans.append(s[fill_cur][1]) cnt[s[fill_cur][1]] += 1 else: ans.append(residual.pop()) ans += residual print("Yes") print(*ans)
s565288660
p03841
u638795007
1577907754
Python
Python (3.4.3)
py
Runtime Error
128
24436
2857
def examA(): x, y = LI() ans = 0 if x<0 and y<0: if x<=y: ans = y-x else: ans = x-y+2 elif x<0 and 0<=y: if -x<=y: ans = y+x+1 else: ans = min(-(x+y)+1,y-x) elif y<=0: ans = abs(y+x)+1 else: if x<=y: ans = y-x else: ans = x-y+2 print(ans) return def examB(): B, K = LI() A = LI() cumA = [0]*(B+1); negA = [0]*(B+1) for i,a in enumerate(A): cumA[i+1] = cumA[i] negA[i+1] = negA[i] if a>0: cumA[i+1] +=a else: negA[i+1] +=a ans = 0 for i in range(B-K+1): curC = cumA[K+i]-cumA[i]; curN = negA[K+i]-negA[i] now1 = cumA[B] + curN now2 = cumA[B] - curC # print(now1,now2) ans = max(ans,now1,now2) print(ans) return def examC(): Ai,Ao,At,Aj,Al,As,Az = LI() ans = 0 ans += Ao ans += (Ai//2 + Aj//2 + Al//2)*2 if Ai>=1 and Aj>=1 and Al>=1: if Ai%2 + Aj%2 + Al%2==3: ans += 3 elif Ai%2 + Aj%2 + Al%2==2: ans +=1 print(ans) return def examD(): N = I() X = LI() A = [0]*(N**2) que = deque() ans = "Yes" need = [0]*(N**2) for i in range(N): need[X[i]-1] = i for i in range(N): A[X[i]-1] = (i+1) # print(need); print(A) X.sort() k = 0 for i in range(N): cur = need[X[i]-1] for j in range(cur): while(A[k]!=0): k +=1 A[k] = A[X[i]-1] if k>=X[i]: ans = "No" break res = N-1-cur que.append((res,i)) # print(que); print(A) loop = 0 if ans=="No": print(ans) return while(que and k<N**2 and loop<10**6): loop +=1 cur,i = que.popleft() while (k<N**2 and A[k] != 0): k += 1 # print(k,A[X[i]-1]) if k<X[i] and que[i]>0: que.append((cur,i)) continue for j in range(cur): while(A[k]!=0): k +=1 A[k] = A[X[i]-1] if que or loop>=10**6: ans = "No" if ans=="No": print(ans) return else: print(ans) print(" ".join(map(str,A))) return """ 3 6 7 8 """ import sys,copy,bisect,itertools,heapq,math from heapq import heappop,heappush,heapify from collections import Counter,defaultdict,deque def I(): return int(sys.stdin.readline()) def LI(): return list(map(int,sys.stdin.readline().split())) def LSI(): return list(map(str,sys.stdin.readline().split())) def LS(): return sys.stdin.readline().split() def SI(): return sys.stdin.readline().strip() global mod,mod2,inf mod = 10**9 + 7 mod2 = 998244353 inf = 10**18 if __name__ == '__main__': examD()
s800436794
p03841
u638795007
1577907654
Python
Python (3.4.3)
py
Runtime Error
130
24420
2797
def examA(): x, y = LI() ans = 0 if x<0 and y<0: if x<=y: ans = y-x else: ans = x-y+2 elif x<0 and 0<=y: if -x<=y: ans = y+x+1 else: ans = min(-(x+y)+1,y-x) elif y<=0: ans = abs(y+x)+1 else: if x<=y: ans = y-x else: ans = x-y+2 print(ans) return def examB(): B, K = LI() A = LI() cumA = [0]*(B+1); negA = [0]*(B+1) for i,a in enumerate(A): cumA[i+1] = cumA[i] negA[i+1] = negA[i] if a>0: cumA[i+1] +=a else: negA[i+1] +=a ans = 0 for i in range(B-K+1): curC = cumA[K+i]-cumA[i]; curN = negA[K+i]-negA[i] now1 = cumA[B] + curN now2 = cumA[B] - curC # print(now1,now2) ans = max(ans,now1,now2) print(ans) return def examC(): Ai,Ao,At,Aj,Al,As,Az = LI() ans = 0 ans += Ao ans += (Ai//2 + Aj//2 + Al//2)*2 if Ai>=1 and Aj>=1 and Al>=1: if Ai%2 + Aj%2 + Al%2==3: ans += 3 elif Ai%2 + Aj%2 + Al%2==2: ans +=1 print(ans) return def examD(): N = I() X = LI() A = [0]*(N**2) que = deque() ans = "Yes" need = [0]*(N**2) for i in range(N): need[X[i]-1] = i for i in range(N): A[X[i]-1] = (i+1) # print(need); print(A) X.sort() k = 0 for i in range(N): cur = need[X[i]-1] for j in range(cur): while(A[k]!=0): k +=1 A[k] = A[X[i]-1] if k>=X[i]: ans = "No" break res = N-1-cur que.append((res,i)) # print(que); print(A) if ans=="No": print(ans) return while(que and k<N**2): cur,i = que.popleft() while (k<N**2 and A[k] != 0): k += 1 # print(k,A[X[i]-1]) if k<X[i] and que[i]>0: que.append((cur,i)) continue for j in range(cur): while(A[k]!=0): k +=1 A[k] = A[X[i]-1] if que: ans = "No" if ans=="No": print(ans) return else: print(ans) print(" ".join(map(str,A))) return """ 3 6 7 8 """ import sys,copy,bisect,itertools,heapq,math from heapq import heappop,heappush,heapify from collections import Counter,defaultdict,deque def I(): return int(sys.stdin.readline()) def LI(): return list(map(int,sys.stdin.readline().split())) def LSI(): return list(map(str,sys.stdin.readline().split())) def LS(): return sys.stdin.readline().split() def SI(): return sys.stdin.readline().strip() global mod,mod2,inf mod = 10**9 + 7 mod2 = 998244353 inf = 10**18 if __name__ == '__main__': examD()
s557642924
p03841
u828766688
1572822291
Python
PyPy3 (2.4.0)
py
Runtime Error
218
46448
832
from collections import deque import sys N = int(input()) x = list(map(int,input().split())) mustuse = deque([]) ableuse = deque([]) xlis = [] ans = [None] * (N ** 2) for i in range(N): ans[x[i]-1] = i+1 xlis.append([x[i],i+1]) xlis.sort() for i in range(N): for j in range(xlis[i][1]-1): mustuse.append(xlis[i][1]) #print (ans) #print (mustuse) for i in range(N**2): if ans[i] != None: if mustuse[0] == ans[i]: print ("No") sys.exit() for j in range(N-ans[i]): ableuse.append(ans[i]) else: if len(mustuse) > 0: ans[i] = mustuse.popleft() elif len(ableuse) > 0: ans[i] = ableuse.popleft() else: print ("No") sys.exit() print ("Yes") print (" ".join(map(str,ans)))
s779189835
p03841
u218843509
1567848894
Python
Python (3.4.3)
py
Runtime Error
315
12016
771
import sys n = int(input()) x = list(map(int, input().split())) s = sorted([[y-1, i+1] for i, y in enumerate(x)]) #print(s) cur = 0 cnt = [0 for _ in range(n+1)] cnt_cur = 0 ans = [] residual = [] for i in range(n*n): #print(i, cur, cnt_cur) if i == s[cur][0] and cnt[s[cur][1]] != s[cur][1]-1: print("No") sys.exit() elif i == s[cur][0]: ans.append(s[cur][1]) cnt[s[cur][1]] += 1 residual += [s[cur][1]] * (n - s[cur][1]) cur += 1 if cur == n: break elif cnt_cur < n: if cnt[s[cnt_cur][1]] == s[cnt_cur][1]-1: cnt_cur += 1 if cnt_cur == n: ans.append(residual.pop()) continue cnt_cur = max(cnt_cur, cur) ans.append(s[cnt_cur][1]) cnt[s[cnt_cur][1]] += 1 else: ans.append(residual.pop()) ans += residual print("Yes") print(*ans)
s989635580
p03841
u218843509
1567848797
Python
Python (3.4.3)
py
Runtime Error
484
16332
770
import sys n = int(input()) x = list(map(int, input().split())) s = sorted([[y-1, i+1] for i, y in enumerate(x)]) #print(s) cur = 0 cnt = [0 for _ in range(n+1)] cnt_cur = 0 ans = [] residual = [] for i in range(n*n): #print(i, cur, cnt_cur) if i == s[cur][0] and cnt[s[cur][1]] < s[cur][1]-1: print("No") sys.exit() elif i == s[cur][0]: ans.append(s[cur][1]) cnt[s[cur][1]] += 1 residual += [s[cur][1]] * (n - s[cur][1]) cur += 1 if cur == n: break elif cnt_cur < n: if cnt[s[cnt_cur][1]] == s[cnt_cur][1]-1: cnt_cur += 1 if cnt_cur == n: ans.append(residual.pop()) continue cnt_cur = max(cnt_cur, cur) ans.append(s[cnt_cur][1]) cnt[s[cnt_cur][1]] += 1 else: ans.append(residual.pop()) ans += residual print("Yes") print(*ans)
s292777773
p03841
u761320129
1545329235
Python
Python (3.4.3)
py
Runtime Error
246
11064
666
N = int(input()) X = list(map(int,input().split())) Y = sorted([(x-1,i+1) for i,x in enumerate(X)]) ans = [None] * (N*N) must = [] for i,n in Y: ans[i] = n must += [n]*(n-1) must.reverse() used = [0] * (N+1) free = [1] for i in range(N*N): if ans[i]: a = ans[i] if used[a] != a-1: print('No') exit() free += [a]*(N-a) elif must: a = must.pop() ans[i] = a else: if free: a = free.pop() ans[i] = a else: print('No') exit() used[ans[i]] += 1 for i in range(1,N+1): assert used[i] == N print('Yes') print(*ans)
s205094575
p03841
u548384403
1482724796
Python
Python (2.7.6)
py
Runtime Error
1127
22744
1345
N=int(raw_input()) L=map(int,raw_input().split()) L=map(lambda x:x-1,L) A=[ [L[i],[-1]*(i),[-1]*(N-i-1)] for i in range(N) ] triindice=1 indice=0 subindice=0 A.sort(key= lambda x:x[0]) def solve(): print 'Yes' let=['' for i in range(N**2)] for i in range(N): ll=A[i][0] chr=str(L.index(ll)+1) for t in (1,2): for s in A[i][t]: let[s]=chr let[ll]=chr print ' '.join(let) for i in range(N**2): if indice==N: indice=0 triindice=2 if len(A[indice][triindice])==0: indice+=1 if indice==N and triindice==2: solve() break if i not in L: if triindice==1: if i < A[indice][0]: A[indice][triindice][subindice]=i subindice+=1 if subindice==len(A[indice][triindice]): subindice=0 indice+=1 else: print 'No' break if triindice==2: if i>A[indice][0]: A[indice][triindice][subindice]=i subindice+=1 if subindice==len(A[indice][triindice]): subindice=0 indice+=1 else: print 'No' break else: solve()
s564023949
p03841
u548384403
1482724406
Python
Python (2.7.6)
py
Runtime Error
1137
21472
1238
N=int(raw_input()) L=map(int,raw_input().split()) L=map(lambda x:x-1,L) A=[ [L[i],[-1]*(i),[-1]*(N-i-1)] for i in range(N) ] triindice=1 indice=0 subindice=0 A.sort(key= lambda x:x[0]) for i in range(N**2): if indice==N: indice=0 triindice=2 if len(A[indice][triindice])==0: indice+=1 if i not in L: if triindice==1: if i < A[indice][0]: A[indice][triindice][subindice]=i subindice+=1 if subindice==len(A[indice][triindice]): subindice=0 indice+=1 else: print 'No' break if triindice==2: if i>A[indice][0]: A[indice][triindice][subindice]=i subindice+=1 if subindice==len(A[indice][triindice]): subindice=0 indice+=1 else: print 'No' break else: print 'Yes' let=['' for i in range(N**2)] for i in range(N): ll=A[i][0] chr=str(L.index(ll)+1) for t in (1,2): for s in A[i][t]: let[s]=chr let[ll]=chr print ' '.join(let)
s545192616
p03841
u098968285
1482724187
Python
PyPy3 (2.4.0)
py
Runtime Error
207
38640
945
# def makelist(n, m): # return [[0 for i in range(m)] for j in range(n)] N = int(input()) x = [0] + list(map(int, input().split())) yes = "Yes" no = "No" flag1 = True # for e in x: # if e > N: # flag1 = False if not flag1: print(no) else: pairL = [0]*N for i in range(1, N+1): pairL[i-1] = (x[i], i) pairL.sort() ans = [0]*(N+1) flag = True cur = 1 dp = [N]*(N+1) for (xi, i) in pairL: if ans[xi] == 0: ans[xi] = i else: flag = False break dp[i] -= i cnt = i - 1 while cnt > 0: if cur >= xi: flag = False break if ans[cur] == 0: ans[cur] = i cnt -= 1 cur += 1 else: cur += 1 if not flag: break if not flag: print(no) else: print(yes) for i in range(1, N): cnt = dp[i] while True: if ans[cur] == 0: ans[cur] = i cnt -= 1 cur += 1 if cnt == 0: break for i in range(1, N): print(ans[i], end = " ") print(ans[N])
s718913763
p03841
u548384403
1482724159
Python
Python (2.7.6)
py
Runtime Error
1140
21472
1235
N=int(raw_input()) L=map(int,raw_input().split()) L=map(lambda x:x-1,L) A=[ [L[i],[-1]*(i),[-1]*(N-i-1)] for i in range(N) ] triindice=1 indice=0 subindice=0 A.sort(key= lambda x:x[0]) for i in range(N**2): if len(A[indice][triindice])==0: indice+=1 if i not in L: if triindice==1: if i < A[indice][0]: A[indice][triindice][subindice]=i subindice+=1 if subindice==len(A[indice][triindice]): subindice=0 indice+=1 else: print 'No' break if triindice==2: if i>A[indice][0]: A[indice][triindice][subindice]=i subindice+=1 if subindice==len(A[indice][triindice]): subindice=0 indice+=1 else: print 'No' break if indice==N: indice=0 triindice=2 else: print 'Yes' let=['' for i in range(N**2)] for i in range(N): ll=A[i][0] chr=str(L.index(ll)+1) for t in (1,2): for s in A[i][t]: let[s]=chr let[ll]=chr print ' '.join(let)
s684865201
p03841
u548384403
1482724077
Python
Python (2.7.6)
py
Runtime Error
1140
21472
1239
N=int(raw_input()) L=map(int,raw_input().split()) L=map(lambda x:x-1,L) A=[ [L[i],[-1]*(i),[-1]*(N-i-1)] for i in range(N) ] triindice=1 indice=0 subindice=0 A.sort(key= lambda x:x[0]) for i in range(N**2): if len(A[indice][triindice])==0: indice+=1 if indice==N: indice=0 triindice=2 if i not in L: if triindice==1: if i < A[indice][0]: A[indice][triindice][subindice]=i subindice+=1 if subindice==len(A[indice][triindice]): subindice=0 indice+=1 else: print 'No' break if triindice==2: if i>A[indice][0]: A[indice][triindice][subindice]=i subindice+=1 if subindice==len(A[indice][triindice]): subindice=0 indice+=1 else: print 'No' break else: print 'Yes' let=['' for i in range(N**2)] for i in range(N): ll=A[i][0] chr=str(L.index(ll)+1) for t in (1,2): for s in A[i][t]: let[s]=chr let[ll]=chr print ' '.join(let)
s827357487
p03841
u548384403
1482723776
Python
Python (2.7.6)
py
Runtime Error
1141
21472
1247
N=int(raw_input()) L=map(int,raw_input().split()) L=map(lambda x:x-1,L) A=[ [L[i],[-1]*(i),[-1]*(N-i-1)] for i in range(N) ] triindice=1 indice=0 subindice=0 A.sort(key= lambda x:x[0]) for i in range(N**2): if len(A[indice][triindice])==0: indice+=1 if i not in L: if triindice==1: if i < A[indice][0]: A[indice][triindice][subindice]=i subindice+=1 if subindice==len(A[indice][triindice]): subindice=0 indice+=1 else: print 'No' break if triindice==2: if i>A[indice][0]: A[indice][triindice][subindice]=i subindice+=1 if subindice==len(A[indice][triindice]): subindice=0 indice+=1 else: print 'No' break if indice==N: indice=0 triindice=2 else: print 'Yes' let=['' for i in range(N**2)] for i in range(N): ll=A[i][0] chr=str(L.index(ll)+1) for t in (1,2): for s in A[i][t]: let[s]=chr let[ll]=chr print ' '.join(let)
s049699940
p03841
u637175065
1482721088
Python
Python (3.4.3)
py
Runtime Error
805
24492
1047
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def main(): n = int(input()) a = list(map(int, input().split())) nn = n*n r = [-1] * nn ms = [] us = [] for i in range(n): c = i+1 ri = a[i] - 1 r[ri] = c ms.append([ri, i, c]) us.append([ri, n-i-1, c]) ms.sort() si = 0 for ri, k, c in ms: for _ in range(k): while r[si] > 0 and si < (nn-1): si += 1 if si > ri or r[si] > 0: print('No') return r[si] = c si += 1 si = nn-1 us.sort() us.reverse() for ri, k, c in us: for _ in range(k): while r[si] > 0 and si > 0: si -= 1 if si < ri or r[si] > 0: print('No') return r[si] = c si += 1 print('Yes') print(' '.join(map(str, r))) main()
s310649929
p03841
u637175065
1482720977
Python
Python (3.4.3)
py
Runtime Error
388
24500
1108
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def main(): n = int(input()) a = list(map(int, input().split())) nn = n*n r = [-1] * nn ms = [] us = [] for i in range(n): c = i+1 ri = a[i] - 1 if r[ri] > 0: print('No') return r[ri] = c ms.append([ri, i, c]) us.append([ri, n-i-1, c]) ms.sort() si = 0 for ri, k, c in ms: for _ in range(k): while r[si] > 0 and si < nn: si += 1 if si > ri or r[si] > 0: print('No') return r[si] = c si += 1 si = nn-1 us.sort() us.reverse() for ri, k, c in us: for _ in range(k): while r[si] > 0 and si > 0: si -= 1 if si < ri or r[si] > 0: print('No') return r[si] = c si += 1 print('Yes') print(' '.join(map(str, r))) main()
s713722299
p03843
u398211451
1546067526
Python
Python (3.4.3)
py
Runtime Error
1846
80980
1254
def solve(): n = int(input()) g = [[] for _ in range(n)] for _ in range(n - 1): a, b = [int(x) for x in input().split()] a -= 1 b -= 1 g[a].append(b) g[b].append(a) ds = dict() def dfs1(g, a, fr): res = 0 for b in g[a]: if b == fr: continue x = dfs1(g, b, a) ds[(a, b)] = x res = max(res, x) return res + 1 dfs1(g, 0, -1) # print(ds) ans = 0 def dfs2(g, a, fr, d_fr): nonlocal ans # print(a, fr, d_fr) cd = [(d_fr, fr)] for b in g[a]: if b == fr: continue cd.append((ds[(a, b)], b)) cd.sort() cd.reverse() # print(cd) cur = (cd[1][0] + 1) if (len(cd) > 1) else 1 cur = min(cur, cd[0][0] - 1) # print(cur) ans += cur + 1 for b in g[a]: if b == fr: continue x = cd[0][0] if cd[0][1] == b: x = cd[1][0] dfs2(g, b, a, x + 1) dfs2(g, 0, -1, 0) print(ans + 1) if __name__ == '__main__': # t = int(input()) t = 1 for _ in range(t): solve()
s775865766
p03843
u398211451
1546067400
Python
Python (3.4.3)
py
Runtime Error
18
3064
1242
def solve(): n = int(input()) g = [[] for _ in range(n)] for _ in range(n - 1): a, b = [int(x) for x in input().split()] a -= 1 b -= 1 g[a].append(b) g[b].append(a) ds = dict() def dfs1(g, a, fr): res = 0 for b in g[a]: if b == fr: continue x = dfs1(g, b, a) ds[(a, b)] = x res = max(res, x) return res + 1 dfs1(g, 0, -1) # print(ds) ans = 0 def dfs2(g, a, fr, d_fr): nonlocal ans # print(a, fr, d_fr) cd = [(d_fr, fr)] for b in g[a]: if b == fr: continue cd.append((ds[(a, b)], b)) cd.sort() cd.reverse() # print(cd) cur = (cd[1][0] + 1) if (len(cd) > 1) else 1 cur = min(cur, cd[0][0] - 1) # print(cur) ans += cur + 1 for b in g[a]: if b == fr: continue x = cd[0][0] if cd[0][1] == b: x = cd[1][0] dfs2(g, b, a, x + 1) dfs2(g, 0, -1, 0) print(ans + 1) if __name__ == '__main__': t = int(input()) for _ in range(t): solve()
s857700621
p03844
u085186789
1601351719
Python
Python (3.8.2)
py
Runtime Error
26
9164
93
A, op, B = input().split() if op == '-': print(int(A) - int(B)) else: print(int(A) + (B))
s887184248
p03844
u085186789
1601351615
Python
Python (3.8.2)
py
Runtime Error
26
8880
75
A, op, B = input().split() if op = '-': print(A - B) else: print(A + B)
s834362053
p03844
u085186789
1601351563
Python
Python (3.8.2)
py
Runtime Error
24
8920
90
A, op, B = list(map(int,input().split())) if op = '+': print(A + B) else: print(A - B)
s651991336
p03844
u401183062
1601307054
Python
Python (3.8.2)
py
Runtime Error
24
8940
164
a, op, b = map(str, input().split()) a = int(a) b = int(b) if op == "+": result = a + b else: result = a - b print(result)
s676290835
p03844
u401183062
1601306850
Python
Python (3.8.2)
py
Runtime Error
25
8900
164
a, op, b = map(str, input().split()) a = int(a) b = int(b) if op == "+": result = a + b else: result = a - b print(result)
s289236566
p03844
u401183062
1601306801
Python
Python (3.8.2)
py
Runtime Error
26
9004
163
a, op, b = map(str, input().split()) a = int(a) b = int(b) if op == "+": result = a + b else: result = a - b print(result
s587348414
p03844
u894856270
1601086514
Python
PyPy3 (7.3.0)
py
Runtime Error
86
74484
115
a, op, b = input().split() a, b = map(int()) if op = "+": print(a + b) elif op = "-": print(a - b) else: pass
s928348434
p03844
u485349322
1600398801
Python
Python (3.8.2)
py
Runtime Error
22
8888
92
A,c,B=input().split() if c=="+": print(int(A)+int(B)): elif c=="-": print(int(A)-int(B))
s177496019
p03844
u485349322
1600398759
Python
Python (3.8.2)
py
Runtime Error
23
8960
74
A,c,B=input().split() if c=="+": print(A+B): elif c=="-": print(A-B)
s738836934
p03844
u620846115
1600308922
Python
Python (3.8.2)
py
Runtime Error
25
9076
19
print(eval(input())
s837168194
p03844
u434630332
1600061190
Python
Python (3.8.2)
py
Runtime Error
25
9012
110
a = int(input()) op = str(input()) b = int(input()) if op == "+": print(a + b) if op == "-": print(a - b)
s589020391
p03844
u847033024
1599988963
Python
Python (3.8.2)
py
Runtime Error
24
9028
102
a, b, c = map(input().split()) a = int(a) c = int(c) if b == '+': print(a + c) else: print(a - c)
s264550540
p03844
u847033024
1599988942
Python
Python (3.8.2)
py
Runtime Error
24
8948
99
a, b, c = map(input().split()) a = int(a) c = int(c) if b == +: print(a + c) else: print(a - c)
s722235676
p03844
u847033024
1599988871
Python
Python (3.8.2)
py
Runtime Error
27
8952
83
a, b, c = map(int, input().split()) if b == +: print(a + c) else: print(a - c)
s232666881
p03844
u847033024
1599988850
Python
Python (3.8.2)
py
Runtime Error
27
8896
77
a, b, c = map(input().split()) if b == +: print(a + c) else: print(a - c)
s941649746
p03844
u847033024
1599988716
Python
Python (3.8.2)
py
Runtime Error
24
9148
26
a = input() print(int(a))
s151328157
p03844
u847033024
1599988695
Python
Python (3.8.2)
py
Runtime Error
23
8892
31
a = input() print(int(input()))
s991314669
p03844
u666550725
1599875376
Python
PyPy3 (7.3.0)
py
Runtime Error
85
68680
94
A, B, C = input().split() if B == "+": print(int(A) + int(B)) else: print(int(A) - int(B))
s743950720
p03844
u886902015
1599858782
Python
Python (3.8.2)
py
Runtime Error
28
8980
91
a,op,b=input().split()) if op=="+": print(int(a)+int(b)) else: print(int(a)-int(b))
s747717274
p03844
u612975321
1599614852
Python
Python (3.8.2)
py
Runtime Error
23
8916
97
a, o, b = input().split() if o = '+': print(int(a) + int(b)) else: print(int(a) - int(b))
s005134337
p03844
u040298438
1599062275
Python
Python (3.8.2)
py
Runtime Error
25
8900
146
let [a, op, b] = require("fs").readFileSync("/dev/stdin", "utf8").split(" "); [a, b] = [a, b].map(Number); console.log(op == "+" ? a + b : a - b);
s617345541
p03844
u912728973
1598993085
Python
Python (3.8.2)
py
Runtime Error
31
8936
58
a,o,b = map(str,input.split()) print(int(a)int(o)int(b))
s052925193
p03844
u278143034
1598894900
Python
Python (3.8.2)
py
Runtime Error
26
9096
118
# 数値と符号の取得 A,op,B = map(str,input().split()) # 計算して出力 calc = eval(A & op & B) print(calc)
s792449360
p03844
u705418271
1598732607
Python
Python (3.8.2)
py
Runtime Error
27
8932
69
a,b,c=map(input().split()) if b=="+": print(a+b) else: print(a-b)
s513451422
p03844
u278143034
1598675593
Python
Python (3.8.2)
py
Runtime Error
25
8944
152
# 数値と符合を取得 A,op,B = map(str,input().split()) # 計算結果を出力 A = int(A) op = sign(op) B = int(B) calc = int(A op B) print(calc)
s738928642
p03844
u526818929
1598542835
Python
Python (3.8.2)
py
Runtime Error
22
9100
116
A, op, B = map(input().split()) A = int(A) B = int(B) if op == "+": print(A + B) if op == "-": print(A - B)
s790324537
p03844
u526818929
1598542662
Python
Python (3.8.2)
py
Runtime Error
26
8972
109
A = int(input()) op = input() B = int(input()) if op == "+": print(A + B) if op == "-": print(A - B)
s451497478
p03844
u003505857
1598535875
Python
Python (3.8.2)
py
Runtime Error
27
9136
122
# 入力 A = int(input()) op = input() B = int(input()) if op == '+': print(A + B) elif op == '-': print(A - B)
s705538549
p03844
u228223940
1598411956
Python
Python (3.8.2)
py
Runtime Error
26
9084
73
a,b,c = input().split() if b == "+": print(a+c) else: print(a-c)
s039893176
p03844
u434630332
1598395248
Python
Python (3.8.2)
py
Runtime Error
22
8932
68
a = int(input()) op = str(input()) b = int(input()) print(a "op" b)
s021525522
p03844
u546853743
1598372382
Python
Python (3.8.2)
py
Runtime Error
25
8972
72
a,b,c = input().split() if b == '+': print(a+c) else: print(a-c)
s865882344
p03844
u779830746
1598323228
Python
Python (3.8.2)
py
Runtime Error
25
9096
162
# 入力 a, b = map(int, input().split()) op = str(input()) # 処理 if op == '+': answer = a + b elif op == '-': answer = a - b # 出力 print(answer)
s965092090
p03844
u779830746
1598323156
Python
Python (3.8.2)
py
Runtime Error
23
9100
157
# 入力 a = int(input()) op = input() b = int(input()) # 処理 if op == '+': answer = a + b elif op == '-': answer = a - b # 出力 print(answer)
s763173274
p03844
u779830746
1598323068
Python
Python (3.8.2)
py
Runtime Error
23
9068
161
# 入力 a = int(input()) op = input() b = int(input()) # 処理 if op == '+': answer = a + b elif op == '-': answer = a - b # 出力 print(answer)
s096297840
p03844
u596536048
1598304242
Python
Python (3.8.2)
py
Runtime Error
22
8956
101
A, op, B = input().split() A, B = int(A), int(B) if op == '+' print(A + B) else: print(A - B)
s396347084
p03844
u244836567
1598238996
Python
Python (3.8.2)
py
Runtime Error
24
8920
81
a,b,c=input().split() a=int(a) c=int(c) if b="+": print(a+c) else: print(a-c)
s124324825
p03844
u423812170
1598207191
Python
Python (3.8.2)
py
Runtime Error
29
9000
166
a = input() if a[2] == "+": answer = int(a[0]) + int(a[4]) elif a[2] == "-": answer = int(a[0]) - int(a[4]) else: print('該当しない') print(answer)
s159391565
p03844
u423812170
1598207122
Python
Python (3.8.2)
py
Runtime Error
20
9008
131
a = input() if a[2] == "+": answer = int(a[0]) + int(a[4]) elif a[2] == "-": answer = int(a[0]) - int(a[4]) print(answer)
s842470035
p03844
u468972478
1598200299
Python
Python (3.8.2)
py
Runtime Error
25
9164
153
n = int(input()) p = map(int, input().split()) k = int(input()) s = sum(p) for i in range(k): a, b = map(int, input().split()) print(s - p[a-1] + b)
s316350350
p03844
u468972478
1598200203
Python
Python (3.8.2)
py
Runtime Error
30
9120
159
n = int(input()) p = list(map(int, input().split())) k = int(input()) s = sum(p) for i in range(k): a, b = map(int, input().split()) print(s - p[a-1] + b)
s403229517
p03844
u871841829
1597982106
Python
Python (3.8.2)
py
Runtime Error
23
8892
100
a, op, b = input().split() if op = '+': ans = int(a)+int(b) else: ans = int(a) - int(b) print(ans)
s811491184
p03844
u396211450
1597635252
Python
Python (3.8.2)
py
Runtime Error
20
9104
93
a,b,c=map(str,input().split()) if b=="+": print(int(a)+int(b)) else: print(int(a)-int(b))
s034941058
p03844
u589969467
1597161487
Python
Python (3.8.2)
py
Runtime Error
27
8936
102
a,op,b = map(str,input().split()) if op = '+': print(int(a)+int(b)) else: print(int(a)-int(b))
s674245404
p03844
u477696265
1597110884
Python
Python (3.8.2)
py
Runtime Error
26
9068
19
print(eval(input())
s507253823
p03844
u477696265
1597110852
Python
Python (3.8.2)
py
Runtime Error
25
8876
19
print(eval(input())
s699268949
p03844
u274615057
1596950647
Python
Python (3.8.2)
py
Runtime Error
25
9164
181
def main(): n = input().split() if n[1] == '+': print(int(n[0]) + int(n[1])) else: print(int(n[0]) - int(n[1])) if __name__ == "__main__": main()
s859965307
p03844
u714104087
1596668994
Python
PyPy3 (7.3.0)
py
Runtime Error
100
74476
80
a, b = map(int, input().split()) op = input() print(a+b if op == "+" else a-b)
s043452222
p03844
u714104087
1596576701
Python
PyPy3 (7.3.0)
py
Runtime Error
91
74704
75
a, b = map(int, input().split()) op =int() print(a+b if op = "+" else a-b)
s469394289
p03844
u629607744
1596515579
Python
Python (3.8.2)
py
Runtime Error
26
9092
102
a,op,b = map(str,input(),split()) if op == "+": print(int(a) + int(b)) else: print(int(a) - int(b))
s837193164
p03844
u629607744
1596515550
Python
Python (3.8.2)
py
Runtime Error
23
9032
101
a,op,c = map(str,input(),split()) if op == "+": print(int(a) + int(b)) else: print(int(a) - int(b))
s256363022
p03844
u029929095
1596285028
Python
Python (3.8.2)
py
Runtime Error
22
9160
88
a=input() if a[1]=="+": print(int(a[0])+int(a[2])) else: print(int(a[0])-int(a[2]))
s030381112
p03844
u029929095
1596284991
Python
Python (3.8.2)
py
Runtime Error
23
9004
68
a=input() if a[1]=="+": print(a[0]+a[2]) else: print(a[0]-a[2])
s798775938
p03844
u029929095
1596284959
Python
Python (3.8.2)
py
Runtime Error
22
8992
55
a=input() if a[1]=="+": print(a+b) else: print(a-b)
s689600388
p03844
u099212858
1596151159
Python
Python (3.8.2)
py
Runtime Error
24
9020
96
a, op, b = map(int, input().split()) op = str(op) if p == "+": print(a+b) else: print(a-b)
s788879794
p03844
u099212858
1596151125
Python
Python (3.8.2)
py
Runtime Error
25
9100
97
a, op, b = map(int, input().split()) op = str(op) if op == "+": print(a+b) else: print(a-b)
s096064069
p03844
u099212858
1596151098
Python
Python (3.8.2)
py
Runtime Error
21
9100
95
a, op, b = map(int, input().split()) op = str(op) if p == "+": print(a+b) else: print(a-b)
s261685286
p03844
u099212858
1596150116
Python
Python (3.8.2)
py
Runtime Error
23
9108
113
a = list(map(int,input().split())) op = a[1] x = a[0] y = a[2] if op == "+": print(x+y) else: print(x-y)
s796281372
p03844
u099212858
1596148404
Python
Python (3.8.2)
py
Runtime Error
27
9080
124
a = list(map(int,input().split())) op = a[1] if op == "+": print(int(a[0])+int(a[2])) else: print(int(a[0])-int(a[2]))
s920030520
p03844
u099212858
1596148258
Python
Python (3.8.2)
py
Runtime Error
24
9036
103
a = list(map(int,input().split())) op = a[1] if op == "+": print(a[0]+a[2]) else: print(a[0]-a[2])
s900244823
p03844
u099212858
1596148161
Python
Python (3.8.2)
py
Runtime Error
24
8920
69
a = list(map(int,input().split())) x = int(x[1]) print(x[0]x[1]x[2])
s196638621
p03844
u122495382
1595711965
Python
Python (3.8.2)
py
Runtime Error
23
9020
100
li = input().split() if li[1] == "+": print(int(li[0]+li[2])) else: print(int(li[0]-li[2]))