四大文化赛道完整展开
03-execution/run-002/source-snapshot/main.cpp
main.cpp
站内文件视图直接读取仓库内容,Markdown 使用文档排版渲染,其余文本文件保持原始排版,方便校对训练证据链。
文件类型.cpp
10-cases/s3-jh-01-trade-conversion/03-execution/run-002/source-snapshot/main.cpp
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
if (!(cin >> n)) {
return 0;
}
double total = 0.0;
string best_name;
double best_value = -1e100;
for (int i = 0; i < n; ++i) {
string name;
double amount, rate, transport;
int fee;
cin >> name >> amount >> rate >> fee >> transport;
double value = amount * rate * (100 - fee) / 100.0 - transport;
total += value;
if (value > best_value || (fabs(value - best_value) < 1e-9 && name < best_name)) {
best_name = name;
best_value = value;
}
}
cout << fixed << setprecision(2);
cout << "total_settlement=" << total << "\n";
cout << "best_item=" << best_name << ' ' << best_value << "\n";
return 0;
}