답안 #13473

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
13473 2015-02-21T07:28:25 Z drcotr0623 공주님의 정원 (KOI11_flower) C++
컴파일 오류
0 ms 0 KB
#include<stdio.h>
#include<vector>
using namespace std;

typedef struct day{
  int fd;
  int ld;
}day;

day data[100000];

int n, i, j, fd=60, ld=335, count, t1, t2, t3, t4;

int change(int x, int y){
  if(x==1)  return y;
  else if(x==2)	return 31+y;
  else if(x==3)	return 59+y;
  else if(x==4)	return 90+y;
  else if(x==5)	return 120+y;
  else if(x==6)	return 151+y;
  else if(x==7)	return 181+y;
  else if(x==8)	return 212+y;
  else if(x==9)	return 243+y;
  else if(x==10)	return 273+y;
  else if(x==11)	return 304+y;
  else	return 334+y;
}

void mSort(int x, int y){
  if(x>=y)	return;
  int chk1=x, chk2=(x+y)/2+1;
  vector<day> vc;
  mSort(x, (x+y)/2);
  mSort((x+y)/2+1, y);
  while(chk1<=(x+y)/2 && chk2<=y){
    if(data[chk1].fd<data[chk2].fd){
      vc.push_back(data[chk1]);
      chk1++;
    }
    else if(){
      if(data[chk1].ld>data[chk2].ld){
        vc.push_back(data[chk1]);
        chk1++;
      }
      else{
        vc.push_back(data[chk2]);
        chk2++;
      }
    }
    else{
      vc.push_back(data[chk2]);
      chk2++;
    }
  }
  if(chk1==(x+y)/2+1){
    
  }
}

int main(){
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%d %d %d %d", &t1, &t2, &t3, &t4);
    data[i].fd=change(t1, t2);
    data[i].ld=change(t3, t4);
  }
  mSort(0, n-1);
  while(fd<ld){
    for(i=0;i<n;i++){
      
      count++;
      break;
    }
  }
}

Compilation message

flower.cpp: In function ‘void mSort(int, int)’:
flower.cpp:40:13: error: expected primary-expression before ‘)’ token
     else if(){
             ^
flower.cpp: In function ‘int main()’:
flower.cpp:61:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &n);
                  ^
flower.cpp:63:45: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d %d %d", &t1, &t2, &t3, &t4);
                                             ^