Submission #1259433

#TimeUsernameProblemLanguageResultExecution timeMemory
1259433phtungLasers (NOI19_lasers)C++20
10 / 100
22 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; } int res = len - (L / 2); if(L % 2) { cout << res * 2 - 1 << "\n"; } else cout << res * 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:55:17: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   55 |         freopen (name".INP", "r", stdin);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
lasers.cpp:56:17: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   56 |         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...