fork download
  1. void solve(std::istream& in, std::ostream& out) {
  2. static int testNumber = 0;
  3. ++testNumber;
  4. std::cerr << testNumber << endl;
  5.  
  6. int n;
  7. in >> n;
  8.  
  9. int cnt = 0;
  10. priority_queue<Elem> pq;
  11. for (int i = 0; i < n; ++i) {
  12. int d, m, h;
  13. in >> d >> h >> m;
  14. cnt += h;
  15. for (int i: range(h)) {
  16. int time = m + i;
  17. Elem e = {true, time * 360LL, time * (360LL - d)};
  18. pq.push(e);
  19. }
  20. }
  21.  
  22. int cur = cnt;
  23. int ans = cnt;
  24. int need = cnt;
  25. cerr << cnt << endl;
  26. while(true) {
  27. Elem e = pq.top();
  28. pq.pop();
  29. if(e.first) {
  30. --cur;
  31. --need;
  32. }
  33. else
  34. ++cur;
  35. if(cur - need > ans)
  36. break;
  37. e.first = false;
  38. e.val += e.add;
  39. pq.push(e);
  40. ans = min(ans, cur);
  41. }
  42.  
  43. out << "Case #" << testNumber << ": " << ans << "\n";
  44.  
  45. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:17: error: variable or field 'solve' declared void
 void solve(std::istream& in, std::ostream& out) {
                 ^
prog.cpp:1:12: error: 'istream' is not a member of 'std'
 void solve(std::istream& in, std::ostream& out) {
            ^
prog.cpp:1:26: error: 'in' was not declared in this scope
 void solve(std::istream& in, std::ostream& out) {
                          ^
prog.cpp:1:30: error: 'ostream' is not a member of 'std'
 void solve(std::istream& in, std::ostream& out) {
                              ^
prog.cpp:1:44: error: 'out' was not declared in this scope
 void solve(std::istream& in, std::ostream& out) {
                                            ^
stdout
Standard output is empty