s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s958451010
p03592
u714642969
1588216864
Python
PyPy3 (2.4.0)
py
Runtime Error
189
39024
550
# -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10**9) INF=10**18 MOD=10**9+7 input=lambda: sys.stdin.readline().rstrip() YesNo=lambda b: bool([print('Yes')] if b else print('No')) YESNO=lambda b: bool([print('YES')] if b else print('NO')) int1=lambda x:int(x)-1 def main(): N,M,K=map(int,input().split()) ...
s155966484
p03592
u896741788
1586722798
Python
Python (3.4.3)
py
Runtime Error
18
2940
180
n,m,k=map(int,input().split()) n,m=min(n,m),max(n,m) for i in range(n//2+n%2): num,dem=k-i*m,n-2*i if num%dem or not(0<=num///dem<=m):continue print("Yes");exit() print("No")
s351802963
p03592
u374531474
1585886817
Python
Python (3.4.3)
py
Runtime Error
18
2940
174
N, M, K = map(int, input().split()) ans = False for n in range(N + 1): if (M * n - K) % (2 * n - N) == 0: ans = True break print('Yes' if ans else 'No')
s076397919
p03592
u539517139
1583295766
Python
Python (3.4.3)
py
Runtime Error
17
2940
180
n,m,k=map(int,input().split()) x='No' for i in range(m+1) t=n*i if t==k: x='Yes' break for j in range(n): t+=m-2*i if t==k: x='Yes' break print(x)
s029998630
p03592
u113971909
1583158399
Python
Python (3.4.3)
py
Runtime Error
18
3060
169
N,M,K=map(int,input().split()) ret = 'No' for m in range(M+1): a=K-m*N b=M-2*m if 0<=a and 0<=b and a%b==0: n=a//b if 0<=n<=N: ret = 'Yes' print(ret)
s851715455
p03592
u995062424
1581732722
Python
Python (3.4.3)
py
Runtime Error
17
3064
74
N, M, K = map(int, input().split()) print("Yes" if (N+M)%K == 0 else "No")
s270582016
p03592
u127499732
1580742813
Python
Python (3.4.3)
py
Runtime Error
420
3060
196
n,m,k=map(int,input().split()) if n%k==0 or m%k==0: print("Yes") exit() for i in range(n): for j in range(m): s=(n*i+m*j-i*j)-i*j if s==k: print("Yes") exit() print("No")
s750270932
p03592
u375616706
1573610632
Python
PyPy3 (2.4.0)
py
Runtime Error
174
38484
305
# python template for atcoder1 import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline H, W, K = map(int, input().split()) Upper = H//2 if H % 2 == 1 else H//2+1 for h in range(Upper): w = (K-W*h)/(H-2*h) if int(w) == w and 0 <= w <= W: print("Yes") exit() print("No")
s694250074
p03592
u375616706
1573610497
Python
PyPy3 (2.4.0)
py
Runtime Error
175
38384
267
# python template for atcoder1 import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline H, W, K = map(int, input().split()) for h in range(H//2+1): w = (K-W*h)/(H-2*h) if int(w) == w and 0 <= w <= W: print("Yes") exit() print("No")
s243347643
p03592
u185464141
1570894710
Python
Python (3.4.3)
py
Runtime Error
454
13672
327
# coding: utf-8 # submission # - User: herp_sy # https://atcoder.jp/contests/ # # lang: Python3 (3.4.3) import math import statistics import numpy as np import queue n,m,k = map(int, input().split()) for i in range(n): for j in range(m): if i * (m - j) + j * (n - i) == k: print('Yes') exit(-1) print...
s327809298
p03592
u185464141
1570894552
Python
Python (3.4.3)
py
Runtime Error
273
19120
326
# coding: utf-8 # submission # - User: herp_sy # https://atcoder.jp/contests/ # # lang: Python3 (3.4.3) import math import statistics import numpy as np import queue n,m,k = map(int, input.split()) for i in range(n): for j in range(m): if i * (m - j) + j * (n - i) == k: print('Yes') else: print(...
s656689238
p03592
u296150111
1570072818
Python
Python (3.4.3)
py
Runtime Error
17
2940
85
n,m,k=map(int,input().split()) if n%k==0 or m%k==0: print("Yes") else: print("No")
s825079885
p03592
u668503853
1569091294
Python
Python (3.4.3)
py
Runtime Error
17
2940
156
N,M,K=map(int,input().split()) ans="No" for x in range(N+1): a=K-x*M b=N-2*x if x!=0 and a%b==0 and 0<=a//b<M: print("Yes") exit() print("No")
s908752021
p03592
u668503853
1569091247
Python
Python (3.4.3)
py
Runtime Error
18
2940
156
N,M,K=map(int,input().split()) ans="No" for x in range(N+1): a=K-x*M b=N-2*x if a!=0 and a%b==0 and 0<=a//b<M: print("Yes") exit() print("No")
s633374308
p03592
u814986259
1567350101
Python
PyPy3 (2.4.0)
py
Runtime Error
2106
50360
480
N,M,K = map(int, input().split()) field = [[0]*M for i in range(N)] def reverse(x): if x == 0: return 1 else: return 0 now = 0 for i in range(N+1): if (K - now) % (N - 2 * i) == 0 and (K - now) / (N - 2 * i) <= M and (K - now) / (N - 2 * i) >= 0: print("Yes") exit(0) eli...
s510428976
p03592
u814986259
1567348705
Python
PyPy3 (2.4.0)
py
Runtime Error
2106
50204
480
N,M,K = map(int, input().split()) field = [[0]*M for i in range(N)] def reverse(x): if x == 0: return 1 else: return 0 now = 0 for i in range(N+1): if (K - now) % (N - 2 * i) == 0 and (K - now) / (N - 2 * i) <= N and (K - now) / (N - 2 * i) >= 0: print("Yes") exit(0) eli...
s796882213
p03592
u814986259
1567348680
Python
Python (3.4.3)
py
Runtime Error
2104
10868
480
N,M,K = map(int, input().split()) field = [[0]*M for i in range(N)] def reverse(x): if x == 0: return 1 else: return 0 now = 0 for i in range(N+1): if (K - now) % (N - 2 * i) == 0 and (K - now) / (N - 2 * i) <= N and (K - now) / (N - 2 * i) >= 0: print("Yes") exit(0) eli...
s873136443
p03592
u899975427
1564007809
Python
Python (3.4.3)
py
Runtime Error
17
3060
208
n,m,k = map(int,input().split()) for i in range(m+1): if k - n*i == 0 or (k - n*i > 0 and (k - n*i) % (m - 2*i) == 0): print('Yes') exit() elif k - n*i < 0: print('No') exit() print('No')
s452285078
p03592
u899975427
1564007511
Python
Python (3.4.3)
py
Runtime Error
18
3060
160
n,m,k = map(int,input().split()) for i in range(m+1): if k - n*i < 0: print('No') exit() if (k - n*i) % (m - 2*i) == 0: print('Yes') exit()
s043335060
p03592
u163320134
1556002978
Python
Python (3.4.3)
py
Runtime Error
18
2940
234
n,m,k=map(int,input().split()) flag=False if n==1 or m==1: print('Yes') else: for i in range(n): for j in range(m): if i*j + (n-i)*(m-j) + k == n*m: flag=True if flag: print('Yes') else: print('No')
s783904564
p03592
u426108351
1554340625
Python
Python (3.4.3)
py
Runtime Error
18
2940
176
N, M, K = map(int, inpu().split()) flag = 0 for i in range(N+1): for j in range(M+1): if (N-i)*(M-j) == K: flag = 1 if flag == 1: print("Yes") else: print("No")
s429407330
p03592
u180908266
1547769486
Python
Python (3.4.3)
py
Runtime Error
485
3316
241
from collections import deque N, M, K = map(int, input().split()) r_c = deque([(0, 0)]) r = 0 c = 0 sum = 0 for i in range(1000010): if (sum > 10000*K): print('No') exit() sum = i*N if (K-sum%(M-N-r+c) == 0): print('Yes') exit()
s839804534
p03592
u820351940
1542080766
Python
Python (3.4.3)
py
Runtime Error
162
12500
321
import numpy as np n = int(input()) ab = [list(map(int, input().split())) for x in range(n)] cnt = 0 for a, b in reversed(ab): diff = a - b + cnt if diff == -b: pass elif diff < 0: cnt -= diff else: diffb = diff % b if diffb: cnt += b - diffb print(int(cnt)) ...
s259127958
p03592
u612636296
1542069658
Python
Python (3.4.3)
py
Runtime Error
17
3060
226
N, M, K = list(map(int, input().split())) mass = [] for i in range(M): for j in range(N): mass[i].append(0) if K == (N * M): print("Yes") elif K % N == 0 or K % M == 0: print("Yes") else: print("No")
s146405408
p03592
u050428930
1525314685
Python
Python (3.4.3)
py
Runtime Error
314
3060
219
n,m,k=map(int,input().split()) if n%k==0 or m%k==0: print("Yes") exit() for i in range(1,n+1): for j in range(1,m+1): if m*i+n*j-2*(i*j)==k: print("Yes") exit() print("No")
s606932104
p03592
u751663243
1506224673
Python
Python (3.4.3)
py
Runtime Error
17
2940
319
N,M,K = map(int,input().strip().split()) def judge(N,M,K): if K > N * M or K < 0: return False for n in range(0, N + 1): for m in range(0, M + 1): if n * M + m * N - m * n == K or: return True return False if judge(N, M, K): print("Yes") else: print("No")
s823051606
p03592
u885958935
1506221931
Python
Python (3.4.3)
py
Runtime Error
19
3064
396
import sys M,N,K = map(int,input().split()) if N > M: tmp = M M = N N = tmp if K == 1: if M == 1 and N == 1: print('Yes') sys.exit() else: print('No') sys.exit() if M % K == 0 or N % K == 0 : print('Yes') sys.exit() else: for i in range(N): if (M +...
s468615174
p03592
u885958935
1506221858
Python
Python (3.4.3)
py
Runtime Error
17
3064
378
import sys M,N,K = map(int,input().split()) if N > M: tmp = M M = N N = tmp if K == 1: if M == 1 and N == 1: print('Yes') else: print('No') sys.exit() if M % K == 0 or N % K == 0 : print('Yes1') sys.exit() else: for i in range(N): if (M + i*(N-2) == K): ...
s083338887
p03592
u493221626
1506221821
Python
Python (3.4.3)
py
Runtime Error
1205
21544
294
# coding:utf-8 import numpy as np all=int(input()) all_list=all.split(" ") n=all_list[0] m=all_list[1] k=all_list[2] for i_n in range(n): for i_m in range(m): now_k=(i_n*m+i_m*n)-2*i_n*i_m if k==now_k: print("Yes") print("No")
s700240803
p03592
u586577600
1506221779
Python
Python (3.4.3)
py
Runtime Error
2104
3976
418
def flip(N, M, K, Mnum, Nnum, black): if black < 0 or black > K: return False if black == K: return True return flip(N, M, K, Mnum, Nnum+1, black+N-(Mnum*2)) or flip(N, M, K, Mnum+1, Nnum, black+M-(Nnum*2)) if __name__ == '__main__': inputs = input('> ').split() if flip(int(inputs[...
s603674352
p03592
u523964576
1506221716
Python
Python (3.4.3)
py
Runtime Error
2109
20200
306
s=input().split() import numpy as np a=np.zeros((int(s[0]),int(s[1]))) b=int(int(s[0])/2) c=int(int(s[1])/2) x=[] for i in range(b): a[i,:]=1 x.append(np.count_nonzero(a)) for j in range(c): a[:,j]=1-i x.append(np.count_nonzero(a)) if int(s[2]) in x: print("Yes") else: print("No")
s559356008
p03592
u493221626
1506221641
Python
Python (3.4.3)
py
Runtime Error
186
14552
256
# coding:utf-8 import numpy as np n=int(input()) m=int(input()) k=int(input()) for i_n in range(n): for i_m in range(m): now_k=(i_n*m+i_m*n)-2*i_n*i_m if k==now_k: print("Yes") print("No")
s935296921
p03592
u493221626
1506221462
Python
Python (3.4.3)
py
Runtime Error
758
21396
265
# coding:utf-8 import numpy as np n=int(input()) m=int(input()) k=int(input()) sum_set=set() for i_n in range(n): for i_m in range(m): sum_set.add((i_n*m+i_m*n)-2*i_n*i_m) if k in sum_set: print("Yes") else: print("No")
s577333551
p03592
u586577600
1506221104
Python
Python (3.4.3)
py
Runtime Error
2104
3968
410
def flip(N, M, K, Mnum, Nnum, black): if black < 0 or black > K: return False if black == K: return True return flip(N, M, K, Mnum+1, Nnum, black+M-Nnum) or flip(N, M, K, Mnum, Nnum+1, black+N-Nnum) if __name__ == '__main__': inputs = input('> ').split() if flip(int(inputs[0]), int...
s528744981
p03592
u586577600
1506220990
Python
Python (3.4.3)
py
Runtime Error
2104
26404
459
def flip(N, M, K, Mnum, Nnum, black): print('count: ', Mnum+Nnum) print(black) if black < 0 or black > K: return False if black == K: return True return flip(N, M, K, Mnum+1, Nnum, black+M-Nnum) or flip(N, M, K, Mnum, Nnum+1, black+N-Nnum) if __name__ == '__main__': inputs = in...
s135926350
p03592
u885958935
1506220735
Python
Python (3.4.3)
py
Runtime Error
18
2940
196
M,N,K = map(int,input().split()) if M % K == 0 or N % K == 0 : print('Yes') else: if K >= N and K <= M*(N-1) or K >= M and K <= N*(M-1): print('Yes') else: print('No')
s019466612
p03592
u885958935
1506220636
Python
Python (3.4.3)
py
Runtime Error
17
2940
191
M,N,K = map(int,input().split()) if M % K == 0 or N % K == 0 : print('Yes') else: if K >= N and K <= M*(N-1) or K >= M and K <= N*(M-1) print('Yes') else: print('No')
s238392840
p03592
u885958935
1506219800
Python
Python (3.4.3)
py
Runtime Error
17
2940
102
M,N,K = map(int,input().split()) if M % K == 0 or N % K == 0 : print('Yes') else: print('No')
s873843695
p03592
u007808656
1506219534
Python
Python (3.4.3)
py
Runtime Error
18
3060
263
N,M,K=map(int,input().split()) x=N*M-2*K if x==0: print('Yes') else: for d in range(1,abs(x)+1): if x%d==0 and (d<newM and abs(x//d)<newM and (N-d)%2==0 and (M-x//d)%2==0): print('Yes') break else: print('No')
s120228585
p03592
u665415433
1506219381
Python
Python (3.4.3)
py
Runtime Error
72
3980
372
def solve(N, M, K, n, m, b): if n > N or m > M: return 0 if b == K: return 1 if 1 == solve(N, M, K, n + 1, m, b + M - 2 * m): return 1 if 1 == solve(N, M, K, n, m + 1, b + N - 2 * n): return 1 return 0 N, M, K = [int(i) for i in input().split()] if 1 == solve(N, M, ...
s987890011
p03592
u243492642
1506219213
Python
Python (3.4.3)
py
Runtime Error
2106
36076
1039
# coding: utf-8 def II(): return int(input()) def ILI(): return list(map(int, input().split())) def read(): N, M, K = ILI() return N, M, K def solve(N, M, K): def draw(n_count=0, m_count=0, now=0): if n_count == N and m_count == M: ret_set = set() ret_set.add(now) ...
s778872099
p03592
u448407332
1506219200
Python
Python (2.7.6)
py
Runtime Error
773
245252
315
import numpy as np data = raw_input().split() n, m, k = map(int, data) d = np.zeros([n+1, m+1, n, m]) for i in range(n+1): d[i, :, :i, :] = 1 for j in range(m+1): d[:, j, :, :j] += 1 d %= 2 ans = [int(d[i, j].sum()) for i in range(n+1) for j in range(m+1)] if k in ans: print 'Yes' else: print 'No'
s389416643
p03592
u665415433
1506218892
Python
Python (3.4.3)
py
Runtime Error
2104
3984
372
def solve(N, M, K, n, m, b): if n > N or m > M: return 0 if b == K: return 1 if 1 == solve(N, M, K, n + 1, m, b + N - 2 * m): return 1 if 1 == solve(N, M, K, n, m + 1, b + M - 2 * n): return 1 return 0 N, M, K = [int(i) for i in input().split()] if 1 == solve(N, M, ...
s521150645
p03592
u448407332
1506218866
Python
Python (2.7.6)
py
Runtime Error
1170
245248
431
import numpy as np data = raw_input().split() n, m, k = map(int, data) prob = [] d = np.zeros([n+1, m+1, n, m]) for i in range(n+1): d[i, :, :i, :] = 1 for j in range(m+1): d[:, j, :, :j] += 1 d %= 2 flag = 0 for i in range(n+1): if flag: break for j in range(m+1): a = int(d[i, j].sum())...
s395259142
p03592
u665415433
1506218552
Python
Python (3.4.3)
py
Runtime Error
2104
3980
415
def solve(N, M, K, n, m, b): if n > N or m > M or b > K: return 0 if b + N - 2 * m == K or b + M - 2 * n == K: return 1 if 1 == solve(N, M, K, n + 1, m, b + N - 2 * m): return 1 if 1 == solve(N, M, K, n, m + 1, b + M - 2 * n): return 1 return 0 N, M, K = [int(i) for...
s380573424
p03592
u552668967
1506218382
Python
Python (2.7.6)
py
Runtime Error
10
2568
163
from sys import stdin ans = 'No' n,m,k = map(int,stdin.readline().split()) for i in xrange(n+1): for j in xrange(m+1): if i*m - b*j==k: ans = 'Yes' print ans
s443004715
p03592
u552668967
1506218313
Python
Python (2.7.6)
py
Runtime Error
10
2696
155
from sys import stdin ans = 'No' n,m,k = map(int,stdin.readline()) for i in xrange(n+1): for j in xrange(m+1): if i*m - b*j==k: ans = 'Yes' print ans
s691991751
p03592
u224226076
1506217668
Python
PyPy3 (2.4.0)
py
Runtime Error
199
38768
686
# -*- coding: utf-8 -*- """ Created on Sat Sep 23 20:49:53 2017 @author: thvinmei """ import numpy as np if __name__ == '__main__': answer = False N,M,K=map(int,input().split()) tile = np.zeros((N,M),dtype=bool) if( K > N*M): print("No") for j in range(M): tile[:,j]...
s733936329
p03592
u792078574
1506215970
Python
Python (2.7.6)
py
Runtime Error
10
2568
167
N, M, K = map(int, raw_input().split(' '))   for n in xrange(N+1): for m in xrange(M+1): if n*M + m*N - 2*n*m == K: print 'Yes' exit()   print 'No'
s973024314
p03592
u858136677
1506215943
Python
Python (3.4.3)
py
Runtime Error
75
3060
165
a = list(map(int,input().split())) s = [] s[0] = a[0] * a[1] - 1 for i in range(1,n + 1): s[i] = s[i-1] - (2 * i) * 2 if a[2] in s: print('Yes') else: print('No')
s432372127
p03592
u150117535
1506215140
Python
PyPy3 (2.4.0)
py
Runtime Error
207
39280
200
n,m,k=[int(x) for x in input().split()] from itertools import product from sys import exit for i,j in product(range(n),range(m)): if i*m+j*(n-i)==K: print("Yes") exit() print("No")
s944129281
p03593
u231095456
1599536073
Python
Python (3.8.2)
py
Runtime Error
28
9368
630
from collections import defaultdict H,W = map(int,input().split()) d = defaultdict(int) for _ in range(H): for c in list(input()): d[c] += 1 for i in range((H-1)//2+1): for j in range((W-1)//2+1): s = set([(x,y) for x,y in [(i,j),(i,W-1-j),(H-1-i,j),(H-1-i,W-1-j)] if 0<=x<H and 0<=y<W]) ...
s421802599
p03593
u017415492
1599103076
Python
Python (3.8.2)
py
Runtime Error
27
8952
1003
from collections import Counter h,w=map(int,input().split()) #a=[list(input()) for i in range(w)] a=[] flag=True for i in range(h): a+=list(input()) ca=Counter(a) if h%2==0 and w%2==0: for i in ca: if ca[i]%4!=0: flag=False print('No') break if flag: print('Yes') elif h%2!=0 and w%2!=0:...
s126041766
p03593
u860002137
1599097676
Python
Python (3.8.2)
py
Runtime Error
116
27312
1042
from collections import Counter import numpy as np h, w = map(int, input().split()) arr = [list(map(str, input().rstrip())) for _ in range(h)] arr = sum(arr, []) arr = Counter(arr) arr = np.array(list(arr.values())) def solve(arr): # 偶数×偶数なら、制約がかなりきつい if h % 2 == 0 and w % 2 == 0: return np.all(c %...
s258851178
p03593
u940139461
1597348864
Python
PyPy3 (7.3.0)
py
Runtime Error
101
74584
2674
# https://atcoder.jp/contests/code-festival-2017-quala/tasks/code_festival_2017_quala_c from collections import defaultdict H,W = map(int,input().split()) C = defaultdict(int) for _ in range(H): row = list(input()) for i in range(W): C[row[i]] += 1 if H%2==0 and W%2=...
s323696078
p03593
u094155508
1595779147
Python
Python (3.8.2)
py
Runtime Error
24
8836
731
#include <iostream> #include <string> #include <vector> #include <map> using namespace std; int main() { int h,w; cin >> h >> w; vector<string> a(h); for (int i=0; i<h; i++) cin >> a[i]; for (int i=0; i<h; i++) sort(a[i].begin(), a[i].end()); bool ans = true; for (int i=0; i<h; i++) { ...
s590030446
p03593
u747703115
1595704027
Python
Python (3.8.2)
py
Runtime Error
27
9044
482
from collections import Counter h, w = map(int, input().split()) A = [] for i in range(h): A.extend(list(input())) cA = Counter(A) l1 = h*w%2 l2 = (h//2)*(w%2) + (w//2)*(h%2) l3 = (h//2)*(w//2) if l1: for key, val in cA.items(): if val%2==1: cA[key] -= 1 break for _ in range(l2)...
s996492438
p03593
u747703115
1595703995
Python
Python (3.8.2)
py
Runtime Error
24
8956
471
from collections import Counter h, w = map(int, input().split()) A = [] for i in range(h): A.extend(list(input())) cA = Counter(A) l1 = h*w%2 l2 = (h//2)*(w%2) + (w//2)*(h%2) l3 = (h//2)*(w//2) if l1: for key, val in cA.items(): if val%2==1: cA[key] -= 1 break for _ in range(l2)...
s337835749
p03593
u382423941
1595129544
Python
Python (3.8.2)
py
Runtime Error
33
9388
503
import collections h,w = map(int, input().split()) s = ''.join([''.join(input().split()) for _ in range(h)]) ctr = collections.Counter(s) if h % 2 == 0 and w % 2 == 0: four, two = h*w//4 elif h % 2 == 0: four, two = (h*w-h)//4, h//2 elif w % 2 == 0: four, two = (h*w-w)//4, w//2 else: four, two = (h*w-h...
s069876295
p03593
u830054172
1595086111
Python
Python (3.8.2)
py
Runtime Error
26
9364
938
from collections import Counter h,w=map(int,input().split()) s="" for i in range(h): s+=input() sc=Counter(s) d=[0,0,0] for v in sc.values(): d[0]+=(v//4)*4 d[1]+=2 if v%4>=2 else 0 d[2]+=v%2 if w%2==0 and h%2==0: print("Yes" if d[0]==h*w else "No") elif (w%2)*(h%2)==1: print("Yes" if d[1]<=(w-1)+(h-...
s051524829
p03593
u296150111
1594865826
Python
Python (3.8.2)
py
Runtime Error
34
9164
677
h,w=map(int,input().split()) cnt=[0]*26 for i in range(h): a=input() for j in range(w): cnt[ord(a[j])-ord("a")]+=1 if h%2==1 and w%2==1: f=0 for i in range(26): if cnt[i]%2==1: cnt[i]-=1 break four=0 for i in range(26): if cnt[i]>=4: four+=cnt[i]//4*4 elif cnt[i]%2==1: f=-1 break print(2/0...
s353814338
p03593
u296150111
1594863432
Python
Python (3.8.2)
py
Runtime Error
33
9208
535
h,w=map(int,input().split()) cnt=[0]*26 for i in range(h): a=input() for j in range(w): cnt[ord(a[j])-ord("a")]+=1 cnt.sort(reverse=True) now=0 for i in range(h//2+w//2): if cnt[now]>=4: cnt[now]-=4 else: now+=1 if now==26: break cnt.sort(reverse=True) if h%2==1 and w%2==1: print(2/0) if cnt[:3] in ([2,2...
s068638738
p03593
u296150111
1594858099
Python
Python (3.8.2)
py
Runtime Error
29
9140
476
h,w=map(int,input().split()) cnt=[0]*26 for i in range(h): a=input() for j in range(w): cnt[ord(a[j])-ord("a")]+=1 cnt.sort(reverse=True) now=0 for i in range(h//2+w//2): if cnt[now]>=4: cnt[now]-=4 else: now+=1 cnt.sort(reverse=True) if h%2==1 and w%2==1: if cnt[:3]==[2,2,1] or h==w==1: print("Yes") else...
s356490869
p03593
u464205401
1594730611
Python
Python (3.8.2)
py
Runtime Error
31
9492
687
from collections import defaultdict d = defaultdict(int) h,w = map(int,input().split()) for hh in range(h): s = list(input()) for ss in s: d[ss]+=1 dv = list(d.values()) d2 = [i for i in dv if i%2 == 0 and i%4 !=0] d2_2 = [i for i in d2 if i == 2] d4 = [i for i in dv if i%4 == 0] d2_e = [i for i in d2 if i ...
s910604886
p03593
u830054172
1594698478
Python
Python (3.8.2)
py
Runtime Error
25
9012
328
n, m, k = map(int, input().split()) # if n*m%2 == 0: # if k%2 == 0 and k >= min(n, m): # ans = 1 # else: # ans = 0 # else: # ans = 1 # if ans: # print("Yes") # else: # print("No") n,m,K=map(int,input().split());print("YNeos"[all(k*m-K+l*n-k*l*2for k in range(n+1)for l in range(m+1...
s265913603
p03593
u923270446
1594093964
Python
Python (3.8.2)
py
Runtime Error
27
9044
275
h,w=map(int,input().split()) a,l=[list(input())for i in range(h)],[0]*26 for i in a: for j in i:l[ord(j)-97]+=1 o,t,f=(h//2)*(w//2),(h//2)*(w%2)+(w//2)*(h%2),(h%2)*(w%2) for i in l: while o and i>3:o-=1;i-=4 while t and i>1:t-=1i-=2 f-=i print("Yes"if o==t==f==0else"No")
s815432284
p03593
u644907318
1593606574
Python
PyPy3 (7.3.0)
py
Runtime Error
108
74928
592
H,W = map(int,input().split()) A = [list(input()) for _ in range(H)] C = {chr(i):0 for i in range(97,123)} for i in range(H): for j in range(W): C[A[i][j]] += 1 if H%2==0 and W%2==0: flag = 0 for a in C: if C[a]%4!=0: flag = 1 break elif H%2==0 and W%2==1 or H%2==1 an...
s801668984
p03593
u860002137
1593136339
Python
Python (3.8.2)
py
Runtime Error
36
9648
1104
from collections import Counter h, w = map(int, input().split()) arr = [list(map(str, input().rstrip())) for _ in range(h)] arr = sum(arr, []) c = Counter(arr) c = list(c.values()) if h % 2 == 0 and w % 2 == 0: ans = all([x % 4 == 0 for x in c]) # 全て4個セットならOK elif h % 2 == 1 and w % 2 == 1: even = (h + w)...
s000796059
p03593
u813174766
1592179546
Python
Python (3.4.3)
py
Runtime Error
18
3064
139
h,w,k=map(int,input().split()) ans="No" for i in range(h+1): for j in range(w+1): if i*j+(h-i)*(w-j) == k: ans="Yes" print(ans)
s919524243
p03593
u474423089
1590460556
Python
Python (3.4.3)
py
Runtime Error
22
3316
950
from collections import Counter, defaultdict H, W = map(int, input().split(' ')) d = defaultdict(int) for i in range(H): for k, v in Counter(input()).items(): d[k] += v if H % 2 == 0 and W % 2 == 0: for i in d.values(): if i % 4 != 0: print('No') exit() print('Yes') e...
s344150248
p03593
u474423089
1590460513
Python
Python (3.4.3)
py
Runtime Error
23
3316
970
from collections import Counter, defaultdict H, W = map(int, input().split(' ')) d = defaultdict(int) for i in range(H): for k, v in Counter(input()).items(): d[k] += v if H % 2 == 0 and W % 2 == 0: for i in d.values(): if i % 4 != 0: print('No') exit() print('Yes') e...
s941064455
p03593
u810356688
1589555853
Python
Python (3.4.3)
py
Runtime Error
22
3316
1256
import sys def input(): return sys.stdin.readline().rstrip() from collections import Counter def main(): h,w=map(int,input().split()) s="" for _ in range(h): s+=input() sc=list(Counter(s).values()) #print(sc) if h%2==1 and w%2==1: for i,scc in enumerate(sc): if scc%2=...
s985225191
p03593
u623687794
1589518448
Python
Python (3.4.3)
py
Runtime Error
18
3064
949
h,w=map(int,input().split()) a={} for i in range(26): a[chr(i+97)]=0 for i in range(h): s=input() for j in s: a[j]+=1 if h==1 and w==1:print("Yes") elif h==1 or w==1: cnt=0 for i in a.values(): if i%2==1:cnt+=1 if cnt!=1:print("No") else:print("Yes") elif h%2==0 and w%2==0: for i in a.values(): ...
s180557256
p03593
u781262926
1588938135
Python
Python (3.4.3)
py
Runtime Error
19
3064
963
def solve(): inputs = open(0).readlines() h, w = map(int, inputs[0].split()) *A, = map(lambda x: x.strip(), inputs[1:]) B = [] for S in A: C = [0] * 26 for c in S: C[ord(c)-ord('a')] += 1 B.append(C) if w % 2 == 0: if all(all(x % 2 == 0 for x in b...
s732576814
p03593
u159975271
1588648866
Python
Python (3.4.3)
py
Runtime Error
22
3572
1254
import collections H,W = list(map(int , input().split())) D = [] for j in range(H): x=list(input()) D.extend(x) s = len((set(D))) c = collections.Counter(D) Q = [] for i in range(s): Q.append(c.most_common()[i][1]) if s == 1: print("Yes") else: if ((H*W)%2 == 1): seigen = (H//2+1)*(W//2 +1)...
s020617107
p03593
u159975271
1588645519
Python
Python (3.4.3)
py
Runtime Error
18
3064
851
import collections H,W = list(map(int , input().split())) D = [] for j in range(H): x=list(input()) D.extend(x) s = len((set(D))) c = collections.Counter(D) Q = [] for i in range(s): Q.append(c.most_common()[i][1]) if ((H*W)%2 == 1): seigen = (H//2+1)*(W//2 +1) q = 0 for k in range(s): ...
s565678972
p03593
u992910889
1588171895
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38640
808
import sys sys.setrecursionlimit(10 ** 5 + 10) def input(): return sys.stdin.readline().strip() def resolve(): def main(): H,W=map(int,input().split()) grid=[[_ for _ in input()] for _ in range(H)] for g in grid: gg=Counter(g) cnt=0 for i in gg.values():...
s573234820
p03593
u375616706
1586384730
Python
Python (3.4.3)
py
Runtime Error
22
3436
941
from collections import Counter H, W = map(int, input().split()) D = [] for _ in range(H): D.extend(list([v for v in input()])) C = Counter(D) L = list([v for i, v in C.most_common()]) if H == 1 and W == 1: ans = "Yes" elif H == 1 or W == 1: if sum([1 if v % 2 == 1 else 0 for v in L]) == 1: ans = "...
s761568709
p03593
u375616706
1586384457
Python
Python (3.4.3)
py
Runtime Error
22
3436
872
from collections import Counter H, W = map(int, input().split()) D = [] for _ in range(H): D.extend(list([v for v in input()])) C = Counter(D) L = list([v for i, v in C.most_common()]) # print(C) if H == 1 and W == 1: ans = "Yes" elif H == 1 or W == 1: if sum([1 if v % 2 == 1 else 0 for v in L]) == 1: ...
s761901234
p03593
u423585790
1586070208
Python
PyPy3 (2.4.0)
py
Runtime Error
197
38512
1299
#!/usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop from bisect import bisect_left, bisect_right import sys, random, itertools, math sys.setrecursionlimit(10**5) input = sys.stdin.readline sqrt = math.sqrt def LI(): return list(map(int, input().split())) def LF(): return...
s181243844
p03593
u977661421
1586007470
Python
Python (3.4.3)
py
Runtime Error
23
3444
889
# -*- coding: utf-8 -*- import collections h, w = map(int,input().split()) a = [] for i in range(h): a.append(list(input())) tmp = [] for i in range(h): for j in a[i]: tmp.append(j) #print(tmp) c = collections.Counter(tmp) tmp2 = list(set(tmp)) four = 0 two = 0 odd = 0 for i in tmp2: if c[i] % 4 ==...
s917896085
p03593
u977661421
1586007142
Python
Python (3.4.3)
py
Runtime Error
24
3444
771
# -*- coding: utf-8 -*- import collections h, w = map(int,input().split()) a = [] for i in range(h): a.append(list(input())) tmp = [] for i in range(h): for j in a[i]: tmp.append(j) #print(tmp) c = collections.Counter(tmp) tmp2 = list(set(tmp)) four = 0 two = 0 odd = 0 for i in tmp2: if c[i] % 4 ==...
s935297348
p03593
u977661421
1586007034
Python
Python (3.4.3)
py
Runtime Error
22
3444
765
# -*- coding: utf-8 -*- import collections h, w = map(int,input().split()) a = [] for i in range(h): a.append(list(input())) tmp = [] for i in range(h): for j in a[i]: tmp.append(j) #print(tmp) c = collections.Counter(tmp) tmp2 = set(tmp) four = 0 two = 0 odd = 0 for i in tmp2: if c[i] % 4 == 0: ...
s975922464
p03593
u977661421
1586006445
Python
Python (3.4.3)
py
Runtime Error
22
3444
618
# -*- coding: utf-8 -*- import collections h, w = map(int,input().split()) a = [] for i in range(h): a.append(list(input())) tmp = [] for i in range(h): for j in a[i]: tmp.append(j) #print(tmp) c = collections.Counter(tmp) tmp2 = set(tmp) odd = 0 for i in tmp2: if c[i] % 2 == 1: odd += 1 i...
s523177346
p03593
u727148417
1585357558
Python
Python (3.4.3)
py
Runtime Error
21
3316
792
from collections import Counter H, W = map(int, input().split()) raw = "" for i in range(H): raw = raw + input() #words = Counter(list(raw)) print(words) if H*W % 2 == 1: flag = 0 two_sum = (H-1) + (W-1) elif H%2 == 1: flag = 1 two_sum = W elif W%2 == 1: flag = 1 two_sum = H else: fla...
s176863043
p03593
u379959788
1585265175
Python
Python (3.4.3)
py
Runtime Error
27
3320
1847
al = [chr(ord('a') + i) for i in range(26)] H, W = map(int, input().split()) A = [input() for _ in range(H)] cnt = [0] * 26 for h in range(H): for w in range(W): cnt[al.index(A[h][w])] += 1 cnt = [i for i in cnt if i != 0] cnt.sort(reverse=True) if H == 1 or W == 1: count = (H*W) // 2 while count...
s246693146
p03593
u379959788
1585264883
Python
Python (3.4.3)
py
Runtime Error
27
3192
1816
al = [chr(ord('a') + i) for i in range(26)] H, W = map(int, input().split()) A = [input() for _ in range(H)] cnt = [0] * 26 for h in range(H): for w in range(W): cnt[al.index(A[h][w])] += 1 cnt = [i for i in cnt if i != 0] cnt.sort(reverse=True) if H == 1 or W == 1: count = (H*W) // 2 while count...
s190915960
p03593
u379959788
1585263637
Python
Python (3.4.3)
py
Runtime Error
26
3192
1725
al = [chr(ord('a') + i) for i in range(26)] H, W = map(int, input().split()) A = [input() for _ in range(H)] cnt = [0] * 26 for h in range(H): for w in range(W): cnt[al.index(A[h][w])] += 1 if H == 1 or W == 1: check = 0 for i in range(26): if cnt[i] % 2 == 1: check += 1 if...
s481623441
p03593
u987164499
1582588203
Python
Python (3.4.3)
py
Runtime Error
30
3768
982
from sys import stdin import string import heapq h,w = map(int,stdin.readline().rstrip().split()) s = "" for i in range(h): s += stdin.readline().rstrip() task_4 = (h//2)*(w//2) task_2 = (h%2)*(h//2)+(w%2)*(w//2) task_1 = (h%2)*(w%2) alpha = string.ascii_lowercase li = [-s.count(i) for i in alpha if s.count(i) != 0...
s146693609
p03593
u785578220
1579333528
Python
Python (3.4.3)
py
Runtime Error
17
3064
525
from collections import Counter a,b = map(int,input().split()) l = '' for i in range(a): t = input() l+=t c = Counter(list(l)) # print(c) dp = [0,0,0] for i in c: if c[i]%2 ==1: dp[0] +=1 elif c[i]%4 == 0: dp[2] += 1 elif c[i]%2 == 0: dp[1] += 1 # print(dp) ans = 'No' if a...
s447364698
p03593
u711539583
1575428866
Python
PyPy3 (2.4.0)
py
Runtime Error
176
38256
284
h, w = map(int. input().split()) d = {} for i in h: for c in input(): if c in d: d[c] += 1 else: d[c] = 1 m = ((w + 1)// 2) * ((h + 1) // 2) ans = "Yes" if len(d.keys()) > m: ans = "No" oc = 0 for key in d: oc += d[key] % 2 if oc > 1: ans = "No" print(ans)
s032838393
p03593
u518042385
1574914567
Python
Python (3.4.3)
py
Runtime Error
51
3440
1235
n,m=map(int,input().split()) #n,mの偶奇で場合分け #n,mがともに偶数の時は全部4の倍数個なきゃダメ #n,mの片方のみ奇数の時は、例えばnが奇数の時は個数が偶数だが4の倍数でない組みがm//2組みまで許される #n,mがともに奇数の時は個数が偶数だが4の倍数でない組みが(n+m)//2組み許され、ただ一つ奇数が必要 l=[] for i in range(n): l.append(list(input())) from collections import defaultdict d=defaultdict(int) for i in range(n): for j in range(m)...
s203293392
p03593
u623687794
1573155296
Python
PyPy3 (2.4.0)
py
Runtime Error
170
38384
648
h,w=map(int,input().split()) a={} for i in range(26): a[chr(i+97)]=0 for i in range(h): s=input() for j in s: a[j]+=1 if h%2==0 and w%2==0: for i in a.values(): if i%4!=0:print("No");exit() print("Yes") elif h%2==1 and w%2==0: cnt=0 for i in a.values(): if i%4!=2:cnt+=1 if cnt>w//2: prin...
s989159246
p03593
u644778646
1572728354
Python
Python (3.4.3)
py
Runtime Error
42
5460
1927
from fractions import gcd from datetime import date, timedelta from heapq import* import math from collections import defaultdict, Counter, deque import sys from bisect import * import itertools import copy sys.setrecursionlimit(10 ** 7) MOD = 10 ** 9 + 7 def main(): h, w = map(int, input().split()) a = [list...
s753815667
p03593
u644778646
1572728309
Python
Python (3.4.3)
py
Runtime Error
45
5588
1925
from fractions import gcd from datetime import date, timedelta from heapq import* import math from collections import defaultdict, Counter, deque import sys from bisect import * import itertools import copy sys.setrecursionlimit(10 ** 7) MOD = 10 ** 9 + 7 def main(): h, w = map(int, input().split()) a = [list...
s727552072
p03593
u644778646
1572728288
Python
Python (3.4.3)
py
Runtime Error
41
5584
1923
from fractions import gcd from datetime import date, timedelta from heapq import* import math from collections import defaultdict, Counter, deque import sys from bisect import * import itertools import copy sys.setrecursionlimit(10 ** 7) MOD = 10 ** 9 + 7 def main(): h, w = map(int, input().split()) a = [list...
s571898906
p03593
u644778646
1572727823
Python
Python (3.4.3)
py
Runtime Error
40
5332
1825
from fractions import gcd from datetime import date, timedelta from heapq import* import math from collections import defaultdict, Counter, deque import sys from bisect import * import itertools import copy sys.setrecursionlimit(10 ** 7) MOD = 10 ** 9 + 7 def main(): h, w = map(int, input().split()) a = [list...
s469170741
p03593
u644778646
1572727766
Python
Python (3.4.3)
py
Runtime Error
40
5332
1794
from fractions import gcd from datetime import date, timedelta from heapq import* import math from collections import defaultdict, Counter, deque import sys from bisect import * import itertools import copy sys.setrecursionlimit(10 ** 7) MOD = 10 ** 9 + 7 def main(): h, w = map(int, input().split()) a = [list...
s975090818
p03593
u118642796
1569468245
Python
PyPy3 (2.4.0)
py
Runtime Error
173
38480
340
H,W = map(int,input().split()) dic = {} for h in range(H): s = list(input()) for x in s: dic[x] = dic.get(x,0) + 1 c1 = 0 c2 = 0 for x in dic.values(): if x%2 == 1: c1 += 1 x -= 1 if x%4 == 2: c2 += 1 if c1>(H%2)*(W%2): print("No") return if c2>((W*(H%2))//2)+((H*(W%2))//2): print("No") ...
s607659775
p03593
u426108351
1568512838
Python
Python (3.4.3)
py
Runtime Error
19
3188
1085
from heapq import * H, W = map(int, input().split()) strings = [0] * 26 for i in range(H): s = list(map(int, input().split())) for j in range(W): strings[ord(s[j])-97] -= 1 one = 0 two = 0 four = 0 s = H * W if H % 2 == 1 and W % 2 == 1: one = 1 two = H // 2 + W // 2 four = (s-1-2*two)//4 ...