# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
743107 | vjudge1 | Lasers (NOI19_lasers) | C++17 | 1081 ms | 2444 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
vector<long long> wall;
const int maxL = 1e6 + 1;
bool walloc[maxL] = {};
int main()
{
long long l, r, amount, a, sum = 0;
cin >> l >> r;
for (long long i = 0; i < r; ++i)
{
cin >> amount;
for (long long j = 0; j < amount; ++j)
{
cin >> a;
wall.push_back(a);
}
if (amount == 1)
{
if (wall[0] >= (l / 2) + 1)
{
long long left = l - wall[0];
for (long long k = left + 1; k <= l - left, k <= l; ++k)
{
if (walloc[k] == false)
{
walloc[k] = true;
sum++;
}
}
}
}
else
{
for (long long k = 0; k < amount; ++k)
{
long long otherl = 0, otherr = 0;
if (k != 0)
{
for (long long j = k - 1; j >= 0; --j)
otherl += wall[j];
}
if (k != amount - 1)
{
for (long long j = k + 1; j < amount; ++j)
otherr += wall[j];
}
long long wallleft = l - otherl - otherr;
if (wall[k] >= (wallleft / 2) + 1)
{
long long coverage = wallleft - wall[k];
for (long long j = otherl + 1 + coverage; j <= l - otherr - coverage, j <= l; ++j)
{
if (walloc[j] == false)
{
walloc[j] = true;
sum++;
}
}
}
}
}
while (!wall.empty())
wall.pop_back();
}
cout << sum;
}
컴파일 시 표준 에러 (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... |