Submission #3600454
Source Code Expand
N,M,*X = `dd`.split.map(&:to_i) ns = {} X.each{ |x| ns[x] = (ns[x] || 0) + 1 } ds = Array.new(M,0) ss = Array.new(M,0) ns.each{ |x,n| ds[x%M] += n/2 ss[x%M] += n%2 } #p ss, ds ans = ds[0] + ss[0]/2 if N%2 == 0 ans += ds[N/2] + ss[N/2]/2 end #p ans (1..(M-1)/2).each{ |k| s = ss[k] - ss[M-k] ans += [ss[k], ss[M-k]].min ans += [s.abs/2, (s < 0 ? ds[k] : ds[M-k])].max ans += ds[k] + ds[M-k] #p [k,M-k,ans] } p ans
Submission Info
Submission Time | |
---|---|
Task | D - Pair Cards |
User | Corvvs |
Language | Ruby (2.3.3) |
Score | 0 |
Code Size | 452 Byte |
Status | RE |
Exec Time | 176 ms |
Memory | 19600 KB |
Judge Result
Set Name | sample | all | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 700 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
sample | sample-01.txt, sample-02.txt |
all | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-20.txt, 01-21.txt, 01-22.txt, 01-23.txt, 01-24.txt, 01-25.txt, 01-26.txt, 01-27.txt, 01-28.txt, 01-29.txt, 01-30.txt, sample-01.txt, sample-02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | RE | 8 ms | 2044 KB |
01-02.txt | RE | 95 ms | 13072 KB |
01-03.txt | RE | 93 ms | 13068 KB |
01-04.txt | RE | 93 ms | 13068 KB |
01-05.txt | RE | 94 ms | 13072 KB |
01-06.txt | RE | 93 ms | 13076 KB |
01-07.txt | RE | 93 ms | 13076 KB |
01-08.txt | RE | 95 ms | 13080 KB |
01-09.txt | RE | 93 ms | 13076 KB |
01-10.txt | RE | 94 ms | 13716 KB |
01-11.txt | WA | 143 ms | 17168 KB |
01-12.txt | AC | 60 ms | 8980 KB |
01-13.txt | RE | 60 ms | 9624 KB |
01-14.txt | RE | 115 ms | 15504 KB |
01-15.txt | RE | 116 ms | 15512 KB |
01-16.txt | RE | 114 ms | 15504 KB |
01-17.txt | RE | 112 ms | 15504 KB |
01-18.txt | RE | 113 ms | 15508 KB |
01-19.txt | RE | 113 ms | 15640 KB |
01-20.txt | AC | 176 ms | 19600 KB |
01-21.txt | RE | 64 ms | 9232 KB |
01-22.txt | RE | 64 ms | 9232 KB |
01-23.txt | RE | 65 ms | 9232 KB |
01-24.txt | RE | 63 ms | 9232 KB |
01-25.txt | RE | 64 ms | 9612 KB |
01-26.txt | WA | 112 ms | 13328 KB |
01-27.txt | AC | 107 ms | 11916 KB |
01-28.txt | WA | 57 ms | 3972 KB |
01-29.txt | WA | 28 ms | 2564 KB |
01-30.txt | AC | 54 ms | 3456 KB |
sample-01.txt | AC | 8 ms | 2044 KB |
sample-02.txt | AC | 8 ms | 2044 KB |