답안 #885730

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
885730 2023-12-10T14:45:59 Z Ninedesu Pilot (NOI19_pilot) C++14
14 / 100
20 ms 4700 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--){
        ll h,ans=0,cnt=0;
        cin >> h;
        cout << min((h*(h+1))/2,((ll)n*(n+1))/2) << '\n';
    }

    return 0;
}

Compilation message

pilot.cpp: In function 'int main()':
pilot.cpp:16:14: warning: unused variable 'ans' [-Wunused-variable]
   16 |         ll h,ans=0,cnt=0;
      |              ^~~
pilot.cpp:16:20: warning: unused variable 'cnt' [-Wunused-variable]
   16 |         ll h,ans=0,cnt=0;
      |                    ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 2652 KB Output is correct
2 Correct 7 ms 2700 KB Output is correct
3 Correct 6 ms 2652 KB Output is correct
4 Correct 6 ms 2652 KB Output is correct
5 Correct 7 ms 2652 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 3676 KB Output is correct
2 Correct 20 ms 4688 KB Output is correct
3 Correct 20 ms 4696 KB Output is correct
4 Correct 20 ms 4696 KB Output is correct
5 Correct 20 ms 4700 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 19 ms 3676 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -