結果
| 問題 |
No.38 赤青白ブロック
|
| コンテスト | |
| ユーザー |
6soukiti29
|
| 提出日時 | 2017-07-27 23:01:48 |
| 言語 | Nim (2.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,013 bytes |
| コンパイル時間 | 844 ms |
| コンパイル使用メモリ | 66,032 KB |
| 最終ジャッジ日時 | 2024-06-30 01:50:31 |
| 合計ジャッジ時間 | 1,446 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
/home/judge/data/code/Main.nim(18, 31) Error: type mismatch: got 'seq[int]' for 'map(split(readLine(stdin), {' ', '\t', '\v', '\r', '\n', '\f'}, -1), parseInt)' but expected 'tuple'
ソースコード
import sequtils,strutils,math
proc matchstr(s : string,c : char, index : int): bool =
if index < 0:
return false
if index > s.high:
return false
if s[index] == c:
return true
else:
return false
var
Kr,Kb : int
S : string
ans = 0
(Kr,Kb) = stdin.readline.split.map(parseInt)
S = stdin.readline
for i in 1..<(1 shl 20):
var
j = i
ns = ""
flag = true
for s in S:
if s == 'W':
ns &= "W"
else:
if j mod 2 == 1:
ns &= s
j = j shr 1
for index,s in ns:
if s == 'W':
continue
elif (s == 'R' and
(matchstr(ns,s,index + Kr) or
matchstr(ns,s,index - Kr))):
flag = false
break
elif (s == 'B' and
(matchstr(ns,s,index + Kb) or
matchstr(ns,s,index - Kb))):
flag = false
break
if flag:
ans = max(ans,ns.len)
echo ans
6soukiti29