# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
320889 | 2020-11-10T07:09:30 Z | egas | Pilot (NOI19_pilot) | C++14 | 1000 ms | 9952 KB |
#include <bits/stdc++.h> using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); long long n; cin >> n; long long m; cin >> m; vector<long long> a(n); for(long long i = 0 ; i < n ; i++) { cin >> a[i]; } vector<long long> b(m); for(long long i = 0 ; i < m ; i++) { cin >> b[i]; } vector<long long> diff(1000005,0); for(long long i=0; i<n; i++) { long long ryt=0; for(long long j=i+1; j<a.size(); j++) { if(a[j]>a[i])break; ryt++; } long long left=0; for(long long j=i-1; j>=0; j--) { if(a[j]>a[i])break; left++; } diff[a[i]]+=((left+1)*(ryt+1)); } for(long long i=1; i<diff.size(); i++) { diff[i]+=diff[i-1]; } for(long long i = 0 ; i < b.size() ; i++) { cout << diff[b[i]] << '\n'; } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 8172 KB | Output is correct |
2 | Correct | 8 ms | 8172 KB | Output is correct |
3 | Correct | 8 ms | 8172 KB | Output is correct |
4 | Correct | 8 ms | 8172 KB | Output is correct |
5 | Correct | 9 ms | 8172 KB | Output is correct |
6 | Incorrect | 8 ms | 8172 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 8172 KB | Output is correct |
2 | Correct | 8 ms | 8172 KB | Output is correct |
3 | Correct | 8 ms | 8172 KB | Output is correct |
4 | Correct | 8 ms | 8172 KB | Output is correct |
5 | Correct | 9 ms | 8172 KB | Output is correct |
6 | Incorrect | 8 ms | 8172 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 8172 KB | Output is correct |
2 | Correct | 8 ms | 8172 KB | Output is correct |
3 | Correct | 8 ms | 8172 KB | Output is correct |
4 | Correct | 8 ms | 8172 KB | Output is correct |
5 | Correct | 9 ms | 8172 KB | Output is correct |
6 | Incorrect | 8 ms | 8172 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 8172 KB | Output is correct |
2 | Correct | 8 ms | 8172 KB | Output is correct |
3 | Correct | 8 ms | 8172 KB | Output is correct |
4 | Correct | 8 ms | 8172 KB | Output is correct |
5 | Correct | 9 ms | 8172 KB | Output is correct |
6 | Incorrect | 8 ms | 8172 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 20 ms | 9092 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1055 ms | 9836 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1033 ms | 9952 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 8172 KB | Output is correct |
2 | Correct | 8 ms | 8172 KB | Output is correct |
3 | Correct | 8 ms | 8172 KB | Output is correct |
4 | Correct | 8 ms | 8172 KB | Output is correct |
5 | Correct | 9 ms | 8172 KB | Output is correct |
6 | Incorrect | 8 ms | 8172 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 8172 KB | Output is correct |
2 | Correct | 8 ms | 8172 KB | Output is correct |
3 | Correct | 8 ms | 8172 KB | Output is correct |
4 | Correct | 8 ms | 8172 KB | Output is correct |
5 | Correct | 9 ms | 8172 KB | Output is correct |
6 | Incorrect | 8 ms | 8172 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 8172 KB | Output is correct |
2 | Correct | 8 ms | 8172 KB | Output is correct |
3 | Correct | 8 ms | 8172 KB | Output is correct |
4 | Correct | 8 ms | 8172 KB | Output is correct |
5 | Correct | 9 ms | 8172 KB | Output is correct |
6 | Incorrect | 8 ms | 8172 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |