Skip to content

Instantly share code, notes, and snippets.

@Luzhiled
Luzhiled / math.cpp
Created December 15, 2016 13:52
sin, cosの実装(有効数字およそ15桁)
#include <iostream>
using namespace std;
long double abs(long double x)
{
return (x < 0.0 ? -x : x);
}
long double sqrt(long double x)
{
@Luzhiled
Luzhiled / 0530.cpp
Last active December 7, 2016 13:43
ぴょんぴょん川渡り
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define fi first
#define se second
const int inf = 1e17 + 9;
@Luzhiled
Luzhiled / 0531.cpp
Created December 7, 2016 13:31
ペンキの色
#include <bits/stdc++.h>
using namespace std;
const int dx[] = {0, 0, 1, -1}, dy[] = {-1, 1, 0, 0};
int h, w;
int n;
int lx[1010], ly[1010], rx[1010], ry[1010];
vector<int> x, y;
@Luzhiled
Luzhiled / 0537.cpp
Created December 4, 2016 11:28
ビンゴ
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e5;
int n, m, s;
int dp[50][3001];
int main()
{
while (cin >> n >> m >> s, n){
@Luzhiled
Luzhiled / 0596.cpp
Created November 28, 2016 11:31
タクシー
#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 9;
const int max_n = 5000;
typedef pair<int, int> P;
struct edge{
int to, cost;
};
@Luzhiled
Luzhiled / 0580.cpp
Created November 27, 2016 13:06
魚の生息範囲
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX_N = 60;
int n, k;
int X1[60], Y1[60], Z1[60];
int X2[60], Y2[60], Z2[60];