Skip to content

Instantly share code, notes, and snippets.

@Yang-33
Yang-33 / Ackerman_function_visualizer.cpp
Last active May 14, 2020 06:42
Visualize the expansion expression of an Ackerman function.
#include <iostream>
#include <string>
using namespace std;
/*
m <= 3, n <= 4 が望ましい(やばいので)
A(m, n) = n + 1 (m == 0)
A(m - 1, 1) (n == 0)
A(m - 1, A(m ,n - 1)) (otherwise)
*/
@Yang-33
Yang-33 / ref_and_move.cpp
Created October 19, 2019 13:04
手元で確認したやつ
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,e) for(int i = a;i < e;++i)
using LL = long long;
// Put this in the declarations for a class to be uncopyable.
#define DISALLOW_COPY(TypeName) \
TypeName(const TypeName&) = delete
// Put this in the declarations for a class to be unassignable.
#define DISALLOW_ASSIGN(TypeName) TypeName& operator=(const TypeName&) = delete
@Yang-33
Yang-33 / move_and_copy.cpp
Last active October 7, 2019 15:56
インターンで登場したやつ
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,e) for(int i = a;i < e;++i)
using LL = long long;
// Put this in the declarations for a class to be uncopyable.
#define DISALLOW_COPY(TypeName) \
TypeName(const TypeName&) = delete
// Put this in the declarations for a class to be unassignable.
#define DISALLOW_ASSIGN(TypeName) TypeName& operator=(const TypeName&) = delete
alias g++='g++ -std=c++14 -Wall -Wextra -Wshadow -ftrapv -g' (適宜-O3)
for i in{a..h}
do
touch $i.cpp
done
for i in{a..h}
do
touch $i_insample.cpp
@Yang-33
Yang-33 / example.cpp
Created July 10, 2019 13:23
cpp boost 競技プログラミング
#include <bits/stdc++.h>
using namespace std;
using VS = vector<string>; using LL = long long;
using VI = vector<int>; using VVI = vector<VI>;
using PII = pair<int, int>; using PLL = pair<LL, LL>;
using VL = vector<LL>; using VVL = vector<VL>;
#define ALL(a) begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()

年越せま100 概要

今年はTopCoder Single Round Match div1 EASYの問題を#601から#702まで解きます。(644,6??は欠番)
期間は2018/12/26から、2018/12/36まで開催されます。
全部解いた人から年越しです。

リンク

https://vjudge.net/contest/274573

目的

SRM(Single Round Match)の問題は考察よりの問題と言われている事が多いようです。

#include <bits/stdc++.h>
using namespace std;
using VS = vector<string>; using LL = long long;
using VI = vector<int>; using VVI = vector<VI>;
using PII = pair<int, int>; using PLL = pair<LL, LL>;
using VL = vector<LL>; using VVL = vector<VL>;
#define ALL(a) begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
int lis(vector<int> a) {
int n = a.size();
const int inf = 1e9;
vector<int> dp(n, inf);
for (int i = 0; i < n; i++) *lower_bound(dp.begin(), dp.end(), a[i]) = a[i];
return lower_bound(dp.begin(), dp.end(), inf) - dp.begin();
}
int main() {
int n;
/*
* chat_client.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <bits/stdc++.h>
using namespace std;
using VS = vector<string>; using LL = long long;
using VI = vector<int>; using VVI = vector<VI>;
using PII = pair<int,int>; using PLL = pair<LL, LL>;
using VL = vector<LL>; using VVL = vector<VL>;
#define ALL(a) begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()