text stringlengths 8 6.88M |
|---|
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#define INT_MAX 0x7fffffff
#define INT_MIN 0x80000000
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : va... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#de... |
#include "pch.h"
#include "AudioSource.h"
#include "Core/ComponentFactory.h"
#include "System/AudioSystemWwise.h"
IMPLEMENT_COMPONENT_TYPEID(Hourglass::AudioSource)
void Hourglass::AudioSource::Start()
{
hg::g_AudioSystem.RegisterEntity(GetEntity(), "AudioSourceEntity");
}
void Hourglass::AudioSource::Shutdown()
{... |
#ifndef LINEARKALMANFILTER_H
#define LINEARKALMANFILTER_H
// http://arma.sourceforge.net/docs.html
#include "armadillo"
class LinearKalmanFilter {
public:
LinearKalmanFilter(
const arma::mat& stateTransitionMatrix,
const arma::mat& controlMatrix,
const arma::mat& observationMatrix,
const arma::mat& ini... |
//知识点: 模拟,树状结构
/*
By:Luckyblock
题目要求:
给定 一棵树, 点有点权
给定两种操作:
1.修改某节点的点权
2.查询 距某节点 最近的 一个祖先,
满足 此节点 与 其祖先节点 点权值 最大公约数>1
分析题意:
由于此题数据 较弱
可以直接 暴力模拟
对于被查询节点, 暴力上跳
对于其每一个祖先 , 都与被查询节点进行比较
如果 最大公约数 >1 则直接输出
数据加强:
在初期状态和更改节点时,所有定点进行一次更新。之后所有1询问,用O(1)的方法得出。
A[i]的范围约20亿,而将其平方根后,质数约5000个。
先把A[i]全部质因数分解掉,... |
/*In this program we will be seeing about ARRAY in C++ Program*/
/*Array in a C++ Program is a kind of data type which is an user Defined data type, which is used to store a Collection of data which have same data type.*/
/*ADVANTAGE OF ARRAY : When used need to store many values of same data type, he/she can't ale t... |
#ifndef MSORT_H
#define MSORT_H
#include <cmath>
#include "comparison.h"
using namespace std;
template <class T, class Comparator>
void mergeSort (vector<T>& myArray, Comparator comp) {
mergeSortHelper(myArray, comp, 0, myArray.size()-1);
}
template <class T, class Comparator>
void mergeSortHelper (vector<T>& ... |
#ifndef DB_H
#define DB_H
#include "log.h"
#include <vector>
#include <QtSql/QSqlQuery>
#include <QObject>
using namespace std;
class Db : protected Log
{
public:
Db();
void connectSQL();
void selectNames();
void selectParts(QString name);
void selectConstruct(QString name);
static vector<... |
//
// Team_Pokemon.cpp for piscine in /home/selari_j/rendu/rush03_pool/s_team
//
// Made by Julien Selaries
// Login <[email protected]>
//
// Started on Sat Jan 24 17:15:29 2015 Julien Selaries
// Last update Sun Jan 25 23:24:49 2015 Tristan Roby
//
#include <iostream>
#include <fstream>
#include "Pokeplus.h... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2010 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* @author Tomasz Jamroszczak [email protected]
*
*/
#ifndef D... |
/*
========================================================================
DEVise Data Visualization Software
(c) Copyright 1992-1996
By the DEVise Development Group
Madison, Wisconsin
All Rights Reserved.
========================================================================
Under no circumstances ... |
//
// Created by fab on 20/12/2020.
//
#ifndef DUMBERENGINE_IPOSTRENDERING_HPP
#define DUMBERENGINE_IPOSTRENDERING_HPP
class IPostRendering
{
public:
virtual void postDraw() = 0;
};
#endif //DUMBERENGINE_IPOSTRENDERING_HPP
|
#pragma once
#include "SquareGrid.h"
SquareGrid::SquareGrid()
{
std::srand(std::time(NULL));
}
SquareGrid::~SquareGrid()
{
delete[] mTiles;
delete[] mNeighbors;
}
bool SquareGrid::init(/*std::string file*/ std::vector<SpawnerStruct>& enemySpawners)
{
startPos = 0;
mWidth = 10;
mHeight = 10;
mTileWidth = 125... |
#ifndef LocalizationSimulator_h
#define LocalizationSimulator_h
// standard includes
#include <cmath>
#include <memory>
// system includes
#include <Eigen/Dense>
#include <actionlib/server/simple_action_server.h>
#include <eigen_conversions/eigen_msg.h>
#include <nav_msgs/OccupancyGrid.h>
#include <ros/ros.h>
#includ... |
/*
* struct.h
*
* Created on: 2021. 9. 25.
* Author: dhjeong
*/
#ifndef RAIIANDMEM_STRUCT_H_
#define RAIIANDMEM_STRUCT_H_
#include <boost/shared_ptr.hpp>
#include <iostream>
class DataInfo {
public:
DataInfo() {
size = 0;
permission = 0;
}
DataInfo(const std::string &sName, size_t sSize, int sPerm... |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
std::vector<int> vs1;
int n = 5;
for (int i = 0;i < n;i++) {
vs1.push_back(i);
}
vs1.pop_back();
vs1.insert(vs1.begin(), 100);
vs1.insert(vs1.begin()+3, 200);
vs1.insert(vs1.end() ,300);
for (size... |
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// Простой пример использования логических значений
// При каких условиях можно поплавать?
// V 1.0
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
#include<iostream>
using namespace std;
int main() {
cout... |
#include "Graph.h"
#include <map>
#include <iomanip>
#include <vector>
#include <algorithm>
Graph::Graph(ofstream * flog)
{
this->mList = NULL; // mList[from vetex] = map<to vertex, weigth>
this->vertex = NULL; // vetex[index] = CityData *
this->mstMatrix = NULL; // MST
this->flog = flog;
}
... |
// Created on: 1994-09-02
// Created by: Bruno DUMORTIER
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GN... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef PRINT_PROGRESS_DIALOG_H
#define PRINT_PROGRESS_DIALOG_H
#include "adjunct/qui... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 10