-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoj-prepare-template
85 lines (77 loc) · 2.26 KB
/
oj-prepare-template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<%!
import json
import os
import platform
import shutil
from logging import getLogger
import onlinejudge_template.generator.cplusplus as cplusplus
import onlinejudge_template.generator.topcoder as topcoder
import onlinejudge_template.generator.about as about
import onlinejudge_template.generator.hook as hook
%>\
<%
data['config']['scanner'] = 'scanf'
data['config']['printer'] = 'printf'
logger = getLogger(__name__)
# if not shutil.which("clang-format"):
# logger.warning("clang-format is not installed. If you want to generate well-formatted code, please install it. If you use Ubuntu, you can run $ sudo apt install clang-format")
# else:
# format_config = {
# "BasedOnStyle": "Google",
# "IndentWidth": 4,
# "ColumnLimit": 9999,
# "ForEachMacros": ["ALL"],
# }
# hook.register_filter_command(["clang-format", "--style", json.dumps(format_config)], data=data)
%>\
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
#define ALL(v) (v).begin(), (v).end()
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD_1000000007 = 1000000007LL;
const ll MOD_998244353 = 998244353LL;
// generated by ${about.title} ${about.version} (${about.url})
${cplusplus.declare_constants(data)}
% if topcoder.is_topcoder(data):
<% solve_function = topcoder.class_name(data) + "()." + topcoder.method_name(data) %>\
class ${topcoder.class_name(data)} {
public:
};
% else:
int main() {
return 0;
}
% endif