# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1268868 | discontinuous | Kangaroo (CEOI16_kangaroo) | C++20 | 9 ms | 12100 KiB |
// Author: Anikait Prasar
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
void setIO(string name = "") {
ios_base::sync_with_stdio(0);
cin.tie(0);
if (!name.empty()) {
freopen((name + ".in").c_str(), "r", stdin);
freopen((name + ".out").c_str(), "w", stdout);
}
}
const ll MOD = 1e9 + 7;
const ll INF = 1e15;
const ll N = 1e6;
ll n, m, k, a, b, c, d, h, l, r, q, x, y;
ll modPow(ll x, ll n) {
ll res = 1;
while(n >= 1) {
if(n & 1) {
res = (res * x) % MOD;
n--;
}
else {
x = (x * x) % MOD;
n /= 2;
}
}
return res;
}
ll modInv(ll num) { return modPow(num, MOD - 2); }
int lastSetBit(ll num) {
if(num==0) {
return -1;
}
for(int j = 0; j<60; j++) {
if((1LL << j) & num) {
return j;
}
}
return 0; // to avoid warning
}
int firstSetBit(ll num) {
if(num==0) {
return -1;
}
for(int j = 60; j>=0; j--) {
if((1LL << j) & num) {
return j;
}
}
return 0; // to avoid warning
}
vector<int> arr(N);
vector<int> brr(N);
vector<int> adj[N+1];
vector<int> visited(N);
void dfs(int node) {
visited[node] = true;
for(auto j : adj[node]) {
if(!visited[j]) dfs(j);
}
}
void solve() {
cin >> n >> l >> r;
ll ans = 1;
for(int j = n-2; j>=1; j--) {
ans = (ans*j)%MOD;
}
cout << ans;
}
/**
----------------------------------------------------
Problem Notes :-
----------------------------------------------------
**/
int main() {
ios::sync_with_stdio(false);
cout.tie(0); cin.tie(0);
int tc = 1;
// cin >> tc;
while(tc--) {
solve();
// cout << "\n";
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |