제출 #259838

#제출 시각아이디문제언어결과실행 시간메모리
259838srj곤돌라 (IOI14_gondola)C++14
20 / 100
59 ms5496 KiB
#include "gondola.h"
#include<bits/stdc++.h>
using namespace std;

int valid(int n, int inputSeq[])
{
	map<int,int> pos;
  for(int i =0;i<n;i++){
  		if(pos.find(inputSeq[i])!=pos.end())
  			return 0;	
  			pos[inputSeq[i]] = i;
  }
  int sortSeq[n];
  memcpy(sortSeq,inputSeq,sizeof(sortSeq));
  sort(sortSeq,sortSeq+n);
  if(sortSeq[0]>n)
  	return 1;
  int smallval = sortSeq[0];
  int cur = pos[sortSeq[0]];
  for(int i =0;i<n;i++){
  	if(inputSeq[(cur+i)%n]!=smallval+i && inputSeq[(cur+i)%n]<=n){
  		// cout << smallval << endl;
  		// cout << i << endl;
  		return 0;
  	}
  }
  return 1;
}

//----------------------

int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
  return -2;
}

//----------------------

int countReplacement(int n, int inputSeq[])
{
  return -3;
}

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

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:9:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if(pos.find(inputSeq[i])!=pos.end())
     ^~
gondola.cpp:11:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
      pos[inputSeq[i]] = i;
      ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...