社区讨论

关于 CSP

P1421小玉买文具参与者 6已保存回复 12

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
12 条
当前快照
1 份
快照标识符
@mhizwngt
此快照首次捕获于
2025/11/03 18:26
4 个月前
此快照最后确认于
2025/11/03 20:27
4 个月前
查看原帖
  1. 如果真的用了 #define int long long 会不会出问题。
  2. 比如说这份代码:
CPP
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
signed main(){
	freopen("s.in","r",stdin);
	freopen("s.out","w",stdout);
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>n;
	return 0;
}
为什么显示:
CPP
terminate called after throwing an instance of 'std::ios_base::failure'
  what():  basic_filebuf::underflow error reading the file
  1. 怎么测大样例呀,比如我下载完了一个大样例 s1.in 一般不都是这么些的吗:
CPP
#include<bits/stdc++.h>
#define int long long
using namespace std;

signed main(){
	freopen("s.in","r",stdin);
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	...
	cout<<...;
	return 0;
}
为什么这么写没有输出呀?就是编译完后运行一会就没输出就停止了。
  1. 如果大样例输出很多,该怎么对比是否和标准答案一样?
  2. 有没有显示程序运行时间和空间的代码。

回复

12 条回复,欢迎继续交流。

正在加载回复...