結果
| 問題 | No.1835 Generalized Monty Hall Problem |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-11 21:33:01 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 299 bytes |
| 記録 | |
| コンパイル時間 | 1,148 ms |
| コンパイル使用メモリ | 179,164 KB |
| 実行使用メモリ | 12,800 KB |
| 最終ジャッジ日時 | 2026-03-15 18:47:39 |
| 合計ジャッジ時間 | 13,550 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | WA * 5 TLE * 6 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;
const int mod=2147483647;//pow(2,31)-1
int main(){
int n,m,k;
cin>>n>>m>>k;
ll p=m*(n-1),q=n*(n-k-1);
for(int i=2;i<=p;i++){
if(p%i==0 && q%i==0){
p/=i;
q/=i;
}
}
cout<<p<<endl<<q<<endl;
return 0;
}