結果
問題 |
No.2684 折々の色
|
ユーザー |
|
提出日時 | 2024-03-20 22:33:02 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,204 bytes |
コンパイル時間 | 396 ms |
コンパイル使用メモリ | 82,344 KB |
実行使用メモリ | 203,404 KB |
最終ジャッジ日時 | 2024-09-30 08:37:37 |
合計ジャッジ時間 | 25,741 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 RE * 1 |
other | AC * 2 RE * 54 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random #sys.setrecursionlimit(10**9) #sys.set_int_max_str_digits(0) n,m = map(int,input().split()) x = list(map(int,input().split())) for i in range(m): x[i] *= 10000 c = [list(map(int,input().split())) for i in range(n)] s = set() for i in range(n): z = [] for j in range(m): z.append(1 * c[i][-1] * c[i][j]) s.add(tuple(z)) for i in range(n): if 100 - c[i][-1] == 0: cnt = 0 for j in range(m): if x[j] == 100 * c[i][j] * c[i][-1]: cnt += 1 else: break if cnt == m: print('Yes') exit() continue z = [] for j in range(m): z.append(1 * c[i][-1] * c[i][j]) s.discard(tuple(z)) y = [] for j in range(m): y.append(x[j] - 100*c[i][-1]*c[i][j]) check = 1 for j in range(m): if y[j] % (100 - c[i][-1]) != 0: check = 0 break else: y[j] //= (100 - c[i][-1]) if check == 0: continue #print(i,y,s) if tuple(y) in s: exit(print('Yes')) s.add(z) print('No')