Submission #238283

#TimeUsernameProblemLanguageResultExecution timeMemory
238283PbezzLasers (NOI19_lasers)C++14
24 / 100
444 ms33400 KiB
#include <bits/stdc++.h> using namespace std; #define loop(i,n) for (ll i = 0; i < n; i++) #define ll long long #define INF 1e9+5 #define MAXN 300007 #define pb push_back #define mp make_pair typedef pair<ll,ll> pii; int main(){ ll l,r,k,x,maxi=0; cin>>l>>r; vector<vector<ll>>row(r); loop(i,r){ cin>>x; maxi=max(maxi,x); loop(j,x){ cin>>k; row[i].pb(k); } } if(maxi==1){//só há um por linha ll savedL=INF, savedR=-1; loop(i,r){ k=row[i][0]; savedR = max(savedR , k); savedL = min(savedL, l-k-1); } k = savedL+1; savedR=max(savedR,savedL+1); k+=(l-savedR); printf("%lld\n",l-k); }else{ } return 0; }
#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...