void solve( std:: istream & in, std:: ostream & out) {
static int testNumber = 0 ;
++ testNumber;
std:: cerr << testNumber << endl;
int n;
in >> n;
int cnt = 0 ;
priority_queue< Elem> pq;
for ( int i = 0 ; i < n; ++ i) {
int d, m, h;
in >> d >> h >> m;
cnt + = h;
for ( int i: range( h) ) {
int time = m + i;
Elem e = { true , time * 360LL, time * ( 360LL - d) } ;
pq.push ( e) ;
}
}
int cur = cnt;
int ans = cnt;
int need = cnt;
cerr << cnt << endl;
while ( true ) {
Elem e = pq.top ( ) ;
pq.pop ( ) ;
if ( e.first ) {
-- cur;
-- need;
}
else
++ cur;
if ( cur - need > ans)
break ;
e.first = false ;
e.val + = e.add ;
pq.push ( e) ;
ans = min( ans, cur) ;
}
out << "Case #" << testNumber << ": " << ans << "\n " ;
}
dm9pZCBzb2x2ZShzdGQ6OmlzdHJlYW0mIGluLCBzdGQ6Om9zdHJlYW0mIG91dCkgewoJCXN0YXRpYyBpbnQgdGVzdE51bWJlciA9IDA7CgkJKyt0ZXN0TnVtYmVyOwoJCXN0ZDo6Y2VyciA8PCB0ZXN0TnVtYmVyIDw8IGVuZGw7CgoJCWludCBuOwoJCWluID4+IG47CgoJCWludCBjbnQgPSAwOwoJCXByaW9yaXR5X3F1ZXVlPEVsZW0+IHBxOwoJCWZvciAoaW50IGkgPSAwOyBpIDwgbjsgKytpKSB7CgkJCWludCBkLCBtLCBoOwoJCQlpbiA+PiBkID4+IGggPj4gbTsKCQkJY250ICs9IGg7CgkJCWZvciAoaW50IGk6IHJhbmdlKGgpKSB7CgkJCQlpbnQgdGltZSA9IG0gKyBpOwoJCQkJRWxlbSBlID0ge3RydWUsIHRpbWUgKiAzNjBMTCwgdGltZSAqICgzNjBMTCAtIGQpfTsKCQkJCXBxLnB1c2goZSk7CgkJCX0KCQl9CgoJCWludCBjdXIgPSBjbnQ7CgkJaW50IGFucyA9IGNudDsKCQlpbnQgbmVlZCA9IGNudDsKCQljZXJyIDw8IGNudCA8PCBlbmRsOwoJCXdoaWxlKHRydWUpIHsKCQkJRWxlbSBlID0gcHEudG9wKCk7CgkJCXBxLnBvcCgpOwoJCQlpZihlLmZpcnN0KSB7CgkJCQktLWN1cjsKCQkJCS0tbmVlZDsKCQkJfQoJCQllbHNlCgkJCQkrK2N1cjsKCQkJaWYoY3VyIC0gbmVlZCA+IGFucykKCQkJCWJyZWFrOwoJCQllLmZpcnN0ID0gZmFsc2U7CgkJCWUudmFsICs9IGUuYWRkOwoJCQlwcS5wdXNoKGUpOwoJCQlhbnMgPSBtaW4oYW5zLCBjdXIpOwoJCX0KCgkJb3V0IDw8ICJDYXNlICMiIDw8IHRlc3ROdW1iZXIgPDwgIjogIiA8PCBhbnMgPDwgIlxuIjsKCgl9
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