ACGO欢乐赛T1~T6题解
2025-10-26 11:26:15
发布于:上海
T1
t, x, y, z = map(int, input().split())
file_size_mb = (x * y // 8 * z * t) / (1024 * 1024)
print("{0:.4f}".format(file_size_mb))
T2
n = int(input())
a = list(map(int, input().split()))
x, y = map(int, input().split())
wait_time = sum(a[x-1 : y-1])
print(wait_time)
T3
n = int(input())
s = input()
for student_id in range(1, n + 1):
st = input()
errors = []
max_len = max(len(s), len(st))
for pos in range(1, max_len + 1):
idx = pos - 1
if idx >= len(st):
errors.append(str(pos))
elif idx >= len(s):
errors.append(str(pos))
elif st[idx] != s[idx]:
errors.append(str(pos))
if errors:
print(f"{student_id} {' '.join(errors)}")
T4
def is_possible(k, n, m, t, x, y):
bomb_events = []
T_bomb = ((t + 11) // 12) * 12
bomb_time = 12
while bomb_time <= T_bomb:
bomb_events.append(bomb_time)
bomb_time += 12
repair_events = []
T_repair = ((t + 9) // 10) * 10
repair_time = 10
while repair_time <= T_repair:
repair_events.append(repair_time)
repair_time += 10
events = []
for t_b in bomb_events:
events.append((t_b, 'bomb'))
for t_r in repair_events:
events.append((t_r, 'repair'))
events.sort(key=lambda x: (x[0], 0 if x[1] == 'bomb' else 1))
current_armor = m
for time, typ in events:
if typ == 'bomb':
damage = 4 * n * x
current_armor -= damage
if current_armor <= 0:
return False
else:
repair = k * y
current_armor = min(current_armor + repair, m)
return current_armor > 0
def main():
n, m, t = map(int, input().split())
x, y = map(int, input().split())
if y == 0:
T_bomb = ((t + 11) // 12) * 12
num_bombs = T_bomb // 12
total_damage = num_bombs * 4 * n * x
if total_damage < m:
print(0)
else:
print(-1)
return
low = 0
high = 10**18
answer = -1
while low <= high:
mid = (low + high) // 2
if is_possible(mid, n, m, t, x, y):
answer = mid
high = mid - 1
else:
low = mid + 1
print(answer if answer != -1 else -1)
if __name__ == "__main__":
main()
T5
n, m = map(int, input().split())
students = {}
for _ in range(m):
x, y, a, b, c = map(int, input().split())
if y not in students:
students[y] = [0, 0, 0]
students[y][0] += a
students[y][1] += b
students[y][2] += c
result = []
for y in students:
a_total, b_total, c_total = students[y]
total = (a_total * 4 + b_total * 4 + c_total * 2) / 10.0
result.append((-total, y))
result.sort()
for item in result:
total = -item[0]
if total.is_integer():
print(f"{item[1]} {int(total)}")
else:
print(f"{item[1]} {total}")
T6
#include<bits/stdc++.h>
#define int long long
using namespace std;
int in[5], out[5];
int num[5]; //工厂数量
int w[5]; //上一次开工数量
int ans[5];
void f(int x) { //x级工厂 获取上一次的结果 并且再次开工
//采集
ans[x] += w[x] * out[x];
if(x == 0) w[x] = num[x];
else {
w[x] = min(num[x], ans[x - 1] / in[x]);
ans[x - 1] -= w[x] * in[x];
}
return;
}
signed main() {
int t;
cin >> t;
for(int i = 0; i < 5; i++) {
if(i) cin >> in[i];
cin >> out[i];
}
for(int i = 0; i< 5; i++) cin >> num[i];
for(int i = 1; i <= t + 1; i++) {
for(int j = 0; j < 5; j++) f(j);
if(i <= t) {
f(0);
f(0); f(1);
f(0);
}
}
for(int i = 0; i < 5; i++) cout << ans[i] << ' ';
return 0;
}
全部评论 3
AI哥别叫了
2025-11-22 来自 云南
2从T1就开始AI,你是这个👍
2025-11-22 来自 云南
0
哇还有AI大佬吗这么牛逼
2025-11-22 来自 浙江
0不不不,他是AI专业的,专门调教AI,然后考试用AI被肘飞了
2025-11-22 来自 云南
1
ber你这T4……
2025-10-23 来自 江西
0哈哈哈,不小心搞复杂了
2025-10-23 来自 江苏
0o
2025-10-23 来自 江西
0人话:忘改变量名了
2025-11-22 来自 浙江
1





















有帮助,赞一个