submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s621042122
p00108
Accepted
while 1: n=int(input()) if n==0: break s=list(map(int,input().split())) cont=0 while 1: tmp=[] for i in range(n): tmp.append(s.count(s[i])) if s==tmp: print(cont) break else: s=tmp cont+=1 for i in range(n): if i != n-1: print(s[i],end=' ') else: print(s[i])
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s443351022
p00108
Accepted
output = [] while True: length = int(input()) if length == 0: break oldList = [int(item) for item in input().split(" ")] operateCount = 0 while True: numberCount = {} for item in oldList: if item in numberCount: numberCount[item] += 1 ...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s197967630
p00108
Accepted
while True: length = int(input()) if length == 0: break oldList = [int(item) for item in input().split(" ")] operateCount = 0 while True: numberCount = {} for item in oldList: if item in numberCount: numberCount[item] += 1 else: ...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s722703722
p00108
Accepted
while 1: n=int(input()) if n==0:break s=list(map(int,input().split())) c=0 while 1: t=s;s=[t.count(e)for e in t] if t==s:break c+=1 print(c);print(*s)
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s920894695
p00108
Accepted
while 1: if'0'==input():break s=list(map(int,input().split())) c=0 while 1: t=s;s=[t.count(e)for e in t] if t==s:break c+=1 print(c);print(*s)
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s733784494
p00108
Accepted
import sys a=sys.stdin while 1: if'0\n'==a.readline():break s=list(map(int,a.readline().split())) c=0 while 1: t=s;s=[t.count(e)for e in t] if t==s:break c+=1 print(c);print(*s)
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s976670392
p00108
Accepted
def get_input(): while True: try: yield ''.join(input()) except EOFError: break while True: N = int(input()) if N == 0: break p = [int(i) for i in input().split()] cnt = 0 while True: flag = True s = [0 for i in range(101)] ...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s726764930
p00108
Accepted
from collections import Counter while True: n = int(input()) if not n: break slst = list(map(int, input().split())) temp = [i for i in slst] ans = 0 while True: ans += 1 counter = Counter() for i in slst: counter[i] += 1 slst = [counter[i] for i in temp] if temp ...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s484953773
p00108
Accepted
from collections import Counter def pr(s): c=0 while 1: b=s t=Counter(s) s=[t[i] for i in s] c+=1 if b==s:break return s,c-1 while 1: le=int(input()) if not le:break s=list(map(int,input().split())) s,c=pr(s) print(c) print(" ".join(map(s...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s699150641
p00108
Accepted
# AOJ 0108 Operation of Frequency of Appearance # Python3 2018.6.18 bal4u f = [0]*105 a = [[0 for j in range(15)] for i in range(2)] while True: n = int(input()) if n == 0: break a[0] = list(map(int, input().split())) a[1] = [0]*n cnt = k1 = 0 while True: for i in range(n): f[a[k1][i]] += 1 k2 = 1-k1 for i...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s637414805
p00108
Accepted
def answer(arr): l, m = [], [] h = {} for num in arr: l.append(num) i = 0 while True: i += 1 h, m = {}, [] for num in l: if h.has_key(num): h[num] += 1 else: h[num] = 1 for num in l: m.appen...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s997860688
p00108
Accepted
def OFA(seq): return [seq.count(e) for e in seq] def find_P(seq): count = 0 prev = seq while True: new = OFA(prev) count += 1 if new == prev: return count - 1, prev prev = new while True: n = int(raw_input()) if n == 0: break c, P = find_P(map(i...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s490490387
p00108
Accepted
while not input()==0: pos=map(int,raw_input().split()) pre=[] c=0 while not pre==pos: pre=pos[:] pos=[pre.count(n) for n in pre] c+=1 print c-1 print " ".join(map(str,pos))
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s787480135
p00108
Accepted
import itertools while 1: n = int(raw_input()) if n == 0: break ss = map(int, raw_input().split()) for i in itertools.count(0): ps = [ss.count(s) for s in ss] if ps == ss: break ss = ps print i print ' '.join(map(str, ps))
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s509944688
p00108
Accepted
while True: n=input() if n==0: break S=list(map(int,raw_input().split())) cnt=0 post=[S.count(S[i]) for i in range(n)] while S<>post: S=post[:] cnt+=1 post=[S.count(S[i]) for i in range(n)] print cnt print " ".join(map(str,post))
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s734666335
p00108
Accepted
import sys import math def solv(s): i = 0 while True: i += 1 c = frequency(s) if c == s: break else: s = c return (i - 1, c) def frequency(lis): lis2 = map(lambda x: count(x, lis), lis) return lis2 def count(n, lis): return len(filter...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s290352939
p00108
Accepted
#!/usr/bin/env python from __future__ import division, print_function from sys import stdin, exit from itertools import count from collections import Counter def main(readline=stdin.readline): counter = Counter() while 1: if not int(readline()): exit() ary = [int(digit) for digit...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s186855500
p00108
Accepted
def foa(a,count): b = a[:] for i in range(len(b)): b[i] = a.count(a[i]) if b == a: print count print " ".join(map(str, b)) return else: return foa(b,count+1) while True: n = int(raw_input()) if n == 0: break a = map(int, raw_input().split()) ...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s805269925
p00108
Accepted
# 辞書型のキーで数字を判別し、バリューにカウンタを用意 # 上記辞書を元に出現頻度操作関数を行う関数を作成し、都度呼び出す # 出現頻度操作関数では不動点を求めるまでループさせ続ける def transport(L,before_L=[],cnt=0): cnt += 1 if L==before_L: print(cnt-2) return cnt L_before = L[:] dic = {} for i in L: dic[i] = 0 for i in L: dic[i] += 1 # 上の2つのfo...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s476892151
p00108
Accepted
from collections import Counter def solve(): N = int(input()) if N == 0: return False *S, = map(int, input().split()) cnt = 0 while 1: c = Counter(S) *T, = map(c.__getitem__, S) if S == T: break S = T cnt += 1 print(cnt) print(*S) ...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s930587658
p00108
Accepted
def getFreequencyStr(arr): datas = [0] * 101 arr2 = [0] * len(arr) # 数を数える for i in range(0,len(arr)): datas[arr[i]] += 1 # 頻出を配列にする for i in range(0,len(arr)): arr2[i] = datas[arr[i]] return arr2 while(1): n = int(input()) changeNum = 0 if n == 0: ...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s906229661
p00108
Accepted
import heapq from collections import deque from enum import Enum import sys import math from _heapq import heappush, heappop import copy from test.support import _MemoryWatchdog BIG_NUM = 2000000000 HUGE_NUM = 99999999999999999 MOD = 1000000007 EPS = 0.000000001 sys.setrecursionlimit(100000) SIZE = 101 table = [None...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s139476529
p00108
Accepted
# coding=utf-8 ### ### for python program ### import sys import math # math class class mymath: ### pi pi = 3.14159265358979323846264338 ### Prime Number def pnum_eratosthenes(self, n): ptable = [0 for i in range(n+1)] plist = [] for i in range(2, n+1): if ptable...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s979997367
p00108
Accepted
def operation(N,point): N_another = [] for i in N: count = 0 for j in N: if i==j: count +=1 N_another.append(count) if N==N_another:return N,point else:return operation(N_another,point+1) while 1: num=int(input()) if num==0:break N=list(map...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s915247821
p00108
Accepted
import copy if __name__ == '__main__': while True: n = int(input()) if n == 0: break line = list(map(int,input().split())) num = len(line) ans = copy.deepcopy(line) tmp = [0]*num cnt = 0 for i,j in enumerate(ans): tmp[i] = line.count(j) while True: if ans == tmp: print(cnt) pri...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s577029305
p00108
Accepted
while 1: n=int(input()) if n==0:break count=0 S_keep=list(map(int,input().split())) while 1: S=[] for i in S_keep: S.append(S_keep.count(i)) if S_keep==S: print(count) print(" ".join(map(str,S))) break else: ...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s092308086
p00108
Accepted
import copy while 1: n = int(input()) if n == 0: break datas = list(map(int, input().split())) prev = copy.deepcopy(datas) curr = [0] * n cnt = 0 while 1: for i, p in enumerate(prev): curr[i] = prev.count(p) if prev == curr: break p...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s162472808
p00108
Accepted
while True: n = int(input()) if n == 0: break s_list = [list(map(int, input().split()))] i = 0 while True: i += 1 s = [] for j in s_list[-1]: s.append(s_list[-1].count(j)) if s == s_list[-1]: break s_list.append(s) print(i -...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s509823215
p00108
Accepted
while True: n = int(input()) if n == 0: break a = list(map(int, input().split())) b = [] cnt = 0 while True: for i in a: b.append(a.count(i)) if a == b: break else: a, b = b[:], [] cnt+=1 print(cnt) print(*a)...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s751920002
p00108
Accepted
while True: n = int(input()) ## n = len(S) if (n==0): break S = list(map(int, input().split())) C = [] for s in S: num = S.count(s) C.append(num) c = 0 #print(c,C) if (C == S): print(c) print(*C) else: while True: copy = C[...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s215814955
p00108
Accepted
while(int(input())): ar = list(map(int, input().split())) n = 0 while(True): br = [ar.count(l) for l in ar] if ar == br: break ar = br n += 1 print(n) print(" ".join(str(e) for e in br))
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s342575952
p00108
Runtime Error
while True: n = int(input()) if n == 0: break s = [] s = list(input().split()) while True: t = [] u = 0 v = 0 for i in range(n): for j in range(n): if s[i] == s[j]: u += 1 t.append(u) t_str = list(map(str, t)) u = 0 if s == t: print(str(v)) print(" ".join(t_str...
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s836242269
p00108
Runtime Error
def FOA(a, count): b = a for i in range(len(b)): b[i] = a.count(a[i]) if b == a: print(count) print(" ".join(map(str, b))) break else: return FOA(b, count + 1) while True: n = int(input()) if n == 0: break a = map(int, input().split()) FOA(a, 0)
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s026319180
p00108
Runtime Error
import sys while 1: n=int(input()) if n==0: break s=list(int(input().split())) cont=0 while 1: tmp=[] for i in range(n): tmp[i]=[s.count(s[i])] if s==temp: print(cont) break else: cont+=1 for i in range(n): if i != n-1: sys.stdout('{0} '.format(s[i])) else: print(s[i])
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s241947646
p00108
Runtime Error
while 1: n=int(input()) if n: s=list(map(int,input().split())) c=0 while 1: t=s;s=[t.count(e)for e in t] if t==s:break c+=1 print(c);print(*s)
10 4 5 1 1 4 5 12 3 5 4 0
3 6 6 4 4 6 6 4 4 6 6
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>出現頻度操作</H1> <p> 有限数列の変換操作に出現頻度操作というものがありま...
s916485369
p00109
Wrong Answer
n=int(input()) for i in range(n): s=input() print(s)
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s761864275
p00109
Wrong Answer
n=int(input()) for i in range(n): print(input())
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s458147210
p00109
Wrong Answer
n=int(input()) s="" for i in range(n): s=raw_input() print(eval(s[0:-1]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s090942526
p00109
Wrong Answer
n=int(input()) s="" for i in range(n): s=input() print(eval(s[0:-1]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s855420459
p00109
Wrong Answer
n=int(input()) for i in range(n): s=input() print(int(eval(s[0:-1])))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s766148793
p00109
Wrong Answer
n=int(input()) for _ in range(n): s=input() s=s.replace("/","//") s=s[:-1:] print(eval(s))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s562412679
p00109
Wrong Answer
for i in range( int(raw_input()) ): print eval( raw_input()[:-1] )
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s919849082
p00109
Wrong Answer
for _ in range( int(raw_input()) ): print int(eval( "1.0+"+raw_input()[:-1] ))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s970155005
p00109
Wrong Answer
for _ in range( int(raw_input()) ): print int(eval( "1.0*"+raw_input()[:-1] ))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s895760480
p00109
Wrong Answer
while True: try: for i in range(int(input())): print(str(int(eval(input().replace('=', ''))))) except: break
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s440226548
p00109
Wrong Answer
# Edit: 2014/09/26 # Lang: Python3 # Time: 0.xxs # if __name__ == "__main__": n = int(input()) for i in range(n): print(eval(input().strip("=").replace("/","//")))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s283592772
p00109
Wrong Answer
# Edit: 2014/09/26 # Lang: Python3 # Time: 0.xxs # if __name__ == "__main__": n = int(input()) for i in range(n): print(eval(input().strip("=").replace("/", "//")))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s665762201
p00109
Wrong Answer
n=input() for _ in [0]*n: print eval(raw_input()[:-1])
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s213049112
p00109
Wrong Answer
def f(s): while 1: b=s.find(")") if b<0: return g(s) a=s[:b].rfind("(") s1=s[a:b+1] s=s.replace(s1,f(s1[1:-1])) def g(s): a="" f=1 x=[] def F(a,b): x.append(a) x.append(b) return 1,"" for c in s: if c=="=": continue elif c in "*/": f,a=F(a,c) elif c in "+-": ...
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s687165641
p00109
Wrong Answer
def f(s): while 1: b=s.find(")") if b<0: return g(s) a=s[:b].rfind("(") s=s.replace(s[a:b+1],f(s[a+1:b])) def g(s): a="" f=1 x=[] def F(a,b): x.append(a) x.append(b) return 1,"" for c in s: if c=="=": continue elif c in "*/": f,a=F(a,c) elif c in "+-": if f==1:...
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s409473586
p00109
Wrong Answer
import sys n = int(input()) while n != 0: s = input() print(eval(s[0:len(s)-1])); n -= 1 sys.stdout.flush()
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s757765244
p00109
Wrong Answer
#!/usr/bin/python3 n = int(input()) for _ in range(n): print(eval(input()[0:-1]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s852246480
p00109
Wrong Answer
#!/usr/bin/python3 import re n = int(input()) for _ in range(n): print(eval(re.sub(r'(\d+/\d+)', r'int(\1)', input()[0:-1])))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s360541813
p00109
Wrong Answer
#!/usr/bin/python3 import re n = int(input()) for _ in range(n): print(int(eval(re.sub(r'(\d+/\d+)', r'int(\1)', input()[0:-1]))))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s790255868
p00109
Wrong Answer
#!/usr/bin/python3 import re n = int(input()) for _ in range(n): expr = input()[0:-1] expr = expr.replace('/', '//'); print(eval(expr))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s245427450
p00109
Wrong Answer
N = int(raw_input()) for loop in xrange(N): print eval(raw_input()[:-1].replace("/","//"))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s508864554
p00109
Wrong Answer
N = int(raw_input()) for loop in xrange(N): print eval(raw_input()[:-1])
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s700256345
p00109
Wrong Answer
for i in xrange(int(raw_input())): s = raw_input() print eval(s[:-1])
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s262288521
p00109
Wrong Answer
n = input() for i in range(n): print eval(raw_input().strip("="))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s526401282
p00109
Wrong Answer
for _ in range(int(input())):print(eval(input()[:-1]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s735832317
p00109
Wrong Answer
for _ in range(int(input())):print(eval(input()[:-1].replace('/', '//')))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s504974748
p00109
Wrong Answer
for _ in range(int(input())):print(int(eval(input()[:-1])))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s333757120
p00109
Wrong Answer
for _ in range(input()):print(eval(raw_input()[:-1]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s219106049
p00109
Wrong Answer
def up_to_you(formula): l_p = None r_p = None for i, c in enumerate(formula): if c == '(': l_p = i elif c == ')': r_p = i break else: print fx(formula) return r = fx(formula[l_p+1:r_p]) n_formula = formula[:l_p]+r+formula[r...
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s754294427
p00109
Wrong Answer
ol = input() for oi in xrange(ol): s = raw_input() s = s[:-1] r = eval(s) print r
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s258928785
p00109
Wrong Answer
def seekBackOperatorInLand(op,s): depth = 0 for i in xrange(len(s)-1,-1,-1): if s[i]==')': depth+=1 if s[i]=='(': depth-=1 if s[i]==op and depth==0: return i return None def calc(s): if all(map(lambda t: t in "0123456789", s)): return int(s) if s[0]=='(' and s[-1]==')' and all(map(lambda t: t!='(' and t!=...
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s595365555
p00109
Wrong Answer
def seekBackOperatorInLand(op,s): depth = 0 for i in xrange(len(s)-1,-1,-1): if s[i]==')': depth+=1 if s[i]=='(': depth-=1 if s[i]==op and depth==0: return i return None def calc(s): if all(map(lambda t: t in "0123456789", s)): return int(s) if s[0]=='(' and s[-1]==')' and all(map(lambda t: t!='(' and t!=...
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s813205140
p00109
Wrong Answer
def seekBackOperatorInLand(op,s): depth = 0 for i in xrange(len(s)-1,-1,-1): if s[i]==')': depth+=1 if s[i]=='(': depth-=1 if s[i]==op and depth==0: return i return None def calc(s): if all(map(lambda t: t in "0123456789", s)): return int(s) p = seekBackOperatorInLand('-',s) if not p is None: return ca...
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s534342420
p00109
Wrong Answer
def seekBackOperatorInLand(op,s): depth = 0 for i in xrange(len(s)-1,-1,-1): if s[i]==')': depth+=1 if s[i]=='(': depth-=1 if s[i]==op and depth==0: return i return None def calc(s): if s=='': return 0 if all(map(lambda t: t in "0123456789", s)): return int(s) p = seekBackOperatorInLand('+',s) if n...
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s653736864
p00109
Wrong Answer
def seekBackOperatorInLand(op,s): depth = 0 for i in xrange(len(s)-1,-1,-1): if s[i]==')': depth+=1 if s[i]=='(': depth-=1 if s[i]==op and depth==0: return i return None def calc(s): if s=='': return 0 if all(map(lambda t: t in "0123456789", s)): return int(s) p = seekBackOperatorInLand('+',s) if n...
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s949228098
p00109
Wrong Answer
n = int(raw_input()) for i in range(n): print eval(raw_input()[:-1])
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s206233427
p00109
Wrong Answer
n = int(raw_input()) for i in range(n): print eval(raw_input()[:-1])
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s362474683
p00109
Wrong Answer
n = int(raw_input()) for i in range(n): print int(eval(raw_input()[:-1]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s588670679
p00109
Wrong Answer
n = input() for i in range(int(n)): command = input() answer = eval(command[0:-1]) print(answer)
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s473158260
p00109
Wrong Answer
n=int(input()) for t in range(n): s=input() s=s[:-1] print(eval(s))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s149737729
p00109
Wrong Answer
n=int(input()) for t in range(n): print(eval(input()[:-1].replace("/","//")))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s350411583
p00109
Wrong Answer
n=int(input()) for t in range(n): s=input() s=s[:-1] s=s.replace("/","//") print(eval(s))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s492978544
p00109
Wrong Answer
n = int(input()) [print(eval(input()[:-1])) for i in range(n)]
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s795671711
p00109
Wrong Answer
n = input() for i in range(n): s = raw_input()[:-1] print eval(s)
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s425223439
p00109
Wrong Answer
n=int(input()) for T in range(n): s=input()[0:-1] s=s.replace('/','//') print(eval(s))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s941714323
p00109
Wrong Answer
import sys input() for i in sys.stdin.readlines(): print(eval(i[:-2]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s459833604
p00109
Wrong Answer
import sys input() for i in sys.stdin.readlines(): print(eval(i[:-2].replace('/', '//')))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s442686990
p00109
Wrong Answer
import sys input() for i in sys.stdin.readlines(): print(int(eval(i[:-2].replace('/', '//'))))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s475862839
p00109
Wrong Answer
import sys input() for i in sys.stdin.readlines(): print(int(eval(i[:-2])))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s870563652
p00109
Wrong Answer
n=int(input()) for i in range(n): a=input() print(eval(a[:len(a)-1]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s142203528
p00109
Wrong Answer
n=int(input()) for i in range(n): a=input() print(int(eval(a[:len(a)-1])))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s089560111
p00109
Wrong Answer
n=int(input()) for i in range(n): a=input() b="" for i in a: b+=i if i=='/':b+='/' print(int(eval(a[:len(a)-1])))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s143977228
p00109
Wrong Answer
n=int(input()) for i in range(n): a=input() b="" for i in a: b+=i if i=='/':b+='/' print(int(eval(b[:len(b)-1])))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s471267879
p00109
Wrong Answer
n=int(input()) for i in range(n): a=input() b="" for i in a: b+=i if i=='/':b+='/' print(eval(b[:len(b)-1]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s927943903
p00109
Wrong Answer
n=int(input()) for i in range(n):print(eval(input()[:-1].replace('/','//')))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s654624712
p00109
Wrong Answer
n = int(input()) for i in range(n): s = input() print(s)
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s819566443
p00109
Wrong Answer
n = int(input()) for i in range(n): s = raw_input().split('=') print(eval(s[0]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s716110826
p00109
Wrong Answer
import re n = int(input()) for i in range(n): s = raw_input().split('=') print(s) print(eval(s[0]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s285304408
p00109
Wrong Answer
import re n = int(input()) for i in range(n): s = raw_input().split('=') print(eval(s[0]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s649184728
p00109
Wrong Answer
import re n = int(input()) for _ in range(n): expr = input()[0:-1] print(eval(expr))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s543065846
p00109
Wrong Answer
# -*- coding: utf-8 -*- if __name__ == '__main__': num = int(raw_input()) for i in range(num): input_line = raw_input() eval_line = input_line[0:-1] result = eval(eval_line) print result
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s147421570
p00109
Wrong Answer
# -*- coding: utf-8 -*- num = int(raw_input()) for i in range(num): input_line = raw_input() eval_line = input_line[0:-1] result = eval(eval_line) print result
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s699687759
p00109
Wrong Answer
n = int(input()) for i in range(n): s = input() print(eval(s[:-1:]))
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s258408623
p00109
Wrong Answer
def calc(eqt): l = eqt.split("+",maxsplit=1) if len(l) == 2: return (calc(l[0])+calc(l[1])) l = eqt.split("-",maxsplit=1) if len(l) == 2: return (calc(l[0])-calc(l[1])) l = eqt.split("*",maxsplit=1) if len(l) == 2: return (calc(l[0])*calc(l[1])) l = eqt.split("/",maxsplit=1) if len(l) == 2: ...
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...
s780731728
p00109
Wrong Answer
while True: try: n=int(input()) datasets=[input() for i in range(0,n)] for line in datasets: l = line.split("=",maxsplit=1)[0] print(int(eval(l))) except EOFError: break
2 4-2*3= 4*(8+4+3)=
-2 60
<H1>Smart Calculator</H1> <p> Your task is to write a program which reads an expression and evaluates it. </p> <ul> <li>The expression consists of numerical values, operators and parentheses, and the ends with '='.</li> <li>The operators includes +, - , *, / where respectively represents, addition, subtraction, mul...