Submission #143991

#TimeUsernameProblemLanguageResultExecution timeMemory
14399144442Uzastopni (COCI17_uzastopni)C++11
72 / 80
3 ms376 KiB
#include <bits/stdc++.h>
using namespace std;
long long n,p,q,b;
int main (){
ios::sync_with_stdio(0);
     scanf("%d",&n);
     for(int i=2;i<sqrt(2*n)+1;i++){
     	 if(!((2*n)%i)){
     	 	 b=(2*n)/i+i;
     	 	 if(b%2){
     	 	     q=(b-1)/2;
     	 	     p=q+1-i;
     	 	     printf("%d %d\n",p,q);
	         }
	     }
	 }
     
return 0;
}

Compilation message (stderr)

uzastopni.cpp: In function 'int main()':
uzastopni.cpp:6:19: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
      scanf("%d",&n);
                 ~~^
uzastopni.cpp:13:34: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
              printf("%d %d\n",p,q);
                                  ^
uzastopni.cpp:13:34: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=]
uzastopni.cpp:6:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
      scanf("%d",&n);
      ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...