Task: | 3-Coloring |
Sender: | Nallue |
Submission time: | 2024-11-27 16:49:18 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.00 s | details |
#2 | WRONG ANSWER | 0.00 s | details |
#3 | WRONG ANSWER | 0.00 s | details |
#4 | WRONG ANSWER | 0.00 s | details |
#5 | WRONG ANSWER | 0.00 s | details |
#6 | WRONG ANSWER | 0.00 s | details |
#7 | WRONG ANSWER | 0.00 s | details |
#8 | WRONG ANSWER | 0.00 s | details |
#9 | WRONG ANSWER | 0.00 s | details |
#10 | WRONG ANSWER | 0.00 s | details |
#11 | WRONG ANSWER | 0.00 s | details |
#12 | WRONG ANSWER | 0.01 s | details |
#13 | WRONG ANSWER | 0.02 s | details |
Compiler report
input/code.cpp: In function 'int comb_rec_prog(int)': input/code.cpp:13:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 13 | for(int i=0; i<sol.size(); i++){ | ~^~~~~~~~~~~
Code
#include <iostream> #include <vector> using namespace std; long int m=1000000007; int comb_rec_prog(int n){ vector<long int> sol(n+1,-1); sol[0] = 1; for(int i=0; i<sol.size(); i++){ if(sol[i]==-1){ sol[i]=0; for(int d=1; d<=6; d++){ if((i-d) >= 0){ sol[i] = (sol[i]+sol[i-d]) % m; } } } } return sol[n]; } int main(){ int n; cin >> n; cout << comb_rec_prog(n) <<endl; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
2 2 1 |
correct output |
---|
1 2 |
user output |
---|
2 |
Test 2
Verdict: WRONG ANSWER
input |
---|
3 2 1 1 |
correct output |
---|
1 2 2 |
user output |
---|
4 |
Test 3
Verdict: WRONG ANSWER
input |
---|
4 3 1 4 2 |
correct output |
---|
1 2 2 1 |
user output |
---|
8 |
Test 4
Verdict: WRONG ANSWER
input |
---|
5 5 5 1 5 4 |
correct output |
---|
1 1 2 1 2 |
user output |
---|
16 |
Test 5
Verdict: WRONG ANSWER
input |
---|
10 3 1 9 9 3 4 10 10 5 1 |
correct output |
---|
1 2 2 2 3 1 1 1 1 2 |
user output |
---|
492 |
Test 6
Verdict: WRONG ANSWER
input |
---|
10 9 10 4 3 9 1 1 4 2 6 |
correct output |
---|
1 1 1 2 1 3 2 1 2 2 |
user output |
---|
492 |
Test 7
Verdict: WRONG ANSWER
input |
---|
10 3 8 4 5 10 8 5 10 4 6 |
correct output |
---|
1 1 2 1 2 2 1 3 2 1 |
user output |
---|
492 |
Test 8
Verdict: WRONG ANSWER
input |
---|
10 9 1 10 3 9 4 6 9 3 5 |
correct output |
---|
1 2 1 2 1 1 2 1 2 2 |
user output |
---|
492 |
Test 9
Verdict: WRONG ANSWER
input |
---|
10 4 6 5 5 1 2 4 2 1 3 |
correct output |
---|
1 1 1 2 3 2 1 2 2 2 |
user output |
---|
492 |
Test 10
Verdict: WRONG ANSWER
input |
---|
100 19 7 2 67 47 20 73 93 43 11 49... |
correct output |
---|
1 1 2 1 1 1 3 2 1 2 1 1 2 1 1 ... |
user output |
---|
201345653 |
Test 11
Verdict: WRONG ANSWER
input |
---|
1000 155 447 741 874 264 87 534 724... |
correct output |
---|
1 1 2 1 1 1 1 1 1 1 1 2 1 2 2 ... |
user output |
---|
937196411 |
Test 12
Verdict: WRONG ANSWER
input |
---|
10000 7778 6074 2376 8595 8243 8930 ... |
correct output |
---|
1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 ... |
user output |
---|
692547185 |
Test 13
Verdict: WRONG ANSWER
input |
---|
100000 51396 92191 77318 65910 87045 ... |
correct output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
user output |
---|
797925478 |