답안 #1027939

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1027939 2024-07-19T11:50:50 Z vjudge1 Job Scheduling (CEOI12_jobs) C++17
0 / 100
1000 ms 12840 KB
#include <bits/stdc++.h>
using namespace std;

int n, d, m;
priority_queue<pair<int, int> > req;
vector<int> res[100000];

int main() {
    cin>>n>>d>>m;
    for(int i = 0; i < m; i++) {
        int a;
        cin>>a;
        a--;
        req.push({-a, i});
    }
    int l = 0, r = n - 1;
    while(true) {
        int mid = (l + r) / 2;
        bool ok = true;
        for(int i = 0; i < n; i++) {
            res[i].clear();
            for(int j = 0; j < mid; j++) {
                int k = req.top().first;
                int idx = req.top().second;
                req.pop();

                
            }
        }
    }
    return 0;
}

Compilation message

jobs.cpp: In function 'int main()':
jobs.cpp:23:21: warning: unused variable 'k' [-Wunused-variable]
   23 |                 int k = req.top().first;
      |                     ^
jobs.cpp:24:21: warning: unused variable 'idx' [-Wunused-variable]
   24 |                 int idx = req.top().second;
      |                     ^~~
jobs.cpp:19:14: warning: unused variable 'ok' [-Wunused-variable]
   19 |         bool ok = true;
      |              ^~
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1010 ms 3792 KB Time limit exceeded
2 Execution timed out 1092 ms 4044 KB Time limit exceeded
3 Execution timed out 1069 ms 3796 KB Time limit exceeded
4 Execution timed out 1047 ms 3792 KB Time limit exceeded
5 Execution timed out 1061 ms 3796 KB Time limit exceeded
6 Execution timed out 1045 ms 3792 KB Time limit exceeded
7 Execution timed out 1035 ms 4048 KB Time limit exceeded
8 Execution timed out 1029 ms 3792 KB Time limit exceeded
9 Execution timed out 1029 ms 3792 KB Time limit exceeded
10 Execution timed out 1049 ms 3792 KB Time limit exceeded
11 Execution timed out 1034 ms 3796 KB Time limit exceeded
12 Execution timed out 1066 ms 4816 KB Time limit exceeded
13 Execution timed out 1049 ms 7360 KB Time limit exceeded
14 Execution timed out 1061 ms 8384 KB Time limit exceeded
15 Execution timed out 1012 ms 8380 KB Time limit exceeded
16 Execution timed out 1070 ms 12212 KB Time limit exceeded
17 Execution timed out 1059 ms 11856 KB Time limit exceeded
18 Execution timed out 1052 ms 12840 KB Time limit exceeded
19 Execution timed out 1038 ms 12212 KB Time limit exceeded
20 Execution timed out 1064 ms 11896 KB Time limit exceeded