제출 #570201

#제출 시각아이디문제언어결과실행 시간메모리
570201OspleiMountains (NOI20_mountains)C++17
64 / 100
2059 ms4512 KiB
#include <bits/stdc++.h> using namespace std; vector <long long int> v; int main() { long long int n, a, c=0, p, md=0, mi=0; cin >> n; for (long long int i=0; i<n; i++){ cin >> a; v.push_back(a); } for (long long int y=1; y<n-1; y++){ p=y; for (int i=y-1; i>=0; i--){ if (v[i]<v[y]) mi++; } if (mi!=0){ for (int i=y+1; i<n; i++){ if (v[i]<v[y]) md++; } c+=mi*md; mi=0; md=0; } } cout << c; }

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

Mountains.cpp: In function 'int main()':
Mountains.cpp:8:28: warning: variable 'p' set but not used [-Wunused-but-set-variable]
    8 |   long long int n, a, c=0, p, md=0, mi=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...
#Verdict Execution timeMemoryGrader output
Fetching results...