mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17: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);
|
||||
if ((this.code as any).content.startsWith('@@hydro_submission_file@@')) {
|
||||
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);
|
||||
this.code = { src: target };
|
||||
this.clean.push(() => fs.remove(target));
|
||||
|
||||
@@ -14,7 +14,8 @@ async function stackSize() {
|
||||
try {
|
||||
const context: Context = {
|
||||
lang: 'cc',
|
||||
code: `#include <iostream>
|
||||
code: {
|
||||
content: `#include <iostream>
|
||||
using namespace std;
|
||||
int i=1;
|
||||
int main(){
|
||||
@@ -24,6 +25,7 @@ int main(){
|
||||
if (i>256) return 0;
|
||||
main();
|
||||
}`,
|
||||
},
|
||||
config: {
|
||||
time: '3s',
|
||||
memory: '256m',
|
||||
|
||||
Reference in new issue
Block a user