s_id string | p_id string | u_id string | date string | language string | original_language string | filename_ext string | status string | cpu_time string | memory string | code_size string | code string | error string | stdout string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s063069167 | p02557 | u456910011 | 1600026605 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8956 | 2557 | /*
_ _
| |__ | |__ __ _ __ _ _ _ __ _
| '_ \| '_ \ / _` |/ _` | | | |/ _` |
| |_) | | | | (_| | (_| | |_| | (_| |
|_.__/|_| |_|\__,_|\__, |\__, |\__,_|
|___/ |___/
*/
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#... | File "/tmp/tmpcej8emw_/tmp21mnl1h7.py", line 1
/*
^
SyntaxError: invalid syntax
| |
s306736426 | p02557 | u667084803 | 1600026547 | Python | PyPy3 (7.3.0) | py | Runtime Error | 300 | 171868 | 269 | from collections import Counter, deque
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A_cn = Counter(A)
B_cn = Counter(B)
AB_cn = Counter(A+B)
if AB_cn.most_common()[0][1] > 2*N:
print("No")
else:
print("Yes")
0/0
| Traceback (most recent call last):
File "/tmp/tmph9t8pury/tmp8lfsibu9.py", line 3, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s052263086 | p02557 | u867320886 | 1600026520 | Python | Python (3.8.2) | py | Runtime Error | 712 | 81588 | 812 | import sys
from collections import Counter
import heapq
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a_count = Counter(a)
b_count = Counter(b)
for i in a_count.keys():
if a_count[i] + b_count[i] > n:
print("No")
sys.exit()
b_can = []
for k,v in b_count.i... | Traceback (most recent call last):
File "/tmp/tmpvt7k9gg5/tmpct6v77pc.py", line 5, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s243098192 | p02557 | u723792785 | 1600026301 | Python | PyPy3 (7.3.0) | py | Runtime Error | 217 | 156864 | 515 | from collections import Counter
n = int(input())
a = list(map(int,input().split()))
ac = Counter(a)
b = list(map(int,input().split()))
bc = Counter(b)
mode = 1
for i in range(n):
if ac[i] > n - bc[i]:
mode = 0
break
if mode:
print("Yes")
b.reverse()
ansl = [0 for _ in range(n)]
i = 0
while i < n:
if a[i] ... | Traceback (most recent call last):
File "/tmp/tmp7za1cz10/tmpw7ci74h_.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s831507353 | p02557 | u111365362 | 1600026214 | Python | PyPy3 (7.3.0) | py | Runtime Error | 160 | 126780 | 583 | n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
b.reverse()
c = []
cs = -1
for i in range(n):
if a[i] > b[i]:
c.append(1)
elif a[i] == b[i]:
c.append(0)
e = a[i]
if cs == -1:
cs = i
else:
c.append(-1)
#print(a)
#print(b)
#print(c)
ans = 0
for i in r... | Traceback (most recent call last):
File "/tmp/tmp9jnl19jr/tmp86dct_n3.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s023408102 | p02557 | u102461423 | 1600025765 | Python | Python (3.8.2) | py | Runtime Error | 232 | 49092 | 1370 | import sys
from heapq import *
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))
countA = [0] * (N + 1)
countB = [0] * (N + 1)
for x in A:
countA[x] += 1
for x ... | Traceback (most recent call last):
File "/tmp/tmp_mo7_h4f/tmpsw0m309c.py", line 8, in <module>
N = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: b''
| |
s574137566 | p02557 | u969708690 | 1600025520 | Python | Python (3.8.2) | py | Runtime Error | 321 | 59484 | 487 | import collections
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
L=A+B
c = collections.Counter(L)
for i in c:
if c[i]>N:
print("No")
exit()
c = collections.Counter(B)
K=list(c)
M=dict(c)
ans=list()
for i in range(N):
if A[i]==K[-1]:
ans.append(K[-2])
M[K[-2]]-=1
... | Traceback (most recent call last):
File "/tmp/tmpnos0vfl9/tmpnfqpmf93.py", line 3, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s350489124 | p02557 | u102461423 | 1600025303 | Python | Python (3.8.2) | py | Runtime Error | 2210 | 174472 | 1355 | import sys
from heapq import *
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))
countA = [0] * (N + 1)
countB = [0] * (N + 1)
for x in A:
countA[x] += 1
for x ... | Traceback (most recent call last):
File "/tmp/tmpu9725mbg/tmpzm8topsq.py", line 8, in <module>
N = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: b''
| |
s115834967 | p02557 | u102461423 | 1600025242 | Python | Python (3.8.2) | py | Runtime Error | 2210 | 164980 | 1271 | import sys
from heapq import *
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))
countA = [0] * (N + 1)
countB = [0] * (N + 1)
for x in A:
countA[x] += 1
for x ... | Traceback (most recent call last):
File "/tmp/tmp0_gstrs_/tmppz5a4ng8.py", line 8, in <module>
N = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: b''
| |
s568614117 | p02557 | u102461423 | 1600025171 | Python | Python (3.8.2) | py | Runtime Error | 2210 | 163548 | 1271 | import sys
from heapq import *
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))
countA = [0] * (N + 1)
countB = [0] * (N + 1)
for x in A:
countA[x] += 1
for x ... | Traceback (most recent call last):
File "/tmp/tmpgbcfdsuu/tmpa9egip08.py", line 8, in <module>
N = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: b''
| |
s405465991 | p02557 | u873915460 | 1600024603 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2208 | 108124 | 502 | N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=[0]*N
D=[0]*N
for i in range(N):
C[A[i]-1]+=1
D[B[i]-1]+=1
E,F=max(C),max(D)
if min(E,F)>N//2 and C.index(E)==D.index(F):
print('No')
exit()
B=B[::-1]
U=[0]*N
for i in range(N):
if U[i]:
continue
if A[i]==B[i]:
j=i+1
... | Traceback (most recent call last):
File "/tmp/tmpiadfb7g8/tmpmyr5ta95.py", line 1, in <module>
N=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s413883470 | p02558 | u543954314 | 1600703964 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8928 | 1499 | #![allow(unused_imports, non_snake_case, dead_code)]
use proconio::{
input, fastout,
marker::{Chars, Bytes, Usize1}
};
struct UnionFind {
size: usize,
pos: Vec<isize>,
}
impl UnionFind {
fn new(n: usize) -> Self {
let size = n;
let pos = vec![-1; n + 1];
UnionFind { size, po... | File "/tmp/tmp814yogl0/tmp0abnni1g.py", line 2
use proconio::{
^^^^^^^^
SyntaxError: invalid syntax
| |
s614527875 | p02558 | u095094246 | 1600563942 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9336 | 1800 | N, Q = map(int, input().split())
dsu = DSU(N)
for _ in range(Q):
t, u, v = map(int, input().split())
if t == 0:
# add line
dsu.merge(u, v)
else:
# concat
if dsu.same(u, v):
print(1)
else:
print(0)
import typing
class DSU:
'''
Implem... | Traceback (most recent call last):
File "/tmp/tmpyxo7507d/tmpz2v2imf2.py", line 1, in <module>
N, Q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s109104563 | p02558 | u658655325 | 1600544035 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8932 | 356 | #include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
int main() {
int N, Q;
cin >> N >> Q;
dsu d(N);
for (int i = 0; i < Q; i++) {
int t, u, v;
cin >> t >> u >> v;
if (t) {
cout << d.same(u, v) << endl;
} else {
... | File "/tmp/tmp1pkcqaj9/tmpcv7v8ntf.py", line 3
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s238984146 | p02558 | u077291787 | 1600308978 | Python | PyPy3 (7.3.0) | py | Runtime Error | 91 | 68636 | 915 | class UnionFind:
__slots__ = ["_data_size", "_roots"]
def __init__(self, data_size: int) -> None:
self._data_size = data_size
self._roots = [-1] * data_size
def __getitem__(self, x: int) -> int:
while self._roots[x] >= 0:
x = self._roots[x]
return x
def is_... | Traceback (most recent call last):
File "/tmp/tmp479ovnjx/tmp589d4mdx.py", line 30, in <module>
N, _, *X = map(int, readline().split())
^^^^^^^^
NameError: name 'readline' is not defined
| |
s004825740 | p02558 | u034128150 | 1600283356 | Python | PyPy3 (7.3.0) | py | Runtime Error | 5564 | 2052640 | 4489 | # https://atcoder.jp/contests/practice2/submissions/16598132
# 上記のリンクの提出をいじらせてもらってます。
class mf_graph:
__slots__ = ["N", "graph", "capacities", "level", "it"]
def __init__(self, N):
self.N = N
self.graph = [[] for _ in range(N)]
self.capacities = [dict() for _ in range(N)]
def add... | Traceback (most recent call last):
File "/tmp/tmp4p68u9uz/tmp7zf5luup.py", line 98, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s953352516 | p02558 | u034128150 | 1600282850 | Python | PyPy3 (7.3.0) | py | Runtime Error | 5595 | 2017012 | 4544 | # import cProfile
# https://atcoder.jp/contests/practice2/submissions/16598132
# 上記のリンクの提出をいじらせてもらってます。
# from collections import deque
class mf_graph:
# __slots__ = ["N", "graph", "capacities", "level", "it"]
def __init__(self, N):
self.N = N
self.graph = [[] for _ in range(N)]
se... | Traceback (most recent call last):
File "/tmp/tmpm597wck2/tmpdeu3g3q7.py", line 102, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s874333383 | p02558 | u722217673 | 1600211172 | Python | PyPy3 (7.3.0) | py | Runtime Error | 123 | 90248 | 516 | import sys
def input(itr=iter(sys.stdin.readlines())): # pylint: disable= redefined-builtin
return next(itr).rstrip('\n\r')
###############################################################################
from networkx.utils.union_find import UnionFind
N, Q = map(int, input().split())
uf = UnionFind()
responses ... | Traceback (most recent call last):
File "/tmp/tmpze90j4nd/tmpv0ff4n6q.py", line 8, in <module>
N, Q = map(int, input().split())
^^^^^^^
File "/tmp/tmpze90j4nd/tmpv0ff4n6q.py", line 3, in input
return next(itr).rstrip('\n\r')
^^^^^^^^^
StopIteration
| |
s952110197 | p02558 | u201234972 | 1600111286 | Python | Python (3.8.2) | py | Runtime Error | 216 | 39324 | 855 | import sys
input = sys.stdin.readline
def find(A,x):
p = A[x]
if p == x:
return x
a = find(A,p)
A[x] = a
return a
def union(A, x, y):
# bx, by = sorted([find(A,x), find(A,y)]) # bx, by = find(A,x), find(A,y)だと無限ループ。
if find(A,x) > find(A,y):
bx, by = find(A,y), find(A,x)
... | Traceback (most recent call last):
File "/tmp/tmp53livlro/tmp5_w6ouw_.py", line 36, in <module>
main()
File "/tmp/tmp53livlro/tmp5_w6ouw_.py", line 21, in main
N, Q = map( int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s373503345 | p02558 | u187516587 | 1599994962 | Python | PyPy3 (7.3.0) | py | Runtime Error | 85 | 68660 | 1321 | def input():
return sys.stdin.readline()[:-1]
sys.setrecursionlimit(300000)
class uf:
def __init__(self,n):
self.n=n
self.l=[-1]*n
def ro(self,n): #root
if self.l[n]<0:
return n
r=self.ro(self.l[n])
self.l[n]=r
return r
def me(self,a,b)... | Traceback (most recent call last):
File "/tmp/tmpozp9kpmv/tmpxu055qsr.py", line 3, in <module>
sys.setrecursionlimit(300000)
^^^
NameError: name 'sys' is not defined
| |
s022664977 | p02558 | u729133443 | 1599991139 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9020 | 989 | code = r"""
# distutils: language=c++
# distutils: include_dirs=opt/atcoder-stl
from libcpp cimport bool
from libcpp.vector cimport vector
cdef extern from "<atcoder/dsu>" namespace "atcoder" nogil:
cdef cppclass dsu:
dsu(int n)
int merge(int a, int b)
bool same(int a, int b)
int lea... | Traceback (most recent call last):
File "/tmp/tmpc1d_sxdm/tmplkcfij1i.py", line 36, in <module>
import solve
ModuleNotFoundError: No module named 'solve'
| |
s855316686 | p02558 | u102655885 | 1599942730 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9024 | 1364 | class UnionFind:
def __init__(self, length):
self.parent_indexes = [-1]* length
def union(self, i, j):
if self.are_in_the_same_group(i, j):
return
# iが所属する集団のサイズ>=jが所属する集団のサイズにする
if self.get_group_size(i) < self.get_group_size(j):
i, j = j, i
... | File "/tmp/tmpv542k2ld/tmp_fjmqd5i.py", line 11
parent_of_i = self.find(i)
IndentationError: unexpected indent
| |
s872207323 | p02558 | u102655885 | 1599940481 | Python | Python (3.8.2) | py | Runtime Error | 30 | 10404 | 1345 |
class UnionFind():
def __init__(self, n):
self.n = n
self.parents = [-1] * n
def find(self, x):
if self.parents[x] < 0:
return x
else:
self.parents[x] = self.find(self.parents[x])
return self.parents[x]
def union(self, x, y):
x =... | Traceback (most recent call last):
File "/tmp/tmpuuhi73d5/tmppgliwr5x.py", line 47, in <module>
n, q = list(map(lambda x: int(x), input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s462932513 | p02558 | u102655885 | 1599940229 | Python | Python (3.8.2) | py | Runtime Error | 2364 | 140804 | 1357 | class UnionFind:
def __init__(self, length):
self.parent_indexes = [-1]* length
def union(self, i, j):
if i == j:
return
# iが所属する集団のサイズ>=jが所属する集団のサイズにする
if self.get_group_size(i) < self.get_group_size(j):
i, j = j, i
self.parent_indexes[i]... | Traceback (most recent call last):
File "/tmp/tmpg4ssk075/tmpp_y_aksb.py", line 32, in <module>
n, q = list(map(lambda x: int(x), input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s408621468 | p02558 | u102655885 | 1599939916 | Python | Python (3.8.2) | py | Runtime Error | 802 | 12360 | 1305 | class UnionFind:
def __init__(self, length):
self.parent_indexes = [-1]* length
def union(self, i, j):
# iが所属する集団のサイズ>=jが所属する集団のサイズにする
if self.get_group_size(i) < self.get_group_size(j):
i, j = j, i
self.parent_indexes[i] = - self.get_group_size(i) - self.get... | Traceback (most recent call last):
File "/tmp/tmp1gvksll3/tmps3h_2sj5.py", line 30, in <module>
n, q = list(map(lambda x: int(x), input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s228761989 | p02558 | u102655885 | 1599935470 | Python | Python (3.8.2) | py | Runtime Error | 721 | 42440 | 352 | from collections import defaultdict
links = defaultdict(set)
n, q = list(map(lambda x: int(x), input().split()))
for _ in range(n):
t, u, v = list(map(lambda x: int(x), input().split()))
if t == 0:
links[min(u, v)].add(max(u, v))
links[v].add(u)
continue
print('1') if max(u, v) in l... | Traceback (most recent call last):
File "/tmp/tmphm1m11jp/tmpn22dib52.py", line 4, in <module>
n, q = list(map(lambda x: int(x), input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s399830650 | p02558 | u942356554 | 1599906026 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9140 | 432 | n,m,t = map(int,input().split())
shop = []
for i in range(n):
shop.append([0]*t)
cash = []
for i in range(m):
ts, id1 = map(int,input().split())
shop[id1-1][ts-1] += 1
for i in range(len(shop)):
chek = 0
for j in range(t):
if shop[i][j] == 0:
if chek != 0:
chek-=... | Traceback (most recent call last):
File "/tmp/tmp1agreybo/tmpcvls2gc2.py", line 1, in <module>
n,m,t = map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s155688470 | p02558 | u509368316 | 1599845997 | Python | Python (3.8.2) | py | Runtime Error | 421 | 45440 | 1884 | code = r"""
# distutils: language=c++
# distutils: include_dirs=[/home/contestant/.local/lib/python3.8/site-packages/numpy/core/include,/opt/atcoder-stl]
# cython: boundscheck=False
# cython: wraparound=False
from libcpp cimport bool
from libcpp.vector cimport vector
cdef extern from "/opt/atcoder-stl/atcoder/dsu.hpp" ... | /tmp/tmphrigdpao/atcoder.cpp:1155:10: fatal error: /opt/atcoder-stl/atcoder/dsu.hpp: No such file or directory
1155 | #include "/opt/atcoder-stl/atcoder/dsu.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command '/bin/g++' failed with exit code 1
Traceback (most recent call las... | Compiling /tmp/tmphrigdpao/atcoder.pyx because it changed.
[1/1] Cythonizing /tmp/tmphrigdpao/atcoder.pyx
|
s434574315 | p02558 | u767543103 | 1599776264 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9060 | 69418 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
// const ll MOD = 1000000007;
const ll MOD = 998244353;
const ll INF = MOD * MOD;
const long double EPS = 1e-12;
struct mint {
ll x;
mint(ll x = 0): x((x % MOD + MOD) % MOD){}
mint operator-() const {return mint(-x)... | File "/tmp/tmpd4l1dtuk/tmprk52_f2z.py", line 216
// priority queue. Taking from the higher value. Don't forget calling !q.empty()
^
SyntaxError: unterminated string literal (detected at line 216)
| |
s272576090 | p02558 | u576335153 | 1599747335 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8984 | 2529 | // package jp.atcoder.library.kotlin.dsu
import java.util.*
/**
* Disjoint set union.
*/
class DSU(private val n: Int) {
private val parentOrSize = IntArray(n)
/**
* Merge nodes.
*/
fun merge(a: Int, b: Int): Int {
if (a !in 0 until n) throw IndexOutOfBoundsException("a=$a")
i... | File "/tmp/tmpnih32cco/tmpyeh396jk.py", line 52
* A group's size.
^
SyntaxError: unterminated string literal (detected at line 52)
| |
s729625363 | p02558 | u029574076 | 1599687883 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8956 | 7116 | #ifndef ATCODER_CONVOLUTION_HPP
#define ATCODER_CONVOLUTION_HPP 1
#include <algorithm>
#include <array>
#include <atcoder/internal_bit>
#include <atcoder/modint>
#include <cassert>
#include <type_traits>
#include <vector>
namespace atcoder {
namespace internal {
template <class mint, internal::is_static_modint_t<mi... | File "/tmp/tmpkdx763n1/tmp3sm5tt35.py", line 191
// (x, x - M, x - 2M, or x - 3M) = r (mod 2B)
^
SyntaxError: invalid decimal literal
| |
s244935369 | p02558 | u029574076 | 1599686969 | Python | Python (3.8.2) | py | Runtime Error | 51 | 12500 | 1981 | #!/usr/bin/env python3
import re
import sys
import argparse
from logging import Logger, basicConfig, getLogger
from os import getenv, environ
from pathlib import Path
from typing import List
logger = getLogger(__name__) # type: Logger
atcoder_include = re.compile('#include\s*["<](atcoder/[a-z_]*(|.hpp))[">]\s*')
... | usage: tmpnl0wf9vo.py [-h] [-c] [--lib LIB] source
tmpnl0wf9vo.py: error: the following arguments are required: source
| |
s771771364 | p02558 | u201928947 | 1599642446 | Python | PyPy3 (7.3.0) | py | Runtime Error | 5565 | 2053352 | 3043 | from collections import deque
class mf_graph:
def __init__(self,N):
self.N = N
self.graph = [[] for _ in range(N)]
def add_edge(self,v,w,cap):
edge = [w,cap,None]
edge[2] = rev_edge = [v,0,edge]
self.graph[v].append(edge)
self.graph[w].append(rev_edge)
... | Traceback (most recent call last):
File "/tmp/tmphhh0di3m/tmpnfsunn8j.py", line 63, in <module>
N,M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s720272159 | p02558 | u193880030 | 1599640763 | Python | Python (3.8.2) | py | Runtime Error | 332 | 53336 | 269 | import networkx as nx
n, q = map(int, input().split())
G = nx.Gragh()
for i in range(q):
t, u, v = map(int, input().split())
if t == 0:
G.add_edge(u, v)
else:
if len(nx.shortest_path(G, source=u, target=v)) == 0:
print(0)
else:
print(1) | Traceback (most recent call last):
File "/tmp/tmpfobjbdgk/tmpk0ayq9x5.py", line 3, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s943654012 | p02558 | u279493135 | 1599625224 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9060 | 204 | import networkx as nx
def MAP(): return map(int, input().split())
n,q=MAP()
g=nx.utils.UnionFind(range(n))
for _ in range(q):
t,u,v=MAP()
if t==0:g.union(u,v)
else:print(1 if g[u]==g[v] else 0 | File "/tmp/tmpn223k2qd/tmpc1gfxzix.py", line 8
else:print(1 if g[u]==g[v] else 0
^
SyntaxError: '(' was never closed
| |
s795753925 | p02558 | u875291233 | 1599600166 | Python | PyPy3 (7.3.0) | py | Runtime Error | 91 | 68704 | 530 | # coding: utf-8
# Your code here!
def floor_sum(n,m,a,b):
ans = n*(b//m)
b %= m
while True:
ans += (n-1)*n*(a//m)//2
a %= m
if a*n+b < m:
return ans
y_max = (a*n + b)//m
b -= y_max*m #now we have x_max = -(b//a)
ans += (n + b//a)*y_max
n =... | Traceback (most recent call last):
File "/tmp/tmpwmsw0g_7/tmpvc491uom.py", line 21, in <module>
T = int(input())
^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: b''
| |
s425907026 | p02558 | u571969099 | 1599589635 | Python | PyPy3 (7.3.0) | py | Runtime Error | 311 | 77524 | 1909 | import sys
input = sys.stdin.readline
from typing import List
class DSU:
def __init__(self, n: int) -> None:
self._n = n
self.parent_or_size = [-1] * n
def merge(self, a: int, b: int) -> int:
assert 0 <= a <= self._n
assert 0 <= b <= self._n
x, y = self.leader(a), self.... | Traceback (most recent call last):
File "/tmp/tmprw2ifna8/tmpmeh7y4o8.py", line 53, in <module>
n, q = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s602031660 | p02558 | u225388820 | 1599576884 | Python | PyPy3 (7.3.0) | py | Runtime Error | 90 | 68536 | 2469 | class UnionFind:
def __init__(self, N: int):
"""
N:要素数
root:各要素の親要素の番号を格納するリスト.
ただし, root[x] < 0 ならその頂点が根で-root[x]が木の要素数.
rank:ランク
"""
self.N = N
self.root = [-1] * N
self.rank = [0] * N
def __repr__(self):
return '\n'.join('{... | File "/tmp/tmpf5jrrdpk/tmp9nsx6iro.py", line 77
print(int(uf.same(u, v)])
^
SyntaxError: closing parenthesis ']' does not match opening parenthesis '('
| |
s511682019 | p02558 | u227082700 | 1599569296 | Python | Python (3.8.2) | py | Runtime Error | 261 | 11900 | 832 | import sys
input = lambda: sys.stdin.readline().rstrip()
# UnionFind
class UnionFind:
def __init__(self,n):
self.n=n
self.a=[-1]*n
self.siz=n
def root_find(self,x):
if self.a[x]<0:
return x
else:
self.a[x]=self.root_find(self.a[x])
ret... | Traceback (most recent call last):
File "/tmp/tmpolipax3u/tmpzxkqz4tf.py", line 28, in <module>
n,q=map(int,input().split())
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s772728116 | p02558 | u700805562 | 1599567671 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9212 | 874 | class UnionFind:
def __init__(self, size):
self.par = [-1] * size
def find(self, x):
if self.par[x] < 0:
return x
else:
self.par[x] = self.find(self.par[x])
return self.par[x]
def unite(self, x, y):
x, y = self.find(x), self.find(... | Traceback (most recent call last):
File "/tmp/tmp5wqypzsm/tmph0vx6ipm.py", line 27, in <module>
N, Q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s139766382 | p02558 | u284854859 | 1599564553 | Python | PyPy3 (7.3.0) | py | Runtime Error | 132 | 69328 | 988 | #Union Find
#xの根を求める
def find(x):
if par[x] < 0:
return x
else:
tank = []
while par[x] >= 0:
tank.append(x)
x = par[x]
for elt in tank:
par[elt] = x
return x
#xとyの属する集合の併合
def unite(x,y):
x = find(x)
y = find(y)
if x =... | Traceback (most recent call last):
File "/tmp/tmp5miy74e4/tmp8uyfiynm.py", line 42, in <module>
n,q = map(int,input().split())
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s387924309 | p02558 | u965730380 | 1599515396 | Python | PyPy3 (7.3.0) | py | Runtime Error | 99 | 68444 | 1162 | #include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <atcoder/dsu>
using namespace std;
using namespace atcode... | File "/tmp/tmprpkord_u/tmp05xstrnd.py", line 16
using namespace std;
^^^^^^^^^
SyntaxError: invalid syntax
| |
s562145071 | p02559 | u597455618 | 1600305746 | Python | Python (3.8.2) | py | Runtime Error | 1802 | 145948 | 1004 | import numpy as np
from numba import njit, i8, jitclass
import sys
spec = [
("size", i8),
("tree", i8[:])
]
@jitclass(spec)
class Bit:
def __init__(self, n, arr):
self.size = n
self.tree = np.array([0] + arr, np.int64)
for i in range(1, n+1):
self.tree[i + 1 | i + 2] +... | Traceback (most recent call last):
File "/tmp/tmpvulp1qvy/tmpowa9msz_.py", line 2, in <module>
from numba import njit, i8, jitclass
ImportError: cannot import name 'jitclass' from 'numba' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/site-packages/numba/__init__.py)
| |
s759856812 | p02559 | u597455618 | 1600305707 | Python | Python (3.8.2) | py | Runtime Error | 1785 | 146308 | 1003 | import numpy as np
from numba import njit, i8, jitclass
import sys
spec = [
("size", i8),
("tree", i8[:])
]
@jitclass(spec)
class Bit:
def __init__(self, n, arr):
self.size = n
self.tree = np.array([0] + arr, np.int64)
for i in range(1, n+1):
self.tree[i + (i & -i)] +=... | Traceback (most recent call last):
File "/tmp/tmpxanx4bbf/tmpedanplf9.py", line 2, in <module>
from numba import njit, i8, jitclass
ImportError: cannot import name 'jitclass' from 'numba' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/site-packages/numba/__init__.py)
| |
s805796337 | p02559 | u597455618 | 1600302846 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9152 | 908 | import sys
class Bit:
def __init__(self, n, arr):
self.size = n
self.tree = [0] + arr
for i in range(1, n+1):
if i + (i & -i) < n+1:
self.tree[i + (i & -i)] += self.tree[i]
def sum(self, i):
s = 0
while i > 0:
s += self.tree[i]
... | Traceback (most recent call last):
File "/tmp/tmpdnpx9hwc/tmp6kkm6z0e.py", line 41, in <module>
main()
File "/tmp/tmpdnpx9hwc/tmp6kkm6z0e.py", line 29, in main
n, q = map(int, sys.stdin.buffer.readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s146548795 | p02559 | u597455618 | 1600300015 | Python | Python (3.8.2) | py | Runtime Error | 1190 | 60888 | 803 | import sys
class Bit:
def __init__(self, n):
self.size = n
self.tree = [0] * (n + 1)
def sum(self, i):
s = 0
while i > 0:
s += self.tree[i]
i -= i & -i
return s
def add(self, i, x):
while i <= self.size:
self.tree[i] += ... | Traceback (most recent call last):
File "/tmp/tmpcemu0z5v/tmps5r2wjki.py", line 39, in <module>
main()
File "/tmp/tmpcemu0z5v/tmps5r2wjki.py", line 24, in main
n, q = map(int, sys.stdin.buffer.readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s613531226 | p02559 | u785989355 | 1600199941 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8940 | 840 | # distutils: language=c++
# distutils: include_dirs=[/home/contestant/.local/lib/python3.8/site-packages/numpy/core/include, /opt/atcoder-stl]
# cython: boundscheck=False
# cython: wraparound=False
cimport numpy as np
cdef extern from "<atcoder/fenwicktree>" namespace "atcoder" nogil:
cdef cppclass fenwick_tree[T]:... | File "/tmp/tmp1dyfwiz3/tmpb21hx4xo.py", line 5
cimport numpy as np
^^^^^
SyntaxError: invalid syntax
| |
s372939922 | p02559 | u785989355 | 1600199673 | Python | Python (3.8.2) | py | Runtime Error | 253 | 83848 | 1408 |
code = """
# distutils: language=c++
# distutils: include_dirs=[/home/USERNAME/.local/lib/python3.8/site-packages/numpy/core/include, /opt/atcoder-stl]
# cython: boundscheck=False
# cython: wraparound=False
cimport numpy as np
cdef extern from "<atcoder/fenwicktree>" namespace "atcoder" nogil:
cdef cppclass fen... | Traceback (most recent call last):
File "/tmp/tmpqcqvd4y0/tmp5enuz3a1.py", line 42, in <module>
from atcoder import FenwickTree
ModuleNotFoundError: No module named 'atcoder'
| |
s172951863 | p02559 | u785989355 | 1600147083 | Python | Python (3.8.2) | py | Runtime Error | 879 | 63584 | 1216 |
code = """
# distutils: language=c++
# distutils: include_dirs=[/home/contestant/.local/lib/python3.8/site-packages/numpy/core/include, /opt/atcoder-stl]
# cython: boundscheck=False
# cython: wraparound=False
cdef extern from "<atcoder/fenwicktree>" namespace "atcoder":
cdef cppclass fenwick_tree[T]:
fe... | Traceback (most recent call last):
File "/tmp/tmpacd9b0pk/tmp0w9ev_u8.py", line 33, in <module>
from atcoder import FenwickTree
ModuleNotFoundError: No module named 'atcoder'
| |
s843063672 | p02559 | u353919145 | 1600023343 | Python | Python (3.8.2) | py | Runtime Error | 5513 | 65212 | 805 | def p(k: int):
ans = 0
for i in range(20):
if k % (1<<i) == 0:
ans = i
else:
break
return ans
def sum_f(k: int, tree: list):
s = 0
while k >= 1:
s += tree[k]
k -= k&-k
return s
def add(k: int, x: int, tree: list):
while k <= len(tree)... | Traceback (most recent call last):
File "/tmp/tmpe3b31i12/tmpxa3pea27.py", line 37, in <module>
main()
File "/tmp/tmpe3b31i12/tmpxa3pea27.py", line 23, in main
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s032825749 | p02559 | u767543103 | 1599950108 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9012 | 3118 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vl2;
const bool multiple_queries = false;
#define rep(i, n) for(ll i = 0; i < (n) ; ++i)
#define For(i, a, b) for(ll i = (a); i < (b) ; ++i)
#define revrep(i, n) for(ll i = (n) - 1; i >= 0 ; --i)
#define revFo... | File "/tmp/tmp63kp2jev/tmp9xk9_us1.py", line 23
// x & - x: 0001 0010 0100 0001 0001 0001
^^^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers
| |
s094420569 | p02559 | u102655885 | 1599949035 | Python | Python (3.8.2) | py | Runtime Error | 245 | 65032 | 601 | n, q = list(map(lambda x: int(x), input().split()))
list_a = list(map(lambda x: int(x), input().split()))
# element of ith index is the sum of subarray: list_a[:i+1]
current_sum = 0
sum_list_a = []
for ele in list_a:
# print(ele, current_sum)
current_sum += ele
sum_list_a.append(current_sum)
for _ in rang... | Traceback (most recent call last):
File "/tmp/tmpvdttc3f8/tmpc5o8_q8j.py", line 1, in <module>
n, q = list(map(lambda x: int(x), input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s874156747 | p02559 | u102655885 | 1599948555 | Python | Python (3.8.2) | py | Runtime Error | 246 | 65060 | 593 | n, q = list(map(lambda x: int(x), input().split()))
list_a = list(map(lambda x: int(x), input().split()))
# element of ith index is the sum of subarray: list_a[:i+1]
current_sum = 0
sum_list_a = []
for ele in list_a:
# print(ele, current_sum)
current_sum += ele
sum_list_a.append(current_sum)
for _ in rang... | Traceback (most recent call last):
File "/tmp/tmpocdfepo_/tmpc_fzgqql.py", line 1, in <module>
n, q = list(map(lambda x: int(x), input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s199127969 | p02559 | u350248178 | 1599948326 | Python | Python (3.8.2) | py | Runtime Error | 149 | 65132 | 457 | n,q=map(int,input().split())
a=list(map(int,input().split()))
bit=[0]*(2*n+10)
def bit_update(x,v):
while x<size:
bit[x]+=v
x+=(x&-x)
def bit_sum(n):
s=0
if n==0:return 0
x=n
while x>0:
s+=bit[x]
x-=(x&-x)
return s
for i,j in enumerate(a,1):
bit_update(i,j)
fo... | Traceback (most recent call last):
File "/tmp/tmpws1yt4wa/tmpy19cbcm0.py", line 1, in <module>
n,q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s962255041 | p02559 | u350248178 | 1599948260 | Python | Python (3.8.2) | py | Runtime Error | 2349 | 65076 | 468 | n,q=map(int,input().split())
a=list(map(int,input().split()))
size=(1<<18)+1
bit=[0]*size
def bit_update(x,v):
while x<size:
bit[x]+=v
x+=(x&-x)
def bit_sum(n):
s=0
if n==0:return 0
x=n
while x>0:
s+=bit[x]
x-=(x&-x)
return s
for i,j in enumerate(a,1):
bit_upd... | Traceback (most recent call last):
File "/tmp/tmpzy_u6yaf/tmponjpuffe.py", line 1, in <module>
n,q=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s633982838 | p02559 | u102655885 | 1599944973 | Python | Python (3.8.2) | py | Runtime Error | 247 | 65196 | 570 | n, q = list(map(lambda x: int(x), input().split()))
list_a = list(map(lambda x: int(x), input().split()))
# element of ith index is the sum of subarray: list_a[:i+1]
current_sum = 0
sum_list_a = []
for ele in list_a:
# print(ele, current_sum)
current_sum += ele
sum_list_a.append(current_sum)
for _ in rang... | Traceback (most recent call last):
File "/tmp/tmprwohz300/tmpyfohwws5.py", line 1, in <module>
n, q = list(map(lambda x: int(x), input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s832963549 | p02559 | u708618797 | 1599727343 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9048 | 916 | code = r"""
# distutils: language=c++
# distutils: include_dirs=/home/contestant/.local/lib/python3.8/site-packages/numpy/core/include
# cython: boundscheck=False
# cython: wraparound=False
from libcpp cimport bool
from libcpp.vector cimport vector
cdef extern from "/opt/atcoder-stl/atcoder/fenwicktree.hpp" namespace "... | Traceback (most recent call last):
File "/tmp/tmpamwpaucz/tmpzqcakufv.py", line 32, in <module>
import solve
ModuleNotFoundError: No module named 'solve'
| |
s211710817 | p02559 | u708618797 | 1599727271 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9040 | 915 | code = r"""
# distutils: language=c++
# distutils: include_dirs=/home/contestant/.local/lib/python3.8/site-packages/numpy/core/include
# cython: boundscheck=False
# cython: wraparound=False
from libcpp cimport bool
from libcpp.vector cimport vector
cdef extern from "/opt/atcoder-stl/atcoder/fenwicktree.hpp" namespace "... | Traceback (most recent call last):
File "/tmp/tmpfq3wl9js/tmpx3gvtqqs.py", line 32, in <module>
import solve
ModuleNotFoundError: No module named 'solve'
| |
s655450438 | p02559 | u708618797 | 1599727124 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9104 | 909 | code = r"""
# distutils: language=c++
# distutils: include_dirs=/home/contestant/.local/lib/python3.8/site-packages/numpy/core/include
# cython: boundscheck=False
# cython: wraparound=False
from libcpp cimport bool
from libcpp.vector cimport vector
cdef extern from "/opt/atcoder-stl/atcoder/fenwicktree.hpp" namespace "... | Traceback (most recent call last):
File "/tmp/tmp405jtb_j/tmp99axst8i.py", line 32, in <module>
import solve
ModuleNotFoundError: No module named 'solve'
| |
s805253906 | p02559 | u708618797 | 1599726956 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9100 | 897 | code = r"""
# distutils: language=c++
# distutils: include_dirs=/home/contestant/.local/lib/python3.8/site-packages/numpy/core/include
# cython: boundscheck=False
# cython: wraparound=False
from libcpp cimport bool
from libcpp.vector cimport vector
cdef extern from "/opt/atcoder-stl/atcoder/fenwicktree.hpp" namespace "... | Traceback (most recent call last):
File "/tmp/tmp7vzhgl53/tmp3hhxuhh8.py", line 32, in <module>
import solve
ModuleNotFoundError: No module named 'solve'
| |
s172094143 | p02559 | u708618797 | 1599726918 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9076 | 896 | code = r"""
# distutils: language=c++
# distutils: include_dirs=/home/contestant/.local/lib/python3.8/site-packages/numpy/core/include
# cython: boundscheck=False
# cython: wraparound=False
from libcpp cimport bool
from libcpp.vector cimport vector
cdef extern from "/opt/atcoder-stl/atcoder/fenwicktree.hpp" namespace "... | Traceback (most recent call last):
File "/tmp/tmpq5tcaw__/tmp9d7zy3jg.py", line 32, in <module>
import solve
ModuleNotFoundError: No module named 'solve'
| |
s372541001 | p02559 | u708618797 | 1599726871 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9076 | 917 | code = r"""
# distutils: language=c++
# distutils: include_dirs=/home/contestant/.local/lib/python3.8/site-packages/numpy/core/include
# cython: boundscheck=False
# cython: wraparound=False
from libcpp cimport bool
from libcpp.vector cimport vector
cdef extern from "/opt/atcoder-stl/atcoder/fenwicktree.hpp" namespace "... | Traceback (most recent call last):
File "/tmp/tmp9jk_4hqw/tmph4sowk9g.py", line 33, in <module>
import solve
ModuleNotFoundError: No module named 'solve'
| |
s618299835 | p02560 | u327466606 | 1600648373 | Python | PyPy3 (7.3.0) | py | Runtime Error | 117 | 98896 | 609 | def floor_linear_sum(n,m,a,b):
"""
returns sum((a*i+b)//m for i in range(n))
"""
res = 0
while True:
if a >= m:
res += (n-1)*n*(a//m)//2
a %= m
if b >= m:
res += n * (b//m)
b %= m
y_max = (a*n+b)//m
if y_max == 0:
... | ||
s974877642 | p02560 | u879309973 | 1600406241 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9180 | 381 | def solve(n, m, a, b):
if n == 0:
return 0
res = 0
if a > m:
res += (n-1) * n // 2 * (a // m)
a %= m
if b > m:
res += n * (b // m)
b %= m
p = (a*n + b) // m
q = p*m - b
return res + solve(p, a, m, a*n-q)
t = int(input())
for i in range(t):
n, m, a... | Traceback (most recent call last):
File "/tmp/tmpc0q4ejws/tmp4v5kpp5u.py", line 15, in <module>
t = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s855528178 | p02560 | u168578024 | 1599534297 | Python | PyPy3 (7.3.0) | py | Runtime Error | 123 | 74540 | 8028 | #pragma region kyopro_template
#define Nyaan_template
#include <immintrin.h>
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define each(x, v) for (auto &x : v)
#define all(v) (v).begin(), (v).end()
#define sz(v) ((int)(v).size())
#define mem(a, val) memset(a, v... | File "/tmp/tmpt8mou3cx/tmp66x17lcf.py", line 14
int __VA_ARGS__; \
IndentationError: unexpected indent
| |
s227268465 | p02561 | u481187938 | 1600625826 | Python | Python (3.8.2) | py | Runtime Error | 255 | 16872 | 5435 | # thanks: https://atcoder.jp/contests/practice2/submissions/16784996
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify
import itertools
import math, fr... | Traceback (most recent call last):
File "/tmp/tmpwayhgu46/tmp4ap79134.py", line 163, in <module>
main()
File "/tmp/tmpwayhgu46/tmp4ap79134.py", line 114, in main
N, M = LI()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s294340742 | p02561 | u481187938 | 1600624988 | Python | Python (3.8.2) | py | Runtime Error | 259 | 17220 | 5377 | # thanks: https://atcoder.jp/contests/practice2/submissions/16784996
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify
import itertools
import math, fr... | Traceback (most recent call last):
File "/tmp/tmpp2_qbcob/tmpyoqh532c.py", line 161, in <module>
main()
File "/tmp/tmpp2_qbcob/tmpyoqh532c.py", line 114, in main
N, M = LI()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s843595965 | p02561 | u481187938 | 1600613109 | Python | Python (3.8.2) | py | Runtime Error | 255 | 16304 | 6312 | # thanks: https://atcoder.jp/contests/practice2/submissions/16784996
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify
import itertools
import math, fr... | Traceback (most recent call last):
File "/tmp/tmpo_1ilbxz/tmpld4f37pv.py", line 189, in <module>
main()
File "/tmp/tmpo_1ilbxz/tmpld4f37pv.py", line 117, in main
N, M = LI()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s561885548 | p02561 | u994521204 | 1600612883 | Python | Python (3.8.2) | py | Runtime Error | 5401 | 112612 | 1367 | import networkx as nx
n, m = map(int, input().split())
def calc(i, j): # 0<=i<n, 0<=j<m
return i * m + j
def inv(num):
return num // m, num % m
S = [list(input()) for _ in range(n)]
start = n * m
goal = start + 1
G = nx.Graph()
di = [1, 0, -1, 0]
dj = [0, 1, 0, -1]
for num in range(n * m):
i, j = in... | Traceback (most recent call last):
File "/tmp/tmpy9sun5nh/tmplvjfmevy.py", line 3, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s296813995 | p02561 | u481187938 | 1600612625 | Python | Python (3.8.2) | py | Runtime Error | 4783 | 16536 | 5568 | #!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify
import itertools
import math, fractions
import sys, copy
def L(): return sys.stdin.readline().split()... | Traceback (most recent call last):
File "/tmp/tmpls83s00u/tmpl7gq98dr.py", line 167, in <module>
main()
File "/tmp/tmpls83s00u/tmpl7gq98dr.py", line 116, in main
N, M = LI()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s857963277 | p02561 | u994521204 | 1600612292 | Python | Python (3.8.2) | py | Runtime Error | 5376 | 112604 | 1277 | import networkx as nx
n, m = map(int, input().split())
def calc(i, j): # 0<=i<n, 0<=j<m
return i * m + j
def inv(num):
return num // m, num % m
S = [list(input()) for _ in range(n)]
start = n * m
goal = start + 1
G = nx.Graph()
di = [1, 0, -1, 0]
dj = [0, 1, 0, -1]
for num in range(n * m):
i, j = in... | Traceback (most recent call last):
File "/tmp/tmpkmm0pjzf/tmprspmbaiz.py", line 3, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s859514534 | p02561 | u994521204 | 1600611736 | Python | Python (3.8.2) | py | Runtime Error | 4349 | 112624 | 1245 | import networkx as nx
n, m = map(int, input().split())
def calc(i, j): # 0<=i<n, 0<=j<m
return i * m + j
def inv(num):
return num // m, num % m
S = [list(input()) for _ in range(n)]
start = n * m
goal = start + 1
G = nx.Graph()
for num in range(n * m):
i, j = inv(num)
if S[i][j] == "#":
... | Traceback (most recent call last):
File "/tmp/tmpamcscxm8/tmpvobfom4c.py", line 3, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s889805188 | p02561 | u994521204 | 1600611651 | Python | Python (3.8.2) | py | Runtime Error | 4448 | 112332 | 1310 | import networkx as nx
n, m = map(int, input().split())
def calc(i, j): # 0<=i<n, 0<=j<m
return i * m + j
def inv(num):
return num // m, num % m
S = [list(input()) for _ in range(n)]
start = n * m
goal = start + 1
G = nx.Graph()
for num in range(n * m):
i, j = num // m, num % m
if S[i][j] == "#":... | Traceback (most recent call last):
File "/tmp/tmpyrc3g15g/tmpln5fjhzn.py", line 3, in <module>
n, m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s265943069 | p02561 | u467736898 | 1600560180 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9252 | 21122 | # TODO: メモリリーク確認
# TODO: min_cut, change_edge が正しく動くか確認
code_mf_graph = r"""
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h"
#include <memory>
// 元のライブラリの private を剥がした
// >>> AtCoder >>>
#ifndef ATCODER_MAXFLOW_HPP
#define ATCODER_MAXFLOW_HPP 1
#include <algorithm>
#ifndef ATCODER_INTERNAL... | g++: error: /std:c++14: No such file or directory
error: command '/bin/g++' failed with exit code 1
Traceback (most recent call last):
File "/tmp/tmphbhumapx/tmplh4lstbg.py", line 565, in <module>
from atcoder import MFGraph, MFGraphEdge
ModuleNotFoundError: No module named 'atcoder'
| |
s691718940 | p02561 | u562016607 | 1600532644 | Python | PyPy3 (7.3.0) | py | Runtime Error | 161 | 101812 | 4820 | from collections import deque
class mf_graph():
n=1
g=[[] for i in range(n)]
pos=[]
def __init__(self,N):
self.n=N
self.g=[[] for i in range(N)]
def add_edge(self,f,t,cap):
assert 0<=f<self.n, "0<=from<n,(from,n)=({0},{1})".format(f,self.n)
assert 0<=t<self.n, "0<=to<... | Traceback (most recent call last):
File "/tmp/tmpzucypgnn/tmpwwjc06g3.py", line 101, in <module>
N,M=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s405702905 | p02561 | u562016607 | 1600531697 | Python | Python (3.8.2) | py | Runtime Error | 135 | 22112 | 4962 | from collections import deque
class mf_graph():
n=1
g=[[] for i in range(n)]
pos=[]
def __init__(self,N):
self.n=N
self.g=[[] for i in range(N)]
def add_edge(self,f,t,cap):
assert 0<=f<self.n, "0<=from<n,(from,n)=({0},{1})".format(f,self.n)
assert 0<=t<self.n, "0<=to<... | Traceback (most recent call last):
File "/tmp/tmprt0cf1qf/tmpbebgeiqy.py", line 104, in <module>
N,M=map(int,input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s516922250 | p02561 | u102461423 | 1600506087 | Python | Python (3.8.2) | py | Runtime Error | 647 | 82832 | 1139 | import sys
import itertools
import numpy as np
import networkx as nx
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, M = map(int, readline().split())
S = np.frombuffer(read(), 'S1').reshape(N, -1)[:, :M].astype('U1')
A = []
B = []
E = []
for i, j in iterto... | Traceback (most recent call last):
File "/tmp/tmpnxvbnn75/tmpz2yshf75.py", line 10, in <module>
N, M = map(int, readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s306515239 | p02561 | u102461423 | 1600506068 | Python | Python (3.8.2) | py | Runtime Error | 557 | 69820 | 1144 | import sys
import itertools
import numpy as np
import networkx as nx
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, M = map(int, readline().split())
S = np.frombuffer(read(), 'S1').reshape(N, -1)[:, :M].astype('U1')
A = []
B = []
E = []
for i, j in iterto... | Traceback (most recent call last):
File "/tmp/tmpgiuy32_i/tmpgqhekp3z.py", line 10, in <module>
N, M = map(int, readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s885044311 | p02561 | u102461423 | 1600505637 | Python | Python (3.8.2) | py | Runtime Error | 549 | 69664 | 1137 | import sys
import itertools
import numpy as np
import networkx as nx
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, M = map(int, readline().split())
S = np.frombuffer(read(), 'S1').reshape(N, -1)[:, :M].astype('U1')
A = []
B = []
E = []
for i, j in iterto... | Traceback (most recent call last):
File "/tmp/tmpq91pftx1/tmpmpl1mt8n.py", line 10, in <module>
N, M = map(int, readline().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s997601362 | p02561 | u535803878 | 1600375843 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 68568 | 1695 | import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")
n,m = list(map(int, input().split()))
s = [input() for _ in range(n)]
# scipyの例
import scipy.sparse
data = []
rs = []
cs = []
def add(i,j,v=1,directed=False):
rs.append(i)
... | Traceback (most recent call last):
File "/tmp/tmp5z6xy8fw/tmp2g8sxdho.py", line 7, in <module>
n,m = list(map(int, input().split()))
^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s171662862 | p02561 | u623231048 | 1600342294 | Python | PyPy3 (7.3.0) | py | Runtime Error | 254 | 81072 | 4189 | from collections import deque
class MaxFlow:
def __init__(self, n):
self.n = n
self.graph = [[] for _ in range(n)]
self.pos = []
def add_edge(self, fr, to, cap):
m = len(self.pos)
self.pos.append((fr, len(self.graph[fr])))
self.graph[fr].append([to, len(self.gra... | Traceback (most recent call last):
File "/tmp/tmpq4kiswkx/tmpv7jvil7l.py", line 94, in <module>
n,m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s848855880 | p02561 | u623231048 | 1600342163 | Python | PyPy3 (7.3.0) | py | Runtime Error | 268 | 81180 | 4189 | from collections import deque
class MaxFlow:
def __init__(self, n):
self.n = n
self.graph = [[] for _ in range(n)]
self.pos = []
def add_edge(self, fr, to, cap):
m = len(self.pos)
self.pos.append((fr, len(self.graph[fr])))
self.graph[fr].append([to, len(self.gra... | Traceback (most recent call last):
File "/tmp/tmpto9_115z/tmpyl70pl8f.py", line 94, in <module>
n,m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s416893232 | p02561 | u623231048 | 1600341948 | Python | PyPy3 (7.3.0) | py | Runtime Error | 263 | 81260 | 4183 | from collections import deque
class MaxFlow:
def __init__(self, n):
self.n = n
self.graph = [[] for _ in range(n)]
self.pos = []
def add_edge(self, fr, to, cap):
m = len(self.pos)
self.pos.append((fr, len(self.graph[fr])))
self.graph[fr].append([to, len(self.gra... | Traceback (most recent call last):
File "/tmp/tmpsmyg0iku/tmpkd425dkc.py", line 94, in <module>
n,m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s495900272 | p02561 | u623231048 | 1600341887 | Python | PyPy3 (7.3.0) | py | Runtime Error | 295 | 81768 | 4205 | from collections import deque
class MaxFlow:
def __init__(self, n):
self.n = n
self.graph = [[] for _ in range(n)]
self.pos = []
def add_edge(self, fr, to, cap):
m = len(self.pos)
self.pos.append((fr, len(self.graph[fr])))
self.graph[fr].append([to, len(self.gra... | Traceback (most recent call last):
File "/tmp/tmpwe0znlr1/tmpyqktfdrd.py", line 94, in <module>
n,m = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s150087185 | p02561 | u216928054 | 1600302090 | Python | PyPy3 (7.3.0) | py | Runtime Error | 436 | 93360 | 6105 | #!/usr/bin/env python3
from collections import deque
from collections import defaultdict
import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1 # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7
INF = 10 ** 10
def init():
global edges
edges = defaultdict(dict)
def add_edge(frm, to, capacity):
edges[frm... | Traceback (most recent call last):
File "/tmp/tmpaibmrw3x/tmploh_8e2l.py", line 317, in <module>
main()
File "/tmp/tmpaibmrw3x/tmploh_8e2l.py", line 123, in main
N, M = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s577995056 | p02561 | u216928054 | 1600301625 | Python | PyPy3 (7.3.0) | py | Runtime Error | 450 | 93144 | 5858 | #!/usr/bin/env python3
from collections import deque
from collections import defaultdict
import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1 # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7
INF = 10 ** 10
def init():
global edges
edges = defaultdict(dict)
def add_edge(frm, to, capacity):
edges[frm... | Traceback (most recent call last):
File "/tmp/tmp9xqo1w1l/tmphoidnrmv.py", line 297, in <module>
main()
File "/tmp/tmp9xqo1w1l/tmphoidnrmv.py", line 122, in main
N, M = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s623647459 | p02561 | u216928054 | 1600300792 | Python | PyPy3 (7.3.0) | py | Runtime Error | 424 | 92440 | 5318 | #!/usr/bin/env python3
from collections import deque
from collections import defaultdict
import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1 # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7
INF = 10 ** 10
edges = defaultdict(dict)
def add_edge(frm, to, capacity):
edges[frm][to] = capacity
edges[to][frm]... | Traceback (most recent call last):
File "/tmp/tmpovw7kawi/tmp6o_my4z8.py", line 234, in <module>
main()
File "/tmp/tmpovw7kawi/tmp6o_my4z8.py", line 117, in main
N, M = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s393329496 | p02561 | u216928054 | 1600300747 | Python | PyPy3 (7.3.0) | py | Runtime Error | 420 | 92092 | 5314 | #!/usr/bin/env python3
from collections import deque
from collections import defaultdict
import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1 # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7
INF = 10 ** 10
edges = defaultdict(dict)
def add_edge(frm, to, capacity):
edges[frm][to] = capacity
edges[to][frm]... | Traceback (most recent call last):
File "/tmp/tmpvh_r10_u/tmp7erchl21.py", line 234, in <module>
main()
File "/tmp/tmpvh_r10_u/tmp7erchl21.py", line 117, in main
N, M = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s851980182 | p02561 | u216928054 | 1600299703 | Python | PyPy3 (7.3.0) | py | Runtime Error | 449 | 93288 | 5284 | #!/usr/bin/env python3
from collections import deque
from collections import defaultdict
import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1 # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7
INF = 10 ** 10
edges = defaultdict(dict)
def add_edge(frm, to, capacity):
edges[frm][to] = capacity
edges[to][frm]... | Traceback (most recent call last):
File "/tmp/tmpom3flwx_/tmpjilyo9la.py", line 234, in <module>
main()
File "/tmp/tmpom3flwx_/tmpjilyo9la.py", line 117, in main
N, M = map(int, input().split())
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s413555602 | p02561 | u509368316 | 1600107766 | Python | Python (3.8.2) | py | Runtime Error | 124 | 20000 | 5411 | code = r"""
# distutils: language=c++
# distutils: include_dirs=[/home/contestant/.local/lib/python3.8/site-packages/numpy/core/include,/opt/atcoder-stl]
# cython: boundscheck=False
# cython: wraparound=False
from libcpp cimport bool
from libcpp.string cimport string
from libcpp.vector cimport vector
cdef extern from ... | /tmp/tmp8u0wobuh/atcoder.cpp:1158:10: fatal error: atcoder/dsu.hpp: No such file or directory
1158 | #include "atcoder/dsu.hpp"
| ^~~~~~~~~~~~~~~~~
compilation terminated.
error: command '/bin/g++' failed with exit code 1
Traceback (most recent call last):
File "/tmp/tmp8u0wobuh/tmpykiuokt_.py", line ... | Compiling /tmp/tmp8u0wobuh/atcoder.pyx because it changed.
[1/1] Cythonizing /tmp/tmp8u0wobuh/atcoder.pyx
|
s570695999 | p02561 | u864197622 | 1600038199 | Python | PyPy3 (7.3.0) | py | Runtime Error | 124 | 78680 | 3351 | class maxflow():
def __init__(self, n):
self.pos = []
self.g = [[] for _ in range(n)]
self.n = n
def add_edge(self, v, w, cap):
e1 = [w, 0, cap]
e2 = [v, e1, 0]
e1[1] = e2
self.g[v].append(e1)
self.g[w].append(e2)
def flow(self, s, t,... | Traceback (most recent call last):
File "/tmp/tmp3i39_99w/tmpukojs45f.py", line 67, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s065452178 | p02561 | u960080897 | 1599953456 | Python | Python (3.8.2) | py | Runtime Error | 126 | 25128 | 44602 | # AC Library Python版
# Author Koki_tkg
'''
internal_type_traits以外は翻訳しました。
practiceは一応全部ACしていますが,
practiceで使っていない関数などの動作は未確認なので保証はしません。
また,C++版をほぼそのまま書き換えているので速度は出ません。 (2020/09/13 by Koki_tkg)
'''
# --------------------<< Library Start >>-------------------- #
# convolution.py
class convolution:
def __init__(self,... | Traceback (most recent call last):
File "/tmp/tmpl1c7x0q4/tmp85pyiktb.py", line 1452, in <module>
Main_D()
File "/tmp/tmpl1c7x0q4/tmp85pyiktb.py", line 1267, in Main_D
n, m = read_ints()
^^^^
ValueError: not enough values to unpack (expected 2, got 0)
| |
s309339380 | p02561 | u456353530 | 1599939141 | Python | PyPy3 (7.3.0) | py | Runtime Error | 331 | 85428 | 3631 | #test
NUMERIC_LIMITS = 10 ** 18
import queue
class maxFlow:
class edge:
def __init__(s, frm, to, cap, flow):
s.frm, s.to = frm, to
s.cap, s.flow = cap, flow
def __init__(s, n):
s._n = n
s.g = [[] for _ in range(n)]
s.pos = []
def add_edge(s, frm, to, cap):
m = len(s.pos)
s.po... | Traceback (most recent call last):
File "/tmp/tmpwuwbi336/tmpej80nnc4.py", line 106, in <module>
N, M = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s069627020 | p02561 | u844789719 | 1599783778 | Python | Python (3.8.2) | py | Runtime Error | 303 | 40884 | 1198 | from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import maximum_flow, maximum_bipartite_matching
import copy
N, M = [int(_) for _ in input().split()]
A = [['#'] * (M + 2)] + [list('#' + input() + '#')
for _ in range(N)] + [['#'] * (M + 2)]
A2 = copy.deepcopy(A)
S = ''.join(''.join(... | Traceback (most recent call last):
File "/tmp/tmpnq0yg07f/tmph561qtn5.py", line 4, in <module>
N, M = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s567296757 | p02561 | u844789719 | 1599783699 | Python | Python (3.8.2) | py | Runtime Error | 253 | 39396 | 1230 | from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import maximum_flow, maximum_bipartite_matching
import copy
N, M = [int(_) for _ in input().split()]
A = [['#'] * (M + 2)] + [list('#' + input() + '#')
for _ in range(N)] + [['#'] * (M + 2)]
A2 = copy.deepcopy(A)
S = ''.join(''.join(... | Traceback (most recent call last):
File "/tmp/tmpxfca7wdh/tmp2347jlpx.py", line 4, in <module>
N, M = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s806549455 | p02561 | u844789719 | 1599783582 | Python | Python (3.8.2) | py | Runtime Error | 260 | 38980 | 1204 | from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import maximum_flow, maximum_bipartite_matching
import copy
N, M = [int(_) for _ in input().split()]
A = [['#'] * (M + 2)] + [list('#' + input() + '#')
for _ in range(N)] + [['#'] * (M + 2)]
A2 = copy.deepcopy(A)
S = ''.join(''.join(... | Traceback (most recent call last):
File "/tmp/tmprffydmp5/tmpvju9jooz.py", line 4, in <module>
N, M = [int(_) for _ in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s574561171 | p02561 | u994988729 | 1599776976 | Python | Python (3.8.2) | py | Runtime Error | 100 | 11684 | 2190 | class BipartiteMatching:
def __init__(self, N, M):
self.N = N
self.M = M
self.pairA = [-1] * N
self.pairB = [-1] * M
self.edge = [[] for _ in range(N)]
self.was = [0] * N
self.iter = 0
def add(self, s, t):
self.edge[s].append(t)
def _DFS(self... | Traceback (most recent call last):
File "/tmp/tmp88sx9sju/tmpnltmivov.py", line 48, in <module>
H, W = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s499308947 | p02561 | u034128150 | 1599683091 | Python | PyPy3 (7.3.0) | py | Runtime Error | 132 | 78248 | 3772 | # https://atcoder.jp/contests/practice2/submissions/16598132
# 上記のリンクの提出をいじらせてもらってます。
from collections import deque
class mf_graph:
__slots__ = ["N", "graph"]
def __init__(self, N):
self.N = N
self.graph = [[] for _ in range(N)]
def add_edge(self, v, w, cap):
edge = [w, cap, No... | Traceback (most recent call last):
File "/tmp/tmpzv9g5_gv/tmpeszfjw05.py", line 85, in <module>
N, M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s751447681 | p02561 | u201928947 | 1599682815 | Python | PyPy3 (7.3.0) | py | Runtime Error | 237 | 89040 | 2976 | # Dinic's algorithm
#https://tjkendev.github.io/procon-library/python/max_flow/dinic.htmlより
from collections import deque
class Dinic:
def __init__(self, N):
self.N = N
self.G = [[] for i in range(N)]
def add_edge(self, fr, to, cap):
forward = [to, cap, None]
forward[2] = backwa... | Traceback (most recent call last):
File "/tmp/tmpcfefnzkd/tmpvmdmc7p4.py", line 61, in <module>
N,M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s131343889 | p02561 | u201928947 | 1599682760 | Python | PyPy3 (7.3.0) | py | Runtime Error | 95 | 68544 | 2979 | # Dinic's algorithm
#https://tjkendev.github.io/procon-library/python/max_flow/dinic.htmlより
from collections import deque
class Dinic:
def __init__(self, N):
self.N = N
self.G = [[] for i in range(N)]
def add_edge(self, fr, to, cap):
forward = [to, cap, None]
forward[2] = backwa... | Traceback (most recent call last):
File "/tmp/tmp_jfky48r/tmpe6v1kp3d.py", line 61, in <module>
N,M = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.