-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1070 from yosupo06/feature/allow_re
add allow_re
- Loading branch information
Showing
11 changed files
with
173 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// https://github.com/MikeMirzayanov/testlib/blob/master/checkers/wcmp.cpp | ||
|
||
// The MIT License (MIT) | ||
|
||
// Copyright (c) 2015 Mike Mirzayanov | ||
|
||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
|
||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
|
||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
#include "testlib.h" | ||
|
||
using namespace std; | ||
|
||
int main(int argc, char * argv[]) | ||
{ | ||
setName("compare sequences of tokens"); | ||
registerTestlibCmd(argc, argv); | ||
|
||
int n = 0; | ||
string j, p; | ||
|
||
while (!ans.seekEof() && !ouf.seekEof()) | ||
{ | ||
n++; | ||
|
||
ans.readWordTo(j); | ||
ouf.readWordTo(p); | ||
|
||
if (j != p) | ||
quitf(_wa, "%d%s words differ - expected: '%s', found: '%s'", n, englishEnding(n).c_str(), compress(j).c_str(), compress(p).c_str()); | ||
} | ||
|
||
if (ans.seekEof() && ouf.seekEof()) | ||
{ | ||
if (n == 1) | ||
quitf(_ok, "\"%s\"", compress(j).c_str()); | ||
else | ||
quitf(_ok, "%d tokens", n); | ||
} | ||
else | ||
{ | ||
if (ans.seekEof()) | ||
quitf(_wa, "Participant output contains extra tokens"); | ||
else | ||
quitf(_wa, "Unexpected EOF in the participants output"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1234 5678 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1000000000 1000000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"example_00.in": "346a847f5875beb74d494de0680a81fc2ff840b12f79de30dc7ef3a798d23c28", | ||
"example_00.out": "d6e0da7b83d84fac4d6a6bd11ad0b0e6ea72351748b4f6a277b9762d9d0eb159", | ||
"example_01.in": "0073cf03577a737756752129cc3abcb9f5a4069c705321ee2115574cc31c59f9", | ||
"example_01.out": "6f2264250160ee91b20af64f30128e3787fcf641f1c504f7ac752597e7d2cc09" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
title = 'Simple AplusB' | ||
timelimit = 2.0 | ||
|
||
[[tests]] | ||
name = "example.in" | ||
number = 2 | ||
|
||
[[solutions]] | ||
name = "naive.cpp" | ||
allow_re = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <iostream> | ||
#include <vector> | ||
|
||
using namespace std; | ||
using uint = unsigned int; | ||
using ll = long long; | ||
using ull = unsigned long long; | ||
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); } | ||
template <class T> using V = vector<T>; | ||
template <class T> using VV = V<V<T>>; | ||
|
||
int main() { | ||
|
||
int a, b; | ||
scanf("%d %d", &a, &b); | ||
printf("%d\n", a + b); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include <iostream> | ||
#include <vector> | ||
#include <cassert> | ||
|
||
using namespace std; | ||
using uint = unsigned int; | ||
using ll = long long; | ||
using ull = unsigned long long; | ||
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); } | ||
template <class T> using V = vector<T>; | ||
template <class T> using VV = V<V<T>>; | ||
|
||
int main() { | ||
int a, b; | ||
scanf("%d %d", &a, &b); | ||
assert(a <= 1000 && b <= 1000); | ||
printf("%d\n", a + b); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## @{keyword.statement} | ||
整数 $a, b$ が与えられます。 $a + b$ を出力してください。 | ||
|
||
## @{keyword.constraints} | ||
|
||
- $0 \leq a, b \leq 10^9$ | ||
|
||
|
||
## @{keyword.input} | ||
|
||
``` | ||
$A$ $B$ | ||
``` | ||
|
||
## @{keyword.output} | ||
|
||
``` | ||
$A + B$ | ||
``` | ||
|
||
## @{keyword.sample} | ||
|
||
@{example.example_00} | ||
|
||
@{example.example_01} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "testlib.h" | ||
|
||
int main() { | ||
registerValidation(); | ||
|
||
inf.readInt(0, 1'000'000'000); // a | ||
inf.readSpace(); | ||
inf.readInt(0, 1'000'000'000); // b | ||
inf.readChar('\n'); | ||
inf.readEof(); | ||
return 0; | ||
} |