結果
問題 | No.1366 交換門松列・梅 |
ユーザー | ansain |
提出日時 | 2021-01-29 21:24:57 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
AC
|
実行時間 | 19 ms / 1,000 ms |
コード長 | 1,112 bytes |
コンパイル時間 | 165 ms |
コンパイル使用メモリ | 10,916 KB |
実行使用メモリ | 8,660 KB |
最終ジャッジ日時 | 2023-07-30 08:56:56 |
合計ジャッジ時間 | 1,140 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge5 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 18 ms
8,600 KB |
testcase_01 | AC | 19 ms
8,660 KB |
testcase_02 | AC | 19 ms
8,512 KB |
testcase_03 | AC | 18 ms
8,496 KB |
testcase_04 | AC | 19 ms
8,600 KB |
testcase_05 | AC | 18 ms
8,552 KB |
testcase_06 | AC | 18 ms
8,600 KB |
testcase_07 | AC | 19 ms
8,500 KB |
testcase_08 | AC | 18 ms
8,524 KB |
testcase_09 | AC | 18 ms
8,540 KB |
testcase_10 | AC | 19 ms
8,540 KB |
testcase_11 | AC | 19 ms
8,500 KB |
testcase_12 | AC | 18 ms
8,660 KB |
ソースコード
import sys from collections import defaultdict, Counter, deque from itertools import permutations, combinations, product, combinations_with_replacement, groupby, accumulate import operator #from math import sqrt,isqrt #from bisect import bisect_left,bisect_right #from functools import lru_cache,reduce #import heapq #import numpy as np #import networkx as nx # from numba import njit, b1, i1, i4, i8, f8 # numba例 @njit(i1(i4[:], i8[:, :]),cache=True) 引数i4配列、i8 2次元配列,戻り値i1 def input(): return sys.stdin.readline().rstrip() def divceil(n, k): return 1+(n-1)//k # n/kの切り上げを返す def check(a): return len(set(a)) == 3 and a[1] in [max(a), min(a)] def main(): mod = 10**9+7 mod2 = 998244353 a=list(map(int, input().split())) b=list(map(int, input().split())) for i in range(3): for j in range(3): aa=a.copy() bb=b.copy() aa[i]=b[j] bb[j]=a[i] if check(aa) and check(bb): print('Yes') return print('No') if __name__ == '__main__': main()