submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s884302893
p00099
Accepted
# AOJ 0099 Surf Smelt Fishing Contest II # Python3 2018.6.22 bal4u import heapq MAX = 1000000 SFT = 20 # 2**20 = 1048576 > MAX Q = [] # tbl[0:キー, 1:Magic] tbl = [[0 for j in range(2)] for i in range(MAX+2)] n, q = list(map(int, input().split())) for i in range(q): id, v = list(map(int, input().split())) tbl[id][0] ...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s018190656
p00099
Accepted
# AOJ 0099 Surf Smelt Fishing Contest II # Python3 2018.6.22 bal4u import heapq MAX = 1000000 SFT = 20 # 2**20 = 1048576 > MAX Q = [] # tbl[0:キー, 1:Magic] n, q = list(map(int, input().split())) tbl = [0]*(n+1) for i in range(q): id, v = list(map(int, input().split())) tbl[id] += v heapq.heappush(Q, ((-tbl[id] << S...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s815402042
p00099
Accepted
# AOJ 0099 Surf Smelt Fishing Contest II # Python3 2018.6.22 bal4u import heapq SFT = 20 # 2**20 = 1048576 > MAX(1000000) Q = [] n, q = list(map(int, input().split())) tbl = [0]*(n+1) for i in range(q): id, v = list(map(int, input().split())) tbl[id] += v f = tbl[id] heapq.heappush(Q, ((-f << SFT)|id, id, f)) whi...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s671704820
p00099
Accepted
import heapq n,q = map(int,raw_input().split()) p = [0] * (n+1) h = [] for u in xrange(q): a,v = map(int,raw_input().split()) p[a] += v heapq.heappush(h,[-p[a],a]) while True: top = heapq.heappop(h) if p[top[1]] == -top[0]: print "{} {}".format(top[1],-top[0]) hea...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s518085915
p00099
Accepted
from collections import defaultdict n,q=map(int,raw_input().split()) va=defaultdict(set) av=defaultdict(int) for i in range(q): a,v=map(int,raw_input().split()) try: va[av[a]].remove(a) if va[av[a]]==set([]): del va[av[a]] except KeyError: pass av[a]+=v va[av[a]]....
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s479039440
p00099
Accepted
#!/usr/bin/env python from __future__ import division, print_function from sys import stdin, exit def main(readline=stdin.readline): n, q = (int(s) for s in readline().split()) base = [0] * n midway = [0] * (n//100 + 1) last = [0] * (n//10000 + 1) for _ in range(q): a, v = (int(s) for s ...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s386018716
p00099
Accepted
n, q = map(int, raw_input().split()) fish = [0] * n ans1 = 0 ans2 = 0 for i in range(q): a, v = map(int, raw_input().split()) fish[a-1] = fish[a-1] + v if ans1 == a and v < 0: ans1 = fish.index(max(fish)) + 1 ans2 = max(fish) elif ans2 < fish[a-1]: ans1 = a ans2 = fish[a-1] elif ans2 == fish[a-1] and a < a...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s050210818
p00099
Accepted
n, q = map(int, raw_input().split()) s = [0]*n mx,mxa = 0, 0 for i in range(q): a,v = map(int, raw_input().split()) s[a-1] += v if v > 0: if s[a-1] > mx: mx = s[a-1] mxa = a-1 elif s[a-1] == mx: if a-1 < mxa: mxa = a-1 elif v < 0: if a-1 == mxa: mx = max(s) mxa = s.index(mx) print mxa+1,mx
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s875982690
p00099
Accepted
def solve(): import heapq from sys import stdin lines = stdin n, q = map(int, lines.readline().split()) # hq element: [number of caught fish, participant number] hq = [(0, i) for i in range(1, n + 1)] heapq.heapify(hq) fish = [0] * (n + 1) # number of caught fish ans =...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s894537223
p00099
Accepted
[n,q] = map(int,input().split()) t = [ 0 for _ in range(n) ] max_idx = 0 max_val = 0 for _ in range(q): [a,v] = map(int,input().split()) t[a-1] += v if max_idx == a-1: if v > 0: max_val = t[a-1] else: max_val = max(t) max_idx = t.index(max_val) ...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s406003702
p00099
Accepted
n, q = map(int, input().split()) result = [0 for i in range(n + 1)] max_a = -1 max_v = 0 for i in range(q): a, v = map(int, input().split()) result[a] += v if result[a] > max_v: max_a = a max_v = result[a] elif result[a] == max_v: if a < max_a: max_a = a elif a =...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s203531064
p00099
Runtime Error
class SegmentTree: def __init__(self, n): n_ = 1 while n_ < n: n_ *= 2 self.n = n_ self.data = [[0, -n_] for i in xrange(2*n_)] def add(self, k, a): idx = k + (self.n-1) data = self.data data[idx] = [data[idx][0] + a, -k] print data, idx, data[idx...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s476148805
p00099
Runtime Error
class SegmentTree: def __init__(self, n): n_ = 1 while n_ < n: n_ *= 2 self.n = n_ self.data = [(0, -n_-1)] * (2*n_) def add(self, k, a): idx = k + (self.n-1) data = self.data data[idx] = (data[idx][0] + a, -k) while idx: idx = (idx - ...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s249199137
p00099
Runtime Error
n, q = list(map(int, input().split())) cnt = [0 for _ in range(n + 1)] cnt[0] = -1 mx = [0, -1] for _ in range(q): a, v = list(map(int, input().split())) cnt[a] += v if mx[0] == a and v > 0: mx[1] += v elif mx[0] == a and v < 0: def spam(): max_v = max(cnt) idx =...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s319946515
p00099
Runtime Error
n, q = list(map(int, input().split())) cnt = [0 for _ in range(n + 1)] cnt[0] = -1 mx = [0, -1] def spam(): max_v = max(cnt) idx = min([i for i, value in enumerate(cnt) if value == max_v]) return idx, max_v for _ in range(q): a, v = list(map(int, input().split())) cnt[a] += v if mx[0] == a an...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s566254758
p00099
Runtime Error
n, q = list(map(int, input().split())) cnt = [0 for _ in range(n + 1)] cnt[0] = -1 mx = [0, -1] def spam(): # max_v = max(cnt) # idx = min([i for i, value in enumerate(cnt) if value == max_v]) # return idx, max_v return 1,1 for _ in range(q): a, v = list(map(int, input().split())) cnt[a] += v ...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s218060094
p00099
Runtime Error
n, q = [int(el) for el in input().split(' ')] data = [0] * n ex_result = 0 for _ in range(q): a, v = [int(el) for el in input().split(' ')] data[a-1] += v if v < 0: result = ex_result else: result = max(data) print(data.index(result)+1, result) ex_result = result
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s667386160
p00099
Runtime Error
n, q = [int(el) for el in input().split(' ')] data = [0] * n ex_result = 0 for _ in range(q): a, v = [int(el) for el in input().split(' ')] data[a-1] += v result = max(data) print(data.index(result)+1, result) ex_result = result
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s553904387
p00099
Runtime Error
n, q = [int(el) for el in input().split(' ')] data = [0] * n ex_result, exx_result = 0,0 ex_index = 0 for _ in range(q): a, v = [int(el) for el in input().split(' ')] data[a-1] += v if ex_index != a: if v < 0: result = ex_result else: result = max(ex_result, data[a-1]) elif ex_index == a...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s490399122
p00099
Runtime Error
n, q = [int(el) for el in input().split(' ')] data = [0] * n ex_result, exx_result = 0,0 ex_index = 0 for _ in range(q): a, v = [int(el) for el in input().split(' ')] data[a-1] += v if ex_index != a: if v < 0: result = ex_result else: result = max(ex_result, data[a-1]) elif ex_index == a...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s026405578
p00099
Runtime Error
n, q = [int(el) for el in input().split(' ')] data = [0] * n ex_result,exx_result = 0,0 ex_index = 0 for _ in range(q): a, v = [int(el) for el in input().split(' ')] data[a-1] += v if ex_index != a: if v < 0: result = ex_result else: result = max(ex_result, data[a-1]) elif ex_index == a:...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s625375989
p00099
Runtime Error
n, q = [int(el) for el in input().split(' ')] data = [0] * n ex_result, exx_result = 0, 0 ex_index, exx_index = 0, 0 for _ in range(q): a, v = [int(el) for el in input().split(' ')] data[a-1] += v if ex_index != a: if v < 0: result = ex_result else: result = max(ex_result, data[a-1]) el...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s110207452
p00099
Runtime Error
#-*- coding: utf_8 -*- a = [int(x) for x in input().split()] n, q = a[0], a[1] memo = [0] * n for i in range(q): debug(memo) nq = [int(x) for x in input().split()] a, v = nq[0] - 1, nq[1] memo[a] += v mx = max(memo) print(str(memo.index(mx) + 1) + " " + str(mx))
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s848386417
p00099
Runtime Error
import bisect from math import modf [n,q]=map(int,raw_input().split()) decp=1./(n+2) A=[0 for i in range(n+1)] B=[1-decp*(i+1) for i in range(n)] for i in range(q): [a,v]=map(int,raw_input().split()) pp=A[a]+ (1-decp*(a+1)) A[a]+=v remind=bisect.bisect_left(B,pp) B.pop(remind) bisect.insort(B,...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s038553195
p00099
Runtime Error
import bisect from math import modf [n,q]=map(int,raw_input().split()) decp=1./(n+2) A=[0 for i in range(n+1)] B=[1-decp*(i+1) for i in range(1,n+1)] B.sort() for i in range(q): [a,v]=map(int,raw_input().split()) pp=A[a]+ (1-decp*(a+1)) A[a]+=v remind=bisect.bisect_left(B,pp) B.pop(remind) bise...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s765578406
p00099
Runtime Error
n, q = map(int, input().split()) n = [0]*(n+1) maxv = winner = 0 for _ in range(q): a, v = map(int, input().split()) n[a] += v if v < 0: maxv, winner = max(n), n.index(maxv) else: if n[a] > maxv: maxv, winner = n[a], a elif n[a] == maxv: winner = n.index(m...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s131132109
p00099
Runtime Error
from collections import deque n, q = [int(_) for _ in input().split()] book = deque() for _ in range(n+1) : book.append(0) for _ in range(q) : a, v = [int(_2) for _2 in input().split()] book[a] += v print(book.index(max(book)), max(book))
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s954450917
p00099
Runtime Error
from array import array n, q = [int(_) for _ in input().split()] book = array('b', [0] * (n+1)) for _ in range(q) : a, v = [int(_2) for _2 in input().split()] book[a] += v print(book.index(max(book)), max(book))
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s428094323
p00099
Runtime Error
from array import array n, q = [int(_) for _ in input().split()] book = array('b', [0] * (n+1)) max_per, max_val = n, 0 for _ in range(q) : a, v = [int(_2) for _2 in input().split()] book[a] += v if 0 <= v : if max_val < book[a] : max_per, max_val = a, book[a] elif max_val == book[a] and a <...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s869901623
p00099
Runtime Error
from sys import stdin n = [int(_) for _ in input().split()] book = [0]*(n[0]+1) max_per, max_val = [int(_) for _ in input().split()] book[max_per] += max_val print(max_per, max_val) for _ in stdin.read().splitlines() : a = [int(_2) for _2 in _.split()] book[a[0]] += a[1] if a[1] < 0 : for _2 in [N...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s612191459
p00099
Runtime Error
from sys import stdin n = [int(_) for _ in input().split()] book = [0]*(n[0]+1) max_per, max_val = [int(_) for _ in input().split()] book[max_per] += max_val print(max_per, max_val) for _ in stdin.read().splitlines() : a = [int(_2) for _2 in _.split()] book[a[0]] += a[1] if a[1] < 0 : for _2 in [N...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s073100777
p00099
Runtime Error
from sys import stdin n = [int(_) for _ in input().split()] book = [0]*(n[0]+1) max_per, max_val = [int(_) for _ in input().split()] book[max_per] += max_val print(max_per, max_val) for _ in stdin.read().splitlines() : a = [int(_2) for _2 in _.split()] book[a[0]] += a[1] if a[1] < 0 : for _2 in [N...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s691756483
p00099
Runtime Error
n,q=map(int,input().split()) s=[0]*-~n w=m=0 for _ in[0]*q: a,v=map(int,input().split()) s[a]+=v if v<0 and a==w:m=max(s),w=s.index(m) elif s[a]>maxv:w,m=a,s[a] elif s[a]==maxv:w=min(w,a) print(w,m)
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s113965153
p00099
Runtime Error
n,q=map(int,input().split()) s=[0]*-~n w=m=0 for _ in[0]*q: a,v=map(int,input().split()) s[a]+=v if v<0 and a==w:m=max(s);w=s.index(m) elif s[a]>maxv:w,m=a,s[a] elif s[a]==maxv:w=min(w,a) print(w,m)
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s814583547
p00099
Runtime Error
#!/usr/bin/env python from __future__ import division, print_function from sys import stdin, exit from collections import Counter def keyfunc(data): return (data[1], -data[0]) def main(readline=stdin.readline): n, q = (int(s) for s in readline().split()) base = tuple([i+1, 0] for i in range(n)) mid...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s038599327
p00099
Runtime Error
#!/usr/bin/env python from __future__ import division, print_function from sys import stdin, exit, maxsize def main(readline=stdin.readline): n, q = (int(s) for s in readline().split()) base = [0] * n midway = [(1, -maxsize)] * (n//100 + 1) last = [(1, -maxsize)] * (n//10000 + 1) for _ in range(...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s559478438
p00099
Runtime Error
#!/usr/bin/env python from __future__ import division, print_function from sys import stdin, exit, maxsize def main(readline=stdin.readline): n, q = (int(s) for s in readline().split()) base = [0] * n midway = [0] * (n//1000 + 1) for _ in range(q): a, v = (int(s) for s in readline().split())...
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s483336810
p00099
Runtime Error
n, q = map(int, raw_input().split()) s = [0 for i in range(n)] a = [map(int, raw_input().split()) for i in range(q)] for r in a: s[r[0]] += r[1] mx = max(s) print s.index(mx)+1, mx
3 5 1 4 2 5 1 3 3 6 2 7
1 4 2 5 1 7 1 7 2 12
<H1>ワカサギ釣り大会 2</H1> <p> 桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。 </p> <p> 参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。 </p> <H2>入力</H2> <p> 入力は以下の形式で与えられる。 </p> <pre> <var>n</var> <va...
s363115798
p00100
Wrong Answer
while True: n = int(input()) if n == 0: break data = {} ans = [] for i in range(n): tmp = list(map(int, input().split(' '))) if tmp[0] in data: data[tmp[0]] += tmp[1] * tmp[2] else: data[tmp[0]] = tmp[1] * tmp[2] for k, v in data.items(): ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s613028662
p00100
Wrong Answer
while True: n = int(input()) if n == 0: break data = {} ans = [] for i in range(n): tmp = list(map(int, input().split(' '))) if tmp[0] in data: data[tmp[0]] += tmp[1] * tmp[2] else: data[tmp[0]] = tmp[1] * tmp[2] if max(data.values()) < 1000000: ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s700407321
p00100
Wrong Answer
while True: n = int(raw_input()) if n == 0: break sale = {} for i in range(n): n,p,q = map(int,raw_input().split()) if n in sale: sale[n] += p * q else: sale[n] = p * q existflag = False for n in sale: if(sale[n] ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s408006975
p00100
Wrong Answer
while True: n = int(raw_input()) if n == 0: break sale = {} for i in range(n): j,p,q = map(int,raw_input().split()) if j in sale: sale[j] += p * q else: sale[j] = p * q existflag = False for j in sale: if(sale[j] ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s715455885
p00100
Wrong Answer
class sresult(): def judge(self,n): list={} list2=[] for i in range(0,n): str=raw_input() array=str.split(" ") no=int(array[0]) x=no sale=int(array[1]) sold=int(array[2]) if x in list: list[no]+=sale*sold if list[no]>=1000000 and x not in list2: list2.append(no) else : ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s189159357
p00100
Wrong Answer
# Edit: 2014/09/25 # Lang: Python3 # Time: 0.xxs # if __name__ == "__main__": while True: d = {} n = int(input()) if not n: break # exit at n=0 for i in range(n): s, p, m = map(int, input().strip("\n").split(" ")) # s:社員番号, p:価格, m:販売戸数 ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s037116422
p00100
Wrong Answer
# Edit: 2014/09/25 # Lang: Python3 # Time: 0.xxs # if __name__ == "__main__": while True: d = {} n = int(input()) if not n: break # exit at n=0 for i in range(n): s, p, m = map(int, input().strip("\n").split(" ")) # print(s, p, m) ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s677919905
p00100
Wrong Answer
import collections while 1: li=collections.defaultdict(int) n=int(input()) if n==0: break for i in range(n): (emp,prc,num)=list(map(int,input().split())) li[emp]+=prc*num tmp=True for i,j in li.items(): if j>=1000000: print(i) tmp=False if tmp: print("NA") li.clear()
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s476726021
p00100
Wrong Answer
def f(n): D={} for _ in range(n): a,b,c=map(int,raw_input().split(' ')) if a in D: D[a]+=b*c else: D[a]=b*c B=[e for e in D.keys() if D[e]>=1e6] if B==[]: B=["NA"] return B while 1: n=input() if n==0:break for e in f(n): print e
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s846242446
p00100
Wrong Answer
def f(n): D={} for _ in range(n): a,b,c=map(int,raw_input().split(' ')) if a in D: D[a]+=b*c else: D[a]=b*c B=[i for i,e in D.items() if e>=1e6] if B==[]: B=["NA"] return B while 1: n=input() if n==0:break for e in f(n): print e
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s778705258
p00100
Wrong Answer
while True: n=int(input()) if n: f=True a=[list(map(int,input().split())) for _ in range(n)] for i in range(n): if a[i][1]*a[i][2]>=1000000: print(a[i][0]) f=False if f: print("NA") else: break
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s022159493
p00100
Wrong Answer
while True: n=int(input()) if n: a=[list(map(int,input().split())) for _ in range(n)] b={} for i in range(n): if a[i][0] in b: b[a[i][0]]+=a[i][1]*a[i][2] else: b[a[i][0]]=a[i][1]*a[i][2] for k in b.keys(): if b[k]>=1000000: print(k) if max(b.values())<1000000: print("NA") else: b...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s598245292
p00100
Wrong Answer
while True: n=int(input()) if n: a=[list(map(int,input().split())) for _ in range(n)] d={} for i in range(n): if a[i][0] in d: d[a[i][0]]+=a[i][1]*a[i][2] else: d[a[i][0]]=a[i][1]*a[i][2] print(d) for k in d.keys(): if d[k]>=1000000: print(k) if max(d.values())<1000000: print("NA")...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s037548714
p00100
Wrong Answer
while True: n=int(input()) if n: a=[list(map(int,input().split())) for _ in range(n)] d={} for i in range(n): if a[i][0] in d: d[a[i][0]]+=a[i][1]*a[i][2] else: d[a[i][0]]=a[i][1]*a[i][2] for k in d.keys(): if d[k]>=1000000: print(k) if max(d.values())<1000000: print("NA") else: b...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s220856826
p00100
Wrong Answer
while True: n=int(input()) if n==0: break a=[list(map(int,input().split())) for _ in range(n)] d={} for i in range(n): if a[i][0] in d: d[a[i][0]]+=a[i][1]*a[i][2] else: d[a[i][0]]=a[i][1]*a[i][2] for k in d.keys(): if d[k]>=1000000: print(k) if max(d.values())<1000000: print("NA")
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s591488713
p00100
Wrong Answer
while True: n=int(input()) if n==0: break d={} for i in range(n): a,b,c=list(map(int,input().split())) if a in d: d[a]+=b*c else: d[a]=b*c if max(d.values())<1000000: print("NA") else: for k in d.keys(): if d[k]>=1000000: print(k)
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s348725855
p00100
Wrong Answer
def f(n): D = {} for _ in [0]*n: a,b,c = map(int,raw_input().split(' ')) try: D[a] += b*c except: D[a] = b*c B = [i for i,e in D.items() if e>=1e6] if not B: B=["NA"] return B while 1: n = int(raw_input()) if n==0: break for e in f(n): print e
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s531233294
p00100
Wrong Answer
def f(n): D = {} for _ in [0]*n: a,b,c = map(int,raw_input().split(' ')) try: D[a] += b*c except: D[a] = b*c B = [i for i,e in D.items() if e>=1e6] if B==[]: B=["NA"] return B while 1: n = int(raw_input()) if n==0: break for e in f(n): print e
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s669980499
p00100
Wrong Answer
# -*- coding: utf-8 -*- while True: n = int(raw_input()) if n == 0: break else: IDdic={} for k in range(n): ID, p, q = map(int,raw_input().split()) if ID not in IDdic: IDdic[ID] = p*q elif ID in IDdic: IDdic[ID] +=...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s122078283
p00100
Wrong Answer
# -*- coding: utf-8 -*- while True: n = int(raw_input()) if n == 0: break else: IDdic={} for k in range(n): ID, p, q = map(int,raw_input().split()) if ID not in IDdic: IDdic[ID] = [k, p*q] elif ID in IDdic: IDdic[I...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s690060689
p00100
Wrong Answer
# -*- coding: utf-8 -*- while True: n = int(raw_input()) if n == 0: break else: IDdic={} for k in range(n): ID, p, q = map(int,raw_input().split()) if ID not in IDdic: IDdic[ID] = [k, p*q] elif ID in IDdic: IDdic[I...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s897697193
p00100
Wrong Answer
while True: try: n=int(input()) except: break if n==0: break data=[] for i in range(n): spam=[x for x in map(int,input().split())] if spam[1]*spam[2]>=1000000: if (spam[0] in [b[0] for b in data])==False: data.append(spam) if le...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s673022628
p00100
Wrong Answer
while 1: n = int(raw_input()) if n == 0: break for i in range(n): x, y, z = map(int, raw_input().split()) if y*z >= 1000000: print x else: print "NA"
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s049756356
p00100
Wrong Answer
while True: num = int(raw_input()) if num == 0: exit() d = {} cnt = 0 for i in range(num): uid, p, q = map(int, raw_input().split(" ")) if d.has_key(uid): d[uid] += p * q else: d[uid] = p * q sorted(d.items()) for i in d: if d[i] >= 1000000: prin...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s713703241
p00100
Wrong Answer
while True: num = int(raw_input()) if num == 0: exit() d = {} for i in range(num): uid, p, q = map(int, raw_input().split()) if d.has_key(uid): d[uid] += p * q else: d[uid] = p * q if max(d.values()) < 1000000: print "NA" else: reversed(d.items()) for i ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s754478325
p00100
Wrong Answer
while True: n=int(input()) if n==0:break data={} staff=[] for i in range(n): tmp=list(map(int,input().split(' '))) if tmp[0] in data: data[tmp[0]]+=tmp[1]*tmp[2] else: data[tmp[0]]=tmp[1]*tmp[2] staff.append(tmp[0]) if max(data.va...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s146295469
p00100
Wrong Answer
N = int(raw_input()) dic = {} for i in range(N): n, p, q = map(int, raw_input().split()) if not n in dic: dic[n] = [i,p*q] else: dic[n][1] = dic[n][1]+p*q lis = [(v[0], k) for k, v in dic.items() if v[1] >= 1000000] if lis: for t in sorted(lis, key=lambda x: x[0]): print...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s227852903
p00100
Wrong Answer
while True: n = int(raw_input()) if n == 0: break dict = {} list = [] for i in xrange(n): a,b,c = map(int,raw_input().split()) if a in dict: dict[a] = dict[a] + b * c else: dict[a] = b * c for var in dict: if dict[var] >= 1000000: list.append(var) if len(list) == 0: list.append(...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s549669923
p00100
Wrong Answer
while True: n = int(raw_input()) if n == 0: break dict = {} for i in xrange(n): num,a,b = map(int,raw_input().split()) if num in dict: dict[num] += a * b else: dict[num] = a * b judge = True for var in dict: if dict[var] >= 1000000: print var judge = False if judge: print "NA"
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s360785651
p00100
Wrong Answer
while True: n = int(raw_input()) if n == 0: break dict = {} for i in xrange(n): num,a,b = map(long,raw_input().split()) if num in dict: dict[num] += a * b else: dict[num] = a * b judge = True for var in dict: if dict[var] >= 1000000: print var judge = False if judge: print "NA"
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s276891488
p00100
Wrong Answer
while True: n = int(raw_input()) if n == 0: break dict = {} for i in xrange(n): num,a,b = map(long,raw_input().split()) if num in dict: dict[num] += a * b else: dict[num] = a * b judge = True for var in dict: if dict[var] >= 1000000L: print var judge = False if judge: print "NA" prin...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s446740212
p00100
Wrong Answer
import sys from collections import OrderedDict data = OrderedDict() for line in sys.stdin: lst = line.split(' ') if len( lst ) < 2: cnt = 0 for key, val in data.items(): if va...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s759115460
p00100
Wrong Answer
import sys def func(num): dict = {} for i in range(len(num)): if num[i][0] not in dict.keys(): dict[num[i][0]] = int(num[i][1]) * int(num[i][2]) else: dict[num[i][0]] = dict[num[i][0]] + int(num[i][1]) * int(num[i][2]) list = dict.keys() flag = 0 for i in list: ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s660933096
p00100
Wrong Answer
while True: n = int(raw_input()) if n == 0: break employee_no = [] info = {} for r in range(n): no,unit_price,quantity = map(int, raw_input().split(' ')) if no in info: info[no] += unit_price*quantity else: info[no] = unit_price*quantity employee_no.append(no) employee_no = list(set(employee_no)) ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s561732616
p00100
Wrong Answer
while True: n = int(input()) if n == 0: break c = 0 d = {} for i in range(n): num,x,y = map(int,input().split()) if num in d: d[num] = d[num] + x*y else: d[num] = x*y for i in d: if d[i] >= 1000000: print(i) c += 1 if c == 0: print('NA')
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s831705723
p00100
Wrong Answer
while True: N = int(input()) if N == 0: break fla = False for n in range(N): num, p, q = map(int, input().split()) if p*q >= 1000000: print(num) fla = True else: if not fla: print('NA')
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s638625455
p00100
Wrong Answer
num = int(input()) if not num: exit() data = [[int(el) for el in input().split(' ')] for _ in range(num)] result = [print(i) for i,j,k in data if j*k >= 1e6] if not result: print('NA')
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s799402663
p00100
Wrong Answer
while True: num = int(input()) if not num: break data = [[int(el) for el in input().split(' ')] for _ in range(num)] result = [print(i) for i,j,k in data if j*k >= 1e6] if not result: print('NA')
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s362038012
p00100
Wrong Answer
while True: num = int(input()) if not num: break data = [[int(el) for el in input().split(' ')] for _ in range(num)] tmp = [i for i,j,k in data if j*k >= 1e6] seen = set() seen_add = seen.add result = [x for x in tmp if x not in seen and not seen_add(x)] if not result: pr...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s845978596
p00100
Wrong Answer
while True: try: num = int(input()) except: break data = [[int(el) for el in input().split(' ')] for _ in range(num)] tmp = [i for i,j,k in data if j*k >= 1e6] seen = set() seen_add = seen.add result = [x for x in tmp if x not in seen and not seen_add(x)] if not result: ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s677117401
p00100
Wrong Answer
while True: num = int(input()) if not num: break result = {} for _ in range(num): x, y, z = [int(el) for el in input().split(' ')] if x in result: result[x] += y*z else: result[x] = y*z res = [print(k) for k,v in result.items() if v >= 1e6] if not ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s915805667
p00100
Wrong Answer
while True: n = int(input()) if n == 0: break data = {} for i in range(n): tmp = list(map(int, input().split(' '))) if tmp[0] in data: data[tmp[0]] += tmp[1] * tmp[2] else: data[tmp[0]] = tmp[1] * tmp[2] if max(data.values()) < 1000000: p...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s208643097
p00100
Wrong Answer
#!/usr/bin/env python3 import sys input_lines = sys.stdin.readlines() cnt = 0 dataset = [] for i in input_lines: print('s')
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s836913124
p00100
Wrong Answer
while 1: n=input() if n==0:break a=[0]*n s=[] for i in xrange(n): a[i]=map(int,raw_input().split()) for i in xrange(n): if a[i][1]*a[i][2]>=10**6: s.append(a[i][0]) else: pass if s==[]: print("NA") else: for i in xrange(len(...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s602094755
p00100
Wrong Answer
n = int(raw_input()) while n != 0: pass_flag = 0 for x in range(0, n): data = raw_input() data_list = data.split(' ') if int(data_list[1]) * int(data_list[2]) >= 1000000: pass_flag = 1 print data_list[0] if pass_flag == 0: print 'NA' n = int(raw_in...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s189956953
p00100
Wrong Answer
n = int(raw_input()) while n != 0: pass_flag = 0 sales_dict = {} for x in range(0, n): data = raw_input() data_list = data.split(' ') if not sales_dict.has_key(data_list[0]): sales_dict[data_list[0]] = int(data_list[1]) * int(data_list[2]) else: sales_...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s209154194
p00100
Wrong Answer
n = int(raw_input()) while n != 0: pass_flag = 0 sales_dict = {} for x in range(0, n): data = raw_input() data_list = map(int, data.split(' ')) if not sales_dict.has_key(data_list[0]): sales_dict[data_list[0]] = data_list[1] * data_list[2] else: sales_...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s554750887
p00100
Wrong Answer
n = int(raw_input()) while n != 0: pass_flag = 0 sales_dict = {} for x in range(0, n): data = raw_input() data_list = map(int, data.split(' ')) if not data_list[0] in sales_dict: sales_dict[data_list[0]] = data_list[1] * data_list[2] else: sales_dict[d...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s853839307
p00100
Wrong Answer
while True: a = int(input()) if a == 0: break lib = {} for _ in range(a): s,m,l = map(int, input().split()) lib[s] = lib.get(s,0) + m*l if max(lib[x] for x in lib) <1000000: print("NA") else: for i in lib: if lib[i] >= 1000000: ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s162686736
p00100
Wrong Answer
while True: a = int(input()) if a == 0: break lib = {} for _ in range(a): s,m,l = map(int, input().split()) lib[s] = lib.get(s,0) + m*l if max(lib[x] for x in lib) <1000000: print("NA") else: for i in lib: if lib[i] >= 1000000: ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s828779579
p00100
Wrong Answer
while True: a = int(input()) if a == 0: break lib = [0]*4000 for _ in range(a): s,m,l = map(int, input().split()) lib[s-1] += m*l if max(lib) <1000000: print("NA") else: for i in range(4000): if lib[i] >= 1000000: pri...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s460042685
p00100
Wrong Answer
lib = [0] * 4000 while True: a = int(input()) if a == 0: break for _ in range(a): s,m,l = map(int, input().split()) lib[s-1] += m*l if max(lib) <1000000: print("NA") else: for i in range(4000): if lib[i] >= 1000000: prin...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s052556803
p00100
Wrong Answer
while True: n = int(input()) if n != 0: dic = {} initno,initprice,initsales = map(int,input().split(" ")) total = initsales*initprice dic[initno] = total for i in range(n-1): no, price, sales = map(int, input().split(" ")) for k,v in dic.items(): ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s351624201
p00100
Wrong Answer
while True: n = int(input()) if n != 0: dic = {} initno,initprice,initsales = map(int,input().split(" ")) total = initsales*initprice dic[initno] = total for i in range(n-1): no, price, sales = map(int, input().split(" ")) for k,v in dic.items(): ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s737644411
p00100
Wrong Answer
while True: n = int(input()) if n != 0: dic = {} initno,initprice,initsales = map(int,input().split(" ")) total = initsales*initprice dic[initno] = total for i in range(n-1): no, price, sales = map(int, input().split(" ")) for k,v in dic.items(): ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s340404368
p00100
Wrong Answer
while True: n = int(input()) if n != 0: dic = {} initno,initprice,initsales = map(int,input().split(" ")) total = initsales*initprice dic[initno] = total for i in range(n-1): no, price, sales = map(int, input().split(" ")) for k,v in dic.items(): ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s336173896
p00100
Wrong Answer
while True: n = int(input()) if n != 0: dic = {} initno,initprice,initsales = map(int,input().split(" ")) total = initsales*initprice dic[initno] = total for i in range(n-1): no, price, sales = map(int, input().split(" ")) for k,v in dic.items(): ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s198541431
p00100
Wrong Answer
while True: n = int(input()) if n != 0: dic = {} initno,initprice,initsales = map(int,input().split(" ")) total = initsales*initprice dic[initno] = total for i in range(n-1): no, price, sales = map(int, input().split(" ")) for k,v in dic.items(): ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s344580231
p00100
Wrong Answer
while True: num=int(input()) if num==0: break else: d={} for i in range (num): info=list(map(int,input().split())) try: d[info[0]]+=info[1]*info[2] except: d[info[0]]=info[1]*info[2] answer=[] for i in d.keys...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s983178762
p00100
Wrong Answer
num=int(input()) emp=[] cnt=0 for i in range(num): emp.append(num) emp[i]=[int(k) for k in input().split()] for i in range(num): for q in range(i+1,num): if emp[i][0]==emp[q][0]: emp[i][1]=emp[i][1]+emp[q][1] emp[i][2]=emp[i][2]+emp[q][2] emp[q][1],emp[q][2]=0,0 ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s430729281
p00100
Wrong Answer
while True: n = int(input()) if n == 0: break else: greatworkers = [] for i in range(n): person, price, number = [int(i) for i in input().split()] if price * number >= 1000000: greatworkers.append(str(person)) if greatworkers == []: print('NA') else: print('\n'.join(greatworkers))
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...
s814836977
p00100
Wrong Answer
while True: n = int(input()) if n == 0: break else: greatworkers = [] for i in range(n): person, price, number = [int(i) for i in input().split()] if person in greatworkers: pass elif price * number >= 1000000: greatworkers.append(str(person)) if greatworkers == []: print('NA') else: ...
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100 2 2013 5000 100 2013 5000 100 0
1001 1003 NA 2013
<H1>Sale Result</H1> <p> There is data on sales of your company. Your task is to write a program which identifies good workers. </p> <p> The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ...