Problem pigeonhole
User Johnnie
Submission Time 2023-11-08 10:37:58
Score 0
Max Time N/A
Max Memory N/A

Compile Error

pigeonhole.cpp: In function ‘int main()’:
pigeonhole.cpp:7:14: error: the value of ‘H’ is not usable in a constant expression
7 | array<int, H> numOfPidgeons {0};
| ^
pigeonhole.cpp:5:9: note: ‘int H’ is not const
5 | int n, H;
| ^
pigeonhole.cpp:7:14: note: in template argument for type ‘long unsigned int’
7 | array<int, H> numOfPidgeons {0};
| ^
pigeonhole.cpp:16:28: error: ‘h’ was not declared in this scope
16 | numOfPidgeons[pidgeon % h] += 1;
| ^
pigeonhole.cpp:20:28: error: ‘h’ was not declared in this scope
20 | numOfPidgeons[pidgeon % h] -= 1;
| ^
pigeonhole.cpp:23:37: error: request for member ‘size’ in ‘numOfPidgeons’, which is of non-class type ‘int’
23 | for (int i = 0; i < numOfPidgeons.size(); i++)
| ^~~~
pigeonh