Submission #51223271
Source Code Expand
(N,),*XY = $<.map{|ln| ln.split.map(&:to_i) }
AB2C = N.times.map{|a|
x1,y1 = XY[a]
a.times.map{|b|
x2,y2 = XY[b]
dx,dy = x2-x1,y2-y1
b.times.count{|c|
x3,y3 = XY[c]
(y3-y1)*dx==dy*(x3-x1)
}
}
}
p [N-2-AB2C.map{|b2c| b2c.max||0 }.max,N/3].min
Submission Info
| Submission Time | |
|---|---|
| Task | B - Make Many Triangles |
| User | ds14050 |
| Language | Ruby (ruby 3.2.2) |
| Score | 500 |
| Code Size | 272 Byte |
| Status | AC |
| Exec Time | 342 ms |
| Memory | 18176 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 500 / 500 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 01_random_case_01.txt, 01_random_case_02.txt, 01_random_case_03.txt, 01_random_case_04.txt, 01_random_case_05.txt, 01_random_case_06.txt, 01_random_case_07.txt, 01_random_case_08.txt, 01_random_case_09.txt, 01_random_case_10.txt, 01_random_case_11.txt, 01_random_case_12.txt, 01_random_case_13.txt, 01_random_case_14.txt, 01_random_case_15.txt, 02_max_all_case_01.txt, 02_max_all_case_02.txt, 02_max_all_case_03.txt, 02_max_all_case_04.txt, 02_max_all_case_05.txt, 02_max_all_case_06.txt, 02_max_all_case_07.txt, 02_max_all_case_08.txt, 02_max_all_case_09.txt, 02_max_all_case_10.txt, 02_max_all_case_11.txt, 02_max_all_case_12.txt, 02_max_all_case_13.txt, 02_max_all_case_14.txt, 02_max_all_case_15.txt, 02_max_all_case_16.txt, 02_max_all_case_17.txt, 02_max_all_case_18.txt, 02_max_all_case_19.txt, 02_max_all_case_20.txt, 02_max_all_case_21.txt, 02_max_all_case_22.txt, 02_max_all_case_23.txt, 02_max_all_case_24.txt, 02_max_all_case_25.txt, 02_max_all_case_26.txt, 02_max_all_case_27.txt, 02_max_all_case_28.txt, 02_max_all_case_29.txt, 02_max_all_case_30.txt, 02_max_all_case_31.txt, 02_max_all_case_32.txt, 02_max_all_case_33.txt, 02_max_all_case_34.txt, 02_max_all_case_35.txt, 02_max_all_case_36.txt, 02_max_all_case_37.txt, 02_max_all_case_38.txt, 02_max_all_case_39.txt, 02_max_all_case_40.txt, 02_max_all_case_41.txt, 03_max_not_all_case_01.txt, 03_max_not_all_case_02.txt, 03_max_not_all_case_03.txt, 03_max_not_all_case_04.txt, 03_max_not_all_case_05.txt, 03_max_not_all_case_06.txt, 03_max_not_all_case_07.txt, 03_max_not_all_case_08.txt, 03_max_not_all_case_09.txt, 03_max_not_all_case_10.txt, 03_max_not_all_case_11.txt, 03_max_not_all_case_12.txt, 03_max_not_all_case_13.txt, 03_max_not_all_case_14.txt, 03_max_not_all_case_15.txt, 03_max_not_all_case_16.txt, 03_max_not_all_case_17.txt, 03_max_not_all_case_18.txt, 03_max_not_all_case_19.txt, 03_max_not_all_case_20.txt, 03_max_not_all_case_21.txt, 03_max_not_all_case_22.txt, 03_max_not_all_case_23.txt, 03_max_not_all_case_24.txt, 03_max_not_all_case_25.txt, 04_zero_01.txt, 04_zero_02.txt, 04_zero_03.txt, 04_zero_04.txt, 04_zero_05.txt, 05_vertical_01.txt, 05_vertical_02.txt, 05_vertical_03.txt, 05_vertical_04.txt, 05_vertical_05.txt, 06_overflow_killer_01.txt, 06_overflow_killer_02.txt, 06_overflow_killer_03.txt, 06_overflow_killer_04.txt, 06_overflow_killer_05.txt, 06_overflow_killer_06.txt, 06_overflow_killer_07.txt, 07_handmade_01.txt, 07_handmade_02.txt, 07_handmade_03.txt, 07_handmade_04.txt, 07_handmade_05.txt, 07_handmade_06.txt, 07_handmade_07.txt, 07_handmade_08.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 132 ms | 17408 KiB |
| 00_sample_02.txt | AC | 44 ms | 17144 KiB |
| 01_random_case_01.txt | AC | 315 ms | 18112 KiB |
| 01_random_case_02.txt | AC | 313 ms | 17912 KiB |
| 01_random_case_03.txt | AC | 313 ms | 18052 KiB |
| 01_random_case_04.txt | AC | 312 ms | 17992 KiB |
| 01_random_case_05.txt | AC | 320 ms | 18040 KiB |
| 01_random_case_06.txt | AC | 270 ms | 17732 KiB |
| 01_random_case_07.txt | AC | 167 ms | 17916 KiB |
| 01_random_case_08.txt | AC | 219 ms | 17976 KiB |
| 01_random_case_09.txt | AC | 228 ms | 17784 KiB |
| 01_random_case_10.txt | AC | 247 ms | 17720 KiB |
| 01_random_case_11.txt | AC | 150 ms | 17732 KiB |
| 01_random_case_12.txt | AC | 198 ms | 17760 KiB |
| 01_random_case_13.txt | AC | 244 ms | 17812 KiB |
| 01_random_case_14.txt | AC | 209 ms | 17712 KiB |
| 01_random_case_15.txt | AC | 208 ms | 17692 KiB |
| 02_max_all_case_01.txt | AC | 322 ms | 18000 KiB |
| 02_max_all_case_02.txt | AC | 324 ms | 18144 KiB |
| 02_max_all_case_03.txt | AC | 323 ms | 18000 KiB |
| 02_max_all_case_04.txt | AC | 322 ms | 18036 KiB |
| 02_max_all_case_05.txt | AC | 314 ms | 18040 KiB |
| 02_max_all_case_06.txt | AC | 314 ms | 18144 KiB |
| 02_max_all_case_07.txt | AC | 330 ms | 17956 KiB |
| 02_max_all_case_08.txt | AC | 336 ms | 17892 KiB |
| 02_max_all_case_09.txt | AC | 339 ms | 18040 KiB |
| 02_max_all_case_10.txt | AC | 326 ms | 17988 KiB |
| 02_max_all_case_11.txt | AC | 330 ms | 18008 KiB |
| 02_max_all_case_12.txt | AC | 337 ms | 18020 KiB |
| 02_max_all_case_13.txt | AC | 321 ms | 17820 KiB |
| 02_max_all_case_14.txt | AC | 317 ms | 18048 KiB |
| 02_max_all_case_15.txt | AC | 337 ms | 17892 KiB |
| 02_max_all_case_16.txt | AC | 319 ms | 18012 KiB |
| 02_max_all_case_17.txt | AC | 323 ms | 18064 KiB |
| 02_max_all_case_18.txt | AC | 329 ms | 18128 KiB |
| 02_max_all_case_19.txt | AC | 314 ms | 18176 KiB |
| 02_max_all_case_20.txt | AC | 313 ms | 18036 KiB |
| 02_max_all_case_21.txt | AC | 320 ms | 18156 KiB |
| 02_max_all_case_22.txt | AC | 325 ms | 18000 KiB |
| 02_max_all_case_23.txt | AC | 317 ms | 17940 KiB |
| 02_max_all_case_24.txt | AC | 320 ms | 18100 KiB |
| 02_max_all_case_25.txt | AC | 323 ms | 18088 KiB |
| 02_max_all_case_26.txt | AC | 315 ms | 18048 KiB |
| 02_max_all_case_27.txt | AC | 311 ms | 18060 KiB |
| 02_max_all_case_28.txt | AC | 327 ms | 17976 KiB |
| 02_max_all_case_29.txt | AC | 337 ms | 17940 KiB |
| 02_max_all_case_30.txt | AC | 331 ms | 18128 KiB |
| 02_max_all_case_31.txt | AC | 332 ms | 17936 KiB |
| 02_max_all_case_32.txt | AC | 323 ms | 17964 KiB |
| 02_max_all_case_33.txt | AC | 321 ms | 18056 KiB |
| 02_max_all_case_34.txt | AC | 312 ms | 18012 KiB |
| 02_max_all_case_35.txt | AC | 322 ms | 17984 KiB |
| 02_max_all_case_36.txt | AC | 313 ms | 18044 KiB |
| 02_max_all_case_37.txt | AC | 313 ms | 18140 KiB |
| 02_max_all_case_38.txt | AC | 318 ms | 18044 KiB |
| 02_max_all_case_39.txt | AC | 311 ms | 18136 KiB |
| 02_max_all_case_40.txt | AC | 321 ms | 18124 KiB |
| 02_max_all_case_41.txt | AC | 313 ms | 18080 KiB |
| 03_max_not_all_case_01.txt | AC | 314 ms | 18028 KiB |
| 03_max_not_all_case_02.txt | AC | 312 ms | 18140 KiB |
| 03_max_not_all_case_03.txt | AC | 316 ms | 18076 KiB |
| 03_max_not_all_case_04.txt | AC | 325 ms | 18080 KiB |
| 03_max_not_all_case_05.txt | AC | 324 ms | 18020 KiB |
| 03_max_not_all_case_06.txt | AC | 317 ms | 18116 KiB |
| 03_max_not_all_case_07.txt | AC | 314 ms | 18148 KiB |
| 03_max_not_all_case_08.txt | AC | 342 ms | 17964 KiB |
| 03_max_not_all_case_09.txt | AC | 330 ms | 17996 KiB |
| 03_max_not_all_case_10.txt | AC | 331 ms | 18004 KiB |
| 03_max_not_all_case_11.txt | AC | 314 ms | 18064 KiB |
| 03_max_not_all_case_12.txt | AC | 340 ms | 17976 KiB |
| 03_max_not_all_case_13.txt | AC | 317 ms | 18012 KiB |
| 03_max_not_all_case_14.txt | AC | 334 ms | 18084 KiB |
| 03_max_not_all_case_15.txt | AC | 317 ms | 17960 KiB |
| 03_max_not_all_case_16.txt | AC | 312 ms | 18124 KiB |
| 03_max_not_all_case_17.txt | AC | 315 ms | 18024 KiB |
| 03_max_not_all_case_18.txt | AC | 315 ms | 18024 KiB |
| 03_max_not_all_case_19.txt | AC | 326 ms | 18152 KiB |
| 03_max_not_all_case_20.txt | AC | 324 ms | 18140 KiB |
| 03_max_not_all_case_21.txt | AC | 315 ms | 17948 KiB |
| 03_max_not_all_case_22.txt | AC | 313 ms | 17948 KiB |
| 03_max_not_all_case_23.txt | AC | 312 ms | 17996 KiB |
| 03_max_not_all_case_24.txt | AC | 325 ms | 18028 KiB |
| 03_max_not_all_case_25.txt | AC | 315 ms | 18024 KiB |
| 04_zero_01.txt | AC | 155 ms | 17732 KiB |
| 04_zero_02.txt | AC | 142 ms | 17760 KiB |
| 04_zero_03.txt | AC | 245 ms | 17772 KiB |
| 04_zero_04.txt | AC | 141 ms | 17868 KiB |
| 04_zero_05.txt | AC | 288 ms | 18128 KiB |
| 05_vertical_01.txt | AC | 320 ms | 18112 KiB |
| 05_vertical_02.txt | AC | 320 ms | 18024 KiB |
| 05_vertical_03.txt | AC | 319 ms | 18052 KiB |
| 05_vertical_04.txt | AC | 313 ms | 18008 KiB |
| 05_vertical_05.txt | AC | 318 ms | 17928 KiB |
| 06_overflow_killer_01.txt | AC | 312 ms | 18052 KiB |
| 06_overflow_killer_02.txt | AC | 316 ms | 17944 KiB |
| 06_overflow_killer_03.txt | AC | 319 ms | 18068 KiB |
| 06_overflow_killer_04.txt | AC | 339 ms | 18052 KiB |
| 06_overflow_killer_05.txt | AC | 328 ms | 18000 KiB |
| 06_overflow_killer_06.txt | AC | 328 ms | 18152 KiB |
| 06_overflow_killer_07.txt | AC | 328 ms | 17964 KiB |
| 07_handmade_01.txt | AC | 43 ms | 17088 KiB |
| 07_handmade_02.txt | AC | 44 ms | 17304 KiB |
| 07_handmade_03.txt | AC | 44 ms | 17236 KiB |
| 07_handmade_04.txt | AC | 43 ms | 17124 KiB |
| 07_handmade_05.txt | AC | 311 ms | 18044 KiB |
| 07_handmade_06.txt | AC | 312 ms | 18100 KiB |
| 07_handmade_07.txt | AC | 312 ms | 17952 KiB |
| 07_handmade_08.txt | AC | 314 ms | 18040 KiB |