| Task: | Dice Combinations |
| Sender: | datxaban |
| Submission time: | 2025-09-12 14:05:09 +0300 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | details |
| #2 | ACCEPTED | 0.00 s | details |
| #3 | ACCEPTED | 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 | TIME LIMIT EXCEEDED | -- | details |
| #14 | TIME LIMIT EXCEEDED | -- | details |
| #15 | TIME LIMIT EXCEEDED | -- | details |
| #16 | TIME LIMIT EXCEEDED | -- | details |
| #17 | TIME LIMIT EXCEEDED | -- | details |
| #18 | WRONG ANSWER | 0.01 s | details |
| #19 | TIME LIMIT EXCEEDED | -- | details |
| #20 | WRONG ANSWER | 0.00 s | details |
Compiler report
input/code.cpp:65:22: warning: overflow in conversion from 'double' to 'int' changes value from '1.0000000007e+10' to '2147483647' [-Woverflow]
65 | const int MOD = 10e9 + 7;
| ~~~~~^~~Code
/*
Road to Freedom
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define F first
#define S second
#define pb push_back
#define si set<int>
#define vi vector<int>
#define pii pair<int, int>
#define vpi vector<pii>
#define vpp vector<pair<int, pii>>
#define mii map<int, int>
#define mpi map<pii, int>
#define spi set<pii>
#define endl "\n"
#define sz(x) ((int)x.size())
#define all(p) p.begin(), p.end()
#define double long double
#define que_max priority_queue<int>
#define que_min priority_queue<int, vi, greater<int>>
#define bug(...) __f(#__VA_ARGS__, __VA_ARGS__)
#define print(a) \
for (auto x : a) \
cout << x << " "; \
cout << endl
#define print1(a) \
for (auto x : a) \
cout << x.F << " " << x.S << endl
#define print2(a, x, y) \
for (int i = x; i < y; i++) \
cout << a[i] << " "; \
cout << endl
#define REP(i, a, b) for (int i = a; i <= b; i++)
inline int power(int a, int b)
{
int x = 1;
while (b)
{
if (b & 1)
x *= a;
a *= a;
b >>= 1;
}
return x;
}
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) { cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args)
{
const char *comma = strchr(names + 1, ',');
cout.write(names, comma - names) << " : " << arg1 << " | ";
__f(comma + 1, args...);
}
const int N = 200005;
const int MOD = 10e9 + 7;
void solve()
{
int n;
cin >> n;
int dp[n + 10];
memset(dp, 0, sizeof(dp));
// dp[0] = 1;
dp[1] = 1;
dp[2] = 2;
if (n <= 2)
{
cout << dp[n];
return;
}
for (int i = 3; i <= n; i++)
{
for (int j = 0; j < i; j++)
{
dp[i] += dp[j];
dp[i] %= MOD;
}
}
cout << dp[n] + 1;
return;
}
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
clock_t z = clock();
int t = 1;
// cin >> t;
while (t--)
solve();
cerr << "Run Time : " << ((double)(clock() - z) / CLOCKS_PER_SEC);
return 0;
}Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 1 |
| correct output |
|---|
| 1 |
| user output |
|---|
| 1 |
Error:
Run Time : 3.5e-05
Test 2
Verdict: ACCEPTED
| input |
|---|
| 2 |
| correct output |
|---|
| 2 |
| user output |
|---|
| 2 |
Error:
Run Time : 3.6e-05
Test 3
Verdict: ACCEPTED
| input |
|---|
| 3 |
| correct output |
|---|
| 4 |
| user output |
|---|
| 4 |
Error:
Run Time : 3.6e-05
Test 4
Verdict: WRONG ANSWER
| input |
|---|
| 4 |
| correct output |
|---|
| 8 |
| user output |
|---|
| 7 |
Error:
Run Time : 3.7e-05
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 5 |
| correct output |
|---|
| 16 |
| user output |
|---|
| 13 |
Error:
Run Time : 3.5e-05
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 6 |
| correct output |
|---|
| 32 |
| user output |
|---|
| 25 |
Error:
Run Time : 3.6e-05
Test 7
Verdict: WRONG ANSWER
| input |
|---|
| 7 |
| correct output |
|---|
| 63 |
| user output |
|---|
| 49 |
Error:
Run Time : 3.6e-05
Test 8
Verdict: WRONG ANSWER
| input |
|---|
| 8 |
| correct output |
|---|
| 125 |
| user output |
|---|
| 97 |
Error:
Run Time : 3.7e-05
Test 9
Verdict: WRONG ANSWER
| input |
|---|
| 9 |
| correct output |
|---|
| 248 |
| user output |
|---|
| 193 |
Error:
Run Time : 3.6e-05
Test 10
Verdict: WRONG ANSWER
| input |
|---|
| 10 |
| correct output |
|---|
| 492 |
| user output |
|---|
| 385 |
Error:
Run Time : 3.8e-05
Test 11
Verdict: WRONG ANSWER
| input |
|---|
| 50 |
| correct output |
|---|
| 660641036 |
| user output |
|---|
| -65535 |
Error:
Run Time : 4.1e-05
Test 12
Verdict: WRONG ANSWER
| input |
|---|
| 1000 |
| correct output |
|---|
| 937196411 |
| user output |
|---|
| -31 |
Error:
Run Time : 0.001973
Test 13
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 123456 |
| correct output |
|---|
| 113810539 |
| user output |
|---|
| (empty) |
Test 14
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 654321 |
| correct output |
|---|
| 615247550 |
| user output |
|---|
| (empty) |
Test 15
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 999998 |
| correct output |
|---|
| 39372206 |
| user output |
|---|
| (empty) |
Test 16
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 999999 |
| correct output |
|---|
| 511319454 |
| user output |
|---|
| (empty) |
Test 17
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 1000000 |
| correct output |
|---|
| 874273980 |
| user output |
|---|
| (empty) |
Test 18
Verdict: WRONG ANSWER
| input |
|---|
| 1001 |
| correct output |
|---|
| 94201505 |
| user output |
|---|
| -63 |
Error:
Run Time : 0.001974
Test 19
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 999997 |
| correct output |
|---|
| 74225807 |
| user output |
|---|
| (empty) |
Test 20
Verdict: WRONG ANSWER
| input |
|---|
| 40 |
| correct output |
|---|
| 567401756 |
| user output |
|---|
| -63 |
Error:
Run Time : 4e-05
