QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#821804 | #9067. Rampant Growth | Teapot# | AC ✓ | 0ms | 3708kb | C++14 | 1.3kb | 2024-12-19 18:15:35 | 2024-12-19 18:15:35 |
Judging History
answer
/** gnu specific **/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
/** contains everything I need in std **/
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(S) ((int)S.size())
#define FOR(i, st_, n) for(int i = st_; i < n; ++i)
#define RFOR(i, n, end_) for(int i = (n)-1; i >= end_; --i)
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ull, ull> pull;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
using namespace std;
#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif
int32_t main()
{
ios::sync_with_stdio(0);
cin.tie(0);
ll m,n;
ll mod = 998244353;
cin >> n >> m;
if(n == 1 && m > 1)
cout << 0;
else
{
ll res = n;
FOR(i,1,m)
{
res*= n-1;
res%= mod;
}
cout << res;
}
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3552kb
input:
50 50
output:
347776301
result:
ok single line: '347776301'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
3 2
output:
6
result:
ok single line: '6'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
1 5
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
42 25
output:
722210361
result:
ok single line: '722210361'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
1 1
output:
1
result:
ok single line: '1'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
1 50
output:
0
result:
ok single line: '0'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3688kb
input:
50 1
output:
50
result:
ok single line: '50'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
2 50
output:
2
result:
ok single line: '2'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
12 41
output:
508608552
result:
ok single line: '508608552'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3704kb
input:
48 21
output:
873199164
result:
ok single line: '873199164'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
36 13
output:
339677219
result:
ok single line: '339677219'