s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time int64 0 100 | memory stringlengths 4 6 | code_size int64 15 14.7k | code stringlengths 15 14.7k | problem_id stringlengths 6 6 | problem_description stringlengths 358 9.83k | input stringlengths 2 4.87k | output stringclasses 807
values | __index_level_0__ int64 1.1k 1.22M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s716813930 | p01872 | u766163292 | 1457403890 | Python | Python3 | py | Accepted | 50 | 7852 | 838 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import array
def is_valid_number(sequence):
q = lambda n: (n + 1) if 1 <= n <= 6 else (n - 5)
sum_pq = 0
for index in range(1, 12):
sum_pq += sequence[index] * q(index)
rem_pq = sum_pq % 11
check_digit = 0 if rem_pq <= 1 else (11 - rem_pq)
... | p01872 |
<h2>A: マイナンバー - My Number -</h2>
<h3>問題</h3>
<p>いっけなーい!遅刻遅刻!</p>
<p>あっ!私、今日から憧れのこの会社で働くことになったんだ!</p>
<p>それなのに、初日から寝坊だなんて…!?</p>
<p>今日は会社にマイナンバーを教えなければならない大切な日なのに…!</p>
<p>みんな知っていると思うけれど、一応マイナンバーの説明をするね!</p>
<p>マイナンバーは行政手続きにおける個人を識別するために用いられる <var>12</var> 桁からなる数字列 (<var>P_{11} P_{10} P_{9}</var> ... <var>P_{1... | ?12345678901
| 4
| 27,248 |
s754334598 | p01872 | u747915832 | 1593452781 | Python | Python3 | py | Accepted | 20 | 5600 | 585 | P = list(input())
xi = P.index('?')
Q =[6, 5, 4, 3, 2, 7, 6, 5, 4, 3, 2]
pqsum = 0
for i in range(11):
if P[i]=='?':
pass
else:
pqsum += int(P[i])*Q[i]
if xi<11:
Pxi = []
for i in range(10):
PQS = pqsum + i*Q[xi]
if PQS%11<=1:
P0 = 0
if 1<PQS%11:
... | p01872 |
<h2>A: マイナンバー - My Number -</h2>
<h3>問題</h3>
<p>いっけなーい!遅刻遅刻!</p>
<p>あっ!私、今日から憧れのこの会社で働くことになったんだ!</p>
<p>それなのに、初日から寝坊だなんて…!?</p>
<p>今日は会社にマイナンバーを教えなければならない大切な日なのに…!</p>
<p>みんな知っていると思うけれど、一応マイナンバーの説明をするね!</p>
<p>マイナンバーは行政手続きにおける個人を識別するために用いられる <var>12</var> 桁からなる数字列 (<var>P_{11} P_{10} P_{9}</var> ... <var>P_{1... | ?12345678901
| 4
| 27,249 |
s386515189 | p01872 | u240091169 | 1592987762 | Python | Python3 | py | Accepted | 20 | 5600 | 584 | def CheckDisit(a) :
tmp = 0
for i in range(11) :
if i <= 4 :
tmp += int(a[i]) * (6-i)
else :
tmp += int(a[i]) * (12-i)
tmp = tmp % 11
if tmp <= 1 :
return 0
else :
return (11 - tmp)
m = list(input())
if m[11] == '?' :
prin... | p01872 |
<h2>A: マイナンバー - My Number -</h2>
<h3>問題</h3>
<p>いっけなーい!遅刻遅刻!</p>
<p>あっ!私、今日から憧れのこの会社で働くことになったんだ!</p>
<p>それなのに、初日から寝坊だなんて…!?</p>
<p>今日は会社にマイナンバーを教えなければならない大切な日なのに…!</p>
<p>みんな知っていると思うけれど、一応マイナンバーの説明をするね!</p>
<p>マイナンバーは行政手続きにおける個人を識別するために用いられる <var>12</var> 桁からなる数字列 (<var>P_{11} P_{10} P_{9}</var> ... <var>P_{1... | ?12345678901
| 4
| 27,250 |
s651248136 | p01872 | u352394527 | 1546763856 | Python | Python3 | py | Accepted | 20 | 5600 | 634 | def is_collect(fixed_number):
score = 0
for i in range(1, 7):
score += int(fixed_number[i]) * (i + 1)
for i in range(7, 12):
score += int(fixed_number[i]) * (i - 5)
last = 11 - score % 11
if str(last) == fixed_number[0] or (last >= 10 and fixed_number[0] == "0"):
return True
else:
return Fal... | p01872 |
<h2>A: マイナンバー - My Number -</h2>
<h3>問題</h3>
<p>いっけなーい!遅刻遅刻!</p>
<p>あっ!私、今日から憧れのこの会社で働くことになったんだ!</p>
<p>それなのに、初日から寝坊だなんて…!?</p>
<p>今日は会社にマイナンバーを教えなければならない大切な日なのに…!</p>
<p>みんな知っていると思うけれど、一応マイナンバーの説明をするね!</p>
<p>マイナンバーは行政手続きにおける個人を識別するために用いられる <var>12</var> 桁からなる数字列 (<var>P_{11} P_{10} P_{9}</var> ... <var>P_{1... | ?12345678901
| 4
| 27,251 |
s960093677 | p01883 | u509278866 | 1534915885 | Python | Python3 | py | Accepted | 100 | 12696 | 1,161 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.... | p01883 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
</script>
<h2>Parentheses</h2>
<p>
Dave love... | 1
| )(
| 27,252 |
s278376231 | p01891 | u766163292 | 1474090862 | Python | Python3 | py | Accepted | 40 | 7804 | 607 | #!/usr/bin/env python3
def solve(n, m, a, b, ds):
is_waste = [False for _ in range(n)]
for i in range(n):
if ds[i] >= a:
is_waste[i] = True
else:
break
if sum(is_waste) > n - m:
for i in range(n)[::-1]:
if is_waste[i]:
if ds[i] <=... | p01891 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: キャベツ / Cabbage</h1>
<h2>問題文</h2>
<p>
AOR イカちゃんは葉が $N$ 枚あ... | 5 3 6 9
9 7 5 3 1
| 2
| 27,253 |
s647978037 | p01892 | u766163292 | 1474091848 | Python | Python3 | py | Accepted | 50 | 7772 | 427 | #!/usr/bin/env python3
INF = 2 ** 63 - 1
def solve(a, b, n):
# a + x = k * d, b = l * g
# 1 <= k <= n, 1 <= l <= n
x = INF
for l in range(1, n + 1):
d, m = divmod(b, l)
if not m:
for k in range(1, n + 1):
x = min(x, abs(k * d - a))
return x
def main()... | p01892 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>B: イカったー / SNS</h1>
<h2>問題文</h2>
<p>
AOR イカちゃんは最近少し機嫌が悪い。
ど... | 19 30 3
| 1
| 27,254 |
s450705089 | p01892 | u352394527 | 1546826574 | Python | Python3 | py | Accepted | 20 | 5596 | 211 | a, b, n = map(int, input().split())
score = abs(a - b)
for x in range(1, n + 1):
for y in range(1, n + 1):
if b * x % y == 0:
new_a = b * x // y
score = min(score, abs(a - new_a))
print(score)
| p01892 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>B: イカったー / SNS</h1>
<h2>問題文</h2>
<p>
AOR イカちゃんは最近少し機嫌が悪い。
ど... | 19 30 3
| 1
| 27,255 |
s853027390 | p01898 | u144068724 | 1487609771 | Python | Python3 | py | Accepted | 50 | 7896 | 839 |
m,n = map(int,input().split())
seat = [list(input()) for i in range(m)]
dummy = ["0" for i in range(n+2)]
for i in range(m):
seat[i].insert(0,"0")
seat[i].append("0")
seat.insert(0,dummy)
seat.append(dummy)
for i in range(1,m + 1):
for j in range(1,n + 1):
if seat[i][j] == "o":
if seat... | p01898 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath.js" charset="UTF-8"></script>
<h2>A: 席取り - Taking a Seat -</h2>
<h3>物語</h3>
<p>
A君はある試験を受けるために試験会場の教室に入った。
ただ、A君はとても神経質なタイプだ。
そのため、状況によってA君が座りたくない席がもしかしたらあるかもしれない。
そこで、A君はある条件を... | 5 5
--o--
--xo-
--x--
o---x
--xoo
| 3
| 27,257 |
s912029135 | p01898 | u352394527 | 1546827451 | Python | Python3 | py | Accepted | 40 | 5700 | 614 | m, n = map(int, input().split())
mp = [list("#" * (n + 2))] + [list("#" + input() + "#") for _ in range(m)] + [list("#" * (n + 2))]
vec = ((1, 0), (1, -1), (0, -1), (-1, -1), (-1, 0), (-1, 1), (0, 1), (1, 1))
for y in range(1, m + 1):
for x in range(1, n + 1):
if mp[y][x] == "x":
for dx, dy in vec:
... | p01898 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath.js" charset="UTF-8"></script>
<h2>A: 席取り - Taking a Seat -</h2>
<h3>物語</h3>
<p>
A君はある試験を受けるために試験会場の教室に入った。
ただ、A君はとても神経質なタイプだ。
そのため、状況によってA君が座りたくない席がもしかしたらあるかもしれない。
そこで、A君はある条件を... | 5 5
--o--
--xo-
--x--
o---x
--xoo
| 3
| 27,258 |
s249037734 | p01899 | u352394527 | 1546827983 | Python | Python3 | py | Accepted | 20 | 5620 | 149 | n, d = map(int, input().split())
lst = list(map(int, input().split()))
ans = sum([x - d for x in lst if x - d >= 0])
print(ans if ans else "kusoge")
| p01899 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath.js" charset="UTF-8"></script>
<h2>B: 山手線ゲーム - Yamanote-line Game -</h2>
<h3>豆(?)知識</h3>
<p>山手線は便利である。 なぜならば、130円払うだけで時間の許す限り何周でも乗っていられるからだ。ただし、切符で乗車する場合は、切符の有効時間に気をつけなければならない。... | 5 130
130 170 100 120 140
| 50
| 27,259 |
s438709188 | p01905 | u847467233 | 1531300674 | Python | Python3 | py | Accepted | 20 | 5600 | 473 | # AOJ 2805: Tournament
# Python3 2018.7.11 bal4u
def calc(l, n):
if n == 2:
if a[l] and a[l+1]: return [0, True]
if a[l] or a[l+1]: return [0, False]
return [1, False]
m = n >> 1
c1, f1 = calc(l, m)
c2, f2 = calc(l+m, m)
if f1 and f2: return [c1+c2, True]
if f1 or f2: return [c1+c2, False]
return [c1+c2+1... | p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,260 |
s169448030 | p01905 | u847467233 | 1531300800 | Python | Python3 | py | Accepted | 20 | 5580 | 97 | # AOJ 2805: Tournament
# Python3 2018.7.11 bal4u
N, M = map(int, input().split())
print(N-1-M)
| p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,261 |
s784889576 | p01905 | u923668099 | 1490179477 | Python | Python3 | py | Accepted | 20 | 7624 | 59 | n, m = map(int, input().split())
ans = n - m - 1
print(ans) | p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,262 |
s087320865 | p01905 | u509278866 | 1490330393 | Python | Python3 | py | Accepted | 70 | 13564 | 396 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S():... | p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,263 |
s692464078 | p01905 | u728992264 | 1490389565 | Python | Python3 | py | Accepted | 20 | 7660 | 49 | N, M = map(int, input().split())
print(N - M - 1) | p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,264 |
s252961743 | p01905 | u529386725 | 1490413296 | Python | Python | py | Accepted | 10 | 6420 | 52 | n, m = map(int, raw_input().split())
print n - m - 1 | p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,265 |
s286208870 | p01905 | u452212317 | 1495410953 | Python | Python3 | py | Accepted | 20 | 7640 | 81 | n,m = map(int, input().split())
print (n - m - 1)
for i in range(m):
a = input() | p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,266 |
s839541102 | p01905 | u116766943 | 1505059413 | Python | Python3 | py | Accepted | 20 | 7764 | 145 | def main():
N,M=map(int,input().split())
a = [ int(input()) for _ in [0]*M ]
print(N-len(a)-1)
if __name__ == "__main__":
main() | p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,267 |
s739931533 | p01905 | u285015144 | 1518838757 | Python | Python3 | py | Accepted | 20 | 5600 | 159 | N, M = map(int, input().split())
a = []
for i in range(M):
a.append(int(input()))
num = N - M
ans = 0
while(num):
ans += 1
num -= 1
print(ans - 1)
| p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,268 |
s931729012 | p01905 | u078042885 | 1520514934 | Python | Python3 | py | Accepted | 20 | 5592 | 65 | n,m=map(int,input().split())
for _ in [0]*m:input()
print(n-m-1)
| p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,269 |
s619233416 | p01905 | u931207793 | 1522035793 | Python | Python3 | py | Accepted | 20 | 5580 | 44 | N,M = map(int,input().split())
print(N-1-M)
| p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,270 |
s935039269 | p01905 | u306037418 | 1530177297 | Python | Python3 | py | Accepted | 20 | 5588 | 77 | n, m = map(int, input().split())
for i in range(m):
input()
print(n-1-m)
| p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,271 |
s363261849 | p01905 | u958378108 | 1530178465 | Python | Python3 | py | Accepted | 20 | 5600 | 117 | N,M = map(int, input().split())
l = []
for i in range(M):
l.append(int(input()))
count = N - 1 - M
print(count)
| p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,272 |
s423008678 | p01905 | u614485948 | 1530179608 | Python | Python3 | py | Accepted | 20 | 5600 | 524 | a = input().split(' ')
tour = int(a[0])-1
no_vs = 0
if int(a[1]) != 0:
absent = []
for _ in range(int(a[1])):
absent.append(int(input()))
num = int(int(a[0])/2)
while absent != []:
next_absent = []
for n in range(num):
if 2*n in absent or 2*n+1 in absent:
... | p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,273 |
s682627151 | p01905 | u990228206 | 1552988137 | Python | Python3 | py | Accepted | 20 | 5580 | 42 | n,m=map(int,input().split())
print(n-m-1)
| p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,274 |
s922661587 | p01905 | u813675766 | 1548984481 | Python | Python3 | py | Accepted | 20 | 5580 | 42 | n,m=map(int,input().split())
print(n-m-1)
| p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,275 |
s041793176 | p01905 | u352394527 | 1546847873 | Python | Python3 | py | Accepted | 20 | 5596 | 78 | n, m = map(int, input().split())
[input() for _ in range(m)]
print(n - m - 1)
| p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,276 |
s894800459 | p01905 | u717526540 | 1545193004 | Python | Python3 | py | Accepted | 20 | 5588 | 85 | n, m = map(int, input().split())
for _ in range(m):
tmp = input()
print(n-m-1)
| p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,277 |
s771789553 | p01905 | u252700163 | 1532307090 | Python | Python3 | py | Accepted | 20 | 5604 | 505 | n, m = map(int, input().split(' '))
ns = [i for i in range(n)]
for i in range(m):
ha = int(input())
ns[ha] = None
#print(n, m)
#print(ns)
count = 0
while True:
size = len(ns)
ns2 = []
for j in range(0, size, 2):
flag = ns[j] is not None and ns[j+1] is not None
if flag:
ns2.append( 0 )
... | p01905 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: トーナメント</h1>
<h2>問題</h2>
<p>
AOR イカちゃんとあなたは、トーナメント形式の卓球大会... | 2 0
| 1
| 27,278 |
s131080829 | p01916 | u847467233 | 1531311024 | Python | Python3 | py | Accepted | 20 | 5572 | 215 | # AOJ 2816: Alphabet Block
# Python3 2018.7.11 bal4u
dic = {}
S = list(input())
for s in S:
if s not in dic: dic[s] = 1
else: dic[s] += 1
ans = 0
for k in list(dic.keys()):
if dic[k] & 1: ans += 1
print(ans>>1)
| p01916 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath2017.js" charset="UTF-8"></script>
<h2>A: アルファベットブロック</h2>
<p>名川 若菜 (なかわ わかな) ちゃんは回文が大好きだ。なぜなら、自分の名前もまた回文であるからである。</p>
<p>わかなちゃんはアルファベットブロックがいくつか入っているセットを手に入れた。アルファベットブロックというのは... | hcpc
| 1
| 27,279 |
s028081136 | p01916 | u116766943 | 1500203177 | Python | Python3 | py | Accepted | 20 | 7532 | 148 | s=input()
cnt=[0 for _ in[0]*26]
for c in s:
cnt[ord(c)-ord('a')]+=1
odd=0
for i in range(26):
if cnt[i] & 1:
odd+=1
print((odd>>1)) | p01916 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath2017.js" charset="UTF-8"></script>
<h2>A: アルファベットブロック</h2>
<p>名川 若菜 (なかわ わかな) ちゃんは回文が大好きだ。なぜなら、自分の名前もまた回文であるからである。</p>
<p>わかなちゃんはアルファベットブロックがいくつか入っているセットを手に入れた。アルファベットブロックというのは... | hcpc
| 1
| 27,280 |
s802449741 | p01916 | u285015144 | 1518841677 | Python | Python3 | py | Accepted | 20 | 5564 | 237 | S = input()
dict = {}
for i in range(len(S)):
if(S[i] in dict):
dict[S[i]] += 1
else:
dict[S[i]] = 1
l = list(dict.values())
cnt = 0
for i in range(len(l)):
if(l[i] % 2 != 0):
cnt += 1
print(cnt // 2)
| p01916 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath2017.js" charset="UTF-8"></script>
<h2>A: アルファベットブロック</h2>
<p>名川 若菜 (なかわ わかな) ちゃんは回文が大好きだ。なぜなら、自分の名前もまた回文であるからである。</p>
<p>わかなちゃんはアルファベットブロックがいくつか入っているセットを手に入れた。アルファベットブロックというのは... | hcpc
| 1
| 27,281 |
s309118084 | p01916 | u454317532 | 1590294187 | Python | Python3 | py | Accepted | 30 | 5956 | 355 | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()
from collections import Counter
s = ns()
c = Counter(s)
ans = 0
for i in c.values():
if i%2 == ... | p01916 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath2017.js" charset="UTF-8"></script>
<h2>A: アルファベットブロック</h2>
<p>名川 若菜 (なかわ わかな) ちゃんは回文が大好きだ。なぜなら、自分の名前もまた回文であるからである。</p>
<p>わかなちゃんはアルファベットブロックがいくつか入っているセットを手に入れた。アルファベットブロックというのは... | hcpc
| 1
| 27,282 |
s391113232 | p01916 | u813675766 | 1548837586 | Python | Python3 | py | Accepted | 20 | 5568 | 101 | s = input()
cnt = [0]*26
for x in s:
cnt[ord(x)-ord('a')] += 1
print(sum([x%2 for x in cnt])//2)
| p01916 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath2017.js" charset="UTF-8"></script>
<h2>A: アルファベットブロック</h2>
<p>名川 若菜 (なかわ わかな) ちゃんは回文が大好きだ。なぜなら、自分の名前もまた回文であるからである。</p>
<p>わかなちゃんはアルファベットブロックがいくつか入っているセットを手に入れた。アルファベットブロックというのは... | hcpc
| 1
| 27,283 |
s200036560 | p01916 | u352394527 | 1546885644 | Python | Python3 | py | Accepted | 30 | 5968 | 87 | import collections
print(sum([v%2 for v in collections.Counter(input()).values()])//2)
| p01916 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath2017.js" charset="UTF-8"></script>
<h2>A: アルファベットブロック</h2>
<p>名川 若菜 (なかわ わかな) ちゃんは回文が大好きだ。なぜなら、自分の名前もまた回文であるからである。</p>
<p>わかなちゃんはアルファベットブロックがいくつか入っているセットを手に入れた。アルファベットブロックというのは... | hcpc
| 1
| 27,284 |
s809962905 | p01917 | u454317532 | 1590296296 | Python | Python3 | py | Accepted | 30 | 5640 | 2,131 | import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
n = int(input())
R = list(map(int,input().split()))
SPC = []
S = []
P = []
C = []
ans = 10**5
for i in range(n):
s,p,c = map(int,input().split())
S.append(s)
P.append(p)
C.append(c)
SPC.append([s,p,c])
you = list(SPC[0])
for delta ... | p01917 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath2017.js" charset="UTF-8"></script>
<h2>B: だんすなうwww - Dance Now! -</h2>
<h3>物語</h3>
<p>
前回のラボライフ!ダイガクイン!!
マスターアイドルたちが競う最大の大会「ラボライフ」の前哨戦ともいえるイベント「マスターアイドルワールド」で9位を取ってしまったドサンコスノー。
... | 9
9 8 7 6 5 4 3 2 1
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
| 2
| 27,285 |
s928693812 | p01923 | u847467233 | 1531312152 | Python | Python3 | py | Accepted | 40 | 5608 | 236 | # AOJ 2823: JAG Practice Contest
# Python3 2018.7.11 bal4u
while True:
N, M = map(int, input().split())
if N == 0: break
ma = [0]*(M+1)
for i in range(N):
d, v = map(int, input().split())
ma[d] = max(ma[d], v)
print(sum(ma))
| p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,286 |
s237706694 | p01923 | u135085051 | 1556270223 | Python | Python3 | py | Accepted | 40 | 5608 | 659 | #d = むずかしさ, v = 推薦度
ans2 = []
while(1):
tip = []
tmp = []
ans = 0
n, m = map(int,input().split())
if n == 0 and m == 0:
break
else:
for i in range(n):
d, v = map(int,input().split())
tip.append([d, v])
tip = sorted(tip, key = lambda x: x[1])
... | p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,287 |
s892215699 | p01923 | u116766943 | 1499526970 | Python | Python3 | py | Accepted | 50 | 7692 | 328 | while True:
N,M=map(int,input().split())
if N == 0 and M == 0:
break
mp = {}
for _ in [0]*N:
d,v=map(int,input().split())
if d in mp:
mp[d] = max(mp[d],v)
else :
mp[d] = v
maxi=0
for v in mp.values():
maxi+=v
pri... | p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,288 |
s470274528 | p01923 | u260980560 | 1499830526 | Python | Python | py | Accepted | 20 | 6420 | 215 | while 1:
n, m = map(int, raw_input().split())
if n == m == 0:
break
p = [0]*m
for i in xrange(n):
d, v = map(int, raw_input().split())
p[d-1] = max(p[d-1], v)
print sum(p) | p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,289 |
s870024532 | p01923 | u724548524 | 1526611196 | Python | Python3 | py | Accepted | 40 | 5784 | 315 | import bisect
while True:
n, m = map(int, input().split())
if n == 0:break
a = [tuple(map(int, input().split())) for _ in range(n)]
a.sort(key = lambda x:x[1], reverse = True)
a.sort(key = lambda x:x[0])
v = 0
for i in range(1, m + 1):v += a[bisect.bisect_left(a,(i,0))][1]
print(v)
| p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,290 |
s993916338 | p01923 | u531592024 | 1529571576 | Python | Python3 | py | Accepted | 50 | 5620 | 302 | while True:
(n, m) = tuple(map(int, input().split()))
if n == 0:
break
arr = [0 for i in range(m + 1)]
for i in range(n):
inp = list(map(int, input().split()))
arr[inp[0]] = max(inp[1], arr[inp[0]])
res = 0
for e in arr:
res += e
print(res)
| p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,291 |
s348551638 | p01923 | u958378108 | 1530612332 | Python | Python3 | py | Accepted | 40 | 5608 | 274 | while True:
N,M=map(int,input().split())
if N==0 and M==0:
break
l = [0]*M
for i in range(N):
d,v=map(int,input().split())
if l[d-1]<v:
l[d-1]=v
total = 0
for i in range(M):
total += l[i]
print(total)
| p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,292 |
s411888643 | p01923 | u836923362 | 1596113725 | Python | Python3 | py | Accepted | 40 | 5612 | 445 | #21:40
#21:
while True:
n,m = map(int,input().split())
if n ==0 : break
#難易度と最大推薦度の辞書
question_dict={}
for i in range(n):
difficult,recommend = map(int,input().split())
if difficult in question_dict:
question_dict[difficult] = max(question_dict[difficult],recommend)
... | p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,293 |
s581050318 | p01923 | u829695570 | 1577793864 | Python | Python3 | py | Accepted | 40 | 5604 | 217 | while 1:
n, m = map(int, input().split())
if n == 0:
break
s = [0]*(m+1)
for _ in range(n):
d, v = map(int, input().split())
if s[d] < v:
s[d] = v
print(sum(s))
| p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,294 |
s197154437 | p01923 | u998437062 | 1572428686 | Python | Python3 | py | Accepted | 40 | 5612 | 165 | while True:
n,m=map(int,input().split())
if n==0:exit()
a=[0]*(m+1)
for _ in range(n):
d,v=map(int,input().split())
a[d]=max(a[d],v)
print(sum(a))
| p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,295 |
s238507709 | p01923 | u875334713 | 1567142761 | Python | Python3 | py | Accepted | 40 | 5612 | 406 | while True:
line = input()
if line == "0 0":
break
stock, max_difficulty = map(int, line.split(" "))
max_recommend_list = [0 for _ in range(max_difficulty)]
for i in range(stock):
difficulty, recommend = map(int, input().split(" "))
max_recommend_list[difficulty - 1] = ma... | p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,296 |
s951190235 | p01923 | u537067968 | 1562563974 | Python | Python3 | py | Accepted | 40 | 5608 | 297 | while True:
n,m = map(int,input().split())
if n+m == 0:break
lst = []
for _ in range(n):
d,v = map(int,input().split())
lst.append((d,v))
lst.sort()
ans = 0
for i,a in enumerate(lst):
if i == len(lst)-1:
ans += a[1]
continue
if lst[i+1][0] != a[0]:
ans += a[1]
print(ans)
| p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,297 |
s554675898 | p01923 | u396086105 | 1562479362 | Python | Python3 | py | Accepted | 40 | 5612 | 427 | import sys
def solve(n, m):
l = []
for i in range(n):
d, v = map(int, input().split())
l.append((d, v))
l.sort(reverse=True)
now = -1
count = 0
for i in l:
if now == i[0]:
continue
else:
count += i[1]
now = i[0]
print(co... | p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,298 |
s628891107 | p01923 | u931913851 | 1562390634 | Python | Python3 | py | Accepted | 40 | 5612 | 384 | "JAG模擬予選練習会"
while True:
N, M = map(int, input().split()) # 問題の数N, 難易度の幅M
if N == 0 and M == 0:
break
max_value = {}
for i in range(1, M+1):
max_value[i] = 0
for i in range(N):
d, v = map(int, input().split())
max_value[d] = max(max_value[d], v)
ans = sum(max_... | p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,299 |
s642572176 | p01923 | u731941832 | 1562235815 | Python | Python3 | py | Accepted | 40 | 5620 | 286 | while 1:
n,m=map(int,input().split())
if n==m==0:break
s=set()
c=0
for d,v in sorted([list(map(int,input().split()))for i in range(n)],key=lambda x:-x[1]):
if d in s:continue
c+=v
s.add(d)
if len(s)>=m:
break
print(c)
| p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,300 |
s413445799 | p01923 | u328199937 | 1560584933 | Python | Python3 | py | Accepted | 40 | 5616 | 260 | while True:
n, m = map(int, input().split())
if not n and not m:
break
dataset = [0 for _ in range(m)]
for i in range(n):
d, v = map(int, input().split())
dataset[d - 1] = max(v, dataset[d - 1])
print(sum(dataset))
| p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,301 |
s042290520 | p01923 | u990228206 | 1553067337 | Python | Python3 | py | Accepted | 40 | 5612 | 194 | while 1:
n,m=map(int,input().split())
if n==m==0:break
cont=[0]*(m+1)
for i in range(n):
d,v=map(int,input().split())
if cont[d]<v:cont[d]=v
print(sum(cont))
| p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,302 |
s337581025 | p01923 | u352394527 | 1546890185 | Python | Python3 | py | Accepted | 50 | 5988 | 239 | from collections import defaultdict
while True:
n, m = map(int, input().split())
if n == 0:break
dic = defaultdict(int)
for _ in range(n):
d, v = map(int, input().split())
dic[d] = max(dic[d], v)
print(sum(dic.values()))
| p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,303 |
s267605519 | p01923 | u717526540 | 1545015230 | Python | Python3 | py | Accepted | 40 | 5608 | 230 | while 1:
n, m = map(int, input().split())
if n == 0:
break
rec = [0] * (m+1)
for _ in range(n):
d, v = map(int, input().split())
if rec[d] < v:
rec[d] = v
print(sum(rec))
| p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,304 |
s812827175 | p01923 | u509278866 | 1543297917 | Python | Python3 | py | Accepted | 70 | 9052 | 1,095 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.... | p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,305 |
s334209078 | p01923 | u745360181 | 1539673542 | Python | Python3 | py | Accepted | 60 | 5608 | 433 | while True:
N,M = map(int,input().split())
if N == 0 and M == 0:
break
ans = 0
di = []
vi = []
for i in range(0,N):
d,v = map(int,input().split())
di.append(d)
vi.append(v)
for i in range(1,M+1):
max = 0
for j in range(0,N... | p01923 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>JAG 模擬予選練習会</h3>
<p>ACM-I... | 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
| 9
8
8
71
51
| 27,306 |
s840239763 | p01931 | u847467233 | 1531342108 | Python | Python3 | py | Accepted | 80 | 5788 | 212 | # AOJ 2831: Check answers
# Python3 2018.7.12 bal4u
n = int(input())
if n == 0: print(0)
else:
s = input()
ans = 1
for i in range(1, len(s)):
if s[i-1] == 'x' and s[i] == 'x': break
ans += 1
print(ans)
| p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,307 |
s188988770 | p01931 | u847467233 | 1531342500 | Python | Python3 | py | Accepted | 30 | 5788 | 216 | # AOJ 2831: Check answers
# Python3 2018.7.12 bal4u
n = int(input())
if n == 0: print(0)
else:
s = input()
ans = 1; pre = s[0]
for t in s[1:]:
if pre == 'x' and t == 'x': break
pre = t; ans += 1
print(ans)
| p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,308 |
s363873378 | p01931 | u354751877 | 1540388425 | Python | Python | py | Accepted | 10 | 4672 | 98 | p=int(input())
if p>0:
dato=raw_input()
i=dato.find("xx")
if i<0:
print p
else:
print i+1
| p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,309 |
s796663224 | p01931 | u197615397 | 1505713315 | Python | Python3 | py | Accepted | 60 | 7848 | 130 | N = int(input())
S = input()
for i in range(1, N):
if S[i-1] == S[i] == "x":
print(i)
break
else:
print(N) | p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,310 |
s914486592 | p01931 | u792145349 | 1505721489 | Python | Python3 | py | Accepted | 60 | 7856 | 240 | N = int(input())
S = input()
kizetu = False
cnt = 0
for s in S:
if s == "x":
kizetu += 1
else:
kizetu = 0
if kizetu == 2:
print(cnt)
break
cnt += 1
else:
print(len(S)) | p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,311 |
s702807587 | p01931 | u956645355 | 1506349802 | Python | Python3 | py | Accepted | 60 | 7916 | 146 | def main():
N = int(input())
S = input()
try:
ans = S.index('xx') + 1
print(ans)
except:
print(N)
main() | p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,312 |
s634208225 | p01931 | u015553205 | 1506523154 | Python | Python3 | py | Accepted | 60 | 8548 | 305 | N = input()
S = input()
N = int(N)
S_list = list(S)
flg = 0
for i in range(N):
if flg == 0:
if S_list[i] == ('x'):
flg = 1
elif S_list[i] == ('o'):
flg = 0
elif S_list[i] == ('x'):
flg = 2
break
if i == N-1:
if flg < 2:
i = N
print(i) | p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,313 |
s811822112 | p01931 | u260980560 | 1507973278 | Python | Python3 | py | Accepted | 40 | 7576 | 41 | n=input()
print(input().find('xx')+1or n) | p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,314 |
s157937273 | p01931 | u546285759 | 1508361115 | Python | Python3 | py | Accepted | 50 | 7840 | 77 | N = int(input())
try:
print(input().index("xx") + 1)
except:
print(N) | p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,315 |
s249362361 | p01931 | u285015144 | 1518843978 | Python | Python3 | py | Accepted | 70 | 5788 | 249 | N = int(input())
S = input()
ans = 0
flag = False
for i in range(len(S)):
if(S[i] == 'o'):
ans += 1
flag = False
else:
if(flag):
break
else:
ans += 1
flag = True
print(ans)
| p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,316 |
s922436326 | p01931 | u078042885 | 1520694705 | Python | Python3 | py | Accepted | 60 | 5744 | 90 | input();s=input();f=s[0];a=1
for x in s[1:]:
if f==x=='x':break
a+=1;f=x
print(a)
| p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,317 |
s742368939 | p01931 | u814278309 | 1559828429 | Python | Python3 | py | Accepted | 40 | 5788 | 107 | n=int(input())
s=input()
for i in range(n-1):
if s[i]=='x' and s[i+1]=='x':
n=i+1
break
print(n)
| p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,318 |
s317324002 | p01931 | u352394527 | 1546893512 | Python | Python3 | py | Accepted | 80 | 5788 | 113 | n = int(input())
s = input()
for i in range(n):
if s[i:i+2]=="xx":
print(i + 1)
break
else:
print(n)
| p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,319 |
s071860226 | p01931 | u479301710 | 1539135337 | Python | Python3 | py | Accepted | 50 | 5792 | 227 | # -*- coding: utf-8 -*-
from sys import stdin
n = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()
faint = False
for i in range(1,n):
if s[i-1] == "x" and s[i] == "x":
print(i)
exit()
print(n)
| p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,320 |
s430155391 | p01931 | u665008200 | 1537793025 | Python | Python3 | py | Accepted | 70 | 5788 | 189 | import sys
N = int(input())
S = input()
ans = 0
last_s = "o"
for s in S:
if last_s == "x" and s == "x":
print(ans)
sys.exit()
ans += 1
last_s = s
print(ans)
| p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,321 |
s970039838 | p01931 | u776402923 | 1537260375 | Python | Python3 | py | Accepted | 50 | 5788 | 150 | N = int(input());
S = input();
ans = N;
for i in range(N-1):
if S[i] == 'x' and S[i+1] == 'x':
ans = i+1
break
print(ans)
| p01931 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 丸付け</h1>
<h2... | 3
oxx
| 2
| 27,322 |
s708654129 | p01938 | u847467233 | 1531352603 | Python | Python3 | py | Accepted | 20 | 5552 | 140 | # AOJ 2838: A-Z-
# Python3 2018.7.12 bal4u
S = input()
ans = p = 0
for s in S:
k = ord(s)-ord('A')
if k <= p: ans += 1
p = k
print(ans)
| p01938 |
<h2>A: A-Z-</h2>
<h3>問題</h3>
<p><var>26</var> マスの円環状のボードがあり、各マスには大文字のアルファベット <var>1</var> 文字が、アルファベット順に時計回りに書かれています。すなわち、 'A' のマスの時計回り隣は 'B' のマスで、 'B' のマスの隣は 'C' のマスで、・・・、 'Z' のマスの時計回り隣は 'A' のマスです。</p>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_ACPC2017Day3_HUPC2017_aizu17-a-01" type="image/... | AIZU
| 2
| 27,323 |
s949732381 | p01938 | u260980560 | 1505874729 | Python | Python3 | py | Accepted | 60 | 7576 | 75 | s = input()
print((s[0]=='A')+sum(s[i] >= s[i+1] for i in range(len(s)-1))) | p01938 |
<h2>A: A-Z-</h2>
<h3>問題</h3>
<p><var>26</var> マスの円環状のボードがあり、各マスには大文字のアルファベット <var>1</var> 文字が、アルファベット順に時計回りに書かれています。すなわち、 'A' のマスの時計回り隣は 'B' のマスで、 'B' のマスの隣は 'C' のマスで、・・・、 'Z' のマスの時計回り隣は 'A' のマスです。</p>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_ACPC2017Day3_HUPC2017_aizu17-a-01" type="image/... | AIZU
| 2
| 27,324 |
s194631034 | p01938 | u546285759 | 1508361171 | Python | Python3 | py | Accepted | 20 | 7516 | 94 | S = input()
cnt, x = 0, 65
for c in S:
cnt = cnt + (x >= ord(c))
x = ord(c)
print(cnt) | p01938 |
<h2>A: A-Z-</h2>
<h3>問題</h3>
<p><var>26</var> マスの円環状のボードがあり、各マスには大文字のアルファベット <var>1</var> 文字が、アルファベット順に時計回りに書かれています。すなわち、 'A' のマスの時計回り隣は 'B' のマスで、 'B' のマスの隣は 'C' のマスで、・・・、 'Z' のマスの時計回り隣は 'A' のマスです。</p>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_ACPC2017Day3_HUPC2017_aizu17-a-01" type="image/... | AIZU
| 2
| 27,325 |
s651116330 | p01938 | u285015144 | 1518844390 | Python | Python3 | py | Accepted | 20 | 5560 | 177 | S = input()
cur = 'A'
ans = 0
for i in range(len(S)):
if(S[i] == cur):
ans += 1
else:
if(cur > S[i]):
ans += 1
cur = S[i]
print(ans)
| p01938 |
<h2>A: A-Z-</h2>
<h3>問題</h3>
<p><var>26</var> マスの円環状のボードがあり、各マスには大文字のアルファベット <var>1</var> 文字が、アルファベット順に時計回りに書かれています。すなわち、 'A' のマスの時計回り隣は 'B' のマスで、 'B' のマスの隣は 'C' のマスで、・・・、 'Z' のマスの時計回り隣は 'A' のマスです。</p>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_ACPC2017Day3_HUPC2017_aizu17-a-01" type="image/... | AIZU
| 2
| 27,326 |
s705541811 | p01938 | u454317532 | 1593937539 | Python | Python3 | py | Accepted | 20 | 5552 | 94 | now=0
ans=0
for i in input():
j=ord(i)-ord("A")
if now>=j:ans+=1
now=j
print(ans)
| p01938 |
<h2>A: A-Z-</h2>
<h3>問題</h3>
<p><var>26</var> マスの円環状のボードがあり、各マスには大文字のアルファベット <var>1</var> 文字が、アルファベット順に時計回りに書かれています。すなわち、 'A' のマスの時計回り隣は 'B' のマスで、 'B' のマスの隣は 'C' のマスで、・・・、 'Z' のマスの時計回り隣は 'A' のマスです。</p>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_ACPC2017Day3_HUPC2017_aizu17-a-01" type="image/... | AIZU
| 2
| 27,327 |
s161754292 | p01938 | u479301710 | 1539137961 | Python | Python3 | py | Accepted | 20 | 5564 | 195 | from sys import stdin
s = "A" + stdin.readline().rstrip()
AZ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = 0
for i in range(1,len(s)):
if AZ.find(s[i]) <= AZ.find(s[i-1]):
ans += 1
print(ans)
| p01938 |
<h2>A: A-Z-</h2>
<h3>問題</h3>
<p><var>26</var> マスの円環状のボードがあり、各マスには大文字のアルファベット <var>1</var> 文字が、アルファベット順に時計回りに書かれています。すなわち、 'A' のマスの時計回り隣は 'B' のマスで、 'B' のマスの隣は 'C' のマスで、・・・、 'Z' のマスの時計回り隣は 'A' のマスです。</p>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_ACPC2017Day3_HUPC2017_aizu17-a-01" type="image/... | AIZU
| 2
| 27,328 |
s084307184 | p01938 | u665008200 | 1537793784 | Python | Python3 | py | Accepted | 20 | 5556 | 216 | S = input()
alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Now = 0
ans = 0
for s in S:
Next = alpha.find(s)
# print(s, Now, Next)
if(Now < Next):
pass
else:
ans += 1
Now = Next
print(ans)
| p01938 |
<h2>A: A-Z-</h2>
<h3>問題</h3>
<p><var>26</var> マスの円環状のボードがあり、各マスには大文字のアルファベット <var>1</var> 文字が、アルファベット順に時計回りに書かれています。すなわち、 'A' のマスの時計回り隣は 'B' のマスで、 'B' のマスの隣は 'C' のマスで、・・・、 'Z' のマスの時計回り隣は 'A' のマスです。</p>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_ACPC2017Day3_HUPC2017_aizu17-a-01" type="image/... | AIZU
| 2
| 27,329 |
s166864432 | p01939 | u777217951 | 1505872741 | Python | Python3 | py | Accepted | 60 | 7792 | 288 | MOD = 10**9+7
def sum(a,d,n):
return n*(2*a+(n-1)*d)//2
def main():
n,m = map(int,input().split())
s = 0
if n == 1:
s = m+1
else:
s = sum(m+1,-n+1,1+m//(n-1))
s *= 2
s -= (m+1)
print(s%MOD)
if __name__ == '__main__':
main() | p01939 |
<h2>B: えびちゃんと数列 - Ebi-chan and Integer Sequences -</h2>
<h3>問題</h3>
<p>
えびちゃんは数列が好きです。中でも等差数列が特に好きです。
今回は以下の条件を満たす数列を作ることにしました。
</p>
<ul>
<li> 長さ <var>n</var> の等差数列である</li>
<li> 数列の <var>i</var> 番目の要素を <var>s_i</var> と定める時、全ての <var>s_i (1 \leq i \leq n)</var> が <var>0 \leq s_i \leq m</var> を満たす整数である</li>
</ul>
... | 3 9
| 50
| 27,330 |
s546802756 | p01939 | u260980560 | 1505876748 | Python | Python3 | py | Accepted | 20 | 7712 | 172 | n, m = map(int, input().split())
MOD = 10**9 + 7
if n == 1:
print((m+1) % MOD)
else:
k = m//(n-1)
res = m+1 + 2*(m*k - k*(k+1)*(n-1)//2+k)
print(res % MOD) | p01939 |
<h2>B: えびちゃんと数列 - Ebi-chan and Integer Sequences -</h2>
<h3>問題</h3>
<p>
えびちゃんは数列が好きです。中でも等差数列が特に好きです。
今回は以下の条件を満たす数列を作ることにしました。
</p>
<ul>
<li> 長さ <var>n</var> の等差数列である</li>
<li> 数列の <var>i</var> 番目の要素を <var>s_i</var> と定める時、全ての <var>s_i (1 \leq i \leq n)</var> が <var>0 \leq s_i \leq m</var> を満たす整数である</li>
</ul>
... | 3 9
| 50
| 27,331 |
s088126920 | p01939 | u709185111 | 1505877654 | Python | Python3 | py | Accepted | 70 | 7736 | 271 | r = 1000000007
n, m = input().split()
n = int(n)
m = int(m)
if n==1:
output = (m+1)%r
print(output)
else:
l = (m+1) // (n-1) + 1
a = (m+1) - ((m+1) // (n-1)) * (n-1)
e = m+1
output = ((a+e)*l) // 2
output = 2*output - (m+1)
output = output % r
print(output) | p01939 |
<h2>B: えびちゃんと数列 - Ebi-chan and Integer Sequences -</h2>
<h3>問題</h3>
<p>
えびちゃんは数列が好きです。中でも等差数列が特に好きです。
今回は以下の条件を満たす数列を作ることにしました。
</p>
<ul>
<li> 長さ <var>n</var> の等差数列である</li>
<li> 数列の <var>i</var> 番目の要素を <var>s_i</var> と定める時、全ての <var>s_i (1 \leq i \leq n)</var> が <var>0 \leq s_i \leq m</var> を満たす整数である</li>
</ul>
... | 3 9
| 50
| 27,332 |
s346367365 | p01939 | u815718214 | 1505879023 | Python | Python3 | py | Accepted | 60 | 7720 | 269 | s = input()
n, m = s.split()
n = int(n)
m = int(m)
if n==1:
print((m+1)%1000000007)
else:
d = m // (n - 1)
A = m - d * (n-1) + 1
B = m - (n-1) + 1
ans = (A+B)*d + (m+1)
# ans = 2*(d*m+d)-(n-1)*(d+1)*d+m+1
ans %= 1000000007
print(ans) | p01939 |
<h2>B: えびちゃんと数列 - Ebi-chan and Integer Sequences -</h2>
<h3>問題</h3>
<p>
えびちゃんは数列が好きです。中でも等差数列が特に好きです。
今回は以下の条件を満たす数列を作ることにしました。
</p>
<ul>
<li> 長さ <var>n</var> の等差数列である</li>
<li> 数列の <var>i</var> 番目の要素を <var>s_i</var> と定める時、全ての <var>s_i (1 \leq i \leq n)</var> が <var>0 \leq s_i \leq m</var> を満たす整数である</li>
</ul>
... | 3 9
| 50
| 27,333 |
s315235156 | p01939 | u864932961 | 1505879962 | Python | Python | py | Accepted | 30 | 6460 | 186 | asd = raw_input()
asdd = asd.split()
n = int(asdd[0])
m = int(asdd[1])
if n == 1:
print (m+1)%1000000007
exit(0)
x=(m+1)/(n-1)
print (2*((m+1)*x-x*(n-1)*(x+1)/2)+m+1)%1000000007 | p01939 |
<h2>B: えびちゃんと数列 - Ebi-chan and Integer Sequences -</h2>
<h3>問題</h3>
<p>
えびちゃんは数列が好きです。中でも等差数列が特に好きです。
今回は以下の条件を満たす数列を作ることにしました。
</p>
<ul>
<li> 長さ <var>n</var> の等差数列である</li>
<li> 数列の <var>i</var> 番目の要素を <var>s_i</var> と定める時、全ての <var>s_i (1 \leq i \leq n)</var> が <var>0 \leq s_i \leq m</var> を満たす整数である</li>
</ul>
... | 3 9
| 50
| 27,334 |
s544311111 | p01939 | u899421036 | 1505881737 | Python | Python3 | py | Accepted | 50 | 7720 | 216 | n,m = map(int,input().split())
if(n == 1):
ans = (m+1)%1000000007
print(ans)
else:
d = int(m//(n-1))
ans = (m+1)*d - d*(d+1)//2*(n-1)
ans *= 2
ans += (m+1)
ans %= 1000000007
print(ans) | p01939 |
<h2>B: えびちゃんと数列 - Ebi-chan and Integer Sequences -</h2>
<h3>問題</h3>
<p>
えびちゃんは数列が好きです。中でも等差数列が特に好きです。
今回は以下の条件を満たす数列を作ることにしました。
</p>
<ul>
<li> 長さ <var>n</var> の等差数列である</li>
<li> 数列の <var>i</var> 番目の要素を <var>s_i</var> と定める時、全ての <var>s_i (1 \leq i \leq n)</var> が <var>0 \leq s_i \leq m</var> を満たす整数である</li>
</ul>
... | 3 9
| 50
| 27,335 |
s798086126 | p01939 | u231562319 | 1506593276 | Python | Python3 | py | Accepted | 50 | 7788 | 288 | MOD = 10**9+7
def sum(a,d,n):
return n*(2*a+(n-1)*d)//2
def main():
n,m = map(int,input().split())
s = 0
if n == 1:
s = m+1
else:
s = sum(m+1,-n+1,1+m//(n-1))
s *= 2
s -= (m+1)
print(s%MOD)
if __name__ == '__main__':
main() | p01939 |
<h2>B: えびちゃんと数列 - Ebi-chan and Integer Sequences -</h2>
<h3>問題</h3>
<p>
えびちゃんは数列が好きです。中でも等差数列が特に好きです。
今回は以下の条件を満たす数列を作ることにしました。
</p>
<ul>
<li> 長さ <var>n</var> の等差数列である</li>
<li> 数列の <var>i</var> 番目の要素を <var>s_i</var> と定める時、全ての <var>s_i (1 \leq i \leq n)</var> が <var>0 \leq s_i \leq m</var> を満たす整数である</li>
</ul>
... | 3 9
| 50
| 27,336 |
s100980663 | p01939 | u454317532 | 1593938652 | Python | Python3 | py | Accepted | 20 | 5600 | 163 | n,m=map(int,input().split())
mod1,mod2=10**9+7,998244353
mod=mod1
ans=(m+1)%mod
if n!=1:
a=m//(n-1)
ans=((m+1)*(a+1)+(m+1)*a-(n-1)*a*(a+1))%mod
print(ans)
| p01939 |
<h2>B: えびちゃんと数列 - Ebi-chan and Integer Sequences -</h2>
<h3>問題</h3>
<p>
えびちゃんは数列が好きです。中でも等差数列が特に好きです。
今回は以下の条件を満たす数列を作ることにしました。
</p>
<ul>
<li> 長さ <var>n</var> の等差数列である</li>
<li> 数列の <var>i</var> 番目の要素を <var>s_i</var> と定める時、全ての <var>s_i (1 \leq i \leq n)</var> が <var>0 \leq s_i \leq m</var> を満たす整数である</li>
</ul>
... | 3 9
| 50
| 27,337 |
s416987684 | p01945 | u123563150 | 1575542372 | Python | Python3 | py | Accepted | 20 | 5560 | 116 | s=input()
ans=0
for i in range(len(s)):
if s[i]=="*":
break
elif s[i]=="(":
ans+=1
else:
ans-=1
print(ans)
| p01945 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... | ((*)())
| 2
| 27,338 |
s555619749 | p01945 | u430736685 | 1575542252 | Python | Python3 | py | Accepted | 20 | 5564 | 312 | S = list(input())
S_l = len(S)
n=0
l = []
r = []
f_l, f_r = 0,0
for n in range(S.index('*')):
if S[n]== '(':
f_l += 1
elif S[n]== ')':
f_l -= 1
for n in range(S_l - S.index('*')):
if S[S_l-n-1] == ')':
f_r += 1
elif S[S_l-n-1]== '(':
f_r -= 1
print(min(f_r, f_l))
| p01945 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... | ((*)())
| 2
| 27,339 |
s114842041 | p01945 | u015993536 | 1575540767 | Python | Python3 | py | Accepted | 20 | 5556 | 147 | S=list(input())
N=S.index('*')
P=abs(S[0:N].count('(')-S[0:N].count(')'))
Q=abs(S[N+1:len(S)].count('(')-S[N+1:len(S)].count(')'))
print(min(P,Q))
| p01945 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... | ((*)())
| 2
| 27,340 |
s194095760 | p01945 | u199911712 | 1575539032 | Python | Python3 | py | Accepted | 30 | 5560 | 177 | line = input()
lebel = 0
for i in range(len(line)):
if line[i] == '*':
print(lebel)
break
if line[i] == '(':
lebel += 1
elif line[i] == ')':
lebel -= 1
| p01945 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... | ((*)())
| 2
| 27,341 |
s556325755 | p01945 | u048191691 | 1575538777 | Python | Python3 | py | Accepted | 20 | 5552 | 150 |
S = input()
n = 0
ans = 0
for i in S:
if i == "(":
n += 1
elif i == ")":
n -= 1
else:
print (n)
break
| p01945 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... | ((*)())
| 2
| 27,342 |
s364200104 | p01945 | u858560358 | 1543487205 | Python | Python3 | py | Accepted | 20 | 5548 | 88 | s = input()
while '()' in s:
s = s.replace('()', '')
else:
print(s.count('('))
| p01945 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... | ((*)())
| 2
| 27,343 |
s276235681 | p01956 | u598180909 | 1573712422 | Python | Python3 | py | Accepted | 20 | 5648 | 384 | n,h,w=map(int,input().split())
x=list(map(int,input().split()))
wide_total=n*w
wide_cover=[False]*wide_total
for i in range(n):
if (i+1)%2==1:
for j in range(i*w+x[i],i*w+x[i]+w):
wide_cover[j]=True
else:
for j in range(i*w-x[i],i*w-x[i]+w):
wide_cover[j]=True
cnt=0
for ... | p01956 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... | 4 3 3
1 1 2 3
| 9
| 27,344 |
s572056501 | p01956 | u853158149 | 1558079794 | Python | Python3 | py | Accepted | 40 | 8360 | 1,467 | #!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.... | p01956 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... | 4 3 3
1 1 2 3
| 9
| 27,345 |
s203234345 | p01957 | u853158149 | 1560520469 | Python | Python3 | py | Accepted | 40 | 8252 | 4,966 | #!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.... | p01957 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... | [[m-y]-[a-o]]
o 0
a 1
y 2
m 0
| Yes
| 27,346 |
s524770525 | p01957 | u858560358 | 1542881319 | Python | Python3 | py | Accepted | 40 | 6560 | 897 | import re
def main():
s = input()
d = {}
n = len(re.findall(r'\w', s))
for i in range(n):
a, v = input().split()
v = int(v)
d[a] = v
prog = re.compile(r'\[(\w)-(\w)\]')
m = prog.search(s)
while m is not None:
c1, c2 = m.group(1, 2)
if d[c1] == d[c2]:... | p01957 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... | [[m-y]-[a-o]]
o 0
a 1
y 2
m 0
| Yes
| 27,347 |
s513497936 | p01968 | u081847415 | 1522201360 | Python | Python3 | py | Accepted | 30 | 6020 | 671 | # -*- coding: utf-8 -*-
from collections import Counter
def inpl(): return tuple(map(int, input().split()))
N = int(input())
A = list(map(int, input().split()))
C = Counter(A)
if C[-2] % 2 == 0:
ans = [i+1 for i, a in enumerate(A) if abs(a) == 2]
print(len(ans))
if len(ans):
print(*ans, sep="\n")
... | p01968 | <h2>B: 階層的計算機 (Hierarchical Calculator)</h2>
<h3>Problem</h3>
<p>Ebi-chan has <var>N</var> formulae: <var>y = a_i x</var> for <var>i =1, ..., N</var> (inclusive). Now she considers a subsequence of indices with length <var>k</var>: <var>s_1</var>, <var>s_2</var>, <var>...</var>, <var>s_k</var>. At first, let <var>x... | 4
2 0 -2 1
| 1
1
| 27,348 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.