Submission #1259431

#TimeUsernameProblemLanguageResultExecution timeMemory
1259431phtungLasers (NOI19_lasers)C++20
0 / 100
21 ms16968 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)

lasers.cpp: In function 'int main()':
lasers.cpp:49:17: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   49 |         freopen (name".INP", "r", stdin);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
lasers.cpp:50:17: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   50 |         freopen (name".OUT", "w", stdout);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...