mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: code wrapper for sysinfo
This commit is contained in:
1 parent
1adf04ae47
commit
ef59d79b1a
2 files changed
+4
-1
No files matched your search
@@ -232,6 +232,7 @@ async function postInit() {
|
|||||||
this.folder = await cacheOpen(this.source, this.data);
|
this.folder = await cacheOpen(this.source, this.data);
|
||||||
if ((this.code as any).content.startsWith('@@hydro_submission_file@@')) {
|
if ((this.code as any).content.startsWith('@@hydro_submission_file@@')) {
|
||||||
const id = (this.code as any).content.split('@@hydro_submission_file@@')[1]?.split('#')?.[0];
|
const id = (this.code as any).content.split('@@hydro_submission_file@@')[1]?.split('#')?.[0];
|
||||||
|
if (!id) throw new SystemError('Submission File Not Found');
|
||||||
const target = await fetchCodeFile(id);
|
const target = await fetchCodeFile(id);
|
||||||
this.code = { src: target };
|
this.code = { src: target };
|
||||||
this.clean.push(() => fs.remove(target));
|
this.clean.push(() => fs.remove(target));
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ async function stackSize() {
|
|||||||
try {
|
try {
|
||||||
const context: Context = {
|
const context: Context = {
|
||||||
lang: 'cc',
|
lang: 'cc',
|
||||||
code: `#include <iostream>
|
code: {
|
||||||
|
content: `#include <iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
int i=1;
|
int i=1;
|
||||||
int main(){
|
int main(){
|
||||||
@@ -24,6 +25,7 @@ int main(){
|
|||||||
if (i>256) return 0;
|
if (i>256) return 0;
|
||||||
main();
|
main();
|
||||||
}`,
|
}`,
|
||||||
|
},
|
||||||
config: {
|
config: {
|
||||||
time: '3s',
|
time: '3s',
|
||||||
memory: '256m',
|
memory: '256m',
|
||||||
|
|||||||
Reference in new issue
Block a user