Submission #483672

#TimeUsernameProblemLanguageResultExecution timeMemory
483672CaroLindaHop (COCI21_hop)C++14
110 / 110
39 ms1308 KiB
#include <bits/stdc++.h>
 
#define mkt make_tuple
#define all(x) x.begin(),x.end()
#define sz(x) (int)(x.size())
#define ll long long
#define lp(i,a,b) for(int i = a ; i < b ; i++ )
#define pii pair<int,int>
#define mk make_pair
#define pb push_back
 
const int MAX= 1010 ;
const int MAX_PRIMES = 664589 ;
 
using namespace std ;
 
int N ;
ll X[MAX];
 
int getIndex(ll a , ll b )
{
	int ak = 63-__builtin_clzll(a) ;
	int bk = 63 - __builtin_clzll(b) ;
	
	if((ak/4) == (bk/4)) return 1 ;
	if( (ak/16) == (bk/16) ) return 2 ;
	return 3 ;
}
 
int main()
{
 
	scanf("%d", &N  );
	for(int i = 1 ; i <= N ; i++ ) scanf("%lld", &X[i] ) ;
 
	for(int i = 2 ; i <= N ; i++,printf("\n") )
		for(int j = 1 ; j < i ; j++ ) printf("%d " , getIndex(X[j],X[i]) ) ;
		
 
}

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:33:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   33 |  scanf("%d", &N  );
      |  ~~~~~^~~~~~~~~~~~
Main.cpp:34:38: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   34 |  for(int i = 1 ; i <= N ; i++ ) scanf("%lld", &X[i] ) ;
      |                                 ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...