Submission #918815

# Submission time Handle Problem Language Result Execution time Memory
918815 2024-01-30T13:17:45 Z nasir_bashirov Password (RMI18_password) C++17
Compilation error
0 ms 0 KB
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
 
#include <bits/stdc++.h>
using namespace std;
 
#define db long double
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
// #define endl '\n'
#define all(x) x.begin(), x.end()
#define fastio\
    ios_base::sync_with_stdio(0);\
    cin.tie(0);\
    cout.tie(0)\
 
int query(string str);
 
#define pci pair<char, int>
 
map<pair<pci, pci>, bool> memo;
map<char, int> cnt;
bool cmp(pci a, pci b){
  return cnt[a.first] > cnt[b.first];
}
bool comp(pair<char, int> a, pair<char, int> b){
    if(a.first == b.first){
        return a.second < b.second;
    }
    if(memo.count({a, b}))    return memo[{a, b}];  
    string s = "";
    for(int i = 1; i <= a.second; i++){
        s += a.first;
    }

Compilation message

password.cpp: In function 'bool comp(std::pair<char, int>, std::pair<char, int>)':
password.cpp:39:5: error: expected '}' at end of input
   39 |     }
      |     ^
password.cpp:31:48: note: to match this '{'
   31 | bool comp(pair<char, int> a, pair<char, int> b){
      |                                                ^
password.cpp:36:16: warning: control reaches end of non-void function [-Wreturn-type]
   36 |     string s = "";
      |                ^~