This file contains hidden or 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
// Ivan Carvalho | |
// City - JOI SC 2017 | |
#include "Device.h" | |
#include <bits/stdc++.h> | |
using namespace std; | |
static vector<int> sequencia; | |
static void build_sequence(){ | |
This file contains hidden or 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
// Ivan Carvalho | |
// Airline Route Map - JOI SC 2018 | |
#include "Alicelib.h" | |
#include <bits/stdc++.h> | |
using namespace std; | |
const int MAXN = 1020; | |
static vector<int> grafo[MAXN]; | |
This file contains hidden or 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
// Ivan Carvalho | |
// Broken Device - JOI SC 2017 | |
#include "Annalib.h" | |
#include <bits/stdc++.h> | |
using namespace std; | |
const int MAXN = 150; | |
static int possivel[MAXN],resposta[MAXN]; | |
This file contains hidden or 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
// Ivan Carvalho | |
// Navigation - JOI SC 2015 | |
#include "Annalib.h" | |
#include <bits/stdc++.h> | |
using namespace std; | |
const int MAXN = 1e5 + 10; | |
static vector<int> grafo[MAXN]; | |
static int cor[MAXN]; |
This file contains hidden or 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
// Ivan Carvalho | |
// Coins - IOI 2017 Practice | |
// 1 coin flip | |
#include "coins.h" | |
#include <bits/stdc++.h> | |
using namespace std; | |
vector<int> coin_flips(vector<int> b, int c) { | |
int meu_inteiro = 0; | |
for(int i = 0;i<64;i++) if(b[i]) meu_inteiro ^= i; |
This file contains hidden or 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
// Ivan Carvalho | |
// ICC - CEOI 2016 | |
// O(N*log(N)) | |
#include "icc.h" | |
#include <bits/stdc++.h> | |
using namespace std; | |
const int MAXN = 110; | |
int pai[MAXN],N; |
This file contains hidden or 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
// Ivan Carvalho | |
// Library - JOI SC 2018 | |
// O(N*log(N)) | |
#include <cstdio> | |
#include <vector> | |
#include "library.h" | |
using namespace std; | |
const int MAXN = 1001; | |
This file contains hidden or 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
// Ivan Carvalho | |
// Cave - IOI 2013 | |
// O(N*log(N)) | |
#include <bits/stdc++.h> | |
using namespace std; | |
const int MAXN = 5010; | |
int isDefined[MAXN],definedState[MAXN],whichNumber[MAXN],N; | |
int queryArray[MAXN]; |
This file contains hidden or 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
// Ivan Carvalho | |
// Carnival - CEOI 2014 | |
// O(N*log(N)) | |
#include <bits/stdc++.h> | |
using namespace std; | |
const int MAXN = 160; | |
int pai[MAXN],qualcor[MAXN],N,ultima_cor; | |
This file contains hidden or 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
// Ivan Carvalho | |
// Xor - Seletiva IOI - OBI 2016 | |
// O(n*log(MAXV)) | |
#include <bits/stdc++.h> | |
using namespace std; | |
const int MAXN = 3*1e5 + 10; | |
const int MAXL = 30; | |
typedef pair<int,int> ii; |