# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1089404 | Mike_Vu | 새로운 문제 (POI11_met) | C++14 | 2 ms | 604 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double dou;
#define pii pair<int, int>
#define fi first
#define se second
#define pb push_back
#define BITj(x, j) (((x)>>(j))&1)
#define MASK(x) (1LL<<(x))
template<typename T> bool maximize(T &x, const T &y) {
if (x < y) {x = y; return 1;}
return 0;
}
template<typename T> bool minimize(T &x, const T &y) {
if (x > y) {x = y; return 1;}
return 0;
}
const int maxn = 1005;
int n, m, k;
int o[maxn], ans[maxn];
ll goal[maxn];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
#define name "task"
if (fopen(name".inp", "r")) {
freopen(name".inp", "r", stdin);
freopen(name".ans", "w", stdout);
}
cin >> n >> m;
for (int i = 1; i <= m; i++) {
cin >> o[i];
}
for (int i = 1; i <= n; i++) {
cin >> goal[i];
}
memset(ans, -1, sizeof(ans));
cin >> k;
for (int t = 1; t <= k; t++) {
int l, r;
ll val;
cin >> l >> r >> val;
if (l <= r) {
for (int i = l; i <= r; i++) {
goal[o[i]] -= val;
}
}
else {
for (int i = 1; i <= r; i++) {
goal[o[i]] -= val;
}
for (int i = l; i <= m; i++) {
goal[o[i]] -= val;
}
}
//check
for (int i = 1; i <= n; i++) {
if (goal[i] <= 0 && ans[i] == -1) ans[i] = t;
}
}
for (int i = 1; i <= n; i++) {
if (ans[i] == -1) cout << "NIE";
else cout << ans[i];
cout << "\n";
}
}
컴파일 시 표준 에러 (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... |