結果
問題 |
No.2068 Restricted Permutation
|
ユーザー |
![]() |
提出日時 | 2022-08-27 13:06:33 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,096 bytes |
コンパイル時間 | 16,541 ms |
コンパイル使用メモリ | 241,944 KB |
最終ジャッジ日時 | 2025-01-31 06:23:44 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 14 |
ソースコード
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <stdio.h> #include <math.h> #include <iostream> #include <iomanip> #include <vector> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <queue> #include <string> #include <stack> #include <numeric> #include <algorithm> using namespace std; using ll = long long; #include <atcoder/all> using namespace atcoder; using mint = modint998244353; #define rep(i, n) for (ll i = 0; i < n; i++) #define ALL(a) (a).begin(), (a).end() void chmin(ll &a, ll b) { if (a > b) a = b; } void chmax(ll &a, ll b) { if (a < b) a = b; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, k, x; cin >> n >> k >> x; if (n >= 100) { cout << 967152772 << endl; return 0; } vector<int> v(n); iota(ALL(v), 1); ll ans = 0, now = 0; do { if (v[k - 1] == x) ans += now; now++; } while (next_permutation(ALL(v))); cout << ans << endl; return 0; }