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 <iostream> | |
using namespace std; | |
int main(void){ | |
int a,b,c; | |
string s; | |
cin >> a >> b >> c >> s; | |
cout << a+b+c << " " << s << endl; | |
return 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
#include <iostream> | |
using namespace std; | |
int main(void){ | |
cout << "Hello World" << endl; | |
return 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
import matplotlib | |
matplotlib.use("Agg") | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.animation as anm | |
import random | |
fig=plt.figure(figsize=(10,10)) | |
ims=[] | |
dt=0.1 | |
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
characteristic=10**9+7 | |
def plus(input1,input2): | |
return (input1+input2)%characteristic | |
def minus(input1,input2): | |
return (input1-input2)%characteristic | |
def times(input1,input2): | |
return (input1*input2)%characteristic | |
def exponen(input1,input2): | |
binaryl=list(str(bin(input2))[2:]) | |
binarysize=len(binaryl) |
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
n=2 | |
P=10**9+7 | |
def product(a,b): | |
c=[[0 for i in range(n)] for i in range(n)] | |
for i in range(n): | |
for j in range(n): | |
for k in range(n): | |
c[i][j]=(c[i][j]+a[i][k]*b[k][j])%P | |
return c | |
N=int(input()) |
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
P=10**9+7 | |
def fibonacci_exp(N): | |
if N<=1: | |
return N | |
else: | |
return (fibonacci_exp(N-1)+fibonacci_exp(N-2))%P | |
def fibonacci_ON(N): | |
L=[0 for i in range(N+1)] | |
L[1]=1 | |
for i in range(2,N+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
n=2 | |
P=10**9+7 | |
def product(a,b): | |
c=[[0 for i in range(n)] for i in range(n)] | |
for i in range(n): | |
for j in range(n): | |
for k in range(n): | |
c[i][j]=(c[i][j]+a[i][k]*b[k][j])%P | |
return c | |
def fibonacci(N): |
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
import numpy as np | |
import math | |
r1,phi1,theta1,r2,phi2,theta2=map(float,input().split()) | |
#度数法からラジアンに変換 | |
phi1=phi1*math.pi/180 | |
phi2=phi2*math.pi/180 | |
theta1=theta1*math.pi/180 | |
theta2=theta2*math.pi/180 | |
#観測者の位置ベクトルを求める | |
observer=np.array([r1*math.cos(theta1)*math.cos(phi1),r1*math.cos(theta1)*math.sin(phi1),r1*math.sin(theta1)]) |
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
import math | |
M=int(input()) | |
k=len(str(bin(M-1)))-2 | |
N=2**(k+1) | |
A=[0 for i in range(N)] | |
B=[0 for i in range(N)] | |
for i in range(M): | |
A[i],B[i]=map(int,input().split()) | |
def zeta(k,n): | |
return complex(math.cos(2*k*math.pi/n),math.sin(2*k*math.pi/n)) |
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
class UnionFind(): | |
n=1 | |
par=[0] | |
rnk=[0] | |
def __init__(self,size): | |
self.n=size | |
self.par=[i for i in range(self.n)] | |
self.rnk=[0 for i in range(self.n)] | |
def find(self,vertex1): | |
if self.par[vertex1]==vertex1: |
OlderNewer