跳到正文

个人记录

NOI Linux 个人使用方式 2021

m256i约 1 分钟
原文
文章信息与版本

文章信息

发布
2023年4月7日
收录
2025年12月12日
更新
2026年10月26日
篇幅
约 1 分钟
获赞
2

版本

  1. v1当前

2021 CSP 的写题方式,个人认为比较舒服。

编辑器为 VSCode。

代码模板(部分):

C++
#ifndef NO_FREOPEN
#define FREOPEN(x) freopen(#x".in", "r", stdin); freopen(#x".out", "w", stdout);
#else
#define FREOPEN(x) freopen("in.in", "r", stdin); freopen("out.out", "w", stdout);
#endif

调试编译:function dcompile { g++ -g -DNO_FREOPEN -Wall -Wextra $1.cpp -o $1; }(注意不要忘了空格)

编译:function compile { g++ -O2 -Wall -Wextra $1.cpp -o $1; }

使用方式:dcompile test/compile test

运行:./test

(图中题目为 CSP-J 2021 T3,代码为考场代码,图里的脚本和上面给出的有一定差距)

对比:diff -Z out.out ans.ans

原文
存档评论1 条抓取于