# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1259431 | phtung | Lasers (NOI19_lasers) | C++20 | 21 ms | 16968 KiB |
#include <bits/stdc++.h>
using namespace std;
#define name "IO"
#define int long long
const int inf = 1e18 + 7;
const int maxn = 5e5 + 5;
int L, R;
vector<int> row[maxn];
void sub1()
{
int len = row[1].back();
if(len <= L / 2)
{
cout << 0 << "\n";
return;
}
cout << len - (L / 2) << "\n";
}
void solve()
{
cin >> L >> R;
for(int i = 1; i <= R; i++)
{
int x; cin >> x;
for(int i = 1; i <= x; i++)
{
int len;
cin >> len ;
row[i].push_back(len);
}
}
sub1();
}
signed main()
{
if (fopen (name".INP", "r"))
{
freopen (name".INP", "r", stdin);
freopen (name".OUT", "w", stdout);
}
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
clock_t start = clock();
int t = 1;
while(t--) solve();
std::cerr << "Time: " << clock() - start << "ms\n";
return 0;
}
Compilation message (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... |