Skip to content

Commit 9d4f46e

Browse files
committed
Add problem a+b
1 parent 6e18a7b commit 9d4f46e

File tree

20 files changed

+379
-0
lines changed

20 files changed

+379
-0
lines changed

a+b/PROBLEM

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+
pid='X'
4+
5+
problem(
6+
time_limit=1.0,
7+
id=pid,
8+
title=pid + "A + B",
9+
#wiki_name="Your pukiwiki page name", # for wikify plugin
10+
#assignees=['Assignees', 'for', 'this', 'problem'], # for wikify plugin
11+
#need_custom_judge=True, # for wikify plugin
12+
reference_solution='java-correct',
13+
)
14+
15+
atcoder_config(
16+
task_id=None # None means a spare
17+
)

a+b/c-correct/SOLUTION

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
3+
## Solution definition.
4+
## Choose and modify one of definitions below.
5+
## Adding a parameter challenge_cases marks this solution as a wrong solution.
6+
c_solution(src='main.c')
7+
#cxx_solution(src='main.cc')
8+
#java_solution(src='Main.java', encoding='UTF-8', mainclass='Main')
9+
#script_solution(src='main.py')

a+b/c-correct/main.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <stdio.h>
2+
3+
int main() {
4+
int t;
5+
scanf("%d", &t);
6+
while (t-- > 0){
7+
int a, b;
8+
scanf("%d %d", &a, &b);
9+
int answer = a + b;
10+
printf("%d\n", answer);
11+
}
12+
return 0;
13+
}

a+b/cpp-correct/SOLUTION

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
3+
## Solution definition.
4+
## Choose and modify one of definitions below.
5+
## Adding a parameter challenge_cases marks this solution as a wrong solution.
6+
#c_solution(src='main.c')
7+
cxx_solution(src='main.cpp')
8+
#java_solution(src='Main.java', encoding='UTF-8', mainclass='Main')
9+
#script_solution(src='main.py')

a+b/cpp-correct/main.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
int t;
6+
cin >> t;
7+
for(int i=0; i<t; i++){
8+
int a, b;
9+
cin >> a >> b;
10+
int ans = a + b;
11+
cout << ans << endl;
12+
}
13+
}

a+b/java-correct/AB.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import java.util.Scanner;
2+
3+
public class AB {
4+
5+
public static void main(String[] args) {
6+
Scanner sc = new Scanner(System.in);
7+
int n = sc.nextInt();
8+
for(int i=0; i<n; i++){
9+
int a = sc.nextInt();
10+
int b = sc.nextInt();
11+
System.out.println(a + b);
12+
}
13+
sc.close();
14+
}
15+
16+
}

a+b/java-correct/SOLUTION

Lines changed: 18 additions & 0 deletions
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='AB.java', encoding='UTF-8', mainclass='AB')
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)

a+b/python-correct/SOLUTION

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
3+
## Solution definition.
4+
## Choose and modify one of definitions below.
5+
## Adding a parameter challenge_cases marks this solution as a wrong solution.
6+
#c_solution(src='main.c')
7+
#cxx_solution(src='main.cc')
8+
#java_solution(src='Main.java', encoding='UTF-8', mainclass='Main')
9+
script_solution(src='main.py')

a+b/python-correct/main.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/local/bin/python3
2+
# -*- coding: utf-8 -*-
3+
4+
def solve():
5+
a,b = map(int,input().split())
6+
return a + b
7+
8+
def main():
9+
cases = int(input())
10+
for _ in range(cases):
11+
print(solve())
12+
13+
if __name__ == '__main__':
14+
main()

a+b/ruby-correct/SOLUTION

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
3+
## Solution definition.
4+
## Choose and modify one of definitions below.
5+
## Adding a parameter challenge_cases marks this solution as a wrong solution.
6+
#c_solution(src='main.c')
7+
#cxx_solution(src='main.cc')
8+
#java_solution(src='Main.java', encoding='UTF-8', mainclass='Main')
9+
script_solution(src='main.rb')

0 commit comments

Comments
 (0)