結果
問題 | No.1794 Continued Fraction |
ユーザー |
![]() |
提出日時 | 2022-04-15 16:50:30 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 267 bytes |
コンパイル時間 | 174 ms |
コンパイル使用メモリ | 28,928 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 21:13:58 |
合計ジャッジ時間 | 1,883 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
#include<stdio.h>int ans[66], l;void f(int n, int m){if(m==0)return;ans[l] = n / m;l++;n %= m;f(m, n);return;}int main(){int n, m;scanf("%d %d", &n, &m);l = 0;f(n, m);int i;for (i = 0; i < l; i++)printf("%d ", ans[i]);return 0;}