結果

問題 No.1835 Generalized Monty Hall Problem
ユーザー akasinnakasinn
提出日時 2022-02-11 21:33:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 299 bytes
コンパイル時間 1,507 ms
コンパイル使用メモリ 164,280 KB
実行使用メモリ 168,660 KB
最終ジャッジ日時 2023-09-10 01:05:05
合計ジャッジ時間 4,248 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

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