結果

問題 No.406 鴨等間隔の法則
ユーザー 💕💖💞💕💖💞
提出日時 2016-09-09 10:54:20
言語 Python2
(2.7.18)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 584 ms
コンパイル使用メモリ 6,504 KB
実行使用メモリ 23,320 KB
最終ジャッジ日時 2023-09-21 18:09:28
合計ジャッジ時間 4,582 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
12,956 KB
testcase_01 AC 12 ms
6,000 KB
testcase_02 AC 12 ms
6,004 KB
testcase_03 AC 12 ms
6,132 KB
testcase_04 AC 136 ms
21,580 KB
testcase_05 AC 53 ms
11,632 KB
testcase_06 AC 56 ms
12,184 KB
testcase_07 AC 58 ms
12,368 KB
testcase_08 AC 134 ms
21,700 KB
testcase_09 AC 147 ms
23,320 KB
testcase_10 AC 64 ms
13,052 KB
testcase_11 AC 114 ms
19,720 KB
testcase_12 AC 76 ms
14,556 KB
testcase_13 AC 71 ms
14,040 KB
testcase_14 AC 126 ms
21,176 KB
testcase_15 AC 17 ms
6,616 KB
testcase_16 AC 20 ms
7,008 KB
testcase_17 AC 16 ms
6,424 KB
testcase_18 AC 19 ms
7,192 KB
testcase_19 AC 22 ms
7,212 KB
testcase_20 AC 26 ms
8,132 KB
testcase_21 AC 26 ms
8,088 KB
testcase_22 AC 39 ms
9,880 KB
testcase_23 AC 79 ms
15,260 KB
testcase_24 AC 106 ms
16,932 KB
testcase_25 AC 145 ms
23,088 KB
testcase_26 AC 148 ms
21,188 KB
testcase_27 AC 102 ms
21,112 KB
testcase_28 AC 106 ms
23,300 KB
testcase_29 AC 148 ms
21,260 KB
testcase_30 AC 146 ms
20,976 KB
testcase_31 AC 139 ms
23,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import os

import math
import copy
num = 0
for i, line in enumerate(sys.stdin):
 if i == 0:
   num = int(line)
   continue
 line = line.strip()
 li = map(int ,filter(lambda x:x != '', line.split(" ")))
 li = sorted(li)
 li2 = copy.copy(li)
 li2.insert(0, 0)
 binded = [bind[0] - bind[1] for bind in zip(li, li2)]
 binded.pop(0)
 head = binded[0]
 if head == 0:
  print "NO"
  sys.exit(0)
 for b in binded:
   if b != head:
     print "NO"
     sys.exit(0)
 print "YES"
0