結果
問題 | No.1936 Rational Approximation |
ユーザー |
![]() |
提出日時 | 2022-05-13 21:37:07 |
言語 | C++23(draft) (gcc 11.2.0 + boost 1.78.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 575 bytes |
コンパイル時間 | 3,381 ms |
使用メモリ | 6,280 KB |
最終ジャッジ日時 | 2023-02-21 13:30:53 |
合計ジャッジ時間 | 3,930 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,172 KB |
testcase_01 | AC | 1 ms
6,188 KB |
testcase_02 | AC | 1 ms
6,196 KB |
testcase_03 | AC | 2 ms
6,256 KB |
testcase_04 | AC | 1 ms
6,252 KB |
testcase_05 | AC | 2 ms
6,204 KB |
testcase_06 | AC | 1 ms
6,208 KB |
testcase_07 | AC | 2 ms
6,264 KB |
testcase_08 | AC | 2 ms
6,276 KB |
testcase_09 | AC | 2 ms
6,280 KB |
testcase_10 | AC | 1 ms
6,260 KB |
testcase_11 | AC | 2 ms
6,276 KB |
testcase_12 | AC | 1 ms
6,172 KB |
testcase_13 | AC | 1 ms
6,196 KB |
testcase_14 | AC | 1 ms
6,280 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; int gcdExtended(int a, int b, int *x, int *y) { // Base Case if (a == 0) { *x = 0; *y = 1; return b; } int x1, y1; // To store results of recursive call int gcd = gcdExtended(b % a, a, &x1, &y1); // Update x and y using results of // recursive call *x = y1 - (b / a) * x1; *y = x1; return gcd; } int main() { int a, b, x, y; scanf("%d%d", &a, &b); printf("%d\n", a+b); //gcdExtended(a, b, &x, &y); //cout << abs(y) << abs(x) << endl; }