답안 #374279

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
374279 2021-03-07T06:40:44 Z Araragi Euklid (COCI20_euklid) C++17
0 / 110
11 ms 364 KB
/*
* 	author: Araragi
*/

// 3

#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define F first
#define S second
//using namespace __gnu_pbds;
//typedef tree <int, null_type, less_equal <int> , rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

ll R(ll a, ll b)
{
	if (a < b)
		return R(b, a);
	else if (a >= b && b > 1)
		return R(ll(a / b), b);
	else if (a >= b && b == 1)
		return a;	
}

int main()
{
	//ifstream cin("vacation.in");
	//ofstream cout("vacation.out");
	
	int tt;
	cin >> tt;

	while (tt--)
	{
		ll x, y;
		cin >> x >> y;

		bool fnd = 0;

		for (ll i = 1; i <= ll(1e2); i++)
		{
			if (fnd)
				break;
			for (ll j = 1; j <= ll(1e2); j++)
				if (__gcd(i, j) == x && R(i, j) == y)
				{
					cout << i << " " << j << '\n';
					fnd = 1;
					break;
				}
		}
	}
}

Compilation message

euklid.cpp: In function 'll R(ll, ll)':
euklid.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type]
   27 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 364 KB Output is correct
2 Incorrect 11 ms 364 KB Unexpected end of file - int64 expected
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 364 KB Output is correct
2 Incorrect 11 ms 364 KB Unexpected end of file - int64 expected
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 364 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 364 KB Output is correct
2 Incorrect 11 ms 364 KB Unexpected end of file - int64 expected
3 Halted 0 ms 0 KB -