답안 #892088

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
892088 2023-12-24T18:59:05 Z Isam Uzastopni (COCI17_uzastopni) C++17
72 / 80
1 ms 508 KB
#include<bits/stdc++.h>

#ifdef DEBUG
  #include "debug.h"
#else
  #define debug(...) void(37)
#endif

using namespace std;

constexpr int sz = 1e5 + 5;

signed main(){
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	long long N;
	cin >> N;
	N <<= 1;
	for(register int i = 1; 1ll * i * i <= N; ++i){
		if(N % i == 0){
			
			if((i + N / i + 1) % 2 == 0){
				int b = (i + N / i + 1) / 2;
				int a = b - i; --b;
				if(a > 0 && b > 0 && b > a){
					cout << a << ' ' << b << '\n';
				}
			}
			
		}
		
		
	}
	
	return 0;
}

Compilation message

uzastopni.cpp: In function 'int main()':
uzastopni.cpp:18:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   18 |  for(register int i = 1; 1ll * i * i <= N; ++i){
      |                   ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 508 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Incorrect 1 ms 348 KB Output isn't correct