Submission #608251

# Submission time Handle Problem Language Result Execution time Memory
608251 2022-07-27T06:27:49 Z starchan Uzastopni (COCI17_uzastopni) C++17
80 / 80
2 ms 324 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define in pair<int, int>
#define f first
#define s second
#define pb push_back
#define pob pop_back
#define INF (int)1e17
#define MX (int)3e5+5
#define fast() ios_base::sync_with_stdio(false); cin.tie(NULL)
signed main()
{
	fast();
	int n;
	cin >> n;
	for(int u = 2; u*u < 2*n; u++)
	{
		if((2*n)%u)
			continue;
		int v = (2*n)/u;
		u--;
		if(u%2 == v%2)
			cout << (v-u)/2 << " " << (v+u)/2 << "\n";		
		u++;
	}
	return 0;
}	
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 324 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 320 KB Output is correct
10 Correct 2 ms 212 KB Output is correct