Skip to content

Commit 0f414c8

Browse files
committed
fix range issue
1 parent 8e426e3 commit 0f414c8

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

templates/resolver.go

+14-13
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,15 @@ class Rand {
7171
7272
// Returns an random int value in the range [from, to] inclusive
7373
int Int(int from, int to) {
74-
assert(from <= to);
74+
if (from == to) return from;
75+
assert(from < to);
7576
return rand() % (to - from) + from;
7677
}
7778
7879
// Returns an random long long value in the range [from, to] inclusive
7980
long long Long(long long from, long long to) {
80-
assert(from <= to);
81+
if (from == to) return from;
82+
assert(from < to);
8183
return rand() % (to - from) + from;
8284
}
8385
@@ -214,17 +216,16 @@ import java.io.*;
214216
* {{end}}
215217
*/
216218
public class Main {
217-
218-
void solve(Scanner in, PrintWriter out) {
219-
220-
}
221-
222-
public static void main(String[] args) {
223-
try(Scanner in = new Scanner(System.in);
224-
PrintWriter out = new PrintWriter(System.out)) {
225-
new Main().solve(in, out);
226-
}
227-
}
219+
void solve(Scanner in, PrintWriter out) {
220+
221+
}
222+
223+
public static void main(String[] args) {
224+
try(Scanner in = new Scanner(System.in);
225+
PrintWriter out = new PrintWriter(System.out)) {
226+
new Main().solve(in, out);
227+
}
228+
}
228229
}
229230
`
230231

0 commit comments

Comments
 (0)