Skip to content

Commit 594c93b

Browse files
author
kumachan-mis
committed
validatorとtester解を追加しました
1 parent 84b2a1c commit 594c93b

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

gpajanken/cpp-kumachan/SOLUTION

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
3+
## Solution
4+
#c_solution(src='main.c') # -lm -O2 as default
5+
cxx_solution(src='main.cpp', flags=[]) # -std=c++11 -O2 as default
6+
#java_solution(src='Main.java', encoding='UTF-8', mainclass='Main', challenge_cases=[])
7+
#java_solution(src='Main.java', encoding='UTF-8', mainclass='Main', challenge_cases=['10_corner*.in'])
8+
#script_solution(src='main.sh') # shebang line is required
9+
#script_solution(src='main.pl') # shebang line is required
10+
#script_solution(src='main.py') # shebang line is required
11+
#script_solution(src='main.rb') # shebang line is required
12+
#js_solution(src='main.js') # javascript (nodejs)
13+
#hs_solution(src='main.hs') # haskell (stack + ghc)
14+
#cs_solution(src='main.cs') # C# (mono)
15+
16+
## Score
17+
#expected_score(100)

gpajanken/cpp-kumachan/main.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include <iostream>
2+
#include <string>
3+
4+
using namespace std;
5+
6+
void GLprint(int A, int B, string greater, string equal, string less){
7+
if(A > B){
8+
cout << greater << endl;
9+
}else if(A == B){
10+
cout << equal << endl;
11+
}else{
12+
cout << less << endl;
13+
}
14+
}
15+
16+
int main(){
17+
int T;
18+
cin >> T;
19+
20+
int A, B;
21+
for(int t = 0; t < T; ++t){
22+
cin >> A >> B;
23+
GLprint(A, B, "KATO", "DRAW", "SATO");
24+
}
25+
26+
return 0;
27+
}

gpajanken/validator.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include "testlib.h"
2+
#include "constraints.h"
3+
#include <iostream>
4+
using namespace std;
5+
6+
void check_case(){
7+
int a = inf.readInt(-MAX_AB, MAX_AB, "A");
8+
inf.readSpace();
9+
int b = inf.readInt(-MAX_AB, MAX_AB, "B");
10+
inf.readEoln();
11+
}
12+
13+
int main(){
14+
registerValidation();
15+
16+
int cases = inf.readInt(1, MAX_T, "cases");
17+
inf.readEoln();
18+
19+
for(int i=0; i<cases; ++i){
20+
check_case();
21+
}
22+
23+
inf.readEof();
24+
return 0;
25+
}

0 commit comments

Comments
 (0)