提出 #43353658
ソースコード 拡げる
N = gets.to_i
A = N.times.map{ gets.chomp.chars }
C = A.transpose
C0 = *C[0][1,N],A[-1][1]
C9 = A[0][-2],*C[-1][0,N-1]
A[0].rotate! -1
A[-1].rotate! 1
puts A.map{|_,*r,_|
[C0.shift,*r,C9.shift]*''
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Rotate |
| ユーザ | ds14050 |
| 言語 | Ruby (2.7.1) |
| 得点 | 200 |
| コード長 | 210 Byte |
| 結果 | AC |
| 実行時間 | 65 ms |
| メモリ | 14764 KiB |
コンパイルエラー
./Main.rb:6: warning: ambiguous first argument; put parentheses or a space even after `-' operator
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example_00.txt, example_01.txt, example_02.txt |
| All | example_00.txt, example_01.txt, example_02.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| example_00.txt | AC | 61 ms | 14220 KiB |
| example_01.txt | AC | 57 ms | 14240 KiB |
| example_02.txt | AC | 58 ms | 14140 KiB |
| test_00.txt | AC | 59 ms | 14152 KiB |
| test_01.txt | AC | 57 ms | 14208 KiB |
| test_02.txt | AC | 57 ms | 14104 KiB |
| test_03.txt | AC | 59 ms | 14220 KiB |
| test_04.txt | AC | 58 ms | 14328 KiB |
| test_05.txt | AC | 58 ms | 14184 KiB |
| test_06.txt | AC | 58 ms | 14136 KiB |
| test_07.txt | AC | 56 ms | 14764 KiB |
| test_08.txt | AC | 65 ms | 14540 KiB |
| test_09.txt | AC | 58 ms | 14764 KiB |
| test_10.txt | AC | 59 ms | 14716 KiB |
| test_11.txt | AC | 59 ms | 14636 KiB |
| test_12.txt | AC | 59 ms | 14696 KiB |