| Task: | Jubilee |
| Sender: | TLE |
| Submission time: | 2025-11-08 16:06:52 +0200 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | RUNTIME ERROR |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | details |
| #2 | RUNTIME ERROR | 0.42 s | details |
| #3 | RUNTIME ERROR | 0.43 s | details |
| #4 | ACCEPTED | 0.00 s | details |
| #5 | WRONG ANSWER | 0.00 s | details |
| #6 | WRONG ANSWER | 0.00 s | details |
| #7 | ACCEPTED | 0.00 s | details |
| #8 | ACCEPTED | 0.00 s | details |
| #9 | RUNTIME ERROR | 0.42 s | details |
| #10 | ACCEPTED | 0.00 s | details |
| #11 | WRONG ANSWER | 0.00 s | details |
| #12 | RUNTIME ERROR | 0.42 s | details |
| #13 | WRONG ANSWER | 0.00 s | details |
| #14 | WRONG ANSWER | 0.00 s | details |
Code
#include <bits/stdc++.h>
#define fi first
#define se second
#define For(type, i, a, b) for (type i = (a); i <= (b); ++i)
#define endl '\n'
using namespace std;
typedef long long ll;
ll n, m, k;
ll res;
const ll mod = 1e9 + 7;
ll pow(ll a, ll n)
{
a %= mod;
if(n == 1) return a % mod;
ll tmp = pow(a % mod, n / 2);
return (n & 1) ? tmp % mod * tmp % mod * a % mod : tmp % mod * tmp % mod;
}
void FastIn(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
}
void ReadIn(){
cin >> n >> m;
// k = pow(m - 2, 2) % mod;
res = ((m % mod * (m - 1) % mod) % mod * pow((m - 1) % mod, n - 1) % mod) % mod + ((m % mod * (m - 1) % mod) % mod * pow(((m - 2) % mod * (m - 2) % mod) % mod, n - 1) % mod) % mod;
res = res % mod;
// res = m * pow(m - 1, n) + m * (m - 1) * pow(k, n - 1);
cout << res;
}
int main(){
FastIn();
ReadIn();
}
// g++ -o output
// g++ F.cpp
// ./f.outTest details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 3 2 |
| correct output |
|---|
| 2 |
| user output |
|---|
| 2 |
Test 2
Verdict: RUNTIME ERROR
| input |
|---|
| 1 1 |
| correct output |
|---|
| 0 |
| user output |
|---|
| (empty) |
Test 3
Verdict: RUNTIME ERROR
| input |
|---|
| 1 1000000000 |
| correct output |
|---|
| 56 |
| user output |
|---|
| (empty) |
Test 4
Verdict: ACCEPTED
| input |
|---|
| 2 1000000000 |
| correct output |
|---|
| 4088 |
| user output |
|---|
| 4088 |
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 3 1000000000 |
| correct output |
|---|
| 298424 |
| user output |
|---|
| 371000 |
Feedback: Incorrect character on line 1 col 1: expected "298424", got "371000"
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 1000000 1000000000 |
| correct output |
|---|
| 859388820 |
| user output |
|---|
| 416775251 |
Feedback: Incorrect character on line 1 col 1: expected "859388820", got "416775251"
Test 7
Verdict: ACCEPTED
| input |
|---|
| 2 1 |
| correct output |
|---|
| 0 |
| user output |
|---|
| 0 |
Test 8
Verdict: ACCEPTED
| input |
|---|
| 1000000 1 |
| correct output |
|---|
| 0 |
| user output |
|---|
| 0 |
Test 9
Verdict: RUNTIME ERROR
| input |
|---|
| 1 2 |
| correct output |
|---|
| 2 |
| user output |
|---|
| (empty) |
Test 10
Verdict: ACCEPTED
| input |
|---|
| 1000000 2 |
| correct output |
|---|
| 2 |
| user output |
|---|
| 2 |
Test 11
Verdict: WRONG ANSWER
| input |
|---|
| 1000000 3 |
| correct output |
|---|
| 129870828 |
| user output |
|---|
| 705126183 |
Feedback: Incorrect character on line 1 col 1: expected "129870828", got "705126183"
Test 12
Verdict: RUNTIME ERROR
| input |
|---|
| 1 3 |
| correct output |
|---|
| 6 |
| user output |
|---|
| (empty) |
Test 13
Verdict: WRONG ANSWER
| input |
|---|
| 21355 1239478 |
| correct output |
|---|
| 74219157 |
| user output |
|---|
| 110934677 |
Feedback: Incorrect character on line 1 col 1: expected "74219157", got "110934677"
Test 14
Verdict: WRONG ANSWER
| input |
|---|
| 531578 913517291 |
| correct output |
|---|
| 105420893 |
| user output |
|---|
| 339710142 |
Feedback: Incorrect character on line 1 col 1: expected "105420893", got "339710142"
