답안 #164284

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
164284 2019-11-18T21:55:13 Z daddy0h 짝수 정렬 (tutorial3) C++11
100 / 100
4 ms 380 KB
/// https://oj.uz/problem/view/tutorial3

#include <bits/stdc++.h>
#include "grader.h"

using namespace std;

void sort_even(int N, int A[])
{
    vector<int> even;
    for(int id=0; id<N; ++id)
    {
        if(A[id] % 2 == 0) even.push_back(A[id]);
    }
    sort(even.begin(), even.end());
    
    if(even.size() == 0) return;
    else 
    {
        for(int id=0; id<even.size(); ++id)
        {
            Report(even[id]); 
        }
    }
}

Compilation message

tutorial3.cpp: In function 'void sort_even(int, int*)':
tutorial3.cpp:20:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int id=0; id<even.size(); ++id)
                       ~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 380 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 4 ms 376 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct