제출 #1007795

#제출 시각아이디문제언어결과실행 시간메모리
1007795andecaandeciLasers (NOI19_lasers)C++17
24 / 100
60 ms1628 KiB
#include <bits/stdc++.h>
using namespace std; 
#define int long long
#define ld long double
#define fi first 
#define se second 
#define pb push_back
#define pii pair<int,int>
#define piii pair<pair<int,int>,pair<int,int>>
#define pip pair<int,pair<int,int>>

signed main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
    cout.tie(NULL); 
    int ans = 0; 
    int n, q; cin >> n >> q; 
    int val = 0; 
    for(int i = 1; i <= q; i++){
        int x; cin >> x; 
        int a[x+5]; 
        int tmp = 0; 
        for(int i = 1; i <= x; i++){
            cin >> a[i]; tmp += a[i]; 
        }
        int rem = n - tmp; 
        int cnt = 0; 
        for(int i = 1; i <= x; i++){
            cnt += (a[x] - rem); 
        }
        ans = max(ans, cnt); 
    }
    cout << ans << endl; 
}   

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

lasers.cpp: In function 'int main()':
lasers.cpp:18:9: warning: unused variable 'val' [-Wunused-variable]
   18 |     int val = 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...