QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#346042#3195. Within Arm's ReachPetroTarnavskyi#Compile Error//C++20818b2024-03-07 19:59:102024-03-07 19:59:14

Judging History

你现在查看的是最新测评结果

  • [2024-03-07 19:59:14]
  • 评测
  • [2024-03-07 19:59:10]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;

db calc(vector<db> p)
{
	db res = 2 * p[0] * p[1] * p[2];
	FOR(i, 0, 3)
		FOR(j, 0, 3)
			if(j != i)
				res += p[i] * p[j] * p[j];
	return res;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	
	cout << calc({0.3333, 0.3333, 0.3333}) << "\n";
	cout << calc({0.4641, 0.26795, 0.26795}) << "\n";
	
	0.2962074163
	0.2871873108
	
	return 0;
	
}

Details

answer.code: In function ‘int main()’:
answer.code:38:21: error: expected ‘;’ before numeric constant
   38 |         0.2962074163
      |                     ^
      |                     ;
   39 |         0.2871873108
      |         ~~~~~~~~~~~~