-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
86 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import java.io.*; | ||
import java.util.*; | ||
import java.text.*; | ||
import java.math.*; | ||
|
||
public class Main { | ||
static class Solver { | ||
int solve(int a, int b) { | ||
return a + b; | ||
} | ||
} | ||
|
||
public static void main(String[] args) { | ||
Scanner in = new Scanner(System.in); | ||
int a = in.nextInt(); | ||
int b = in.nextInt(); | ||
int sum = new Solver().solve(a, b); | ||
System.out.println(sum); | ||
} | ||
} |
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,38 @@ | ||
use lazy_static::lazy_static; | ||
|
||
use crate::preset::preset::{ | ||
CompileOption, ExecuteCommand, ExecuteOption, LanguagePreset, UserType, | ||
}; | ||
|
||
lazy_static! { | ||
pub(crate) static ref JAVA_PRESET: LanguagePreset = LanguagePreset { | ||
compile: CompileOption::new("java") | ||
.command( | ||
ExecuteCommand::new("javac", vec!["-encoding", "utf8", "-d", ".", "${source}",]) | ||
.default_time_limit(10 * 1000) | ||
.default_memory_limit(1024 * 1024) | ||
.default_user(UserType::Current) | ||
.default_process(10) | ||
.default_ptrace(vec![]) | ||
.default_chroot(true) | ||
.append_read_mount("/proc", "/proc") | ||
.append_read_mount("/dev", "/dev") | ||
) | ||
.command( | ||
// Use bash to expand *.class | ||
ExecuteCommand::new("bash", vec!["-c", "jar -cvf ${executable} *.class"]) | ||
.default_time_limit(10 * 1000) | ||
.default_memory_limit(1024 * 1024) | ||
.default_user(UserType::Current) | ||
.default_process(10) | ||
.default_ptrace(vec![]) | ||
.default_chroot(true) | ||
.append_read_mount("/proc", "/proc") | ||
.append_read_mount("/dev", "/dev") | ||
), | ||
execute: ExecuteOption::new().command(ExecuteCommand::new( | ||
"java", | ||
vec!["-cp", "${executable}", "Main"] | ||
)), | ||
}; | ||
} |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
pub(crate) use c::C_PRESET; | ||
pub(crate) use cpp::CPP_PRESET; | ||
pub(crate) use java::JAVA_PRESET; | ||
|
||
mod c; | ||
mod cpp; | ||
mod java; |
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