답안 #960151

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
960151 2024-04-09T18:27:13 Z Nelt 곤돌라 (IOI14_gondola) C++17
컴파일 오류
0 ms 0 KB
#include <stdio.h>
#include <assert.h>
#include "gondola.h"

int gondolaSequence[100001];
int replacementSequence[250001];

int main()
{
  int i, n, tag;
  int nr; 
  assert(scanf("%d", &tag)==1);
  assert(scanf("%d", &n)==1);
  for(i=0;i< n;i++)
    assert( scanf("%d", &gondolaSequence[i]) ==1);
  
  switch (tag){
  case 1: case 2: case 3:
    printf("%d\n", valid(n, gondolaSequence));
    break;

  case 4: case 5: case 6:
    nr = replacement(n, gondolaSequence, replacementSequence);
    printf("%d ", nr);
    if (nr > 0)
      {
	for (i=0; i<nr-1; i++)
	  printf("%d ", replacementSequence[i]);
	printf("%d\n", replacementSequence[nr-1]);
      }  
    else printf("\n");
    break;

  case 7: case 8: case 9: case 10:
    printf("%d\n",  countReplacement(n, gondolaSequence));  
    break;
  }

  return 0;
}

Compilation message

/usr/bin/ld: /tmp/ccERQdNo.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccwDXeTo.o:gondola.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccERQdNo.o:(.bss+0xf4260): multiple definition of `gondolaSequence'; /tmp/ccwDXeTo.o:(.bss+0xf4260): first defined here
/usr/bin/ld: /tmp/ccERQdNo.o:(.bss+0x0): multiple definition of `replacementSequence'; /tmp/ccwDXeTo.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccwDXeTo.o: in function `main':
gondola.cpp:(.text.startup+0xb2): undefined reference to `valid'
/usr/bin/ld: gondola.cpp:(.text.startup+0x100): undefined reference to `countReplacement'
/usr/bin/ld: gondola.cpp:(.text.startup+0x115): undefined reference to `replacement'
/usr/bin/ld: /tmp/ccERQdNo.o: in function `main':
grader.cpp:(.text.startup+0xb6): undefined reference to `valid'
/usr/bin/ld: grader.cpp:(.text.startup+0x108): undefined reference to `countReplacement'
/usr/bin/ld: grader.cpp:(.text.startup+0x132): undefined reference to `replacement'
collect2: error: ld returned 1 exit status