text stringlengths 8 6.88M |
|---|
/*
1.先求原图的最小生成树T,并记录树边和最小值small1
2.然后求dis[i][j],表示在T中x到y的唯一路径上的最大边
3.枚举所有非树边(u,v),设其值为w,那么small2=min{small1-dis[u][v]+w},最后看small1和
small2是否一样就可以了。
*/
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#define maxn 110
#define maxm 10000
using namespace std;
struct edge{
int u,... |
#ifndef DTFECHA_H
#define DTFECHA_H
class DtFecha {
private:
int dia;
int mes;
int anio;
public:
DtFecha();
DtFecha(int dia, int mes, int anio);
int getD();
int getM();
int getA();
};
#endif
|
//Declaration header
#include"text_renderer.h"
//shady_engine headers
#include"smath/math.h"
#include"resources.h"
#include"shader.h"
#include"texture2D.h"
namespace shady_engine
{
text_renderer::text_renderer()
{
}
text_renderer::~text_renderer()
{
glDeleteBuffers(1,&mVBO);
glDeleteVertexArrays(1,&m... |
/* -*- mode: c++; c-file-style: "gnu" -*- */
group "XMLUtils.XMLFragment.treeaccessor";
require init;
require XMLUTILS_XMLFRAGMENT_XMLTREEACCESSOR_SUPPORT;
include "modules/xmlutils/xmlfragment.h";
include "modules/xmlutils/xmltreeaccessor.h";
include "modules/xmlutils/xmlnames.h";
test("XMLFragment tree accessor #1... |
#include "FreedomLanguage.h"
std::tuple<std::string, std::string> __GET_OVERPARSER_FUNCS__(std::string input, Core* core, std::deque < Order >* orders);
void run(std::string fn, std::string text, Core* core)
{
auto lexer = Lexer(text, fn);
for (auto const& x : core->GetVarables())
{
lexer.Variable... |
#pragma once
#include <iberbar/RHI/Types.h>
namespace iberbar
{
namespace RHI
{
class IShader;
class IVertexBuffer;
class IIndexBuffer;
class IUniformBuffer;
class ITexture;
class IShaderState;
class IShaderVariableTable;
class IBlendState;
class IDepthStencilState;
class ISamplerState;
class... |
#include "hf2_shared_ptr.hpp"
namespace HF2 {
// Scalar
template<class T>
SharedPointer<T>& SharedPointer<T>::operator=(SharedPointer<T>&& sp) {
if (this->ctrl_ != nullptr)
this->ctrl_->decrementRefCount();
this->ctrl_ = sp.ctrl_;
sp.ctrl_ = nullptr;
return *this;
}
template<class T>
SharedPointer<T>... |
#include<iostream>
#include<cstdio>
using namespace std;
const double NI = 1e-6;
double a,b,c,d;
double f(double x)
{
return a*x*x*x+b*x*x+c*x-d;
}
double ft(double x)
{
return 3*a*x*x+2*b*x+c;
}
int main()
{double x0 = 0,x = 0;
cin >> a >> b >> c >> d;
do
{double t1,t2;
x0 = x... |
#pragma once
#include <unordered_map>
#include <unordered_set>
#include "actor.h"
#include "types.h"
#include "vm.h"
namespace sim::infra {
enum class VMStorageEventType
{
kNone,
kVMCreated,
kVMProvisionRequested,
kVMScheduled,
kVMHosted,
kVMStopped,
kVMDeleted
};
enum class VMStatus
{
... |
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <climits>
#include <ctime>
#include <complex>
#include <cmath>
#include <string>
#include <cctype>
#inc... |
#include "TestShadows.h"
#include "VertexBufferLayout.h"
#include <random>
namespace test {
TestShadows::TestShadows()
: camera(&m_Proj, &m_View, m_ScreenWidth, m_ScreenHeight)
{
glEnable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
//triangle 1
glm::vec3 edge1 = m_Point2 - m_Point1;
glm::vec3 edge2 = m_Point3 ... |
/****
* PSEUDOCODE:
MinWordLength
loop array and compare each length
if the length is smaller that the
curent smallest set it as the smallest
return shortest
MaxWordLength
loop array and compare each length
if the length is larger that the last
set it as the longest length return longest
WordLegthRange
return max -... |
//
// Created by biega on 10.03.2018.
//
#ifndef TANKSMAPGENERATOR_MENU_H
#define TANKSMAPGENERATOR_MENU_H
#include "map.h"
#include "objectmap.h"
#include "inputvalidator.h"
#include "mapreader.h"
#include "mapconverter.h"
#include "mapmodificator.h"
class Menu{
public:
void run();
private:
... |
#include <type_traits>
#include <string>
namespace test {
template<typename T>
using Add_const_reference = T const&;
template<typename T>
using Add_reference = T&;
template<typename... Types>
class tuple;
template<>
class tuple<> {
public:
constexpr tuple() {}
};
template<typename Head, typename... Tail>
cl... |
/*!
* \file machine.h
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Header file for model machine
*/
#ifndef MACHINE_H_
#define MACHINE_H_
#include <QList>
#include <QVariant>
#include <QFile>
#include "./machinemodel.h"
#include "./memorymodel.h"
#include "... |
#include "renderer.h"
Renderer::Renderer(Window& window):
mWindow(window),
mDeviceManager(mState),
mSwapChainManager(mState, mWindow),
tquad(mState),
suit(mState),
guard(mState),
dwarf(mState),
fullscreenQuad(mState),
sceneLights(mState),
gBuffer(mState),
imageIndex(0)
{
}
Renderer::~Renderer()
{
}
... |
#include <bits/stdc++.h>
using namespace std;
long long int a,b,c,d,r;
vector<long long int> arr;
int N;
int main()
{
cin >> a >> b >> N;
c = a%b;
for(int i=0;i<N;i++){
cin >> d;
if(d%b == c) r++;
}
cout << r;
return 0;
} |
#include "information.h"
Information::Information()
{
}
//This function prints out the opening instructions
void Information::displayOpening()
{
//opnun á database
Service serv;
bool connect = 0;
connect = serv.connect();
if (!connect)
{
cout << "Error database not opened!";
ex... |
#include "game/HealthBar.hpp"
HealthBar::HealthBar(){
health = 100;
damage = 0;
x = 10;
y = 10;
healthBar = new SDL_Rect();
damageBar = new SDL_Rect();
BarBoundary = new SDL_Rect();
healthBar->x = x;
healthBar->y = y;
damageBar->x = x;
damageBar->y = y;
BarBoundary->x = ... |
#include "MaTaille.h"
CMaTaille::CMaTaille(QWidget *parent, int Largeur, int Hauteur)
: QDialog(parent),
m_nLargeur(Largeur),
m_nHauteur(Hauteur)
{
ui.setupUi(this);
IsModifier=false;
m_proportion = static_cast<double>(Hauteur) /Largeur;
ui.spinBoxHauteur->setMinimum(0);
ui.spinBoxHauteur->setMaximum(Hauteur*... |
#include <iostream>
using namespace std;
int main()
{
int a, b, c;
char Operator;
cout<<"Enter any Operator:";
cin>>Operator;
switch(Operator)
{
case '+':
cout<<"Enter value for A:";
cin>>a;
cout<<"Enter value for B:";
cin>>b;
... |
//
// Created by abel_ on 15-10-2022.
//
//
// Created by abel_ on 15-10-2022.
//
#include <vector>
#include <stack>
#include <unordered_set>
#include <iostream>
#include <tuple>
#include <algorithm>
#include <limits>
int explore(std::vector<std::vector<char>> &grid ,int row,int column,std::unordered_set<std::string... |
void ciclo1(){
if(sensorNivel->switchMode() && contadorNivel<6){
digitalWrite(EV_EntradaAgua, LOW);
digitalWrite(mRecirculacion, HIGH);
if(flagContadorNivel){
contadorNivel++;
}
}else if(contadorNivel<6){
digitalWrite(EV_EntradaAgua, HIGH);
flagContadorNivel = true;
}
... |
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define ll long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ALL(v) v.begin(), v.end()
#define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
#define FORN(a, b, c) for (int(... |
// CLeftTView.cpp: 구현 파일
//
#include "pch.h"
#include "MFC_SplitWnd.h"
#include "CLeftTView.h"
// CLeftTView
IMPLEMENT_DYNCREATE(CLeftTView, CTreeView)
CLeftTView::CLeftTView()
{
}
CLeftTView::~CLeftTView()
{
}
BEGIN_MESSAGE_MAP(CLeftTView, CTreeView)
END_MESSAGE_MAP()
// CLeftTView 진단
#ifdef _DEBUG
void CL... |
static int ft_isspace(char c)
{
if (c == ' ' || c == '\n' || c == '\t'
|| c == '\v' || c == '\f' || c == '\r')
return (1);
return (0);
}
static int ft_isdigit(int c)
{
if (c >= '0' && c <= '9')
return (1);
return (0);
}
int ft_atoi(const char *s)
{
int i;
int sign;
long res;
i = 0;
sign =... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int N_box[200001];
int main()
{
int n;
cin >> n;
vector<int> a, b;
for (int i = 0; i < n; i++)
{
int tmp; cin >> tmp;
a.push_back(tmp);
}
// nから0を見ていく
for (int i = n; i > 0; i--)
{
int tmp... |
/*In this program we will be seeing about LOOPS CONTROL STATEMENTS in C++ Program*/
/*In C++ break , continue and goto are called as LOOP CONTROL STATEMENT, which is been used for controling the flow of loop in a c++ program.*/
/*In this Example lets see how CONTINUE works in a program.*/
/*Continue is a type of loo... |
#include"ClassDate.h"
int main()
{
TestDate();
return 0;
} |
//------------------------------------------------------------------------------
/*
This file is part of Beast: https://github.com/vinniefalco/Beast
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
Portions of this file are from JUCE.
Copyright (c) 2013 - Raw Material Software Ltd.
Please visi... |
#ifndef TILEDEFINITIONMODEL_HPP
#define TILEDEFINITIONMODEL_HPP
#include <QAbstractItemModel>
#include <Tileset.hpp>
#include <vector>
#include <QIcon>
namespace Maint
{
class LevelManager;
class TextureManager;
class TileDefinitionModel : public QAbstractItemModel
{
Q_OBJECT
Tiles... |
/** @file
*****************************************************************************
* @author This file is part of libsnark, developed by SCIPR Lab
* and contributors (see AUTHORS).
* @copyright MIT license (see LICENSE file)
********************************************************************... |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define oo 666666666
int DP[1001][1001];
vector<int>pos[256];
string s;
int n;
int solve(int i, int j)//Longest Palindromic subsequence
{
if(i > j)return 0;
if(i==j)return 1;
if(i+1==j && s[i]==s[j])return 2;
if(D... |
#include "Tests.hpp"
#include <Tanker/Compat/TrustchainFactory.hpp>
#include <Helpers/TimeoutTerminate.hpp>
#include <Tanker/Init.hpp>
#include <Tanker/Version.hpp>
#include <docopt/docopt.h>
using namespace std::string_literals;
using namespace std::literals::chrono_literals;
static const char USAGE[] = R"(compat c... |
// Created on: 1993-03-24
// Created by: JCV
// Copyright (c) 1993-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 GNU Lesser Gen... |
#include<iostream>
#include<queue>
#include<stack>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<string>
#include<string.h>
#include<sstream>
#include<math.h>
#include<iomanip>
#include<map>
using namespace std;
typedef long long int LL;
struct point{
LL x,y;
point(){}
point(LL a, LL b){x=a;y=b;}... |
#ifndef FRAGTRAP_HPP
# define FRAGTRAP_HPP
# include <string>
# include <iostream>
# include <cstdlib>
# include <ctime>
class FragTrap
{
private:
unsigned int _lvl;
unsigned int _hitPoints;
unsigned int _maxHitPoints;
unsigned int _energyPoints;
unsigned int _maxEnergyPoints;
unsigned int _armorDa... |
#include <ionir/passes/pass.h>
namespace ionir {
BranchInst::BranchInst(const BranchInstOpts &opts) :
Inst(opts.parent, InstKind::Branch),
condition(opts.condition),
consequentBasicBlock(opts.consequentBasicBlock),
alternativeBasicBlock(opts.alternativeBasicBlock) {
//
}... |
class Solution1 {
public:
int lengthOfLIS(vector<int>& nums) {
if(nums.size() <= 1) return nums.size();
vector<int> dp(nums.size(),0);
int ans = 0;
for(int i=0; i<nums.size(); ++i){
dp[i] = 1;
for(int j=0; j<i; ++j){
if(nums[j] < nums[i]){
... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "10673"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
int main(int argc, char const *argv[])
{
#ifdef DBG
freopen("uva" PROBLEM TESTC ".in", "r", stdin);
freopen("uva" PROBLEM ".out", "w", stdout);
#endif
long long C... |
#include "InstrTypes.h"
#include "Instruction.h"
#include "llvm/ADT/Twine.h"
#include "BasicBlock.h"
#include "Instruction.h"
#include "Value.h"
#include "Type.h"
#include <msclr/marshal.h>
using namespace LLVM;
TerminatorInst::TerminatorInst(llvm::TerminatorInst *base)
: base(base)
, Instruction(base)
{
}
inline T... |
#pragma once
class GameCursor;
class IconAI :public GameObject
{
public:
~IconAI();
bool Start();
void init(std::string py, int num, GameCursor* cursor, bool isVisualAI = false,int mark = 0);
void Update();
void PostRender();
void Setpos(CVector3 pos);
CVector3 Getpos();
bool isClick()
{
return m_isClick;... |
#pragma once
#include <atomic>
#include <condition_variable>
#include <unordered_set>
#include "eager_version_manager.h"
#include "lazy_version_manager.h"
class Transaction;
class TransactionManager {
public:
struct TransactionSet {
std::unordered_set<Transaction *> transaction_set_;
std::shar... |
#pragma once
#include "base.h"
#include <vector>
class Long {
private:
std::vector<uint> digits;
bool sign;
#define MODULE 65536
#define MASK MODULE - 1
#define BITS 16
public:
Long() : digits(1), sign(0) {}
};
|
#include <iostream>
#include <algorithm>
using namespace std;
int n;
int dp[501][501];
int cost[501][501];
int ans = 0;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
for (int i = 1; i <= n; i++){
for (int j = 1; j <= i; j++){
cin >> cost[i][j];
}
... |
#include "stdafx.h"
#include <cmath>
GENIXAPI(void, adadelta)(const int n, float* gradient, float* gsum, float* xsum, const float rho, const float eps)
{
const float rhoinv = 1.0f - rho;
for (int i = 0; i < n; i++)
{
float g = gradient[i];
gsum[i] = (rho * gsum[i]) + (rhoinv * g * g);
g *= -::sqrt((xsum[i] ... |
#include<constream.h>
class calculator{
public:
void add(int a, int b){
cout<<"Addition is"<<a+b<<endl;
}
void sub(int a,int b){
cout<<"subtration is"<<a-b<<endl;
}
void mul(int a,int b){
cout<<"Multiplication is"<<a*b<<endl;
}
void div(int a, int b){
cout<<"division is "<<a/b<<endl;
}
};
void main(){
clrscr();
calc... |
// ------------------------------------------------------------------------
// File name: changeDue.cpp -
// Project Name: Quiz 6 -
// ------------------------------------------------------------------------
// Creator's Nam... |
#include "CollisionManager.h"
void CollisionManager::SetCollidableModels(vector<CollidableModel*> fCollidableModels)
{
CollidableModels = fCollidableModels;
}
void CollisionManager::AddCollidableModel(CollidableModel * model)
{
CollidableModels.push_back(model);
}
void CollisionManager::RemoveCollidableModel(int m... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2012 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#if defined(X11API) && defined(NS4P_COMPONENT_P... |
#include <bits/stdc++.h>
using namespace std;
#define REP(a,n) for(int i=a; i<n ;i++)
#define pb(a) push_back(a)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> V;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string>... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
while(scanf("%d %d",&a,&b)!=EOF){
if(a==-1 && b==-1)break;
c=abs(a-b);
if(c>50)cout<<100-c<<endl;
else cout<<abs(a-b)<<endl;
}
return 0;
}
|
#pragma once
#include "ofxKinectNui.h"
#include "ofMain.h"
#include "characters\characterBase.h"
#include "shapes\block.h"
class monstro1 : public characterBase
{
public:
monstro1();
void update();
}; |
#include <bits/stdc++.h>
using namespace std;
int main(){
int a, b;
string s;
cin >> a >> b >> s;
bool flag = true;
for(int i=0; i<a; i++){
if(!isalnum(s[i])) flag = false;
}
if(s[a] != '-') flag = false;
for(int i=a+1; i<s.size(); i++){
if(!isalnum(s[i])) f... |
#include "radialbasisfunction.h"
RadialBasisFunction::RadialBasisFunction()
{
}
|
#include "exchange.hpp"
Exchange::Exchange(const string &apiUrl, const string &apiData, int msgLimit = 10)
: orders{}, msgLimit{msgLimit}
{
connect(apiUrl, apiData);
}
Exchange::~Exchange()
{
client.close().wait();
}
void Exchange::connect(const string &apiUrl, const string &apiData)
{
try
{
... |
#include "engine/graphics/LButton.hpp"
LButton::LButton(){}
LButton::LButton(ButtonType type, LTexture* spriteSheet,SDL_Rect (&spriteClips)[BUTTON_SPRITE_TOTAL])
{
mPosition.x = 0;
mPosition.y = 0;
button_type = type;
modeSelected = 0;
gButtonSpriteSheetTexture = spriteSheet;
for (int i = 0; i < BUTTON_SPRITE_T... |
#include <iostream>
#include <queue>
#include <deque>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <math.h>
#include <string.h>
#include <bitset>
#include <cmath>
using namespace std;
int n, vip, lastvip = 1;
vector<int> cont;
int dp[41];
int main()
... |
#pragma once
#include <QString>
#include <QVariantList>
class NamedValues {
public:
// :: Lifecycle ::
NamedValues() = default;
NamedValues(const QString &name);
NamedValues(const QString &name,
std::initializer_list<QVariant> values);
// :: Accessors ::
QString getName()... |
class Solution {
public:
int lengthOfLastWord(string s) {
int last=0;
int now=0;
bool flag = false;
if(s==" ") return 0;
for(int i=0; i<s.size(); i++) {
if(s[i]==' ') {
flag=true;
} else {
if(flag) {
last = i;
flag=false;
}
now=i;
}
}
return now-last;... |
/****************************************************************************
** Meta object code from reading C++ file 'CCategoryFactory.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.3.2)
**
** WARNING! All changes made in this file will be lost!
****************************************************... |
// Algoruthm : Logistic Regression
// Data : binary.csv
#include <iostream>
#include <vector>
#include "algorithms/GradientDescent.h"
#include "algorithms/Newton.h"
using namespace std;
int main(int argc, char const *argv[])
{
mat X, y ,theta;
csv_to_xy("datasets/binary.csv", {"gre" ,"gpa","rank"}, "admit", X, y... |
#pragma once
#include "Physics.h"
#ifdef _WIN32
#include <SDL.h>
#else
#include <SDL2/SDL.h>
#endif // _WIN32
class GameObject
{
public:
int width;
int height;
Physics physics;
SDL_Texture* texture;
GameObject(int width, int height, Physics physics, SDL_Texture* texture);
double i();
double j()... |
/**
******************************************************************************
* Copyright (c) 2019 - ~, SCUT-RobotLab Development Team
* @file : referee.cpp
* @author : charlie 602894526@qq.com
* @brief : Code for communicating with Referee system of Robomaster 2019.
* @date : 2019-03-01
* @par ... |
/** Kabuki SDK
@file /.../Source/Kabuki_SDK-Impl/_G/String.h
@author Cale McCollough
@copyright Copyright 2016 Cale McCollough ©
@license Read accompanying /.../README.md or online at http://www.boost.org/LICENSE_1_0.txt
@brief This file contains the _2D.Vector_f interface.
*/
us... |
#ifndef __CCGREEFRIENDCODE_H__
#define __CCGREEFRIENDCODE_H__
#include "cocos2d.h"
#include "GreeExtensionMacros.h"
NS_CC_GREE_EXT_BEGIN
class CCGreeFriendCode;
class CCGreeCode;
class CCGreeData;
class CCGreeFriendCodeDelegate{
public:
virtual void loadCodeSuccess(CCGreeCode *code){};
virtual void loadCodeFai... |
// Created on: 1995-05-29
// Created by: Jacques GOUSSARD
// Copyright (c) 1995-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 G... |
#pragma once
#include <string>
#include <vector>
#include <tuple>
#include <unordered_set>
#include <map>
#include <QTextCodec>
#include <QTextStream>
#include <boost/optional.hpp>
#include <boost/utility/string_view.hpp>
#include <boost/filesystem/path.hpp>
#include "ComponentsInfrastructure.h"
#include "PticaGovorun... |
#pragma once
#include "stdafx.h"
#include "Voxel.h"
#include "skeleton.h"
#include "boneAbstract.h"
#include "cutTree.h"
#include "neighbor.h"
#include "octreeSolid.h"
#include "cutTreef.h"
#include "boneTransform.h"
#include "voxelObject.h"
#include "poseManager.h"
#include "FilterCutDialog.h"
class cutSurfTreeMngr2
... |
//Program Name: Hello World
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main() {
int var = 1100;
cout << "variable = " << var << endl;
cout << "var memory ref address = " << &var << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, t, a, i=1;
while(scanf("%d %d", &n, &t) && n && t)
{
a = ceil(((double)n-t)/t);
if(a>26)
printf("Case %d: impossible\n", i);
else
printf("Case %d: %d\n", i, a);
i++;
}
return 0;
... |
#include "CObject.h"
#include "3DModel.h"
#include "PrimitiveBase.h"
#include "RenderAttributes.h"
CObject::CObject( PhysicBody::E physicBody )
{
m_bodyType = physicBody;
}
CObject::CObject()
{
m_bodyType = PhysicBody::NONE;
}
void CObject::Create( const Mat4D::CVector4D& bodySize, float fDensity,
std::weak... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
typedef long long L... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2006 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef MODULES_UTIL_SMARTPTR_H
#define MODULES_UTIL_SMARTPTR_H
... |
//Using floodfill. Time-0.000s
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
int dr[] = {1,0,0,-1};
int dc[] = {0,1,-1,0};
char a[51][51];
ll w,h,cnt;
void dfs1(ll i,ll j)
{
if(i >= h || j >= w || i < 0 || j < 0) return;
if(a[i][j]!='X') return;
a[i][j]='*'... |
#include "GameUserWidget.h"
#include "EngineUtils.h"
#include "Fire.h"
#include "Kismet/GameplayStatics.h"
#include "GameFramework/PlayerState.h"
#include "GameFramework/Character.h"
void UGameUserWidget::ShowSingleScore(FString Name, float Score)
{
ScoreBoard->SetRenderOpacity(1);
USingleScore* Single = Cast<USi... |
#ifndef _vector_h
#define _vector_h
#include "color.hpp"
#include <iostream>
#include <math.h>
using namespace std;
class Vector {
public:
double x,y,z;
Vector() : x(0.0),y(0.0),z(0.0) {}
Vector(double x, double y, double z)
{
this->x = x; this->y = y; this->z = z;
}
Vector operator+ (const Vector& vec2)
... |
#include "read_input_file.h"
#include <fstream>
#include <iostream>
#include <sstream>
using std::string;
using std::vector;
void read_input_file(const string s, double **lm, double **wp, size_t& N_lm, size_t& N_wp)
{
int scale = 1;
read_input_file_and_scale(s, scale, lm, wp, N_lm, N_wp);
}
/***************... |
#include "systemc.h"
#include "tester.h"
#include <iostream>
#include <fstream>
void Tester::testing() {
bool t_enable, t_reset;
bool t_data;
while(1) {
if (infile >> t_enable >> t_reset >> t_data) {
wait();
out.write(t_data);
enable_reg.write(t_enable);
... |
// Find the largest palindromic number made from the product of two 3 digit numbers
#include<cstdlib>
#include<string>
#include<iostream>
#include<sstream>
using namespace std;
int main() {
unsigned int max = 0;
for(unsigned int i = 999; i != 99; --i)
for(unsigned int j = 999; j != 99; --j) {
... |
#include "Notebook.h"
std::string Notebook::inputString()
{
std::string temp_string;
std::getline(std::cin, temp_string);
return temp_string;
}
//---------яеррепш----------
void Notebook::setNoteName(std::string note_name)
{
m_note_name = note_name;
}
void Notebook::setNoteContent(std::string note_content)
{
m_... |
#ifndef BOMBA_H
#define BOMBA_H
#include "Enemigo.h"
class Bomba : public Enemigo
{
public:
bool explotar;
Bomba(int x, int y,SDL_Surface* img);
virtual ~Bomba();
void mover(vector<Tile*> tiles, int xMapa, int yMapa);
void mostrar(SDL_Surface* screen, int xMapa, int yMapa);... |
/* BEGIN LICENSE */
/*****************************************************************************
* SKCore : the SK core library
* Copyright (C) 1995-2005 IDM <skcontact @at@ idm .dot. fr>
* $Id: unicodesimplifier.h,v 1.6.2.2 2005/02/17 15:29:24 krys Exp $
*
* Authors: Mathieu Poumeyrol <poumeyrol @at@ idm .dot. ... |
#pragma once
#include <string>
using namespace std;
class Coords
{
friend bool operator==(const Coords &c1, const Coords &c2);
friend bool operator!=(const Coords &c1, const Coords &c2);
friend ostream &operator<<(ostream &os, const Coords coords);
private:
int id;
int x;
int y;
public:
Coords();
Coords(int ... |
#include "Core_PCH.h"
namespace ServerEngine
{
void NetModule::StartModule()
{
printf_s("NetModule::StartModule\n");
}
void NetModule::ShutdownModule()
{
printf_s("NetModule::ShutdownModule\n");
}
}
|
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#define pb push_back
using namespace std;
int moneys[] = {1, 5, 10, 20, 50};
int q[5];
int n;
void input() {
scanf("%d", &n);
}
void solve() {
... |
#include <string>
#include "Rectangle.h"
#include "Vector2d.h"
#include "glfw3.h"
#include "Control.h"
#if DEBUG == 1
#include <iostream>
#include "DebugLine.h"
#endif
namespace Engine2d {
Rectangle::Rectangle(const float x, const float y, const float width, const float height,
const float theta, const bool i... |
#ifndef _TRANSFORM_HPP_
#define _TRANSFORM_HPP_
#pragma once
#include "Vector3.hpp"
class Transform
{
public:
Vector3 position;
Vector3 rotation;
Vector3 scale;
Transform(Vector3 position = Vector3(0, 0, 0), Vector3 rotation = Vector3(0, 0, 0),
Vector3 scale = Vector3(1, 1, 1));
};
#... |
///////////////////////////////////////////////////////////////////////////////
//
// The contents of this file are subject to the Mozilla Public License
// Version 1.1 (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License at
// http://www.mozilla.... |
#include <iostream>
#include <map>
#include <utility>
#include <vector>
#include <string>
#include <tuple>
int main() {
int numberofcar;
std::string madeCar = "";
std::string modelCar = "";
int nameEnterCode = 0;
std::string careMadeSort = "";
int yearCar = 0;
std::cin >> numberofcar;
... |
#pragma once
#include "ofMain.h"
#include "ofxSpriteSheetRenderer.h"
static animation_t walkAnimation = {
0, //.index
0, //.frame
2, //.totalframes
1, //.width
1, //.height
90, //.frameduration
0, //.nexttick
-1, //.loops
-1, //.finalindex
1 //.frameskip
};
struct basi... |
#ifndef __MAXHEAP_H__
#define __MAXHEAP_H__
#include "Node.h"
using namespace std;
class maxHeap {
public:
maxHeap();
~maxHeap();
void Insert(string name, float distance, int count_view);
void LevelOrder();
void heapify(Node *arr, int size, int i);
void buildHeap();
void SearchMostReviewedRestaurant();
... |
\
// LED Array Testing Code
// Light Integrated Threads
//
//
#include <FFT.h>
#include <SPI.h>
#include <LPD8806.h>
//#include <LEDArray.h>
#include <Grid.h>
Grid myGrid(18,18);
int* spectrum;
//int color[3];
//FFT fft(fftAnalogPin,fftStrobePin,fftResetPin);
void setup()
{
Serial.begin(9600);
myGrid.strip... |
/*
* SDEV 340 Week 8 Problem 1
* An abstract class for comparing sorting algortihms, with a simple sort subclass
* Benjamin Lovy
*/
#include <algorithm>
#include <iostream>
class AbstractSort
{
// For tracking how many comparisons are performed
int numCompares = 0;
protected:
// Compare two elements, inc... |
#include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--) {
long n;
cin>>n;
double mp=0.0;
vector<double> a(n);
for(int i=0;i<n;i++) {
cin>>a[i];
if(mp<a[i]) {
mp=a[i];
}
}
d... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
int main()
{
ll n, k;
cin >> n >> k;
vector<int> a;
rep(i, n){ int tmp; cin >> tmp; a.push_back(tmp);}
for (int i = (k - 1) % n; i < n; i++)
{
... |
#include <QFile>
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QDebug>
#include "opener.h"
#include "prefmodel.h"
#ifdef Q_OS_ANDROID
#include <contentdevice.h>
#include <sharedpreferences.h>
#endif
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
Q... |
#include <Wire.h>
#include <stdlib.h>
#include <Servo.h>
#include <IRremote.h>
#define ACTIVATED HIGH
unsigned long elapsed_time;
float sample_time;
unsigned long last_time_print;
/*--- Propeller Servos -------------------------------------------------------*/
Servo right_prop;
Servo left_prop;
double throttle = 1100;... |
#include <Servo.h>
Servo sg;
int blue = 3;
int green = 5;
int red = 6;
int i=255;
int pos = 0;
int j;
void setup()
{
Serial.begin(4800);
sg.attach(9);
sg.write(pos);
}
void loop()
{
for(j=0;j<60;j++){
analogWrite(blue,255);
sg.write(j);
delay(15);
}
analogWrite(blue,0);
delay(500);
for(... |
//Muffin.h
class Muffin
{
public:
string getDescription() const;
void setDescription(const string& inDescription);
int getSize() const;
void setSize(int inSize);
bool getHasChocolateChips() const;
void setHasChocolateChips(bool inChips);
void output(); //Add a function for us... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.