Submission #493117

# Submission time Handle Problem Language Result Execution time Memory
493117 2021-12-10T05:57:00 Z Haruto810198 Kitchen (BOI19_kitchen) C++17
Compilation error
0 ms 0 KB
err<<"ok"<<endl;
	cerr<<"dp_dian : "<<endl;
	FOR(i, 0, 10, 1){
		if(dp_dian[i] < -INF / 2) cerr<<"- ";
		else cerr<<dp_dian[i]<<" ";
	}
	cerr<<endl;

	cerr<<"suf : "<<endl;
	FOR(i, 0, md, 1){
		FOR(j, 0, 10, 1){
			if(suf[i][j] >= INF) cerr<<"- ";
			else cerr<<suf[i][j]<<" ";
		}
		cerr<<endl;
	}
	cerr<<endl;

	cerr<<"dp_weak : "<<endl;
	FOR(i, 0, 10, 1){
		cerr<<dp_weak[i]<<" ";
	}
	cerr<<endl;
	*/
	res = INF;

	// weak chefs + dian chefs	
	FOR(j, 0, meal_sum - 1, 1){
		if(dp_weak[j] == 0) continue;
		int req_chefs = max((int)0, lim - (j / n)); // required dian chefs
		int req_sum = meal_sum - j; // required sum of time
		//cerr<<"j = "<<j<<" ["<<req_chefs<<"]["<<req_sum<<"] "<<endl;
		if(req_chefs > md or req_sum > dian_sum) continue;
		res = min(res, j + suf[req_chefs][req_sum] - meal_sum);
	}
	
	// weak chefs only
	FOR(j, meal_sum, mw*MAX, 1){
		if(dp_weak[j]) res = min(res, j - meal_sum);
	}

	if(res < INF / 2) cout<<res<<'\n';
	else cout<<"Impossible"<<'\n';

	return 0;

}

Compilation message

kitchen.cpp:1:1: error: 'err' does not name a type
    1 | err<<"ok"<<endl;
      | ^~~
kitchen.cpp:2:2: error: 'cerr' does not name a type
    2 |  cerr<<"dp_dian : "<<endl;
      |  ^~~~
kitchen.cpp:3:5: error: expected constructor, destructor, or type conversion before '(' token
    3 |  FOR(i, 0, 10, 1){
      |     ^
kitchen.cpp:7:2: error: 'cerr' does not name a type
    7 |  cerr<<endl;
      |  ^~~~
kitchen.cpp:9:2: error: 'cerr' does not name a type
    9 |  cerr<<"suf : "<<endl;
      |  ^~~~
kitchen.cpp:10:5: error: expected constructor, destructor, or type conversion before '(' token
   10 |  FOR(i, 0, md, 1){
      |     ^
kitchen.cpp:17:2: error: 'cerr' does not name a type
   17 |  cerr<<endl;
      |  ^~~~
kitchen.cpp:19:2: error: 'cerr' does not name a type
   19 |  cerr<<"dp_weak : "<<endl;
      |  ^~~~
kitchen.cpp:20:5: error: expected constructor, destructor, or type conversion before '(' token
   20 |  FOR(i, 0, 10, 1){
      |     ^
kitchen.cpp:23:2: error: 'cerr' does not name a type
   23 |  cerr<<endl;
      |  ^~~~
kitchen.cpp:24:3: error: expected unqualified-id before '/' token
   24 |  */
      |   ^
kitchen.cpp:28:5: error: expected constructor, destructor, or type conversion before '(' token
   28 |  FOR(j, 0, meal_sum - 1, 1){
      |     ^
kitchen.cpp:38:5: error: expected constructor, destructor, or type conversion before '(' token
   38 |  FOR(j, meal_sum, mw*MAX, 1){
      |     ^
kitchen.cpp:42:2: error: expected unqualified-id before 'if'
   42 |  if(res < INF / 2) cout<<res<<'\n';
      |  ^~
kitchen.cpp:43:2: error: expected unqualified-id before 'else'
   43 |  else cout<<"Impossible"<<'\n';
      |  ^~~~
kitchen.cpp:45:2: error: expected unqualified-id before 'return'
   45 |  return 0;
      |  ^~~~~~
kitchen.cpp:47:1: error: expected declaration before '}' token
   47 | }
      | ^