开始计概A下半学期。

This commit is contained in:
rogerwang2008 committed 2026-11-09 21:13:09 +08:00
1 parent 0cfdc8499c
commit 38e97654e1
31 files changed
+2144 -110

No files matched your search

+33 -13
View File
@@ -1,22 +1,42 @@
#include <stdio.h>
int LINE[700000] = {0};
void test(int& a) {
a++;
}
int main() {
int number = 0, logo = 0;
scanf("%d", &number);
for (int wait_test = 1; wait_test <= number; wait_test++) {
while (logo == 0) {
int same = wait_test;
while (same >= 67) {
int a = same % 100;
if (a == 67) {
printf("%d\n", wait_test);
logo++;
break;
int i = 1;
for (int j = 1; j <= 100000; j++) {
while (LINE[j] == 0) {
int flag = 0;
int transform = i;
if (transform % 7 != 0) {
while (transform > 0) {
if (transform % 10 == 7) {
flag++;
}
transform /= 10;
}
same /= 10;
} else {
flag++;
}
if (flag == 0) {
LINE[j] = i;
i++;
} else {
i++;
}
}
logo--;
}
int group = 0;
scanf("%d", &group);
for (int z = 1; z <= group; z++) {
int input = 0;
scanf("%d", &input);
printf("%d\n", LINE[input]);
}
int val = *(LINE+5);
int a=1;
return 0;
}
+41 -43
View File
@@ -1,54 +1,52 @@
#include <algorithm>
#include <array>
#include <iostream>
#include <vector>
#include<bits/stdc++.h>
using namespace std;
constexpr int MAX_N = 1001, MAX_T = 1001;
struct Attendee {
int enter_time = 0, exit_time = 0;
struct patient {
string id;
int year;
};
int get_max_attendees_amount(std::vector<Attendee> attendees_schedule) {
std::array<int, MAX_T> bucket {};
for (const auto [enter_time, exit_time] : attendees_schedule) {
for (int t = enter_time; t < exit_time; t++) {
bucket[t]++;
}
}
return *std::max_element(bucket.begin(), bucket.end());
}
int main() {
std::iostream::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
cin >> n;
std::vector<Attendee> attendees;
char temp_comma;
int x;
while (true) {
std::cin >> x >> temp_comma;
attendees.push_back({x, -1});
if (temp_comma != ',') {
std::cin.unget();
break;
}
int num = 0, cnt = 0;
patient p[n];
patient x[n];
string young[n];
for (int i = 0; i < n; i++) {
cin >> p[i].id >> p[i].year;
x[i].id = p[i].id;
x[i].year = p[i].year;
}
for (int i = 0; i < attendees.size() - 1; i++) {
std::cin >> attendees[i].exit_time >> temp_comma;
}
std::cin >> attendees[attendees.size() - 1].exit_time;
std::cout << attendees.size() << ' ' << get_max_attendees_amount(attendees) << std::endl;
int x = 6, ans = 0;
if (x > 5)
if (x > 10) ans = 1;
for (int j = 0; j < n; j++) {
if (p[j].year >= 60)
num++;
else
ans = 2;
std::cout << ans;
young[cnt] = p[j].id;
cnt++;
}
for (int i = 0; i < n - 1; i++)
for (int j = 0; j < n - 1 - i; j++) {
int temp_year;
string temp_id;
if (x[j].year < x[j + 1].year) {
temp_year = x[j].year;
temp_id = x[j].id;
x[j].year = x[j + 1].year;
x[j].id = x[j + 1].id;
x[j + 1].year = temp_year;
x[j + 1].id = temp_id;
}
}
for (int i = 0; i < num; i++) {
cout << x[i].id << endl;
}
for (int j = 0; j < cnt; j++) {
cout << young[j] << endl;
}
return 0;
}