# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
797172 | vjudge1 | 푸드 코트 (JOI21_foodcourt) | C++17 | 3 ms | 3156 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 2010;
int n, m, q;
deque<int> g[N];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin >> n >> m >> q;
if(n <= 2000 && q <= 2000) {
for(int i = 0; i < q; i++) {
int t;
cin >> t;
if(t == 1) {
ll l, r, c, k;
cin >> l >> r >> c >> k;
for(int j = l; j <= r; j++) {
g[j].push_back(c);
}
}
if(t == 2) {
ll l, r, k;
cin >> l >> r >> k;
for(int j = l; j <= r; j++) {
g[j].pop_front();
// while(!g[j].empty() && g[j].front().second <= k) {
// k -= g[j].front().second;
// g[j].pop_front();
// }
// if(!g[j].empty())
// g[j][0].second -= k;
}
}
if(t == 3) {
ll a, b;
cin >> a >> b;
int ans = 0;
// for(auto [c, k] : g[a]) {
// if(b > k) b -= k;
// else {ans = c; break;}
// }
if(g[a].size() >= b) ans = g[a][b - 1];
cout << ans << '\n';
}
}
return 0;
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |