Problem choosingcandies
User Sofea13
Submission Time 2026-06-24 15:31:54
Score 0
Max Time N/A
Max Memory N/A

Compile Error

choosingcandies.cpp: In function ‘int main()’:
choosingcandies.cpp:4:1: error: ‘cin’ was not declared in this scope
4 | cin >> n >> k;
| ^~~
choosingcandies.cpp:6:1: error: ‘vector’ was not declared in this scope
6 | vector<int> candies(n);
| ^~~~~~
choosingcandies.cpp:6:8: error: expected primary-expression before ‘int’
6 | vector<int> candies(n);
| ^~~
choosingcandies.cpp:8:12: error: ‘candies’ was not declared in this scope
8 | cin >> candies[i];
| ^~~~~~~
choosingcandies.cpp:14:13: error: ‘candies’ was not declared in this scope
14 | if (candies[i] + candies[j] >= k) {
| ^~~~~~~
choosingcandies.cpp:19:1: error: ‘cout’ was not declared in this scope
19 | cout << ways << endl;
| ^~~~
choosingcandies.cpp:19:17: error: ‘endl’ was not declared in this scope
19 | cout << ways &