Submission #44500699
Source Code Expand
N,M = gets.split.map(&:to_i)
S = gets.chomp.chars
C = gets.split.map(&:to_i)
LC = [nil]*(M+1)
C.each_with_index.reverse_each{|m,i|
LC[m] ||= S[i]
}
puts S.zip(C).map{|c1,m|
c0,LC[m] = LC[m],c1
next c0
}*''
Submission Info
| Submission Time | |
|---|---|
| Task | C - Rotate Colored Subsequence |
| User | ds14050 |
| Language | Ruby (ruby 3.2.2) |
| Score | 300 |
| Code Size | 220 Byte |
| Status | AC |
| Exec Time | 158 ms |
| Memory | 51748 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, example0.txt, example1.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 43 ms | 16836 KiB |
| 001.txt | AC | 142 ms | 49340 KiB |
| 002.txt | AC | 158 ms | 51700 KiB |
| 003.txt | AC | 142 ms | 49288 KiB |
| 004.txt | AC | 147 ms | 49560 KiB |
| 005.txt | AC | 151 ms | 50220 KiB |
| 006.txt | AC | 68 ms | 23928 KiB |
| 007.txt | AC | 81 ms | 28788 KiB |
| 008.txt | AC | 86 ms | 29120 KiB |
| 009.txt | AC | 157 ms | 51748 KiB |
| 010.txt | AC | 148 ms | 49964 KiB |
| 011.txt | AC | 145 ms | 49572 KiB |
| 012.txt | AC | 145 ms | 49636 KiB |
| 013.txt | AC | 143 ms | 49740 KiB |
| 014.txt | AC | 145 ms | 50000 KiB |
| 015.txt | AC | 142 ms | 49552 KiB |
| 016.txt | AC | 144 ms | 49444 KiB |
| 017.txt | AC | 142 ms | 49376 KiB |
| 018.txt | AC | 143 ms | 49284 KiB |
| 019.txt | AC | 142 ms | 49240 KiB |
| 020.txt | AC | 139 ms | 46684 KiB |
| 021.txt | AC | 144 ms | 49292 KiB |
| 022.txt | AC | 141 ms | 49380 KiB |
| 023.txt | AC | 142 ms | 49224 KiB |
| 024.txt | AC | 141 ms | 49384 KiB |
| 025.txt | AC | 142 ms | 49256 KiB |
| 026.txt | AC | 141 ms | 46672 KiB |
| example0.txt | AC | 43 ms | 17316 KiB |
| example1.txt | AC | 43 ms | 17052 KiB |