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
#define REP(i,n) for (int i=0;i<(n);i++) | |
#include <iostream> | |
using namespace std; | |
const int MAX = 8; | |
int set,n; | |
int sx,sy; | |
char field[MAX][MAX]; | |
int dx[12] = {1, 0, -1, 0, 2, 0, -2, 0, 3, 0, -3, 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
#define REP(i,n) for (int i=0;i<(n);i++) | |
#include <queue> | |
#include <iostream> | |
using namespace std; | |
const int MAX = 1000; | |
const int INF = 10000; | |
typedef pair<int,int> P; //座標マクロ | |
int N,M,c_num; | |
int sx,sy; |
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
#define REP(i,n) for (int i=0;i<(n);i++) | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; | |
const int MAX_N = 25; | |
typedef pair<int,int> P; | |
int n; | |
int v,l; | |
P p[MAX_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
from fractions import gcd | |
nums = [int(x) for x in input().split()] | |
def ngcd(nums): | |
d = 0 | |
for num in nums: | |
d = gcd(d,num) | |
return d | |
t = ngcd(nums) |
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
#define REP(i,n) for (int i=0;i<(n);i++) | |
#include <iostream> | |
#include <queue> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
const int MAX_N = 100; | |
const int MAX_M = 5000; | |
int N,M; |
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
#define REP(i,n) for (int i=0;i<(n);i++) | |
#include <iostream> | |
#include <queue> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
const int MAX_N = 5000; | |
const long long MIN = -1000000000000; | |
long long d[MAX_N][MAX_N]; //距離表 | |
int n,m; |
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
#define REP(i,n) for (int i=0;i<(n);i++) | |
#include <iostream> | |
#include <queue> | |
#include <vector> | |
#include <algorithm> | |
#include <string.h> | |
using namespace std; | |
const long long INF = -1000000000000; | |
const long long MAX_N = 10001; |
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 | |
import numpy as np | |
nums = [int(x) for x in input().split()] | |
A = (nums[0],nums[1]) | |
B = (nums[2],nums[3]) | |
C = (nums[4],nums[5]) | |
alpha = np.asarray([B[0] - A[0], B[1] - A[1]]) | |
beta = np.asarray([C[0] - A[0], C[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
N = int(input()) | |
cards = ["1","2","3","4","5","6"] | |
N = N % 120 | |
for i in range(N): | |
a = i % 5 + 1 | |
b = i % 5 + 2 | |
cards[a-1],cards[b-1] = cards[b-1],cards[a-1] | |
print("".join(cards)) |
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
nums = [int(x) for x in input().split()] | |
N,M = nums[0],nums[1] | |
right = M-2*N | |
if right < 0: | |
print(-1,-1,-1) | |
exit(0) | |
c = right // 2 | |
b = right % 2 |
OlderNewer