Skip to content

Instantly share code, notes, and snippets.

View LucaDantas's full-sized avatar

Luca Dantas Araujo LucaDantas

View GitHub Profile
#include <cstdio>
#include <vector>
constexpr int maxn = 1e5+10;
std::vector<int> g[maxn];
struct Par {
int tam, qtd;
bool operator>(const Par& o) const { return tam > o.tam; }
#include <cstdio>
#include <vector>
constexpr int maxn = 2e5+10;
std::vector<int> g[maxn];
int ans;
int max(int a, int b) { return a > b ? a : b; }
#include <cstdio>
#include <vector>
constexpr int maxn = 5e3 + 10;
std::vector<int> g[maxn];
int dist[maxn][maxn], s;
int cnt[maxn], ans = 0;
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
#define pb push_back
#define ff first
#define ss second
#define sz(a) ((int)(a).size())
struct Node
{
vector<pii> pref, suf;
long long ans;
};
Node tree[4*maxn];
Node combine(Node l, Node r) {
Node ret;
ret.ans = l.ans + r.ans;
struct Node
{
vector<pair<int,int>> pref, suf;
int gcd_td; // MDC do intervalo completo
};
int gcd(int a, int b) {return !b?a:gcd(b, a%b);}
Node combine(Node l, Node r) {
Node ret;
#include <cstdio>
#include <algorithm>
constexpr int maxn = 510, maxk = 30;
char s[maxn], pos[maxn][maxk], ans[maxn];
int main() {
int n, m, k; scanf("%d %d %d", &n, &m, &k);
scanf(" %s", s);
#include <cstdio>
int main() {
int n, c, s; scanf("%d %d %d", &n, &c, &s);
int ans = 0, pos = 0;
--s; // 0-indexamos
if(s == 0) ++ans;
for(int i = 0; i < c; i++) {
int v; scanf("%d", &v);
pos = (pos + v + n) % n;
#include <cstdio>
int main() {
int n, c, s; scanf("%d %d %d", &n, &c, &s);
int ans = 0, pos = 1;
if(s == 1) ++ans;
for(int i = 0; i < c; i++) {
int v; scanf("%d", &v);
pos += v;
if(pos == 0) pos = n;
#include <iostream>
using namespace std;
int main() {
int P, A, L;
cin >> P >> A >> L;
if(P > 500) {
cout << "pandemilson\n";
} else if(A > 500) {
cout << "alcoolgelson\n";