This file contains hidden or 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 <iostream> | |
using namespace std; | |
bool ok[1000001]; | |
int main(void) { | |
ios_base::sync_with_stdio(false); | |
cin.tie(nullptr); |
This file contains hidden or 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 <unistd.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/wait.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
int main(int argc, char **argv) | |
{ |
This file contains hidden or 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
.PHONY: all clean | |
SRCS = $(wildcard *.c) | |
PROGS = $(patsubst %.c,%,$(SRCS)) | |
CFLAGS = -Wall -Werror -pthread | |
all: $(PROGS) | |
%: %.c | |
$(CC) $(CFLAGS) -o $@ $< -lrt |
This file contains hidden or 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 <queue> | |
#include <cstring> | |
#include <iostream> | |
using namespace std; | |
struct tree { | |
int p; | |
int left, right; | |
tree() : p(-1) {} |
This file contains hidden or 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 <queue> | |
#include <cstring> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
struct tree { // tree 구조체 | |
int p; | |
int left, right; |
This file contains hidden or 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 <iostream> | |
#include <algorithm> | |
using namespace std; | |
long long tree[1000000]; | |
int main(void) { | |
ios_base::sync_with_stdio(false); | |
cin.tie(nullptr); |
This file contains hidden or 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
/* USER CODE BEGIN Header */ | |
/** | |
****************************************************************************** | |
* @file : main.c | |
* @brief : Main program body | |
****************************************************************************** | |
* @attention | |
* | |
* <h2><center>© Copyright (c) 2019 STMicroelectronics. | |
* All rights reserved.</center></h2> |
This file contains hidden or 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 <tuple> | |
#include <queue> | |
#include <string> | |
#include <iostream> | |
using namespace std; | |
int mat[250][250]; | |
int group[250][250]; | |
pair<int, int> group_size[250 * 250 + 1]; |
This file contains hidden or 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
long long multiplier(long long a, long long b) { | |
if(b == 0) { | |
return 1; | |
} | |
else if(b == 1) { | |
return b; | |
} | |
if(b % 2 == 0) { | |
long long tmp = multiplier(a, b/2); |
This file contains hidden or 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
long long go(int a, int b, int c) { | |
if (b == 0) { | |
return 1; | |
} | |
else if (b == 1) { | |
return a % c; | |
} | |
long long tmp = go(a, b / 2, c) % c; | |
long long ans = ((tmp % c) * (tmp % c)) % c; |