#include #include struct mati { int no; int Y; int M; }; struct keiro { int S; int T; int Y; int M; }; int main() { int N, C, V, i; struct keiro *keiro; scanf("%d", &N); scanf("%d", &C); scanf("%d", &V); keiro = (struct keiro*)malloc(sizeof(struct keiro)*V); for (i=0; i= 0) { if (mati[mati_top].M < jikan) { jikan = mati[mati_top].M; } } mati_top--; while (1) { work_top--; if (work_top == -1) { break; } else { if (work[work_top].S < work[work_top+1].S) { mati_top--; continue; } else { break; } } } } else { check = 0; for (i=0; i