結果
| 問題 |
No.1835 Generalized Monty Hall Problem
|
| コンテスト | |
| ユーザー |
publfl2
|
| 提出日時 | 2022-02-11 21:26:30 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 291 bytes |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 30,720 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 17:01:45 |
| 合計ジャッジ時間 | 888 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 11 |
ソースコード
#include <stdio.h>
long long int gcd(long long int a, long long int b)
{
return a?gcd(b%a,a):b;
}
int main()
{
long long int a,b,c;
scanf("%lld%lld%lld",&a,&b,&c);
long long int s = b*(a-1);
long long int t = a*(a-c-1);
long long int g = gcd(s,t);
printf("%lld %lld",s/g,t/g);
}
publfl2