답안 #1109705

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1109705 2024-11-07T10:49:57 Z KindaGoodGames Global Warming (CEOI18_glo) C++14
10 / 100
63 ms 2500 KB
//11:48

#include<bits/stdc++.h>

#define ll long long
#define pii pair<int,int>
#define tiii tuple<int,int,int>

using namespace std;


int main(){
    int n, x;
    cin >> n >> x;

    vector<int> arr(n);
    for(int i = 0; i < n; i++ ){
        cin >> arr[i];
    }

    vector<int> dp;
    for(int i = 0; i < n; i++){
        auto it = lower_bound(dp.begin(),dp.end(),arr[i]) - dp.begin();

        if(it >= dp.size()) {
            dp.push_back(arr[i]);
        }else{
            dp[it] = arr[i];
        }
    }

    cout << dp.size() << endl;
}

Compilation message

glo.cpp: In function 'int main()':
glo.cpp:25:15: warning: comparison of integer expressions of different signedness: 'long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |         if(it >= dp.size()) {
      |            ~~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 63 ms 1220 KB Output is correct
2 Correct 62 ms 1204 KB Output is correct
3 Correct 58 ms 2304 KB Output is correct
4 Correct 57 ms 1216 KB Output is correct
5 Correct 40 ms 2500 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 632 KB Output is correct
2 Correct 14 ms 1116 KB Output is correct
3 Correct 15 ms 1104 KB Output is correct
4 Incorrect 9 ms 848 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 28 ms 1584 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -