Submission #200000

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2000002020-02-04 17:23:17MercenaryScales (IOI15_scales)C++14
100 / 100
75 ms640 KiB
#include<bits/stdc++.h>
using namespace std;
#include"scales.h"
#define mp make_pair
#define pb push_back
const int maxn = 2e6;
vector<vector<int>> perm;
vector<int> lim ={243,81,27,9,3,1};
vector<int> p;
int a[maxn] , b[maxn][3];
int root , nTime = 0;
vector<pair<int,vector<int>>> query;
vector<vector<int>> GetLig(vector<int> & p , vector<int> &a){
vector<vector<int>> res(3);
vector<int> tmp(3);iota(tmp.begin(),tmp.end(),0);
for(auto & c : p){
sort(tmp.begin(),tmp.end(),[&](const int x , const int y){
return perm[c][a[x]] < perm[c][a[y]];
});
res[tmp[0]].pb(c);
}
return res;
}
vector<vector<int>> GetHea(vector<int> & p , vector<int> &a){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

scales.cpp: In function 'std::vector<std::vector<int> > GetLig(std::vector<int>&, std::vector<int>&)':
scales.cpp:18:60: warning: declaration of 'a' shadows a global declaration [-Wshadow]
 vector<vector<int>> GetLig(vector<int> & p , vector<int> &a){
                                                            ^
scales.cpp:13:5: note: shadowed declaration is here
 int a[maxn] , b[maxn][3];
     ^
scales.cpp:18:60: warning: declaration of 'p' shadows a global declaration [-Wshadow]
 vector<vector<int>> GetLig(vector<int> & p , vector<int> &a){
                                                            ^
scales.cpp:11:13: note: shadowed declaration is here
 vector<int> p;
             ^
scales.cpp: In function 'std::vector<std::vector<int> > GetHea(std::vector<int>&, std::vector<int>&)':
scales.cpp:30:60: warning: declaration of 'a' shadows a global declaration [-Wshadow]
 vector<vector<int>> GetHea(vector<int> & p , vector<int> &a){
                                                            ^
scales.cpp:13:5: note: shadowed declaration is here
 int a[maxn] , b[maxn][3];
     ^
scales.cpp:30:60: warning: declaration of 'p' shadows a global declaration [-Wshadow]
 vector<vector<int>> GetHea(vector<int> & p , vector<int> &a){
                                                            ^
scales.cpp:11:13: note: shadowed declaration is here
 vector<int> p;
             ^
scales.cpp: In function 'std::vector<std::vector<int> > GetMed(std::vector<int>&, std::vector<int>&)':
scales.cpp:42:60: warning: declaration of 'a' shadows a global declaration [-Wshadow]
 vector<vector<int>> GetMed(vector<int> & p , vector<int> &a){
                                                            ^
scales.cpp:13:5: note: shadowed declaration is here
 int a[maxn] , b[maxn][3];
     ^
scales.cpp:42:60: warning: declaration of 'p' shadows a global declaration [-Wshadow]
 vector<vector<int>> GetMed(vector<int> & p , vector<int> &a){
                                                            ^
scales.cpp:11:13: note: shadowed declaration is here
 vector<int> p;
             ^
scales.cpp: In function 'std::vector<std::vector<int> > GetNexLig(std::vector<int>&, std::vector<int>&)':
scales.cpp:54:63: warning: declaration of 'a' shadows a global declaration [-Wshadow]
 vector<vector<int>> GetNexLig(vector<int> & p , vector<int> &a){
                                                               ^
scales.cpp:13:5: note: shadowed declaration is here
 int a[maxn] , b[maxn][3];
     ^
scales.cpp:54:63: warning: declaration of 'p' shadows a global declaration [-Wshadow]
 vector<vector<int>> GetNexLig(vector<int> & p , vector<int> &a){
                                                               ^
scales.cpp:11:13: note: shadowed declaration is here
 vector<int> p;
             ^
scales.cpp: In function 'std::vector<std::vector<int> > Get(std::vector<int>&, int)':
scales.cpp:72:47: warning: declaration of 'p' shadows a global declaration [-Wshadow]
 vector<vector<int>> Get(vector<int> &p , int q){
                                               ^
scales.cpp:11:13: note: shadowed declaration is here
 vector<int> p;
             ^
scales.cpp: In function 'int build(std::vector<int>, int)':
scales.cpp:79:34: warning: declaration of 'p' shadows a global declaration [-Wshadow]
 int build(vector<int> p , int pos){
                                  ^
scales.cpp:11:13: note: shadowed declaration is here
 vector<int> p;
             ^
scales.cpp:90:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             cnt += (tmp[j].size() <= lim[pos]);
scales.cpp: In function 'void init(int)':
scales.cpp:145:25: warning: declaration of 'tmp' shadows a previous local [-Wshadow]
             vector<int> tmp;
                         ^~~
scales.cpp:138:17: note: shadowed declaration is here
     vector<int> tmp(6);iota(tmp.begin(),tmp.end(),0);
                 ^~~
scales.cpp:137:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
#Verdict Execution timeMemoryGrader output
Fetching results...