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
signed main() { | |
std::ios::sync_with_stdio(false); | |
std::cin.tie(0); | |
int n; | |
cin >> n; | |
vi c(3); | |
rep(i, n) { | |
int a; | |
cin >> a; |
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
signed main() { | |
std::ios::sync_with_stdio(false); | |
std::cin.tie(0); | |
int T, N; | |
cin >> T >> N; | |
vi s(N), t(N); | |
rep(i, N) cin >> s[i] >> t[i]; | |
// スタート位置についてしゃくとり |
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
enum { KOUSAKA, SONODA, MINAMI }; | |
// A: KOUSAKA & SONODA | |
// B: KOUSAKA & MINAMI | |
// C: SONODA & MINAMI | |
// who_askedが何枚のカードを持っているか? | |
int numCard(int A, int B, int C, int who_joker, int who_asked) { | |
switch (who_asked) { | |
case KOUSAKA: { |
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
struct edge { int to, cap, rev; }; | |
using Graph = vector<vector<edge>>; | |
const int inf = 1e9; | |
const int MAX_V = 110; | |
int level[MAX_V]; | |
int iter[MAX_V]; | |
bool reachable[MAX_V]; // 残余グラフにおいて、Sから到達可能か | |
void add_edge(Graph& G, int from, int to, int cap) { |
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
typedef complex<double> P; | |
typedef vector<P> G; | |
#define here(g, i) g[i] | |
#define next(g, i) g[(i + 1) % g.size()] | |
#define prev(g, i) g[(i - 1 + g.size()) % g.size()] | |
const double EPS = 1e-10; | |
const double INF = 1e12; | |
// 左、下、右、上 | |
const int dx[4] = {-1, 0, 1, 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
signed main() { | |
std::ios::sync_with_stdio(false); | |
std::cin.tie(0); | |
int N, M, A, B; | |
cin >> N >> M >> A >> B; | |
vi D(N); | |
rep(i, N) cin >> D[i]; | |
int i; |
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
signed main() { | |
std::ios::sync_with_stdio(false); | |
std::cin.tie(0); | |
int A, B, N; | |
cin >> A >> B >> N; | |
int ans = inf; | |
rep2(a, 1, N + 1) { | |
rep2(b, 1, 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
#define dame cout << "NO" << endl; return 0 | |
struct edge { int to, cap, rev; }; | |
const int MAX_V = 110; | |
vector<edge> G[MAX_V]; | |
int level[MAX_V]; | |
int iter[MAX_V]; | |
void add_edge(int from, int to, int cap) { |
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
typedef vector<vector<int>> Graph; | |
typedef pair<int, int> Edge; // (a < b: undirected) | |
class BICC { | |
private: | |
const int n; | |
public: | |
Graph G; | |
vi depth; |
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
signed main() { | |
std::ios::sync_with_stdio(false); | |
std::cin.tie(0); | |
int N, M; | |
cin >> N >> M; | |
int ans = 0; | |
rep(i, N) { | |
cout << "lst " << i << endl; | |
int k; |
OlderNewer