Submission #155929
Source Code Expand
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { private static int MODER = 10007; public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { String str = br.readLine(); int num = Integer.parseInt(str); int mod = calc_a_n(num) % MODER; System.out.println(mod); } catch (Exception e) { } } private static int calc_a_n(int n) { if (n == 1 || n == 2) { return 0; } else if (n == 3) { return 1; } return calc_a_n(n - 1) + calc_a_n(n - 2) + calc_a_n(n - 3); } }
Submission Info
Submission Time | |
---|---|
Task | B - トリボナッチ数列 |
User | jkojm23 |
Language | Java (OpenJDK 1.7.0) |
Score | 0 |
Code Size | 635 Byte |
Status | TLE |
Exec Time | 2041 ms |
Memory | 48656 KB |
Judge Result
Set Name | All | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 100 | ||||
Status |
|
Set Name | Test Cases |
---|---|
All | test_1.txt, test_1000000.txt, test_1002.txt, test_104.txt, test_107843.txt, test_10980.txt, test_1212.txt, test_1238.txt, test_13194.txt, test_14.txt, test_16.txt, test_2.txt, test_210782.txt, test_21694.txt, test_243.txt, test_24916.txt, test_278.txt, test_3.txt, test_31.txt, test_32.txt, test_42.txt, test_5555.txt, test_567914.txt, test_61868.txt, test_765671.txt, test_8195.txt, test_8353.txt, test_9.txt, test_9625.txt, test_97.txt, test_998.txt, test_999998.txt, test_999999.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 362 ms | 20400 KB |
sample_02.txt | AC | 357 ms | 20392 KB |
sample_03.txt | TLE | 2037 ms | 27264 KB |
test_1.txt | AC | 361 ms | 20400 KB |
test_1000000.txt | TLE | 2039 ms | 48384 KB |
test_1002.txt | TLE | 2035 ms | 21568 KB |
test_104.txt | TLE | 2036 ms | 21636 KB |
test_107843.txt | TLE | 2037 ms | 27392 KB |
test_10980.txt | TLE | 2037 ms | 22396 KB |
test_1212.txt | TLE | 2036 ms | 21640 KB |
test_1238.txt | TLE | 2034 ms | 21640 KB |
test_13194.txt | TLE | 2037 ms | 22664 KB |
test_14.txt | AC | 362 ms | 20404 KB |
test_16.txt | AC | 361 ms | 20408 KB |
test_2.txt | AC | 373 ms | 20520 KB |
test_210782.txt | TLE | 2036 ms | 29828 KB |
test_21694.txt | TLE | 2037 ms | 23408 KB |
test_243.txt | TLE | 2035 ms | 21584 KB |
test_24916.txt | TLE | 2037 ms | 23688 KB |
test_278.txt | TLE | 2036 ms | 21512 KB |
test_3.txt | AC | 357 ms | 20388 KB |
test_31.txt | AC | 588 ms | 21160 KB |
test_32.txt | AC | 776 ms | 21292 KB |
test_42.txt | TLE | 2036 ms | 21632 KB |
test_5555.txt | TLE | 2036 ms | 21948 KB |
test_567914.txt | TLE | 2038 ms | 38280 KB |
test_61868.txt | TLE | 2038 ms | 26368 KB |
test_765671.txt | TLE | 2038 ms | 42940 KB |
test_8195.txt | TLE | 2037 ms | 22272 KB |
test_8353.txt | TLE | 2036 ms | 22272 KB |
test_9.txt | AC | 360 ms | 20392 KB |
test_9625.txt | TLE | 2037 ms | 22396 KB |
test_97.txt | TLE | 2040 ms | 21504 KB |
test_998.txt | TLE | 2037 ms | 21640 KB |
test_999998.txt | TLE | 2039 ms | 48384 KB |
test_999999.txt | TLE | 2041 ms | 48656 KB |