Last active
July 1, 2016 07:49
-
-
Save pzread/58ae42f7f51347e0b2d11acdc3715aee to your computer and use it in GitHub Desktop.
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
#include<stdio.h> | |
#include<stdlib.h> | |
#include<string.h> | |
int main() { | |
char str[100]; | |
char ans[100]; | |
FILE *ansf = fdopen(2, "r"); | |
while(fgets(str, sizeof(str), stdin) != NULL) { | |
if(fgets(ans, sizeof(ans), ansf) == NULL) { | |
return -1; | |
} | |
if(strcmp(str, ans)) { | |
return -1; | |
} | |
} | |
if(fgets(ans, sizeof(ans), ansf) != NULL) { | |
return -1; | |
} | |
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
{ | |
"test": [{ | |
"memlimit": 268435456, | |
"metadata": { | |
"data": [0] | |
}, | |
"timelimit": 10000, | |
"test_idx": 0 | |
}], | |
"metadata": { | |
"redir_test": { | |
"pipeout": 1, | |
"testin": 0, | |
"testout": -1, | |
"pipein": -1 | |
}, | |
"redir_check": { | |
"ansin": 2, | |
"testin": -1, | |
"pipeout": 0, | |
"pipein": -1 | |
} | |
}, | |
"res_path": "res", | |
"comp_type": "g++", | |
"check_type": "ioredir", | |
"code_path": "test.cpp", | |
"chal_id": 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment