Skip to content

Commit

Permalink
format Convertidor (#26)
Browse files Browse the repository at this point in the history
* format Convertidor

* Fixed /hook_tools/lint.py lints

* admin-group 2020

* .gitignore y quitar outs

Co-authored-by: Janque <[email protected]>
Co-authored-by: Freddy Román <[email protected]>
  • Loading branch information
3 people authored Oct 21, 2020
1 parent d1a0d55 commit 6d76e5b
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 40 deletions.
1 change: 1 addition & 0 deletions 2018/OMI-2018-Convertidor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*.out
1 change: 0 additions & 1 deletion 2018/OMI-2018-Convertidor/generator.cpp

This file was deleted.

3 changes: 2 additions & 1 deletion 2018/OMI-2018-Convertidor/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"limits": {
"TimeLimit": 1000,
"MemoryLimit": 33554432,
"InputLimit": 10240,
"OutputLimit": 16384,
"ExtraWallTime": 0,
"OverallWallTimeLimit": 60000
Expand All @@ -22,7 +23,7 @@
"visibility": 0,
"languages": "all",
"email_clarifications": 0,
"admin-groups": ["OMI-2018"],
"admin-groups": ["OMI-2020"],
"tags": ["omi2018"]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int main() {
z--;
k1.push_back(troy[z] + 'A');
}
cout << k1 << endl;
// cout << k1 << endl;
if (k1 == k) {
cout << res;
return 0;
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions 2018/OMI-2018-Convertidor/statements/es.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ En la segunda línea un entero $X$ o una cadena $S$ dependiendo del tipo de conv

# Salida

La cadena $S$ que representa a $X$ si la conversión es de tipo 0, o el entero $X$ que representa
a la cadena $S$ si la conversión es de tipo 1.
La cadena $S$ que representa a $X$ si la conversión es de tipo 0, o el entero $X$ que representa a la cadena $S$ si la conversión es de tipo 1.

# Ejemplo

Expand Down
1 change: 0 additions & 1 deletion 2018/OMI-2018-Convertidor/tests/ctest.py

This file was deleted.

48 changes: 26 additions & 22 deletions 2018/OMI-2018-Convertidor/tests/test-validator.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

import logging
import unittest
import sys
import os
import re

from ctest import *
from omegaup.validator import validatortest

class Test(CTest):
def test(self):
if 'encode' in self.caseName:
regex = re.compile(r'0\n(\d+)\n$')
results = re.match(regex, self.input).groups()
self.assertEqual(len(results), 1)
number = int(results[0])
self.assertTrue(1 <= number < 2**63)
elif 'decode' in self.caseName:
regex = re.compile(r'1\n([A-Z]+)\n$')
results = re.match(regex, self.input).groups()
self.assertEqual(len(results), 1)
limit = "CRPXNLSKVLJFHG"
testStr = results[0]
self.assertTrue(len(testStr) >= 1)
self.assertTrue(len(testStr) < len(limit) or testStr <= limit)
else:
raise TestFailure('invalid case name')
class MyTest(unittest.TestCase):
def test_input(self):
with open('data.in', 'r') as f:
original_input = f.read()

caseName = sys.argv[1]
if 'encode' in caseName:
regex = re.compile(r'^0\n(\d+)\n$')
results = re.match(regex, original_input).groups()
self.assertEqual(len(results), 1)
number = int(results[0])
self.assertTrue(1 <= number < 2**63)
elif 'decode' in caseName:
regex = re.compile(r'^1\n([A-Z]+)\n$')
results = re.match(regex, original_input).groups()
self.assertEqual(len(results), 1)
limit = "CRPXNLSKVLJFHG"
self.assertTrue(len(results[0]) >= 1)
self.assertTrue(len(results[0]) < len(limit) or results[0] <= limit)
else:
self.fail(f"Invalid case name: {caseName}")

Test().run()
if __name__ == '__main__':
validatortest.main()
22 changes: 10 additions & 12 deletions 2018/OMI-2018-Convertidor/tests/tests.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
{
"solutions": [
{
"filename": "solutions/100A.cpp",
"verdict": "AC",
"score": 100
"filename": "../solutions/solution.cpp",
"verdict": "AC"
},
{
"filename": "solutions/100B.cpp",
"verdict": "AC",
"score": 100
"filename": "../solutions/solutionB.cpp",
"verdict": "AC"
},
{
"filename": "solutions/ParcialA.cpp",
"score": 50
"filename": "../solutions/50A.cpp",
"score_range": [0.5, 0.5]
},
{
"filename": "solutions/ParcialB.cpp",
"score": 50
"filename": "../solutions/50B.cpp",
"score_range": [0.5, 0.5]
},
{
"filename": "solutions/ParcialC.cpp",
"score": 5
"filename": "../solutions/5.cpp",
"score_range": [0.02, 0.02]
}
],
"inputs": {
Expand Down
3 changes: 3 additions & 0 deletions problems.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
{
"path": "2017/omi/dia-2/OMI-2017-Sumas-Geometricas"
},
{
"path": "2018/OMI-2018-Convertidor"
},
{
"path": "2018/OMI-2018-Mapa"
},
Expand Down

0 comments on commit 6d76e5b

Please sign in to comment.