제출 #1007877

#제출 시각아이디문제언어결과실행 시간메모리
1007877kebineLasers (NOI19_lasers)C++17
10 / 100
18 ms18132 KiB
#include <bits/stdc++.h> using namespace std; #define pii pair<ll,ll> #define REP(i,x,y) for(ll i=x;i<=y;i++) #define freeopen freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #define mod 998244353 #define pb push_back #define mk make_pair #define ll long long #define foor(x,vec) for(auto x:vec ){cout<<x<<" ";} #define fi first #define se second #define MAXN 500069 #define lld long double #define cha ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ffl fflush(stdout) #define sst string #define pii pair<ll,ll> ll mvx[]={0,0,-1,1}; ll mvy[]={1,-1,0,0}; ll n,q; ll k[MAXN]; vector<ll> b[MAXN]; ll vis[MAXN]; void solve(){ cin>>n>>q; REP(i,0,q-1){ cin>>k[i]; REP(j,0,k[i]-1){ ll x; cin>>x; b[i].pb(x); } } ll ans=0; REP(i,0,q-1){ ll mx=0; ll l=0; REP(j,0,k[i]-1){ mx=max(mx,b[i][j]); } ans+=(n-2*(n-mx)); } ans=max(ans,(ll)0); cout<<ans<<endl; } int main(){ cha ll tc=1; // cin>>tc; while(tc--){ solve(); } }

컴파일 시 표준 에러 (stderr) 메시지

lasers.cpp: In function 'void solve()':
lasers.cpp:39:12: warning: unused variable 'l' [-Wunused-variable]
   39 |         ll l=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...