Submission #143991

# Submission time Handle Problem Language Result Execution time Memory
143991 2019-08-15T14:50:51 Z 44442 Uzastopni (COCI17_uzastopni) C++11
72 / 80
3 ms 376 KB
#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

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 time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 308 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 3 ms 376 KB Output is correct
10 Incorrect 3 ms 368 KB Output isn't correct