結果
| 問題 | 
                            No.1835 Generalized Monty Hall Problem
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-02-11 21:33:01 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 299 bytes | 
| コンパイル時間 | 1,667 ms | 
| コンパイル使用メモリ | 167,828 KB | 
| 実行使用メモリ | 13,884 KB | 
| 最終ジャッジ日時 | 2024-06-27 17:17:10 | 
| 合計ジャッジ時間 | 4,054 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 4 | 
| other | WA * 2 TLE * 1 -- * 8 | 
ソースコード
#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;
}