# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
698497 | 2023-02-13T15:48:50 Z | arneves | 최후의 만찬 (IOI12_supper) | C++17 | 2500 ms | 70028 KB |
/* ______ _____ _______ _ _ _______ __ _ _____ _ _ _ |_____/ | | | |____/ |______ | \ | | | | | | | \_ |_____| |_____ | \_ ______| | \_| |_____| |__|__| . . . . . . _\/ \/_ _\/ \/_ _\/ \/_ _\/\/_ _\/\/_ _\/\/_ _\_\_\/\/_/_/_ _\_\_\/\/_/_/_ _\_\_\/\/_/_/_ / /_/\/\_\ \ / /_/\/\_\ \ / /_/\/\_\ \ _/\/\_ _/\/\_ _/\/\_ /\ /\ /\ /\ /\ /\ ' ' ' ' ' ' */ #pragma GCC optimize ("O3") #pragma GCC target ("avx2") #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <climits> #include <cstdint> #include <cmath> #include <chrono> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <memory> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_set> #include <unordered_map> #include <vector> using namespace std; #include "advisor.h" void ComputeAdvice(int *C, int N, int K, int M) { vector<deque<int> > times(N, deque<int>()); for(int i=0; i<N; i++){ times[C[i]].push_back(i); } for(int i=0; i<N; i++){ times[i].push_back(1e6); } priority_queue<pair<int,int> > q; set<int> d; for(int i=0; i<K; i++){ d.insert(i); q.push({times[i].front(),i}); } for(int i=0; i<N; i++){ times[C[i]].pop_front(); if(d.find(C[i])==d.end()){ d.insert(C[i]); int y=q.top().second; q.pop(); while(d.find(y)==d.end()) y=q.top().second; q.pop(); d.erase(y); for(int bit=0; bit<17; bit++){ if((1<<bit)&y) WriteAdvice(1); else WriteAdvice(0); } } d.insert(C[i]); q.push({times[i].front(),i}); } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 468 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2589 ms | 7124 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2566 ms | 56260 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2569 ms | 3028 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2581 ms | 69700 KB | Time limit exceeded |
2 | Execution timed out | 2590 ms | 69804 KB | Time limit exceeded |
3 | Execution timed out | 2580 ms | 69960 KB | Time limit exceeded |
4 | Execution timed out | 2598 ms | 69936 KB | Time limit exceeded |
5 | Execution timed out | 2583 ms | 69972 KB | Time limit exceeded |
6 | Execution timed out | 2574 ms | 69968 KB | Time limit exceeded |
7 | Execution timed out | 2578 ms | 70028 KB | Time limit exceeded |
8 | Execution timed out | 2571 ms | 69996 KB | Time limit exceeded |
9 | Execution timed out | 2584 ms | 70000 KB | Time limit exceeded |
10 | Execution timed out | 2592 ms | 69936 KB | Time limit exceeded |