QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#143002 | #149. Peru | penguinman# | Compile Error | / | / | C++17 | 1018b | 2023-08-20 10:54:12 | 2024-07-04 01:49:45 |
Judging History
你现在查看的是测评时间为 2024-07-04 01:49:45 的历史记录
- [2024-07-04 01:49:45]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-08-20 10:54:12]
- 提交
answer
#include "peru.h"
#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::string;
using ll = long long;
using vi = vector<ll>;
using vii = vector<vi>;
using pii = std::pair<ll,ll>;
#define ln "\n"
#define pb emplace_back
#define mp std::make_pair
#define mtp std::make_tuple
#define rep(i,j,k) for(ll i=ll(j); i<ll(k); i++)
#define REP(i,j,k) for(ll i=ll(j); i<=ll(k); i++)
#define per(i,j,k) for(ll i=ll(j); i>=ll(k); i--)
#define all(a) a.begin(),a.end()
constexpr ll inf = (1ll<<60);
constexpr ll mod = 1e9+7;
constexpr ll mul = 23;
int solve(int n, int k, int* v){
assert(n <= 2000);
vi dp(n+1, inf);
dp[0] = 0;
rep(i,0,n){
ll max = 0;
per(j,i,std::max(0ll, i-k+1)){
max = std::max(max, ll(v[j]));
dp[i+1] = std::min(dp[i+1], dp[j]+max);
}
}
ll ret = 0;
rep(i,0,n){
ret = ret*mul+dp[i+1];
ret %= mod;
}
return ret;
}
詳細信息
implementer.cpp: In function ‘int main()’: implementer.cpp:34:13: error: ‘fout’ was not declared in this scope; did you mean ‘out’? 34 | fprintf(fout, "%d\n", sol); | ^~~~ | out implementer.cpp: In function ‘char nextch()’: implementer.cpp:15:31: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | if (pos == BUF_SIZE) fread(buf, BUF_SIZE, 1, fin), pos = 0; | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~