제출 #965972

#제출 시각아이디문제언어결과실행 시간메모리
965972nam_ntmpLasers (NOI19_lasers)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

int main(){
    int l,r;
    cin>>l>>r;
    // sub 1
    while(r--){
        int X;
        cin>>X;
        while(X--){
            int len;
            cin>>len;
            if(len*2 < l){
                cout<<"0\n";
            // } else if(len == l){
                // cout<<l<<"\n";
            // }
            else {
                cout<<(len*2)+1-l<<"\n";
            }
        }
    }
}

/*
10 1 
1 4

10 1 
1 5
*/

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

lasers.cpp: In function 'int main()':
lasers.cpp:19:13: error: expected '}' before 'else'
   19 |             else {
      |             ^~~~
lasers.cpp:14:26: note: to match this '{'
   14 |             if(len*2 < l){
      |                          ^