Submission #1305753

#TimeUsernameProblemLanguageResultExecution timeMemory
1305753hackstarHack (APIO25_hack)C++20
Compilation error
0 ms0 KiB
#include "hack.h" #include <bits/stdc++.h> using namespace std; int hack(){ int low = 1; int high = 1e9; map<vector<ll>,int>cache; while(low<high){ int mid = (low+high)/2; int s = sqrt(mid-low+1); vector<long long> query; for(int i=0;i<s;i++){ query.push_back(i+1); } for(int i=0;low+s*(i+1)<=mid;i++){ query.push_back(low+s*(i+1)); } query.push_back(mid+1); int curr; if(cache.count(query)) curr=cache[query]; else { curr=collisions(query); cache[query]=curr; } if(curr){ high = mid; } else{ low = mid+1; } } return low; }

Compilation message (stderr)

hack.cpp: In function 'int hack()':
hack.cpp:9:16: error: 'll' was not declared in this scope
    9 |     map<vector<ll>,int>cache;
      |                ^~
hack.cpp:9:18: error: template argument 1 is invalid
    9 |     map<vector<ll>,int>cache;
      |                  ^
hack.cpp:9:18: error: template argument 2 is invalid
hack.cpp:9:23: error: template argument 1 is invalid
    9 |     map<vector<ll>,int>cache;
      |                       ^
hack.cpp:9:23: error: template argument 3 is invalid
hack.cpp:9:23: error: template argument 4 is invalid
hack.cpp:22:50: error: request for member 'count' in 'cache', which is of non-class type 'int'
   22 |                                         if(cache.count(query))
      |                                                  ^~~~~
hack.cpp:23:67: error: no match for 'operator[]' (operand types are 'int' and 'std::vector<long long int>')
   23 |                                                         curr=cache[query];
      |                                                                   ^
hack.cpp:27:62: error: no match for 'operator[]' (operand types are 'int' and 'std::vector<long long int>')
   27 |                                                         cache[query]=curr;
      |                                                              ^