結果

問題 No.1835 Generalized Monty Hall Problem
ユーザー akasinn
提出日時 2022-02-11 21:33:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 298 bytes
コンパイル時間 1,467 ms
コンパイル使用メモリ 167,768 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-06-27 17:17:46
合計ジャッジ時間 3,981 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other WA * 2 TLE * 1 -- * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#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<<' '<<q<<endl;
  return 0;
}
0