View solution.txt
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
diverta 2019 Programming Contest: E - XOR Partitioning | |
https://atcoder.jp/contests/diverta2019/tasks/diverta2019_e | |
思考過程のメモ | |
## 観察 | |
validな分け方の例を一つ考える。 | |
``` |
View combo_grader.rb
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
# problem statement: https://ioi2018.jp/wp-content/tasks/contest1/combo.pdf | |
# usage: ruby combo_grader.rb "your program" | |
class ComboGrader | |
KEYS = %w[A B X Y].freeze | |
COMMAND_LENGTH = 100 | |
QUERY_LENGTH_LIMIT = COMMAND_LENGTH * 4 | |
QUERY_LIMIT = 103 | |
def run(program) | |
@program = IO.popen(program, mode = "r+") |
View launch.json
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "lldb", | |
"request": "launch", | |
"name": "Debug Run", | |
"sourceLanguages": [ | |
"rust" | |
], |
View server_thread.c
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 <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <signal.h> |
View server_nonblocking.c
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 <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <signal.h> |
View client.c
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 <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <sys/time.h> | |
#include <arpa/inet.h> | |
#include <netinet/in.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
View client_weight_thread.c
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 <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <sys/time.h> | |
#include <arpa/inet.h> | |
#include <netinet/in.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
View server_multiplexing.c
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 <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/epoll.h> |
View fifo.c
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 <unistd.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
int main(int argc, char* argv[]) { | |
mkfifo("fifo", S_IRWXU); | |
while (1) { | |
sleep(1); | |
} | |
return 0; |
View client.c
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 <unistd.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
void print_error_and_exit() { |
NewerOlder