結果
問題 |
No.415 ぴょん
|
ユーザー |
|
提出日時 | 2018-08-28 15:02:00 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 286 bytes |
コンパイル時間 | 127 ms |
コンパイル使用メモリ | 29,008 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-08 10:35:44 |
合計ジャッジ時間 | 921 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
#include <stdio.h> long gcd(long x,long y) { long r; if(y>x){ r=x; x=y; y=r; } while(y>0){ r=x%y; x=y; y=r; } return x; } long lcm(long x,long y) { return x*y/gcd(x,y); } int main(void) { long n,d; scanf("%ld%ld",&n,&d); printf("%ld",lcm(n,d)/d-1); return 0; }