Problem binarycoins
User KYKY027
Submission Time 2026-03-06 13:57:01
Score 0
Max Time N/A
Max Memory N/A

Compile Error

binarycoins.cpp: In function ‘int main()’:
binarycoins.cpp:11:20: error: invalid type argument of unary ‘*’ (have ‘int’)
11 | biggestNote = 2**maxPower;
| ^~~~~~~~
binarycoins.cpp:15:16: error: conflicting declaration ‘std::map<int, int> numNotes’
15 | map<int, int> numNotes;
| ^~~~~~~~
binarycoins.cpp:5:32: note: previous declaration as ‘int numNotes’
5 | int B, maxPower, biggestNote, numNotes;
| ^~~~~~~~
binarycoins.cpp:18:30: error: invalid type argument of unary ‘*’ (have ‘int’)
18 | numNoteX = B/2**(maxPower-i);
| ^
binarycoins.cpp:19:24: error: invalid type argument of unary ‘*’ (have ‘int’)
19 | B = B%(2**(maxPower-i));
| ^
binarycoins.cpp:20:26: error: invalid type argument of unary ‘*’ (have ‘int’)
20 | numNotes[2**(maxPower-i)] = numNoteX;