各類非算法模板

無限棧:linux

-Wl,--stack=998244353

lemon SPJ:c++

 1 #include <bits/stdc++.h>
 2 
 3 using namespace std;
 4 
 5 ifstream fin,fout,fstd;
 6 ofstream fscore,freport;
 7 // 注意定義
 8 
 9 double judge()
10 {
11     /*
12     關於讀入與輸出:與cin/cout相似
13     Eg.
14         fin >> x; //從輸入文件裏讀入x
15         freport << "too young too simple sometimes naive."; //提示錯因
16     */
17 
18     freport << "AC";
19     return 1;
20 }
21 
22 int main(int argc, char *argv[])
23 {
24     fin.open(argv[1]);
25     fout.open(argv[2]);
26     fstd.open(argv[3]);
27     fscore.open(argv[5]);
28     freport.open(argv[6]);
29 
30     int score = atoi(argv[4]);
31     fscore << score * judge() << endl;
32 
33     fin.close();
34     fout.close();
35     fstd.close();
36     fscore.close();
37     freport.close();
38     return 0;
39 }

要麼放在data下,要麼在lemon的裏面加上文件夾前綴,形如 D1T1\spj.exebash

linux對拍:後綴是.sh,運行命令是 sh ***.sh
dom

#!/bin/bash
while true; do
    ./make
    ./my
    ./right
    if diff my.out right.out; then
        printf "AC "
    else 
        printf "WA\n"
        exit 0
    fi
done

fread:更快的快讀(只能讀文件)ui

inline char gc() {
    static char *p1, *p2, s[N];
    if(p1 == p2) p2 = (p1 = s) + fread(s, 1, N, stdin);
    return (p1 == p2) ? EOF : *p1++;
}
template <class T> inline void read(T &x) { x = 0; char c = gc();
bool f = 0;
while(c < '0' || c > '9') {
if(c == '-') f = 1;
c = gc();
}
while(c >= '0' && c <= '9') { x = x * 10 + c - 48; c = gc(); }
if(f) x = (~x) + 1;
return; }

代碼標準開頭:this

/**
 * There is no end though there is a start in space. ---Infinity.
 * It has own power, it ruins, and it goes though there is a start also in the star. ---Finite.
 * Only the person who was wisdom can read the most foolish one from the history.
 * The fish that lives in the sea doesn't know the world in the land.
 * It also ruins and goes if they have wisdom.
 * It is funnier that man exceeds the speed of light than fish start living in the land.
 * It can be said that this is an final ultimatum from the god to the people who can fight.
 *
 * Steins;Gate
 */
相關文章
相關標籤/搜索