int main() {

  scanf("\n", &N, &M);

  for (int i=0; i<N; i++) {
    scanf("%d %d\n", &B[i], &P[i]);
  }

  prefix[0] = 0;

  for (int i=0; i<=N; i++) {
    prefix[i] = prefix[i-1] + Y[i-1];
  }

  // for (int i=0; i<=N; i++) {
  //   for (int j=0; j<=N; j++) {
  //     minscore_memo[i][j] = -1;
  //   }
  // }

  long long min_so_far = -1;
  for (int x=A; x<=B; x++) {
    min_so_far = min(min_so_far, minscore(x, N, 0), 0);
  }
  printf("%lld\n", min_so_far);

  return 0;
}
Beispiel #2
0
void rankscore(Student *stu)    //考试成绩统计
{
int type;
	do
	{
	printf("\n请输入序号选择相应功能\n");
	printf("******** 1.求课程最高分 ********\n");
	printf("******** 2.求课程最低分 ********\n");
	printf("******** 3.求课程平均分 ********\n");
	printf("******** 0.退出         ********\n");
		scanf("%d",&type);
	    switch(type)
		{
		case 0:printf("");break;
		case 1:maxscore(stu);break;
		case 2:minscore(stu);break;
		case 3:avescore(stu);break;
		default:printf("没有该选项,请重输");break;
		}
	}while(type!=0);
}