답안 #598539

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
598539 2022-07-18T13:26:59 Z Valaki2 Amusement Park (CEOI19_amusementpark) C++14
0 / 100
1 ms 320 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long

const ll mod = 998244353;

void solve() {
    ll n, m;
    cin >> n >> m;
    if(n == 1) {
        cout << "0\n";
        return;
    }
    ll ans = 1;
    for(ll i = 3; i <= n; i++) {
        ans = (ans * i) % mod;
    }
    ans = (ans * m) % mod;
    cout << ans << "\n";
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 320 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 320 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 320 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 320 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 320 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -