結果
問題 |
No.415 ぴょん
|
ユーザー |
![]() |
提出日時 | 2023-10-24 18:36:54 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 299 bytes |
コンパイル時間 | 2,743 ms |
コンパイル使用メモリ | 243,696 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-24 11:43:31 |
合計ジャッジ時間 | 3,678 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; ll gcd(ll a,ll b){ if(b) return gcd(b,a%b); return a; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); ll n,d; cin>>n>>d; ll g = gcd(n,d); ll need = n / g; cout<<need-1<<endl; }