Submission #32420412
Source Code Expand
N, M = gets.split.map(&:to_i) S = gets.split.map(&:to_i) X = gets.split.map(&:to_i) A = Array.new(N, 0) S.each_with_index{|s, i| A[i + 1] = s - A[i] } H = Hash.new(0) A.each_with_index do |a, i| X.each do |x| H[(-1).pow(i) * (x - a)] += 1 end end puts H.values.max
Submission Info
Submission Time | |
---|---|
Task | E - Lucky Numbers |
User | tinsep19 |
Language | Ruby (2.7.1) |
Score | 500 |
Code Size | 287 Byte |
Status | AC |
Exec Time | 363 ms |
Memory | 61048 KiB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 500 / 500 | ||||
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, 027.txt, 028.txt, 029.txt, 030.txt, 031.txt, 032.txt, 033.txt, 034.txt, 035.txt, 036.txt, 037.txt, 038.txt, 039.txt, 040.txt, 041.txt, 042.txt, 043.txt, 044.txt, example0.txt, example1.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 57 ms | 14212 KiB |
001.txt | AC | 210 ms | 21428 KiB |
002.txt | AC | 207 ms | 21540 KiB |
003.txt | AC | 212 ms | 21548 KiB |
004.txt | AC | 211 ms | 21468 KiB |
005.txt | AC | 356 ms | 61048 KiB |
006.txt | AC | 141 ms | 26616 KiB |
007.txt | AC | 222 ms | 23228 KiB |
008.txt | AC | 228 ms | 25640 KiB |
009.txt | AC | 300 ms | 57836 KiB |
010.txt | AC | 106 ms | 21380 KiB |
011.txt | AC | 104 ms | 21444 KiB |
012.txt | AC | 104 ms | 21472 KiB |
013.txt | AC | 105 ms | 21596 KiB |
014.txt | AC | 102 ms | 21364 KiB |
015.txt | AC | 335 ms | 58576 KiB |
016.txt | AC | 310 ms | 58712 KiB |
017.txt | AC | 258 ms | 40436 KiB |
018.txt | AC | 230 ms | 31020 KiB |
019.txt | AC | 215 ms | 21432 KiB |
020.txt | AC | 363 ms | 61040 KiB |
021.txt | AC | 354 ms | 60828 KiB |
022.txt | AC | 356 ms | 60872 KiB |
023.txt | AC | 352 ms | 60804 KiB |
024.txt | AC | 353 ms | 60896 KiB |
025.txt | AC | 90 ms | 20428 KiB |
026.txt | AC | 161 ms | 36564 KiB |
027.txt | AC | 127 ms | 29996 KiB |
028.txt | AC | 110 ms | 25496 KiB |
029.txt | AC | 106 ms | 24844 KiB |
030.txt | AC | 352 ms | 60956 KiB |
031.txt | AC | 353 ms | 60692 KiB |
032.txt | AC | 349 ms | 60940 KiB |
033.txt | AC | 353 ms | 60892 KiB |
034.txt | AC | 356 ms | 60816 KiB |
035.txt | AC | 222 ms | 23296 KiB |
036.txt | AC | 230 ms | 23172 KiB |
037.txt | AC | 226 ms | 23368 KiB |
038.txt | AC | 243 ms | 25852 KiB |
039.txt | AC | 243 ms | 25756 KiB |
040.txt | AC | 231 ms | 25832 KiB |
041.txt | AC | 245 ms | 30524 KiB |
042.txt | AC | 237 ms | 25840 KiB |
043.txt | AC | 257 ms | 30472 KiB |
044.txt | AC | 278 ms | 39588 KiB |
example0.txt | AC | 56 ms | 14192 KiB |
example1.txt | AC | 55 ms | 14340 KiB |