restructure zeta/** to storage/zeta/**

This commit is contained in:
2025-05-10 21:54:24 +09:00
parent 2886820691
commit 2f2e0759fd
407 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
#include <stdbool.h>
#include <stdio.h>
typedef struct TitleCondition {
char title[12];
int condition;
} TitleCondition;
TitleCondition total[100000];
int N, M;
// tc[i-1] < x <= tc[i]일 때, tc[i]
TitleCondition *get_title(int x) {
int start = -1, end = N;
int mid;
while (start + 1 < end) {
mid = (start + end) / 2;
if (total[mid].condition < x) {
start = mid;
} else {
end = mid;
}
}
return total + end;
}
int main() {
scanf("%d %d", &N, &M);
for (int i = 0; i < N; i++) {
scanf("%s %d", &total[i].title, &total[i].condition);
}
int temp;
for (int i = 0; i < M; i++) {
scanf("%d", &temp);
printf("%s\n", get_title(temp)->title);
}
return 0;
}