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 <cstdio> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
void reverse(char *str){ | |
char* end = str; | |
char tmp; | |
if(str){ |
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 <cstdio> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
int main(){ | |
char c; | |
bool chars[256]; | |
bool dup_flag = false; |
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
# -*- coding:utf-8 -*- | |
def isCyclicNum(num): | |
if str(num) == str(num)[::-1]: | |
return True | |
else: | |
return False | |
def main(): | |
ans = 0 |
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
# -*- coding:utf-8 -*- | |
prime_number = list() | |
def function(num): | |
count = largest = 1 | |
while num != 1: | |
count += 1 | |
if any([count % x == 0 for x in prime_number]): | |
continue |
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
def generateFib(): | |
a = 1 | |
b = 2 | |
while a < 4000000: | |
a, b = b, a + b | |
if a % 2 == 0: | |
yield a | |
else: | |
continue |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
def file_open(filename): | |
T = 0 | |
caseList = [] | |
with open(filename) as f: | |
T = int(f.readline().strip()) | |
for i in range(T): | |
key = int(f.readline().strip()) |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
def file_open(filename): | |
T = 0 | |
caseList = [] | |
with open(filename) as f: | |
T = int(f.readline().strip()) | |
for i in range(T): | |
value = [int(x) for x in f.readline().strip().split()] |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from problemC import process as correct | |
def file_open(filename): | |
T = 0 | |
caseList = [] | |
with open(filename) as f: | |
T = int(f.readline().strip()) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def _test(): | |
import doctest | |
doctest.testmod() | |
def cut(cardList, fromA, toB): | |
""" | |
>>> a = [1] |
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
# □□□□ × □ = □□□□ | |
# として、□の中に1~9の数字が一つずつ入る時の組合せ | |
# 1000~9999 * 1~9 を総当りで確かめてみるか → パソコンの力任せ | |
# (a, b, c) で組合せを表現 | |
# 3値のタプルを入力とし、使われている数字をリストで返す |