Submission #187770
Source Code Expand
N = gets.to_i NG = Array.new(3).map!{gets.to_i} if NG.any?{|ng| N==ng} puts "NO" exit end a = Array.new(N+4,200) a[N] = a[N+1] = a[N+2] = a[N+3] = 0 (N).downto(0).each do |i| next if NG.include? i a[i] = [a[i+1]+1,a[i]].min unless NG.include?(i+1) a[i] = [a[i+2]+1,a[i]].min unless NG.include?(i+2) a[i] = [a[i+3]+1,a[i]].min unless NG.include?(i+3) end puts a[0] <= 100 ? "YES" : "NO"
Submission Info
Submission Time | |
---|---|
Task | A - 来月は何月? |
User | berlysia |
Language | Ruby (1.9.3) |
Score | 0 |
Code Size | 421 Byte |
Status | WA |
Exec Time | 56 ms |
Memory | 4304 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 0 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | test_1.txt, test_10.txt, test_11.txt, test_12.txt, test_2.txt, test_3.txt, test_4.txt, test_5.txt, test_6.txt, test_7.txt, test_8.txt, test_9.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
test_1.txt | WA | 52 ms | 4204 KB |
test_10.txt | WA | 53 ms | 4208 KB |
test_11.txt | WA | 52 ms | 4180 KB |
test_12.txt | WA | 53 ms | 4208 KB |
test_2.txt | WA | 52 ms | 4208 KB |
test_3.txt | WA | 52 ms | 4208 KB |
test_4.txt | WA | 52 ms | 4200 KB |
test_5.txt | WA | 52 ms | 4224 KB |
test_6.txt | WA | 52 ms | 4304 KB |
test_7.txt | WA | 51 ms | 4204 KB |
test_8.txt | WA | 52 ms | 4240 KB |
test_9.txt | WA | 56 ms | 4204 KB |