Skip to content

Instantly share code, notes, and snippets.

@pzread
Last active July 1, 2016 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pzread/58ae42f7f51347e0b2d11acdc3715aee to your computer and use it in GitHub Desktop.
Save pzread/58ae42f7f51347e0b2d11acdc3715aee to your computer and use it in GitHub Desktop.
#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;
}
{
"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