Skip to content

Instantly share code, notes, and snippets.

View danielsaad's full-sized avatar

Daniel Saad Nogueira Nunes danielsaad

View GitHub Profile
#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<int> v;
vector<vector<int>> boxes;
bool backtrack(int ik, int sum, int d_sum, int taken) {
if (ik == k && sum == 0) {
#include <bits/stdc++.h>
using namespace std;
const int N = 20;
int dp[1 << N];
int sum[1 << N];
int n, k, p[N], target;
#include <cstdio>
#include <cmath>
int main(){
double n;
int reais,centavos;
int x;
scanf("%lf",&n);
reais = trunc(n);
centavos = 100*(n - reais);
printf("NOTAS:\n");
#include <stdio.h>
#include <stdlib.h>
int** aloca_matriz(int l,int c){
int i;
int** matriz;
matriz = malloc(l*sizeof(int*));
for(i=0;i<l;i++){
matriz[i] = malloc(c*sizeof(int));
}
@danielsaad
danielsaad / d2_backup.py
Last active October 18, 2018 02:47
Script to copy Diablo files
import os.path
import subprocess
import datetime
# Global definitions
d2_folder = "/home/danielsaad/d2-113/Diablo II"
backup_folder = "/home/danielsaad/Dropbox/d2bkp"
# Create the backup folder
print("Creating Backup folder")
os.makedirs(backup_folder, exist_ok=True)
#include <stdio.h>
int main(void){
char str[51];
while(scanf("%50[^\n]%*c",str)!=EOF){
printf("%s lido.\n",str);
}
return 0;
}
var express = require('express');
var port = process.env.PORT || 8080;
var app = express();
var mongoose = require('mongoose');
var Livro = require('./app/models/livroModel');
var bodyParser = require('body-parser');
mongoose.connect('mongodb://127.0.0.1/Livros', function(err) {
if (err) throw err;
});
var express = require('express');
Livro = require('../models/livroModel');
//Livro = mongoose.model('Livro');
var router = express.Router();
router.route('/')
.get(function (req,res){
Livro.find({}, function(err,livro){
if(err){
int j;
void* aux,*tmp;
tmp = vet[i];
for(j=i;j<tam-1;j++){
aux = vet[j+1];
vet[j+1] = tmp;
tmp = aux;
}
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class valorHora{
public:
int valor;