Problem binarycoins
User bluesky2113
Submission Time 2024-08-26 16:20:05
Score 0
Max Time N/A
Max Memory N/A

Compile Error

cc1plus: error: ‘::main’ must return ‘int’
binarycoins.cpp: In function ‘int main()’:
binarycoins.cpp:5:27: error: ‘n’ was not declared in this scope
5 | int main() {int N; cin >> n; for (int i = 0; i < sqrt(n); i++) {if (pow(2, i) >= N) {a = i; break;}}; b = a; for (int j = a; j >= 0; j--) {count += b / static_cast<int>(pow(2, a); b = b % static_cast<int>(pow(2, a));}return 0;}
| ^
binarycoins.cpp:5:86: error: ‘a’ was not declared in this scope
5 | int main() {int N; cin >> n; for (int i = 0; i < sqrt(n); i++) {if (pow(2, i) >= N) {a = i; break;}}; b = a; for (int j = a; j >= 0; j--) {count += b / static_cast<int>(pow(2, a); b = b % static_cast<int>(pow(2, a));}return 0;}
| ^
binarycoins.cpp:5:103: error: ‘b’ was not declared in this scope
5 | int main() {int N; cin >&g