# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
320991 | techiehere08 | Pilot (NOI19_pilot) | C++14 | 1101 ms | 1912 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main(){
int n, m, cnt = 0;
scanf("%d%d", &n, &m);
int A[n];
long long answer = 0;
for(int i = 0; i < n; i++){
scanf("%d", A + i);
}
for(int j = 0; j < m; j++){
answer = cnt = 0;
int x; scanf("%d", &x);
for(int i = 0; i < n; i++){
if(A[i] > x){
answer += (cnt * 1ll * (cnt + 1)) / 2;
cnt = 0;
}
else{
cnt++;
}
}
answer += (cnt * 1ll * (cnt + 1)) / 2;
printf("%lld\n", answer);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |