forked from Startlink/BOJ-spj
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spj.cpp
74 lines (74 loc) · 1.65 KB
/
spj.cpp
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
#include <cstdio>
#include <iomanip>
#include <sstream>
#include <iostream>
#include <tuple>
#include <cassert>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
char buffer[1000000];
string read_string(FILE *fp) {
assert(fscanf(fp,"%10000s",buffer)==1);
return string(buffer);
}
int read_int(FILE *fp) {
string str = read_string(fp);
int temp;
istringstream sin(str);
assert(sin >> temp);
return temp;
}
string read_line(FILE *fp) {
assert(fscanf(fp,"%10000[^\n]\n",buffer)==1);
return string(buffer);
}
long long read_long(FILE *fp) {
string str = read_string(fp);
long long temp;
istringstream sin(str);
assert(sin >> temp);
return temp;
}
float read_float(FILE *fp) {
string str = read_string(fp);
float temp;
istringstream sin(str);
assert(sin >> temp);
return temp;
}
double read_double(FILE *fp) {
string str = read_string(fp);
double temp;
istringstream sin(str);
assert(sin >> temp);
return temp;
}
void assert_eof(FILE *fp) {
assert(fscanf(fp,"%10000s",buffer)!=1);
}
void assert_int_range(int num, int start, int end) {
assert(start <= num && num <= end);
}
void assert_int(int num, int start) {
assert_int_range(num, start, start);
}
int read_int_range(FILE *fp, int start, int end) {
int num = read_int(fp);
assert_int_range(num, start, end);
return num;
}
int main(int agrc, char **agrv){
FILE *in = fopen(agrv[1],"r");
FILE *sol = fopen(agrv[2],"r");
FILE *out = fopen(agrv[3],"r");
fclose(in);
fclose(sol);
fclose(out);
return 0;
}