제출 #339364

#제출 시각아이디문제언어결과실행 시간메모리
339364KerimArranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h"
s#include "shoes.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x)  cerr<< #x <<" = "<< x<<endl;
using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
using namespace std;
int vis[MAXN];
long long count_swaps(std::vector<int> s) {
	int n=s.size(),ans=0;
	for(int i=0;i<n;i++){
		if(vis[i])continue;
		for(int j=i+1;j<n;j++)
			if(!vis[j] and s[i]==-s[j]){
				ans+=(s[i]>s[j]);
				vis[j]=1;
				ans+=j-i-1;
				for(int k=i+1;k<j;k++)ans+=vis[k];
				//cout<<s[i]<<" "<<s[j]<<" "<<ans<<endl;
				break;
			}
	}
	return ans;
}
/*
int main() {
	freopen("file.in","r",stdin);
	int n;
	assert(1 == scanf("%d", &n));
	vector<int> S(2 * n);
	for (int i = 0; i < 2 * n; i++)
		assert(1 == scanf("%d", &S[i]));

	long long result = count_swaps(S);

	printf("%lld\n", result);
	return 0;
}*/

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

shoes.cpp:2:2: error: stray '#' in program
    2 | s#include "shoes.h"
      |  ^
shoes.cpp:2:1: error: 's' does not name a type; did you mean 'ss'?
    2 | s#include "shoes.h"
      | ^
      | ss
shoes.cpp:18:9: error: 'pair' does not name a type
   18 | typedef pair<int,int> PII;
      |         ^~~~