Problem choosingcandies
User yixin
Submission Time 2026-06-24 16:57:29
Score 0
Max Time N/A
Max Memory N/A

Compile Error

choosingcandies.cpp: In function ‘int main()’:
choosingcandies.cpp:10:2: error: ‘cin’ was not declared in this scope
10 | cin >> n >> k;
| ^~~
choosingcandies.cpp:5:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
4 | #include <algorithm>
+++ |+#include <iostream>
5 | using namespace std;
choosingcandies.cpp:16:21: error: ‘t’ was not declared in this scope
16 | for (int i = 0; i <t i = 0;i < n; ++i) {
| ^
choosingcandies.cpp:16:22: error: expected ‘;’ before ‘i’
16 | for (int i = 0; i <t i = 0;i < n; ++i) {
| ^~
| ;
choosingcandies.cpp:16:28: error: expected ‘)’ before ‘;’ token
16 | for (int i = 0; i <t i = 0;i < n; ++i) {
| ~ ^
| )
choosingcandies.cpp:16: