結果
問題 | No.415 ぴょん |
ユーザー |
![]() |
提出日時 | 2019-06-13 23:51:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 419 bytes |
コンパイル時間 | 1,760 ms |
コンパイル使用メモリ | 164,684 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-06 06:21:25 |
合計ジャッジ時間 | 2,781 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; using LL = long long; int main() { // 1. 入力情報取得. LL N, D; scanf("%llu %llu", &N, &D); // 2. 何回ぴょんできるかを計算. LL ans = 0; LL gcd = __gcd(N, D); N /= gcd, D /= gcd; if(N % D == 0) ans = N / D - 1; else ans = N - 1; // 3. 出力. printf("%llu\n", ans); return 0; }