結果
問題 | No.1835 Generalized Monty Hall Problem |
ユーザー |
|
提出日時 | 2022-07-16 16:46:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 393 bytes |
コンパイル時間 | 1,963 ms |
コンパイル使用メモリ | 194,056 KB |
最終ジャッジ日時 | 2025-01-30 09:35:48 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector<ll>; using vvll = vector<vll>; #define all(A) A.begin(),A.end() #define rep(i, n) for (ll i = 0; i < (ll) (n); i++) int main() { cin.tie(nullptr); ios::sync_with_stdio(false); ll N,M,K; cin>>N>>M>>K; ll P=M*(N-1); ll Q=N*(N-K-1); ll G=gcd(P,Q); cout<<P/G<<" "<<Q/G<<endl; }