結果

問題 No.179 塗り分け
ユーザー むらためむらため
提出日時 2019-01-20 07:19:19
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 954 bytes
コンパイル時間 2,208 ms
コンパイル使用メモリ 66,564 KB
実行使用メモリ 5,772 KB
最終ジャッジ日時 2023-09-14 02:21:08
合計ジャッジ時間 3,833 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 3 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 14 ms
5,132 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 14 ms
5,540 KB
testcase_21 AC 20 ms
5,568 KB
testcase_22 AC 18 ms
5,596 KB
testcase_23 WA -
testcase_24 AC 15 ms
5,588 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 14 ms
5,560 KB
testcase_28 WA -
testcase_29 AC 15 ms
5,504 KB
testcase_30 WA -
testcase_31 AC 14 ms
5,512 KB
testcase_32 WA -
testcase_33 AC 15 ms
5,720 KB
testcase_34 WA -
testcase_35 AC 15 ms
5,628 KB
testcase_36 AC 1 ms
4,376 KB
testcase_37 AC 1 ms
4,380 KB
testcase_38 AC 2 ms
4,376 KB
testcase_39 AC 1 ms
4,380 KB
testcase_40 AC 2 ms
4,376 KB
testcase_41 AC 1 ms
4,376 KB
testcase_42 AC 2 ms
4,376 KB
testcase_43 AC 2 ms
4,380 KB
testcase_44 AC 4 ms
4,380 KB
testcase_45 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 54) Warning: imported and not used: 'strformat' [UnusedImport]
/home/judge/data/code/Main.nim(1, 17) Warning: imported and not used: 'strutils' [UnusedImport]
/home/judge/data/code/Main.nim(1, 26) Warning: imported and not used: 'algorithm' [UnusedImport]
/home/judge/data/code/Main.nim(1, 36) Warning: imported and not used: 'math' [UnusedImport]
/home/judge/data/code/Main.nim(1, 41) Warning: imported and not used: 'sugar' [UnusedImport]
/home/judge/data/code/Main.nim(1, 47) Warning: imported and not used: 'macros' [UnusedImport]

ソースコード

diff #

import sequtils,strutils,algorithm,math,sugar,macros,strformat

proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc scan(): int =
  while true:
    var k = getchar_unlocked()
    if k < '0' or k > '9': break
    else: result = 10 * result + k.ord - '0'.ord

let h = scan()
let w = scan()
var S = newSeqWith(w,newSeqWith(h,false))
var blockSum = 0
for y in 0..<h:
  for x in 0..<w:
    let s = getchar_unlocked() == '#'
    S[x][y] = s
    if s : blockSum += 1
  discard getchar_unlocked()

if blockSum <= 1: quit "NO",0
proc check(sx,sy:int) =
  var already = newSeqWith(w,newSeqWith(h,false))
  for x in 0..<w:
    for y in 0..<h:
      if not S[x][y] : continue
      if already[x][y]:continue
      if x + sx >= w or y + sy >= h : return
      if not S[x+sx][y+sy]: return
      already[x+sx][y+sy] = true
  quit "YES",0

for x in 0..<w:
  for y in 0..<h:
    if x == 0 and y == 0 : continue
    check(x,y)
echo "NO"
0