Submission #575325

# Submission time Handle Problem Language Result Execution time Memory
575325 2022-06-10T08:13:28 Z SilentVisitor 짝수 정렬 (tutorial3) C++17
Compilation error
0 ms 0 KB
#include "grader.h" 
#include<bits/stdc++.h> 
using namespace std; 

#define ll long long 

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>) {
            vector<int> dp; 
            for(int i = 0; i < n; i += 1){
                 if(!(a[i] & 1)) 
                      dp.push_back(a[i]); 

            }
            sort(dp.begin(), dp.end()); 
            for(int x : dp)
                  Report(x); 
      }; 
      check(n, a); 
}
main(void) {
      ios::sync_with_stdio(0); 
      cin.tie(0); 
      cout.tie(0); 
      solve(); 
      return 0; 
}

Compilation message

tutorial3.cpp:25:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   25 | main(void) {
      | ^~~~
/usr/bin/ld: /tmp/ccuXWlKv.o: in function `main':
tutorial3.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc1Htl6s.o:grader.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc1Htl6s.o: in function `main':
grader.cpp:(.text.startup+0xb3): undefined reference to `sort_even(int, int*)'
collect2: error: ld returned 1 exit status