QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#100483#5561. Improving ITPetroTarnavskyi#Compile Error//C++171.0kb2023-04-26 16:04:542023-04-26 16:04:56

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-26 16:04:56]
  • 评测
  • [2023-04-26 16:04:54]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

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

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

const LL LINF = 1e18;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, m;
	cin >> n >> m;
	vector<LL> dp(n + 2, LINF);
	FOR(i, 1, min(SZ(dp), m + 1)) {
		dp[i] = 0;
	}
	FOR(i, 1, n + 1) {
		int cost;
		cin >> cost;
		dp[i] += cost;
		FOR(j, 1, min(m, n - i + 1) + 1) {
			int c;
			cin >> c;
			dp[i + j] = min(dp[i + j], dp[i] - c);
			if (i + j == 5 && dp[i] - c == -100) {
				cerr << i << " " << j << " " << dp[i] << " " << c << endl;
			}
		}
	}
	FOR(i, 1, n + 2) {
		cerr << dp[i] << " ";
	}
	cerr << endl;
	cout << dp[n + 1] << "\n";
	return 0;
}
3 2 1200 1300
1000 700 1200 600 -100 
-100

Details

answer.code:49:1: error: expected unqualified-id before numeric constant
   49 | 3 2 1200 1300
      | ^