제출 #714117

#제출 시각아이디문제언어결과실행 시간메모리
714117DepressedMGUzastopni (COCI17_uzastopni)C++17
56 / 80
40 ms65536 KiB
#include<bits/stdc++.h>
#define ull unsigned long long
using namespace std;
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ull n,m,a,b,i,j;
	cin>>n;
	vector<ull> v(n/2+3);
	v[0]=0;
	for(i=1;i<v.size();i++){
		v[i]=v[i-1]+i;
	}
	j=v.size()-2;
	for(i=v.size();i>0 && j>0;){
		if(v[i]-v[j]<n){
			j--;
		}
		else{
			if(v[i]-v[j]>n){
				i--;
			}
			else{
				cout<<j+1<<" "<<i<<endl;
				j--;i--;
			}
		}
	}
	if(v[i]-v[j]<n){
			j--;
		}
		else{
			if(v[i]-v[j]>n){
				i--;
			}
			else{
				cout<<j+1<<" "<<i<<endl;
				j--;i--;
			}
		}
}

컴파일 시 표준 에러 (stderr) 메시지

uzastopni.cpp: In function 'int main()':
uzastopni.cpp:7:8: warning: unused variable 'm' [-Wunused-variable]
    7 |  ull n,m,a,b,i,j;
      |        ^
uzastopni.cpp:7:10: warning: unused variable 'a' [-Wunused-variable]
    7 |  ull n,m,a,b,i,j;
      |          ^
uzastopni.cpp:7:12: warning: unused variable 'b' [-Wunused-variable]
    7 |  ull n,m,a,b,i,j;
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...