跳到正文

题解

题解:P10862 [HBCPC2024] Spicy or Grilled?

xuchenxi约 1 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年5月24日
篇幅
约 1 分钟
获赞
1
题目
P10862

版本

  1. v1当前

P10862题解

题目传送门

看到是英语题目之后一脸懵,然后直接看了题解看了一眼样例解释就明白了。

输入 nn 是所有汉堡总数,xx 是Grilled汉堡总数,aa 是Spicy汉堡价格,bb 是Grilled汉堡价格。

输出总价。

思路简单就不解释了。

AC Code 我知道你们只看这

C++
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int a,b,c,d;
		cin>>a>>b>>c>>d;
		cout<<(a-b)*c+b*d<<"\n";
	}
	return 0;
}

END

原文