답안 #726068

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
726068 2023-04-18T12:18:42 Z Black_Hawk 뒤집기 (IOI16_reverse) C++17
컴파일 오류
0 ms 0 KB
#include "reverse.h"
#include "grader.cpp"

std::vector<long long> reverse(std::vector<long long> a)
{
    for (int i = 0; i < a.size()/2; i++)
    {
        long long temp = a[i];
        a[i] = a[a.size()-i-1];
        a[a.size()-i-1] = temp;
    }

	return a;
}

Compilation message

reverse.cpp: In function 'std::vector<long long int> reverse(std::vector<long long int>)':
reverse.cpp:6:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 |     for (int i = 0; i < a.size()/2; i++)
      |                     ~~^~~~~~~~~~~~
/usr/bin/ld: /tmp/ccm36JwZ.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cclojCq0.o:reverse.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status