Submission #205736

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2057362020-02-29 15:50:12ics0503Kitchen (BOI19_kitchen)C++17
100 / 100
162 ms28024 KiB
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
short D[313][91919];
vector<int>Q[313];
vector<int>V[91919];
int A[313], B[313], S[313], tmp[313];
bool simul(vector<int>B, int n, int k) {
priority_queue<int>H;
int bSum = 0;
for (int v : B) H.push(v);
for (int i = n; i >= 1; i--) {
// int g = A[i] - k;
for (int j = 0; j < k; j++) {
tmp[j] = H.top() - 1; H.pop();
if (tmp[j] < 0)
return false;
}
for (int j = 0; j < k; j++)H.push(tmp[j]);
}
return true;
}
bool sort_a(int a, int b) {
return a < b;
}
int main() {
int n, m, k, i, j, aSum = 0; scanf("%d%d%d", &n, &m, &k);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

kitchen.cpp: In function 'bool simul(std::vector<int>, int, int)':
kitchen.cpp:13:6: warning: unused variable 'bSum' [-Wunused-variable]
  int bSum = 0;
      ^~~~
kitchen.cpp: In function 'int main()':
kitchen.cpp:55:6: warning: unused variable 'ans' [-Wunused-variable]
  int ans = -1;
      ^~~
kitchen.cpp:30:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  int n, m, k, i, j, aSum = 0; scanf("%d%d%d", &n, &m, &k);
                               ~~~~~^~~~~~~~~~~~~~~~~~~~~~
kitchen.cpp:32:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &A[i]), aSum += A[i];
   ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
kitchen.cpp:38:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for (i = 1; i <= m; i++) scanf("%d", &B[i]);
                           ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...