Submission #1141619

#TimeUsernameProblemLanguageResultExecution timeMemory
1141619ereringcmp (balkan11_cmp)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "cmp.h" void remember(int n) { for(int i=1;i<=8;i++){ bit_set(n%3); n/=3; } } int compare(int b) { vector<int> v; for(int i=1;i<=8;i++){ v.pb(b%3); b/=3; } int f=3*7 for(int i=v.size()-1;i>=0;i--){ int x=v[i]; int r=bit_get(f+x); if(x==2 && r==0)return 1; if(x==0 && r==0)return -1; if(x==1 && r==0){ r=bit_get(f+x+1); if(r==1)return -1; else return 1; } f-=3; } }

Compilation message (stderr)

cmp.cpp: In function 'int compare(int)':
cmp.cpp:15:11: error: 'class std::vector<int>' has no member named 'pb'
   15 |         v.pb(b%3);
      |           ^~
cmp.cpp:19:5: error: expected ',' or ';' before 'for'
   19 |     for(int i=v.size()-1;i>=0;i--){
      |     ^~~
cmp.cpp:19:26: error: 'i' was not declared in this scope
   19 |     for(int i=v.size()-1;i>=0;i--){
      |                          ^
cmp.cpp:31:1: warning: no return statement in function returning non-void [-Wreturn-type]
   31 | }
      | ^