Submission #23370

#TimeUsernameProblemLanguageResultExecution timeMemory
23370TAMREF올림픽 피자 (tutorial5)C++11
0 / 100
0 ms2176 KiB
#include <bits/stdc++.h> #include "pizza.h" using namespace std; typedef pair<int,int> pii; int order_num; queue<int> ord[256]; int ing[256]; vector<pii> C; void Init() { order_num = 0; C.clear(); for(int i=0;i<256;i++) while(!ord[i].empty()) ord[i].pop(); } void call_baker(int b){ for(int i=0;i<256;i++) if(b&i) --ing[i]; Bake(order_num); } void Order(int N, int *A) { int b=0; for(int i=0;i<N;i++) b|=1<<A[i]; if(ing[b]) call_baker(b); else ord[b].push(order_num++); } void Delivery(int I) { C.clear(); for(int i=0;i<256;i++){ if(i&(1<<I) && ord[i].size()) C.push_back(make_pair(ord[i].front(),i)); } sort(C.begin(),C.end()); if(C[0].first==INT_MAX) for(auto u : C) ++ing[u.second]; else{ call_baker(C[0].first); ord[C[0].second].pop(); } }

Compilation message (stderr)

grader.cpp: In function 'int main(int, char**)':
grader.cpp:65:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...