QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#116816#149. Peruabs998244353#Compile Error//C++17445b2023-06-30 08:49:282024-05-31 18:30:10

Judging History

你现在查看的是测评时间为 2024-05-31 18:30:10 的历史记录

  • [2024-09-10 16:33:53]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:0ms
  • 内存:5568kb
  • [2024-05-31 18:30:10]
  • 评测
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-30 08:49:28]
  • 提交

answer

#include "peru.h"
#include <cstdio>
typedef long long ll;
const ll INF=0x3f3f3f3f3f3f3f3f;
const int N=2500003;
const int P=1000000007;
int s[N];
ll f[N];
int solve(int n,int k,int* _s){
	for(int i=1;i<=n;++i) s[i]=_s[i-1];
	int res=0;
	for(int i=1;i<=n;++i){
		ll mx=s[i];
		f[i]=INF;
		for(int j=i-1;j>=i-k;--j){
			if(s[j]>mx) mx=s[j];
			if(f[j]+mx<f[i]) f[i]=f[j]+mx;
		}
		res=(res*23ll+f[i])%P;
	}
    return res;
}

詳細信息

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;
      |                          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~