답안 #740942

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
740942 2023-05-13T10:10:42 Z Kakarot Mountains (NOI20_mountains) C++
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>#define ll long long intusing namespace std;void setIO() {  ios_base::sync_with_stdio(false);  cin.tie(NULL);}int main() {  setIO();  int n;  cin >> n;  ll a[n];  for(int i = 0;i < n;++i) cin >> a[i];  ll ans = 0;  for(int i = 0;i < n-2;++i) {    for(int j = i+1;j < n-1;++j) {      for(int k = j+1;k < n;++k) {        if(a[i] < a[j] && a[j] > a[k]) ans++;      }    }  }  cout << ans;  return 0;}

Compilation message

Mountains.cpp:1:25: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>#define ll long long intusing namespace std;void setIO() {  ios_base::sync_with_stdio(false);  cin.tie(NULL);}int main() {  setIO();  int n;  cin >> n;  ll a[n];  for(int i = 0;i < n;++i) cin >> a[i];  ll ans = 0;  for(int i = 0;i < n-2;++i) {    for(int j = i+1;j < n-1;++j) {      for(int k = j+1;k < n;++k) {        if(a[i] < a[j] && a[j] > a[k]) ans++;      }    }  }  cout << ans;  return 0;}
      |                         ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status