답안 #575321

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
575321 2022-06-10T08:06:04 Z SilentVisitor 짝수 정렬 (tutorial3) C++17
컴파일 오류
0 ms 0 KB
/*
     author : SilentVisitor; 
     created on 12.01.22 12.52 A.M. 
*/ 
#include<bits/stdc++.h> 
#include "grader.h"
using namespace std;                                               
#ifdef _DEBUG 
#include "algo/debug.h" 
#else
#define debug(...) 69420 
#endif
#define deb(...) union 

#define ll long long
#define i64 ll64_t 

#define ff first 
#define ss second

#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define sz(s) s.size()
vector<char> data = {'a', 'e', 'i', 'o', 'u'}; 
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T> bool ckmin(T& a, const T& b) { return a > b ? a = b, 1 : 0; }

void solve(){
       int n; 
       cin >> n; 
       vector<int> a(n, 0); 
       for(auto &x : a) cin >> x; 
       function<void(int, vector<int>)> check = [&](int n, vector<int> a) {
            vector<int> dp; 
            for(int i = 0; i < n; i += 1){
                  if(!(a[i] & 1))
                       dp.push_back(a[i]);
                  sort(all(dp)); 
            }
            for(int x : dp) 
                cout << x << ' '; 
            cout << '\n';
       }; 
       check(n, a); 
}
int main(void){
       ios::sync_with_stdio(false); 
       cin.tie(0); 
       cout.tie(0);
       solve(); 
       return 0; 
}

Compilation message

/usr/bin/ld: /tmp/ccYbwegf.o: in function `main':
tutorial3.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccDFPYte.o:grader.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccDFPYte.o: in function `main':
grader.cpp:(.text.startup+0xb3): undefined reference to `sort_even(int, int*)'
collect2: error: ld returned 1 exit status