제출 #477926

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4779262021-10-04 15:51:32victoriadArranging Shoes (IOI19_shoes)C++14
컴파일 에러
0 ms0 KiB
#include <vector>
#include <queue>
#include <cmath>
#include <algorithm>
#include <utility>
#include <iostream>
using namespace std;
int hi(int p){
return p<<1;
}
int hd(int p){
return (p<<1)+1;
}
void f(int n,vector<int>&a){
a[n]=a[hi(n)]+a[hd(n)];
}
void build(vector<int>&l,vector<int>&a,int n,int L,int R){
if(L<R){
int mid=L+(R-L)/2;
build(l,a,hi(n),L,mid);
build(l,a,hd(n),mid+1,R);
f(n,a);
}
else{
a[n]=l[L];
}
}
void pop(vector<int>&a,vector<int>&v,int n,int L,int R){
if(L!=R){
a[hd(n)]+=v[n];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:70:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   70 | for(int i=0;i<S.size();i++)n=max(S[i],n);
      |             ~^~~~~~~~~
shoes.cpp:75:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   75 | for(int i=0;i<S.size();i++){
      |             ~^~~~~~~~~
/usr/bin/ld: /tmp/ccH1MBPN.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccoD5fSN.o:shoes.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status