Submission #885716

# Submission time Handle Problem Language Result Execution time Memory
885716 2023-12-10T14:33:59 Z Ninedesu Pilot (NOI19_pilot) C++14
0 / 100
21 ms 3676 KB
#include<bits/stdc++.h>
#define ll long long
using namespace std;

const int N=1e6+1;
int n,q;
int arr[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;
        ll ans=0,cnt=0;
        cin >> h;
        // for(int i=1; i<=n; i++){
        //     if(arr[i]<h+1)cnt++;
        //     if(arr[i]>=h+1||i==n){
        //         ans+=(cnt*(cnt+1))/2;
        //         cnt=0;
        //     }
        // }
        cout << (h*(h+1))/2 << '\n';
    }

    return 0;
}

Compilation message

pilot.cpp: In function 'int main()':
pilot.cpp:17:12: warning: unused variable 'ans' [-Wunused-variable]
   17 |         ll ans=0,cnt=0;
      |            ^~~
pilot.cpp:17:18: warning: unused variable 'cnt' [-Wunused-variable]
   17 |         ll ans=0,cnt=0;
      |                  ^~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 504 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 504 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 504 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 504 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 2648 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 3676 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 21 ms 3676 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 504 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 504 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 504 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Halted 0 ms 0 KB -