Submission #752399
Source Code Expand
strings = STDIN.gets.chomp
slength = strings.size
#Aの最大値は,bの
# ABCACだから,|B|=|C|=1としても,3文字消費するから,
# c = (b-3)/2(切り捨て)がAの最大値になる
# Aの場合を,cまで繰り返すようなアルゴリズムになる.
i = 0
j = 0
res = 0
maxlen = (slength - 3)/2
while i < maxlen
i += 1
a = strings[0..i]
j = 0
while j < maxlen
j += 1
c = strings[-j..-1]
#puts "cは", c
#b = strings[i+1..-(c.size + a.size + c.size + 1)]
b = strings[(a.size)..-(c.size + a.size + c.size)]
printf "%s,%s,%s,%s,%s\n", a , b, c, a, c
if (a + b + c + a + c) == strings
res += 1
#p a,b,c
end
end
end
puts res
Submission Info
| Submission Time | |
|---|---|
| Task | C - ABCAC |
| User | yokkun_s |
| Language | Ruby (2.3.3) |
| Score | 0 |
| Code Size | 743 Byte |
| Status | WA |
| Exec Time | 1738 ms |
| Memory | 219948 KiB |
Judge Result
| Set Name | Sample | Subtask | All | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 20 | 0 / 80 | ||||||||||
| Status |
|
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 0_000.txt, 0_001.txt, 0_002.txt |
| Subtask | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt, 1_026.txt |
| All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt, 1_026.txt, 2_027.txt, 2_028.txt, 2_029.txt, 2_030.txt, 2_031.txt, 2_032.txt, 2_033.txt, 2_034.txt, 2_035.txt, 2_036.txt, 2_037.txt, 2_038.txt, 2_039.txt, 2_040.txt, 2_041.txt, 2_042.txt, 2_043.txt, 2_044.txt, 2_045.txt, 2_046.txt, 2_047.txt, 2_048.txt, 2_049.txt, 2_050.txt, 2_051.txt, 2_052.txt, 2_053.txt, 2_054.txt, 2_055.txt, 2_056.txt, 2_057.txt, 2_058.txt, 2_059.txt, 2_060.txt, 2_061.txt, 2_062.txt, 2_063.txt, 2_064.txt, 2_065.txt, 2_066.txt, 2_067.txt, 2_068.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 0_000.txt | WA | 24 ms | 1788 KiB |
| 0_001.txt | WA | 19 ms | 1788 KiB |
| 0_002.txt | WA | 17 ms | 1788 KiB |
| 1_003.txt | WA | 18 ms | 1788 KiB |
| 1_004.txt | WA | 17 ms | 1788 KiB |
| 1_005.txt | WA | 17 ms | 1788 KiB |
| 1_006.txt | WA | 19 ms | 1788 KiB |
| 1_007.txt | RE | 1382 ms | 136588 KiB |
| 1_008.txt | RE | 1309 ms | 136592 KiB |
| 1_009.txt | RE | 1313 ms | 136520 KiB |
| 1_010.txt | RE | 1307 ms | 136592 KiB |
| 1_011.txt | RE | 1738 ms | 134720 KiB |
| 1_012.txt | RE | 1543 ms | 135420 KiB |
| 1_013.txt | RE | 1522 ms | 135548 KiB |
| 1_014.txt | WA | 422 ms | 25260 KiB |
| 1_015.txt | RE | 1713 ms | 134668 KiB |
| 1_016.txt | RE | 1289 ms | 136532 KiB |
| 1_017.txt | RE | 1309 ms | 136532 KiB |
| 1_018.txt | RE | 1289 ms | 136564 KiB |
| 1_019.txt | RE | 1293 ms | 136532 KiB |
| 1_020.txt | RE | 1285 ms | 136816 KiB |
| 1_021.txt | RE | 1291 ms | 136564 KiB |
| 1_022.txt | RE | 1299 ms | 136528 KiB |
| 1_023.txt | RE | 1294 ms | 136448 KiB |
| 1_024.txt | RE | 1311 ms | 136580 KiB |
| 1_025.txt | RE | 1315 ms | 136648 KiB |
| 1_026.txt | RE | 1301 ms | 136576 KiB |
| 2_027.txt | RE | 1103 ms | 219752 KiB |
| 2_028.txt | RE | 1080 ms | 219880 KiB |
| 2_029.txt | RE | 1089 ms | 219692 KiB |
| 2_030.txt | RE | 1140 ms | 219760 KiB |
| 2_031.txt | RE | 1093 ms | 219760 KiB |
| 2_032.txt | RE | 1109 ms | 219760 KiB |
| 2_033.txt | RE | 1108 ms | 219948 KiB |
| 2_034.txt | RE | 1132 ms | 219752 KiB |
| 2_035.txt | RE | 1100 ms | 219888 KiB |
| 2_036.txt | RE | 1113 ms | 219760 KiB |
| 2_037.txt | RE | 813 ms | 203364 KiB |
| 2_038.txt | RE | 893 ms | 186480 KiB |
| 2_039.txt | RE | 1001 ms | 195344 KiB |
| 2_040.txt | RE | 911 ms | 195140 KiB |
| 2_041.txt | RE | 976 ms | 194772 KiB |
| 2_042.txt | RE | 1157 ms | 219888 KiB |
| 2_043.txt | RE | 1129 ms | 219760 KiB |
| 2_044.txt | RE | 1117 ms | 219760 KiB |
| 2_045.txt | RE | 1091 ms | 219888 KiB |
| 2_046.txt | RE | 1082 ms | 219888 KiB |
| 2_047.txt | RE | 1135 ms | 219880 KiB |
| 2_048.txt | RE | 1152 ms | 219760 KiB |
| 2_049.txt | RE | 1116 ms | 219692 KiB |
| 2_050.txt | RE | 1099 ms | 219888 KiB |
| 2_051.txt | RE | 1118 ms | 219692 KiB |
| 2_052.txt | RE | 1137 ms | 219888 KiB |
| 2_053.txt | RE | 1084 ms | 219888 KiB |
| 2_054.txt | RE | 1130 ms | 219760 KiB |
| 2_055.txt | RE | 1122 ms | 219760 KiB |
| 2_056.txt | RE | 1129 ms | 219752 KiB |
| 2_057.txt | RE | 1125 ms | 219948 KiB |
| 2_058.txt | RE | 1112 ms | 219752 KiB |
| 2_059.txt | RE | 1063 ms | 219752 KiB |
| 2_060.txt | RE | 1085 ms | 219752 KiB |
| 2_061.txt | RE | 1126 ms | 219760 KiB |
| 2_062.txt | RE | 1096 ms | 219888 KiB |
| 2_063.txt | RE | 1165 ms | 219880 KiB |
| 2_064.txt | RE | 1078 ms | 219692 KiB |
| 2_065.txt | RE | 1153 ms | 219760 KiB |
| 2_066.txt | RE | 1091 ms | 219692 KiB |
| 2_067.txt | RE | 1112 ms | 219760 KiB |
| 2_068.txt | RE | 1112 ms | 219752 KiB |