Submission #885733

# Submission time Handle Problem Language Result Execution time Memory
885733 2023-12-10T14:54:30 Z Ninedesu Pilot (NOI19_pilot) C++14
9 / 100
30 ms 3592 KB
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
using namespace std;

const int N=1e6+1;
int n,q;
int arr[N];
pii qst[N];

int main(){
    ios_base::sync_with_stdio(0),cin.tie(0);
    cin >> n >> q;
    for(int i=1; i<=n; i++){
        cin >> arr[i];
    }
    while(q--){
        int h;
        cin >> h;
        int idx=upper_bound(arr+1,arr+n+1,h)-arr-1;
        cout << ((ll)arr[idx]*(arr[idx]+1))/2 << '\n';
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Incorrect 0 ms 2396 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Incorrect 0 ms 2396 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Incorrect 0 ms 2396 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Incorrect 0 ms 2396 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 28 ms 3404 KB Output is correct
2 Correct 26 ms 3360 KB Output is correct
3 Correct 25 ms 3420 KB Output is correct
4 Correct 30 ms 3420 KB Output is correct
5 Correct 25 ms 3296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 3592 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Incorrect 0 ms 2396 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Incorrect 0 ms 2396 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2648 KB Output is correct
2 Incorrect 0 ms 2396 KB Output isn't correct
3 Halted 0 ms 0 KB -