QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#492683#4591. Maxdifficent GroupPetroTarnavskyi#Compile Error//C++201.1kb2024-07-26 15:15:352024-07-26 15:15:35

Judging History

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

  • [2024-07-26 15:15:35]
  • 评测
  • [2024-07-26 15:15:35]
  • 提交

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 vector<LL> VL;
typedef pair<int, int> PII;
typedef double db;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n;
	cin >> n;
	VI a(n);
	FOR (i, 0, n)
		cin >> a[i];
	vector<VL> mx(4, VL(n));
	FOR (rev, 0, 2)
	{
		FOR (minus, 0, 2)
		{
			LL s = 0;
			FOR (i, 0, n)
			{
				s = max(0ll, s);
				s += a[i];
				mx[rev * 2 + minus][i] = s;
				a[i] *= -1;
			}
		}
		reverse(ALL(a));
	}
	reverse(ALL(mx[2]));
	reverse(ALL(mx[3]));
	FOR (i, 0, n)
	{
		mx[1][i] *= -1;
		mx[3][i] *= -1;
	}
	LL ans = 0;
	FOR (i, 0, n - 1)
	{
		FOR (j, 0, 4)
		{
			FOR (k, j + 1, 4)
			{
				ans = max(ans, abs(mx[j][i] - mx[k][i + 1]));
			}
		}
	}
	cout << ans << '\n';
	
	return 0;
}



fuck

Details

answer.code:71:1: error: ‘fuck’ does not name a type
   71 | fuck
      | ^~~~