Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
using namespace std;
bool ok[1000001];
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
#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)
{
.PHONY: all clean
SRCS = $(wildcard *.c)
PROGS = $(patsubst %.c,%,$(SRCS))
CFLAGS = -Wall -Werror -pthread
all: $(PROGS)
%: %.c
$(CC) $(CFLAGS) -o $@ $< -lrt
#include <queue>
#include <cstring>
#include <iostream>
using namespace std;
struct tree {
int p;
int left, right;
tree() : p(-1) {}
#include <queue>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
struct tree { // tree 구조체
int p;
int left, right;
#include <iostream>
#include <algorithm>
using namespace std;
long long tree[1000000];
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file : main.c
* @brief : Main program body
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
* All rights reserved.</center></h2>
#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];
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);
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;