Skip to content

Commit 5bdb0d0

Browse files
authored
Merge pull request #37 from tossy310/dayama/gpajanken
reopen dayama/gpajanken
2 parents e91abae + 3e4a0de commit 5bdb0d0

File tree

7 files changed

+132
-5
lines changed

7 files changed

+132
-5
lines changed

gpajanken/cpp-kumachan/SOLUTION

+17
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

+27
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/cpp-ryoissy/SOLUTION

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
3+
## Solution
4+
#c_solution(src='main.c') # -lm -O2 as default
5+
cxx_solution(src='ryoissy-gpajanken.cpp', flags=[]) # -std=c++11 -O2 as default
6+
#java_solution(src='Main.java', encoding='UTF-8', mainclass='Main')
7+
#java_solution(src='Main.java', encoding='UTF-8', mainclass='Main', challenge_cases=[])
8+
#java_solution(src='Main.java', encoding='UTF-8', mainclass='Main', challenge_cases=['10_corner*.in'])
9+
#script_solution(src='main.sh') # shebang line is required
10+
#script_solution(src='main.pl') # shebang line is required
11+
#script_solution(src='main.py') # shebang line is required
12+
#script_solution(src='main.rb') # shebang line is required
13+
#js_solution(src='main.js') # javascript (nodejs)
14+
#hs_solution(src='main.hs') # haskell (stack + ghc)
15+
#cs_solution(src='main.cs') # C# (mono)
16+
17+
## Score
18+
#expected_score(100)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <bits/stdc++.h>
2+
#define MOD 1000000007LL
3+
using namespace std;
4+
typedef long long ll;
5+
typedef pair<int,int> P;
6+
7+
void solve(){
8+
int a,b;
9+
scanf("%d%d",&a,&b);
10+
if(a<b)printf("SATO\n");
11+
if(a>b)printf("KATO\n");
12+
if(a==b)printf("DRAW\n");
13+
}
14+
15+
int main(void){
16+
int t;
17+
scanf("%d",&t);
18+
for(int i=0;i<t;i++){
19+
solve();
20+
}
21+
return 0;
22+
}

gpajanken/java-tossy/GPAJanken.java

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import java.util.Scanner;
2+
3+
public class GPAJanken {
4+
static final String win_a = "KATO";
5+
static final String win_b = "SATO";
6+
static final String draw = "DRAW";
7+
8+
public static void main(final String[] args) {
9+
final Scanner sc = new Scanner(System.in);
10+
final int n = sc.nextInt();
11+
12+
for(int i=0; i<n; i++) {
13+
final int a = sc.nextInt();
14+
final int b = sc.nextInt();
15+
16+
final String ans;
17+
if (a > b) ans = win_a;
18+
else if (a < b) ans = win_b;
19+
else ans = draw;
20+
21+
System.out.println(ans);
22+
}
23+
sc.close();
24+
}
25+
}

gpajanken/java-tossy/SOLUTION

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

gpajanken/statement.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ GPA JANKENとは
33
「じゃんけんをして、じゃんけんの結果に関わらずGPAが高い方が問答無用で勝ち」
44
というルールのゲームです。
55
GPAが同じ場合引き分けになります。
6-
(ここでいうGPAとはGanbari Point Accumulateの略で、0から4のいずれかの整数です)
6+
(ここでいうGPAとはGanbari Point Accumulateの略で、0から4のいずれかの整数です
77

88
カトー君とサトー君がGPA JANKENをしました。
99
カトー君のGPAは$A$、サトー君のGPAは$B$です。
1010
カトー君が勝った場合`KATO`、サトー君が勝った場合`SATO`、引き分けの場合`DRAW`と出力してください。
1111

1212
# Constraints
13-
$0 \leq A \leq 4$
14-
$0 \leq B \leq 4$
15-
$A,\ B$は整数
13+
- $0 \leq A \leq 4$
14+
- $0 \leq B \leq 4$
15+
- $A$ $B$は整数
1616

1717
# Input
1818
1つの入力ファイルは複数のテストケースからなる。
@@ -22,7 +22,7 @@ $A,\ B$は整数
2222
2行目以降には、$T$個のテストケースが記述されており、各テストケースは次の形式で表される。
2323

2424
```
25-
$A\ B$
25+
$A$ $B$
2626
```
2727

2828
# Output

0 commit comments

Comments
 (0)