답안 #148793

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
148793 2019-09-01T05:08:12 Z Aliensoft(#3636, computerbox) List of Unique Integers (FXCUP4_unique) C++17
컴파일 오류
0 ms 0 KB
#include "unique.h"
#include<bits/stdc++.h>

using namespace std;

vector<int> PickUnique(int N) {
	vector<int>ans;
    for(int i=0;i<N;i++)
    {
       ll sig=0;
       ll sigg=0;
       if(i==0)
       {
        ll cntR=UniqueCount(i,N-1);
        ll cntR1=UniqueCount(i+1,N-1);
        if(cntR1<cntR)sig=1;
        if(sig)ans.push_back(1);
        else ans.push_back(0);
       }
       else if(i==N-1)
       {
        ll cntL=UniqueCount(0,i);
        ll cntL1=UniqueCount(0,i-1);
        if(cntL1<cntL)sigg=1;
        if(sigg)ans.push_back(1);
        else ans.push_back(0);
       }
       else
       {
        ll cntR=UniqueCount(i,N-1);
        ll cntR1=UniqueCount(i+1,N-1);
        if(cntR1<cntR)sig=1;
        ll cntL=UniqueCount(0,i);
        ll cntL1=UniqueCount(0,i-1);
        if(cntL1<cntL)sigg=1;
        if(sigg && sig)ans.push_back(1);
        else ans.push_back(0);
       }
    }
    return ans;
}

Compilation message

unique.cpp: In function 'std::vector<int> PickUnique(int)':
unique.cpp:10:8: error: 'll' was not declared in this scope
        ll sig=0;
        ^~
unique.cpp:11:11: error: expected ';' before 'sigg'
        ll sigg=0;
           ^~~~
unique.cpp:14:12: error: expected ';' before 'cntR'
         ll cntR=UniqueCount(i,N-1);
            ^~~~
unique.cpp:15:12: error: expected ';' before 'cntR1'
         ll cntR1=UniqueCount(i+1,N-1);
            ^~~~~
unique.cpp:16:12: error: 'cntR1' was not declared in this scope
         if(cntR1<cntR)sig=1;
            ^~~~~
unique.cpp:16:18: error: 'cntR' was not declared in this scope
         if(cntR1<cntR)sig=1;
                  ^~~~
unique.cpp:16:18: note: suggested alternative: 'int'
         if(cntR1<cntR)sig=1;
                  ^~~~
                  int
unique.cpp:16:23: error: 'sig' was not declared in this scope
         if(cntR1<cntR)sig=1;
                       ^~~
unique.cpp:16:23: note: suggested alternative: 'sin'
         if(cntR1<cntR)sig=1;
                       ^~~
                       sin
unique.cpp:17:12: error: 'sig' was not declared in this scope
         if(sig)ans.push_back(1);
            ^~~
unique.cpp:17:12: note: suggested alternative: 'sin'
         if(sig)ans.push_back(1);
            ^~~
            sin
unique.cpp:22:12: error: expected ';' before 'cntL'
         ll cntL=UniqueCount(0,i);
            ^~~~
unique.cpp:23:12: error: expected ';' before 'cntL1'
         ll cntL1=UniqueCount(0,i-1);
            ^~~~~
unique.cpp:24:12: error: 'cntL1' was not declared in this scope
         if(cntL1<cntL)sigg=1;
            ^~~~~
unique.cpp:24:18: error: 'cntL' was not declared in this scope
         if(cntL1<cntL)sigg=1;
                  ^~~~
unique.cpp:24:18: note: suggested alternative: 'int'
         if(cntL1<cntL)sigg=1;
                  ^~~~
                  int
unique.cpp:24:23: error: 'sigg' was not declared in this scope
         if(cntL1<cntL)sigg=1;
                       ^~~~
unique.cpp:24:23: note: suggested alternative: 'sig_t'
         if(cntL1<cntL)sigg=1;
                       ^~~~
                       sig_t
unique.cpp:25:12: error: 'sigg' was not declared in this scope
         if(sigg)ans.push_back(1);
            ^~~~
unique.cpp:25:12: note: suggested alternative: 'sig_t'
         if(sigg)ans.push_back(1);
            ^~~~
            sig_t
unique.cpp:30:12: error: expected ';' before 'cntR'
         ll cntR=UniqueCount(i,N-1);
            ^~~~
unique.cpp:31:12: error: expected ';' before 'cntR1'
         ll cntR1=UniqueCount(i+1,N-1);
            ^~~~~
unique.cpp:32:12: error: 'cntR1' was not declared in this scope
         if(cntR1<cntR)sig=1;
            ^~~~~
unique.cpp:32:18: error: 'cntR' was not declared in this scope
         if(cntR1<cntR)sig=1;
                  ^~~~
unique.cpp:32:18: note: suggested alternative: 'int'
         if(cntR1<cntR)sig=1;
                  ^~~~
                  int
unique.cpp:32:23: error: 'sig' was not declared in this scope
         if(cntR1<cntR)sig=1;
                       ^~~
unique.cpp:32:23: note: suggested alternative: 'sin'
         if(cntR1<cntR)sig=1;
                       ^~~
                       sin
unique.cpp:33:12: error: expected ';' before 'cntL'
         ll cntL=UniqueCount(0,i);
            ^~~~
unique.cpp:34:12: error: expected ';' before 'cntL1'
         ll cntL1=UniqueCount(0,i-1);
            ^~~~~
unique.cpp:35:12: error: 'cntL1' was not declared in this scope
         if(cntL1<cntL)sigg=1;
            ^~~~~
unique.cpp:35:18: error: 'cntL' was not declared in this scope
         if(cntL1<cntL)sigg=1;
                  ^~~~
unique.cpp:35:18: note: suggested alternative: 'int'
         if(cntL1<cntL)sigg=1;
                  ^~~~
                  int
unique.cpp:35:23: error: 'sigg' was not declared in this scope
         if(cntL1<cntL)sigg=1;
                       ^~~~
unique.cpp:35:23: note: suggested alternative: 'sig_t'
         if(cntL1<cntL)sigg=1;
                       ^~~~
                       sig_t
unique.cpp:36:12: error: 'sigg' was not declared in this scope
         if(sigg && sig)ans.push_back(1);
            ^~~~
unique.cpp:36:12: note: suggested alternative: 'sig_t'
         if(sigg && sig)ans.push_back(1);
            ^~~~
            sig_t
unique.cpp:36:20: error: 'sig' was not declared in this scope
         if(sigg && sig)ans.push_back(1);
                    ^~~
unique.cpp:36:20: note: suggested alternative: 'sin'
         if(sigg && sig)ans.push_back(1);
                    ^~~
                    sin