Skip to content

Commit 0b33056

Browse files
committed
copy from rime/example, add .sh for pack command
0 parents  commit 0b33056

25 files changed

+217
-0
lines changed

PROJECT

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
3+
## You can load plugins here.
4+
use_plugin('wikify')
5+
use_plugin('htmlify_full')
6+
use_plugin('markdownify_full')

a+b/PROBLEM

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
3+
## Problem definition.
4+
## Required fields are:
5+
## title: The problem title shown in test summary.
6+
## id: The problem ID (typically starts from A) used to order problems.
7+
## time_limit: The time limit of this problem in seconds.
8+
problem(title = "A+B Problem",
9+
wiki_name = 'A+B',
10+
assignees = 'assignee',
11+
need_custom_judge = False,
12+
id = "A",
13+
time_limit = 1.0,
14+
)

a+b/cpp-TLE/SOLUTION

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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', challenge_cases=[])
8+
#java_solution(src='Main.java', encoding='UTF-8', mainclass='Main')

a+b/cpp-TLE/main.cc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <iostream>
2+
3+
using namespace std;
4+
5+
int main() {
6+
int a, b;
7+
cin >> a >> b;
8+
int c = 0;
9+
for (int i = 0; i < a; ++i) {
10+
c++;
11+
}
12+
for (int i = 0; i < b; ++i) {
13+
c++;
14+
}
15+
cout << c << endl;
16+
return 0;
17+
}

a+b/cpp-WA-multiply/SOLUTION

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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', challenge_cases=['00-sample1.in'])
8+
#java_solution(src='Main.java', encoding='UTF-8', mainclass='Main')

a+b/cpp-WA-multiply/main.cc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <iostream>
2+
3+
using namespace std;
4+
5+
int main() {
6+
int a, b;
7+
cin >> a >> b;
8+
cout << a * b << endl;
9+
return 0;
10+
}

a+b/cpp-correct/SOLUTION

+9
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/cpp-correct/main.cc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <iostream>
2+
3+
using namespace std;
4+
5+
int main() {
6+
int a, b;
7+
cin >> a >> b;
8+
cout << a + b << endl;
9+
return 0;
10+
}

a+b/kotlin-WA/SOLUTION

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
3+
kotlin_solution(src='main.kt', challenge_cases=[])

a+b/kotlin-WA/main.kt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import java.util.Scanner;
2+
3+
fun main(args: Array<String>) {
4+
val sc = Scanner(System.`in`)
5+
val a = sc.nextInt()
6+
val b = sc.nextInt()
7+
println(a - b)
8+
}

a+b/kotlin-correct/Main.kt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import java.util.Scanner;
2+
3+
fun main(args: Array<String>) {
4+
val sc = Scanner(System.`in`)
5+
val a = sc.nextInt()
6+
val b = sc.nextInt()
7+
println(a + b)
8+
}

a+b/kotlin-correct/SOLUTION

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
3+
kotlin_solution(src='Main.kt')

a+b/python-correct/SOLUTION

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

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/python
2+
3+
import sys
4+
5+
6+
def main():
7+
a, b = map(int, sys.stdin.read().strip().split())
8+
print(a + b)
9+
10+
11+
if __name__ == '__main__':
12+
main()

a+b/tests/00-sample1.diff

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7

a+b/tests/00-sample1.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3 4

a+b/tests/00-sample2.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
243 28

a+b/tests/10-minimum.diff

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0

a+b/tests/10-minimum.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0 0

a+b/tests/11-maximum.diff

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2000000000

a+b/tests/11-maximum.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1000000000 1000000000

a+b/tests/TESTSET

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
3+
## Input generators.
4+
#c_generator(src='generator.c')
5+
#cxx_generator(src='generator.cc')
6+
#java_generator(src='Generator.java', encoding='UTF-8', mainclass='Generator')
7+
script_generator(src='generator.py')
8+
9+
## Input validators.
10+
#c_validator(src='validator.c')
11+
#cxx_validator(src='validator.cc')
12+
#java_validator(src='Validator.java', encoding='UTF-8', mainclass='Validator')
13+
script_validator(src='validator.py')
14+
15+
## Output judges.
16+
#c_judge(src='judge.c')
17+
#cxx_judge(src='judge.cc')
18+
#java_judge(src='Judge.java', encoding='UTF-8', mainclass='Judge')
19+
#script_judge(src='judge.py')

a+b/tests/generator.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/python
2+
3+
import random
4+
5+
import six
6+
7+
MAX = 1000000000
8+
seq = 0
9+
10+
11+
def Generate(a, b):
12+
global seq
13+
filename = '50-random%02d.in' % seq
14+
with open(filename, 'w') as f:
15+
f.write('{} {}\n'.format(a, b))
16+
seq += 1
17+
18+
19+
def main():
20+
for _ in six.moves.range(20):
21+
Generate(random.randrange(0, MAX), random.randrange(0, MAX))
22+
23+
24+
if __name__ == '__main__':
25+
main()

a+b/tests/validator.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/python
2+
3+
import re
4+
import sys
5+
6+
MAX = 1000000000
7+
8+
9+
def main():
10+
m = re.match(r'^(\d+) (\d+)\n$', sys.stdin.read())
11+
assert m, 'Does not match with regexp'
12+
a, b = map(int, m.groups())
13+
assert 0 <= a <= MAX, 'a out of range: %d' % a
14+
assert 0 <= b <= MAX, 'a out of range: %d' % b
15+
16+
17+
if __name__ == '__main__':
18+
main()

pack_example_for_aoj.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
rime pack
4+
5+
if [ ! -d packed_example ]
6+
then
7+
mkdir packed_example
8+
fi
9+
cd packed_example
10+
rm -r *
11+
12+
# move aoj directories
13+
cp -r ../a+b/rime-out/aoj Z
14+
# ...
15+
# and so on.
16+
17+
rm */AOJCONF
18+
19+
# if you need eps settings
20+
# echo 0.001 > Z/eps.txt
21+
22+
cd ..
23+
zip -r packed_example.zip packed_example

0 commit comments

Comments
 (0)