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 UnityEngine | |
class BallController(MonoBehaviour): | |
public Speed as single = 20.0f | |
def Start(): | |
rigidbody.AddForce((transform.forward+transform.right) * Speed, ForceMode.VelocityChange) | |
def Update(): | |
pass |
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 UnityEngine | |
class Player (MonoBehaviour): | |
public speed as single = 8.0f | |
public gravity as single = 10.0f | |
public controller as CharacterController | |
public jumpSpeed as single = 6.0f | |
public moveDirection as Vector3 |
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
#! python | |
l1 = ['one','two','three','four','five','six','seven','eight','nine'] | |
l2 = ['ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen'] | |
l3 = ['twenty','thirty','forty','fifty','sixty','seventy','eighty','ninety'] | |
l4 = ['hundred', 'thousand', 'and'] | |
ans = 0 | |
for i in l1: | |
ans = ans + len(i) |
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
#! python | |
ndays = [31,28,31,30,31,30,31,31,30,31,30,31] | |
ldays = [31,29,31,30,31,30,31,31,30,31,30,31] | |
day = 0 # 0--Monday --> 6--Sunday | |
ans = 0 | |
def isleap(year): | |
if year % 4 == 0 and (year % 100 != 0 or year % 400 == 0): | |
return True |
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 <cstdio> | |
#include <set> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
typedef long long ll; | |
vector<int> abn; | |
set<int> se; | |
int divis(int num) { | |
int sum = 0; |
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
#! python | |
fib1 = 1 | |
fib2 = 1 | |
fib = 0 | |
n = 2 | |
while fib <= pow(10, 999): | |
fib = fib1 + fib2 | |
fib1 = fib2 | |
fib2 = fib |
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
#! python | |
# s2 = raw_input().split('/') | |
def conv(c): | |
if c == '0': | |
return 0 | |
return 1 | |
def solve(s1): | |
s2 = s1.split('/') |
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
#!/usr/bin/env python | |
# coding: utf-8 | |
def gcd(a, b): | |
if b == 0: | |
return a | |
else: | |
return gcd(b, a%b) | |
a = 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
#! /usr/bin/env python | |
# coding: utf-8 | |
# φ (n) を調べる -> wikiでこんな公式みつける φ (n) = n * Π (1 - 1/Pk) | |
# 変形して φ (n) / n = Π (1 - 1/Pk) の最小 -> 1 - 1/Pk < 1なのでkが大きいほど | |
# 小さいことがわかる | |
# P1P2...Pk<=1000000を探しませう | |
# Pythonの機能使うと素数列挙簡単らしいけど… |
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
extension NSData { | |
func isGIF() -> Bool { | |
let bytes = UnsafePointer<Int8>(self.bytes) | |
return self.length >= 6 && (strncmp(bytes, "GIF87a", 6) == 0 || strncmp(bytes, "GIF89a", 6) == 0) | |
} | |
} |
OlderNewer