Submission #1089919

#TimeUsernameProblemLanguageResultExecution timeMemory
1089919solitaryManRoom Temperature (JOI24_ho_t1)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define ll long long #define line cout << "---------------------------" << endl; #define M -1 #define debug(x) cout << "x " << x << endl; #define all(a) a.begin(), a.end() #define INF (int) 1e9 bool int_(float n){ return float(n) == ceil(n); } int gcd(int a, int b){ return __gcd(a,b); } bool prime(int n){ for(int i = 2; i <= sqrt(n); i++){ if(n % i == 0) return false; } return true; } string showbit(int n){ string s = ""; for(int i = 31; i >= 0 ; i--){ if(n & (1 << i)) s += "1" else s += "0" ; } return s; } bool sq(int n){ return n * n; } void solve(){ cout << 0 << endl; } int32_t main(){ int t = 1; //cin >> t; while(t--){solve();} cerr << "Execution time: " << 1000.f * clock() / CLOCKS_PER_SEC << " ms." << endl; }

Compilation message (stderr)

Main.cpp: In function 'std::string showbit(int)':
Main.cpp:33:28: error: expected ';' before 'else'
   33 |   if(n & (1 << i)) s += "1"
      |                            ^
      |                            ;
   34 |   else s += "0" ;
      |   ~~~~                      
Main.cpp: In function 'bool sq(int)':
Main.cpp:40:11: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context]
   40 |  return n * n;
      |         ~~^~~