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
CC = gcc | |
CFLAGS = -Wall -std=c99 | |
LDFLAGS = -lSDL2 | |
SRC = $(wildcard *.c) | |
OBJ = $(notdir $(SRC:.c=.o)) | |
all: raycasting_test | |
raycasting_test: $(OBJ) |
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
// | |
// Created by zeronsix on 7/12/17. | |
// | |
#ifndef GREENHOUSE_GUI_ConfigMgr_H | |
#define GREENHOUSE_GUI_ConfigMgr_H | |
#include <string> | |
namespace gh { | |
enum OperationMode |
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
from collections import defaultdict | |
class Graph: | |
def __init__(self): | |
self.nodes = set() | |
self.edges = defaultdict(list) | |
self.distances = {} | |
def add_node(self, value): |
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 <map> | |
#include <iostream> | |
#include <vector> | |
#include <stdlib.h> | |
struct Point { | |
int x; | |
int y; | |
}; |
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
s = input() | |
t = input() | |
k = "".join(reversed(t)) | |
i = 0 | |
while s[i] == k[i]: | |
if s[i:len(s)] == t[0:len(s) - i]: | |
break | |
i += 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
n = input() | |
print("".join(map(str, range(int(n) + 1))).find(n)) |
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
import io | |
import sys | |
def prefix(s): | |
v = [0] * len(s) | |
for i in range(1, len(s)): | |
k = v[i - 1] | |
while k > 0 and s[k] != s[i]: | |
k = v[k - 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
n = int(input()) | |
k = 0 | |
for _ in range(n): | |
for j in input().split(): | |
if j == "1": | |
k += 1 | |
print(k // 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
with open("input.txt") as fi: | |
a = [int(s) for s in fi.readline().split()] | |
a.sort() | |
max_sum = -1 | |
max_index = -1 | |
for i in range(0, 3): | |
n = a[i] % 10 + (a[i] // 10) % 10 | |
if n > max_sum: |
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
import math | |
n = int(input()) | |
numbers = [int(input()) for _ in range(n)] | |
for j in range(n): | |
i = numbers[j] | |
if (math.sqrt(8 * i - 7)).is_integer(): | |
print(1) | |
else: |
NewerOlder