Skip to content

Instantly share code, notes, and snippets.

View brun0xff's full-sized avatar

brunoathaíde brun0xff

View GitHub Profile
@brun0xff
brun0xff / PWEB2
Last active February 13, 2017 19:48
<?php
if(isset($_COOKIE["count"])) {
$count = $_COOKIE["count"];
$count++;
setcookie("count", $count, time() + 600);
} else {
$count = 0;
setcookie("count", $count, time() + 600);
}
?> <html>
#include <bits/stdc++.h>
using namespace std;
typedef struct elem{
int value;
int acc;
}tipoElem;
void printVet(int v[], int n){
http://stackoverflow.com/questions/14291636/what-is-the-proper-way-to-convert-between-mysql-datetime-and-python-timestamp
import csv
import urllib2
url = 'http://winterolympicsmedals.com/medals.csv'
response = urllib2.urlopen(url)
cr = csv.reader(response)
for row in cr:
print row
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2
response = urllib2.urlopen('http://python.org/')
print "Response:", response
# Get the URL. This gets the real URL.
print "The URL is: ", response.geturl()
#include <iostream>
#include <cstdio>
#define maxV 10000
using namespace std;
int cnt = 0, lbl[maxV], movimentos, V, A;
int adj[100][100];
Star (URI1233): [ Intermediario / Matematica ] É possivel ver que se um numero K tem algum fator comum com N, entao ele ira voltar para a posicao inicial em alguma rodada. Alem disso, para cada coprimo X de N, as estrelas formadas por X e N - X sao iguais. Dessa forma, o resultado final é phi(N) / 2.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
ll N;
// C implementation of search and insert operations
// on Trie
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define ARRAY_SIZE(a) sizeof(a)/sizeof(a[0])
// Alphabet size (# of symbols)
#include <bits/stdc++.h>
#define endl '\n'
#define DV(value) cout << "[" << value << "]";
#define DPI(p) cout << "[" << p.first << "," << p.second << "]";
#define MAX 10000
using namespace std;
typedef pair<int,int> pii;