제출 #1215785

#제출 시각아이디문제언어결과실행 시간메모리
1215785baliArranging Shoes (IOI19_shoes)C++20
컴파일 에러
0 ms0 KiB
#include "shoes.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

long long count_swaps(std::vector<int> s) {
	vector<int> h;
	for(ll i=0; i<s.size(); i++)
	{
		if(s[i]<0)
		{
			h.push_back(s[i]);
		}
	}
	sort(h.begin(),h.end());
	
	ll cmin=LLONG_MAX;
	do
	{   
		vector<int> h2;
		for(ll i=0; i<h.size(); i++)
		{
			h2.push_back(h[i]);
			h2.push_back(-h[i]);
		}
		ll c=0;
		for(ll i=0; i<s.size(); i++)
		{
		for(ll j=h2.size()-1; j>i; j--)
		{
			if(s[i]==h2[j]){swap(h2[j], h2[j-1]);c++;}
		}
		}
		cmin=min(cmin,c);
	} while((next_permutation(s.begin(),s.end())));
	return cmin;
}#include "shoes.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

long long count_swapsmy(std::vector<int> s) {
	vector<int> h;
	for(ll i=0; i<s.size(); i++)
	{
		if(s[i]<0)
		{
			h.push_back(s[i]);
		}
	}
	sort(h.begin(),h.end());
	
	ll cmin=LLONG_MAX;
	do
	{   
		vector<int> h2;
		for(ll i=0; i<h.size(); i++)
		{
			h2.push_back(h[i]);
			h2.push_back(-h[i]);
		}
		ll c=0;
		for(ll i=0; i<s.size(); i++)
		{
		for(ll j=h2.size()-1; j>i; j--)
		{
			if(s[i]==h2[j]){swap(h2[j], h2[j-1]);c++;}
		}
		}
		cmin=min(cmin,c);
	} while((next_permutation(s.begin(),s.end())));
	return cmin;
}

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

shoes.cpp:37:2: error: stray '#' in program
   37 | }#include "shoes.h"
      |  ^
shoes.cpp:37:3: error: 'include' does not name a type
   37 | }#include "shoes.h"
      |   ^~~~~~~