Skip to content

Commit

Permalink
Add package with long names of solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
MasloMaslane committed Sep 25, 2023
1 parent c69e658 commit 53a1785
Show file tree
Hide file tree
Showing 10 changed files with 162 additions and 0 deletions.
45 changes: 45 additions & 0 deletions tests/packages/long_solution_names/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
title: Package with long solution names
sinol_task_id: lsn
memory_limit: 16000
time_limit: 1000
scores:
1: 25
2: 25
3: 25
4: 25
sinol_expected_scores:
lsn.cpp:
expected:
1: {points: 25, status: OK}
2: {points: 25, status: OK}
3: {points: 25, status: OK}
4: {points: 25, status: OK}
points: 100
lsn1sol_long_name.cpp:
expected:
1: {points: 25, status: OK}
2: {points: 25, status: OK}
3: {points: 25, status: OK}
4: {points: 0, status: WA}
points: 75
lsnb10sol_long_name.cpp:
expected:
1: {points: 25, status: OK}
2: {points: 0, status: WA}
3: {points: 0, status: WA}
4: {points: 0, status: ML}
points: 25
lsns1sol_long_name.cpp:
expected:
1: {points: 25, status: OK}
2: {points: 0, status: WA}
3: {points: 0, status: WA}
4: {points: 0, status: TL}
points: 25
lsnsol_long_name.cpp:
expected:
1: {points: 25, status: OK}
2: {points: 25, status: OK}
3: {points: 0, status: WA}
4: {points: 0, status: RE}
points: 50
Empty file.
Empty file.
9 changes: 9 additions & 0 deletions tests/packages/long_solution_names/prog/lsn.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <bits/stdc++.h>

using namespace std;

int main() {
int a, b;
cin >> a >> b;
cout << a + b;
}
12 changes: 12 additions & 0 deletions tests/packages/long_solution_names/prog/lsn1sol_long_name.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <bits/stdc++.h>

using namespace std;

int main() {
int a, b;
cin >> a >> b;
if (a == 4)
cout << a + b + 1;
else
cout << a + b;
}
34 changes: 34 additions & 0 deletions tests/packages/long_solution_names/prog/lsnb10sol_long_name.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include <bits/stdc++.h>

using namespace std;

int rnd() {
return rand() % 100;
}

int main() {
int a, b;
cin >> a >> b;
if (a == 1)
cout << a + b;
else if (a == 2 || a == 3)
cout << a + b + 2;
else if (a == 4) {
vector<int*> v;
for (int i = 0; i <= 10000; i++) {
int *tmp = new int[1000];
for (int j = 0; j < 1000; j++) {
tmp[j] = rnd();
}
v.push_back(tmp);
}
int s = 0;
for (auto i : v) {
for (int j = 0; j < 1000; j++) {
s = (s + i[j]) % 1000000007;
}
delete[] i;
}
cout << a + b;
}
}
18 changes: 18 additions & 0 deletions tests/packages/long_solution_names/prog/lsningen.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <bits/stdc++.h>

using namespace std;

int main() {
ofstream f("lsn1a.in");
f << "1 3\n";
f.close();
f.open("lsn2a.in");
f << "2 5\n";
f.close();
f.open("lsn3a.in");
f << "3 7\n";
f.close();
f.open("lsn4a.in");
f << "4 9\n";
f.close();
}
20 changes: 20 additions & 0 deletions tests/packages/long_solution_names/prog/lsns1sol_long_name.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <bits/stdc++.h>

using namespace std;

int main() {
int a, b;
cin >> a >> b;
if (a == 1)
cout << a + b;
else if (a == 2 || a == 3)
cout << a + b - 1;
else if (a == 4) {
time_t start = time(0);
int i = 0;
while (time(0) - start < 5) {
i++;
}
cout << a + b;
}
}
17 changes: 17 additions & 0 deletions tests/packages/long_solution_names/prog/lsnsol_long_name.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <bits/stdc++.h>

using namespace std;

int main() {
int a, b;
cin >> a >> b;
if (a == 1 || a == 2)
cout << a + b;
else if (a == 3)
cout << a + b + 2;
else if (a == 4) {
int c = 0;
cout << a + b / c;
return 1;
}
}
7 changes: 7 additions & 0 deletions tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ def get_icpc_package_path():
return os.path.join(os.path.dirname(__file__), "packages", "icpc")


def get_long_solution_names_package():
"""
Get path to package with long solution names (/tests/packages/long_solution_names)
"""
return os.path.join(os.path.dirname(__file__), "packages", "long_solution_names")


def create_ins(package_path, task_id):
"""
Create .in files for package.
Expand Down

0 comments on commit 53a1785

Please sign in to comment.