社区讨论
求助 编译错误
学术版参与者 4已保存回复 4
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 4 条
- 当前快照
- 1 份
- 快照标识符
- @lo8pewf4
- 此快照首次捕获于
- 2023/10/27 22:23 2 年前
- 此快照最后确认于
- 2023/10/27 22:23 2 年前
代码:
CPP#include<bits/stdc++.h>
using namespace std;
int mp[1005][1005], f[1005][1005][1005];
int main()
{
memset(f, 0x81, sizeof f);
int n, m;
cin>>n>>m;
for(int i=1; i<=n; i++) {
for(int j=1; j<=m; j++) {
cin>>mp[i][j];
}
}
for(int k=0; k<=1; k++) {//k=0往上 k=1从往下
for(int i=1; i<=n; i++) {
for(int j=1; j<=m; j++) {
f[i][j][k] = max(f[i-1][j][1], max(f[i][j-1][1], f[i][j+1][0]))+mp[i][j];
}
}
}
int ans = max(f[n][m][0], f[n][m][1]);
cout<<ans;
return 0;
}
错误信息(IDE):
No valid executable file was produced by the compiler
./cculP5nW.o: in function
__static_initialization_and_destruction_0(int, int)': src:(.text+0x285): relocation truncated to fit: R_X86_64_PC32 against .bss'
src:(.text+0x29e): relocation truncated to fit: R_X86_64_PC32 against `.bss'
collect2: 错误:ld 返回 1沦落到编译错误都不会改的地步了,,,
回复
共 4 条回复,欢迎继续交流。
正在加载回复...