結果
問題 |
No.415 ぴょん
|
ユーザー |
![]() |
提出日時 | 2016-12-09 13:40:10 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 260 bytes |
コンパイル時間 | 106 ms |
コンパイル使用メモリ | 20,352 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-18 14:51:46 |
合計ジャッジ時間 | 942 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
コンパイルメッセージ
main.c: In function ‘run’: main.c:15:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | scanf("%d%d",&n,&d); | ^~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> int gcd(int a,int b){ int r=a%b; while(r>0){ a=b; b=r; r=a%b; } return b; } void run(void){ int n,d; scanf("%d%d",&n,&d); int g=gcd(n,d); printf("%d\n",n/g-1); return; } int main(void){ run(); return 0; }