text stringlengths 8 6.88M |
|---|
/****************************************************************************
** Copyright (C) 2017 Olaf Japp
**
** This file is part of FlatSiteBuilder.
**
** FlatSiteBuilder is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free S... |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
vector<int> findDisappearedNumbers(vector<int>& nums) {
//基本思想:哈希表HashMap,利用nums数组的下标作为哈希表的映射,如果该数存在,则对应下标的元素为负。这样就不用申请额外空间标记该数存在并且不改变下标元素值
vector<int> res;
for(int i=0;i<nums.size();i++)
... |
#include<bits/stdc++.h>
using namespace std;
template<typename V>
class Mapnode{
public:
string key;
V value;
Mapnode* next;
Mapnode(string key,V value){
this -> key = key;
this -> value = value;
this -> next = NULL;
}
~Mapnode(){
delete next;
}
};
template<typename V>
class Ourmap{
... |
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <algorithm>
#define INT_MAX 0x7fffffff
#define INT_MIN 0x80000000
using namespace std;
vector<int> findSubstring(string S, vector<string> &L){
vector... |
/** \file BHandSupervisoryRealTime.cpp
\brief Contains the implementation of a class for the BarrettHand Supervisory and RealTime modules.
The BarrettHand API provides high-level control functions for the Barrett
Hand that operates under in a supervisory mode or under a real time mode.
This modu... |
// Created on: 1994-05-02
// Created by: Christian CAILLET
// 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 ... |
#include <iostream>
std::string getBinaryRep(int);
std::string evil(int);
std::string evil(int n) {
int oneCount = 0;
std::string binaryRepresentation = getBinaryRep(n);
for (int i = 0; i < binaryRepresentation.length(); i++) {
if (binaryRepresentation[i] == '1') {
oneCount += 1;
... |
#include <iostream>
#include <algorithm>
using namespace std;
int test(int k, int n) {
int apt[k+1][n];
for(int i=0; i<=k; i++) {
for(int j=0; j<n; j++) {
int under, left;
under = i > 0 ? apt[i-1][j] : 1;
left = j > 0 ? apt[i][j - 1] : 0;
apt[i][j] = under + left;
}
}
return... |
#include "stdio.h"
int main(){
int n;
long long fn[80];
fn[0] = fn[1] = 1;
for(int i = 2;i < 52; i++){
fn[i] = fn[i - 1] + fn[i - 2];
}
while(~scanf("%d", &n)){
printf("%lld\n",fn[n]);
}
return 0;
}
|
#include "platform/i_platform.h"
#include "target_repo.h"
#include "wall_target.h"
#include "ctf_soldier_spawn_target.h"
#include "../ctf_program_state.h"
#include "pickup_target.h"
#include "flag_spawn_target.h"
#include "soldier_spawn_target.h"
using platform::AutoId;
namespace map {
DefaultTarget const TargetRepo... |
#include<SoftwareSerial.h>
SoftwareSerial gsm(8,9);
String incomingch;
int flag=0;
void setup()
{
Serial.begin(9600);
gsm.begin(9600);
pinMode(8,OUTPUT);
pinMode(11,OUTPUT);
}
void check_incoming()
{
if(gsm.available())
{
incomingch = gsm.read();
}
}
void loop()
{
check_incoming();
if(incomi... |
#include "CTSTracker.h"
using namespace CTS;
void setup() {
begin();
}
void loop() {
}
|
#ifndef __VIVADO_SYNTH__
#include <fstream>
using namespace std;
// Debug utility
ofstream* global_debug_handle;
#endif //__VIVADO_SYNTH__
#include "mp_2_opt_compute_units.h"
#include "hw_classes.h"
struct in_in_update_0_write0_merged_banks_2_cache {
// RAM Box: {[0, 126], [0, 127], [0, 31]}
// Capacity: 65
... |
#include "CGetDrawGold.h"
#include "json/json.h"
#include "Logger.h"
#include "Util.h"
#include "threadres.h"
#include "CConfig.h"
#include "SqlLogic.h"
#include "RedisLogic.h"
#include "Helper.h"
//#include "RedisAccess.h"
int CGetDrawGold::do_request(const Json::Value& root, char *client_ip, HttpResult& out)
{
... |
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <unistd.h>
#include "TFile.h"
#include "TTree.h"
#include "TH1.h"
#include "TH2.h"
#include "TGraphAsymmErrors.h"
#include "TVectorT.h"
#include "Nuclear_Info.h"
#include "Cross_Sections.h"
#include "fiducials.h"
#inc... |
////////////////////////////////////////////////////////////////////////////////
// rovioSpeak.cpp
// Mario Chirinos Colunga
// Oscar Sanchez Sioridia
// Áurea - Desarrollo Tecnológico
// http://www.aurea-dt.com
// 18 Dic 2010 - 26 Jun 2013
//-----------------------------------------------------------------------... |
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* LispC Parsing
* 1) tokenize into vector of string
* 2) parse into expressions
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#pragma once
#include <set>
#include <string>
#include <v... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* @author Alexander Remen
*/
#include "core/pch.h"
#include "ad... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-1999 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"
#include "modules/dom/src/domenvironmen... |
/*
* TreeLib
* A library for manipulating phylogenetic trees.
* Copyright (C) 2001 Roderic D. M. Page <r.page@bio.gla.ac.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; eith... |
#include <bits/stdc++.h>
using namespace std;
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 30000
#define INF 0x3f3f3f3f
#define DEVIATION 0.00000005
typedef long long LL;
struct disjoint {
int p[MAXN+10];
void init(){
memset(p,-1,sizeof(p));
}
int find(int k){
return p[k]<0 ? k... |
/*
This file is part of the VRender library.
Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr)
Version 1.0.0, released on June 27, 2005.
http://artis.imag.fr/Members/Cyril.Soler/VRender
VRender is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as pub... |
#include "Boss.h"
vector<RECT> Boss::LoadRECT(BossState::StateName state)
{
vector<RECT> listSourceRect;
RECT rect;
switch (state)
{
case BossState::StandHuman:
rect.left = 8; rect.top = 9; rect.right = rect.left + 64; rect.bottom = rect.top + 70; listSourceRect.push_back(rect);
rect.left = 80; rect.top = 1... |
#include "OpCode.hpp"
/*
#include "Runtime.hpp"
#include "DictionaryWord.hpp"
#include "CountedString.hpp"
#include "StructuredMemory.hpp"
#include "Builder.hpp"
#include <string>
#include <iostream>
#include "TermialIO.hpp"
int digitValue(int base, char c) {
if (c >= '0' && c <= '9') {
if (c -... |
/*
Crayfish - A collection of tools for TUFLOW and other hydraulic modelling packages
Copyright (C) 2016 Lutra Consulting
info at lutraconsulting dot co dot uk
Lutra Consulting
23 Chestnut Close
Burgess Hill
West Sussex
RH15 8HN
This program is free software; you can redistribute it and/or
modify it under the terms o... |
#ifndef __ModuleKatana_H__
#define __ModuleKatana_H__
#include "Module.h"
#include "Animation.h"
#include "p2Point.h"
#include "ModuleInput.h"
//#include "SDL_mixer\include\SDL_mixer.h"
struct SDL_Texture;
struct Collider;
struct Mix_Chunk;
enum player_state {
SPAWN_PLAYER,
IDLE,
BACKWARD,
GO_BACKWARD,
BACK_ID... |
#pragma once
#ifndef WIMGUI_MESH_PAINTER_H
#define WIMGUI_MESH_PAINTER_H
#include <vector>
#include <string>
#include <fstream>
#include <memory>
#define GLM_FORCE_RADIANS
#pragma warning(push, 0)
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/transform.hpp>
#include <glm/mat4x4.hpp>
#include <glm... |
/**素数环问题*/
#include <iostream>
#include <cstdio>
#include <cmath>
#include<cstring>
using namespace std;
int judge[25],ar[25];
int n;
/**素数判断*/
int prime(int sum)
{
if(sum < 2)
return 0;
for(int i=2; i<=sqrt(sum); i++)
{
if(sum % i == 0)
return 0;
}
return 1;
}
void ... |
#include ".\graphics.h"
#include "Variables.h"
#include "Camera.h"
#include "console.h"
#include "SDL_image.h"
extern Camera *camera;
extern gamevars *vars;
extern Console *console;
#pragma comment(lib,"sdl.lib")
#pragma comment(lib,"sdlmain.lib")
#pragma comment(lib,"sdl_image.lib")
#pragma comment(lib... |
#pragma once
#include "../../framework.h"
#include "../gl_command.h"
namespace glmock
{
//
// http://www.opengl.org/sdk/docs/man3/xhtml/glDeleteTextures.xml
class GLGetError : public IReturns<GLenum>, public GLCommand
{
public:
GLGetError();
virtual ~GLGetError();
public:
virtual void Returns(GLenum retu... |
#include <thread>
#include <vector>
#include <iostream>
#include "common/thread/thread_instance.h"
#include "common/thread/thread.h"
#include "common/thread/lock.h"
#include "common/thread/lock_guard.h"
#include <gtest/gtest.h>
namespace common {
class A {
public:
int64_t a_;
};
MutexLock m;
std::vector<std::share... |
#ifndef Q53_H
#define Q53_H
#include<iostream>
#include<stdlib.h>
#include<stack>
#include<queue>
#include<stdio.h>
#include<string.h>
using namespace std;
/* 5.3-综合题02:设计一个算法,判断一个无向图是否为一颗树
*/
#define INF_MAX 999999
const int vexNum = 9;
bool visits[vexNum];
typedef struct ENode
{
int adjvex; // 邻接顶点
int... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
//
// Copyright (C) 2003-2007 Opera Software AS. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
//
//
#ifndef WINDOWS_LAUNCH_PI_H
#define WINDOWS_LAUNCH_PI_H
#i... |
#pragma once
#include "bricks/core/autopointer.h"
#include "bricks/audio/miditypes.h"
namespace Bricks { namespace IO { class Stream; class StreamReader; } }
namespace Bricks { template<typename T> class ReturnPointer; }
namespace Bricks { namespace Audio {
class MidiReader : public Object
{
protected:
AutoPoin... |
#include <iostream>
#include <string>
#include "CarInsoles.hpp"
#pragma warning (disable:4996)
CarInsoles::CarInsoles(): material(materials::carpets)
{
this->product_name = product::carInsoles;
}
CarInsoles::CarInsoles(const std::string& mark, const double& price, const unsigned int& count, const materials& material... |
#include "rectangle.h"
#include <iostream>
#include <stdexcept>
using namespace std;
Rectangle::Rectangle(float new_height, float new_width) : Shape("Rectangle", "Red"){
width = new_width;
height = new_height;
if(area() == 0){
throw domain_error("Invalid constructor argument");
}
}
float Rect... |
#pragma once
#include "ParallelPrimeFinder.h"
class SieveParAlternative2 :
public ParallelPrimeFinder
{
// Inherited via ParallelPrimeFinder
virtual std::string name() override;
virtual int* find(int min, int max, int* size) override;
};
|
/*
playing_screen.hpp
Purpose: Handle all the logic of the main gameplay (e.g. collisions,
enemies, items, etc).
@author Jeremy Elkayam
*/
#pragma once
#include <memory>
#include <iostream>
#include <list>
#include <random>
#include <chrono>
#include <algorithm>
#include <stdexcept>
#include "player... |
#include <maya/MGlobal.h>
#include <maya/MPxCommand.h>
#include <maya/MFnPlugin.h>
#include <maya/MString.h>
#include <maya/MArgList.h>
#include <maya/MObject.h>
#include "third_class.h"
#define __VENDOR "kingmax_res@163.com | 184327932@qq.com | iJasonLee@WeChat"
#define __VERSION "2018.07.25.01"
namespace NeoBards
... |
/*
* Copyright (C) 20182-2021 David C. Harrison. All right reserved.
*
* You may not use, distribute, publish, or modify this code without
* the express written permission of the copyright holder.
*/
// Citation:
// String Sort Method: https://www.geeksforgeeks.org/sort-an-array-of-strings-lexicographically-base... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
public:
void setupConnects();
public slots:
void handlePrevButtonClicked();
... |
/**
* @author: aaditkamat
* @date: 31/12/2018
*/
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
int ind(char m, char n) {
return m == n ? 0 : 1;
}
int dist(string first, string second) {
int firstLength = first.length(), secondLength = second.length();
int m[firstLeng... |
#pragma once
/*
===========================================================================
Copyright (C) 2017 waYne (CAM)
===========================================================================
*/
#pragma once
#ifndef ELYSIUM_CORE_MATH_NUMERICS_QUATERNIONDOUBLE
#define ELYSIUM_CORE_MATH_NUMERICS_QUAT... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* @author Cihat Imamoglu (cihati)
*/
#ifndef QUICK_BUTTON_STRI... |
class BrowserHistory {
public:
vector<string> vec;
int idx = 0;
BrowserHistory(string homepage) {
vec.push_back(homepage);
}
void visit(string url) {
if (idx + 1 < vec.size()) {
vec.resize(idx + 1);
vec.shrink_to_fit();
}
vec.push_bac... |
#ifndef BLACKJACK_H
#define BLACKJACK_H
#include "main/minigame.h"
#include "mini/BlackJack/blackjacktile.h"
#include "mini/BlackJack/about_blackjack.h"
#include <QDialog>
#include <QAbstractButton>
#define num2 3
namespace Ui {
class BlackJack;
}
class BlackJack : public QDialog, public Minigame
{
Q_OBJECT
pu... |
/** Underscore
@file /.../Source/Kabuki_SDK-Impl/_Id/EmailAddress.h
@author Cale McCollough <http://calemccollough.github.io>
@copyright Copyright © 2016 Cale McCollough
@license http://www.apache.org/licenses/LICENSE-2.0
*/
#include "_Id/EmailAddress.h"
using namespace _Id;
EmailAddress... |
// codecmanager.cc
// 5/21/2015 jichi
#include "qtembedplugin/codecmanager.h"
#include "qtembedplugin/pluginmanager.h"
#include <QtCore/QTextCodec>
#include <boost/assign/list_of.hpp>
#include <boost/foreach.hpp>
#include <vector>
#include <unordered_map>
//#define DEBUG "embedplugin::codecmanager"
//#include "sakurak... |
#pragma once
#include "SDL.h"
#include "GameState.h"
class GameSetupState : public GameState
{
public:
void init(Game* game);
void pause();
void resume();
void clean(Game* game);
void handleEvents(Game* game);
void draw(Game* game);
void update(Game* game);
static GameSetupState* Instance()
{
return &mGame... |
#include "Arduino.h"
#include "PD443X.h"
int _Adr0;
int _Adr1;
int _Adr2;
int _CE;
int _WR;
int _RST;
int _latch;
int _clock;
int _data;
PD443X::PD443X(int Adr0,int Adr1,int Adr2,int CE,int RST,int WR,int latch,int clock,int data)
{
_Adr0 = Adr0;
_Adr1 = Adr1;
_Adr2 = Adr2;
_CE = CE;... |
// Created on: 2013-12-20
// Created by: Denis BOGOLEPOV
// Copyright (c) 2013-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 General Public License version 2.1 ... |
//Pie
//UVA12097
/*
題目描述:
現在有一些不同半徑的蛋糕,每個厚度都是 1,現在有 F 個朋友和自己要去分,
而每個人所得到的蛋糕塊的體積要一樣,但分的時候只能來自於一塊蛋糕,
不可由來自不同蛋糕的小蛋糕構成。
題目解法:
二分答案,然後去除每塊蛋糕取整數,得到該蛋糕可以分出幾份。
*/
#include<iostream>
#include<algorithm>
#include<iomanip>
#include<cstdio>
#include<cmath>
using namespace std;
const int maxn = 10000 + 5;
const double pi = a... |
#include<iostream>
using namespace std;
int Merge(int array[] , int p , int q , int r){
int left_size , right_size , i , j , k;
left_size = q - p + 1; // array kiri
right_size = r - q ; // array kanan
int L[left_size] , R[right_size];
for(i = 0 ; i < left_size ; i++) {
L[i] = array... |
//Gvector.cpp
#include <vector>
#include "Gvector.h"
using namespace std;
Gvector::Gvector(){
nx = 0;
ny = 0;
vect = new complex<double>[0];
}
Gvector :: Gvector(int nnx, int nny, complex<double> val){
nx = nnx;
ny = nny;
vect = new complex<double>[nnx*nny];
for (int i=0 ; i<nx*ny ; i++) {
vect[i] = val... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "ObjectInfo.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class FPS_TEST_5_API UObjectInfo : public UActorComponent
{... |
#include <iostream>
#include "ABB.h"
using namespace std;
int main()
{
ABB A;
int e,n;
cout << "Ingresa n: ";
cin >> n;
for(int i=0;i<n;i++){
cout << "Ingresa el valor entero: ";
cin >> e;
A.inserta(e);
}
A.entreorden();
A.preorden();
A.postorden();
... |
#ifdef IS_LIB
# ifdef _WIN32
__declspec(dllexport)
# endif
int internal_empty_1()
{
return 0;
}
#else
# ifdef _WIN32
__declspec(dllexport)
# endif
int empty_1()
{
return 0;
}
#endif
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 1995-2007 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef VEGATRANSFORM_H
#define VEGATR... |
#include "EnemyLogicCalculator.h"
#include "Core.h"
EnemyLogicCalculator::EnemyLogicCalculator():
m_collidingWithPlayer(false)
{
}
EnemyLogicCalculator::~EnemyLogicCalculator()
{
//not responsible to free any element
}
void EnemyLogicCalculator::init(LevelModel* levelModel, AvatarModel* avatarModel )
{
m_avatarMo... |
#include "Player.h"
Player::Player()
{
}
Player::~Player()
{
}
bool Player::initWithNum(int num)
{
char filename[64] = { 0 };
sprintf(filename, "%d", num);
if (!Sprite::initWithFile("playerbg.png"))
{
return false;
}
this->setAnchorPoint(Vec2(0.5, 0.5));
this->setOnBall(false);
_title = LabelTTF::crea... |
#include <iostream>
#include <boost/log/core.hpp>
#include <boost/log/attributes.hpp>
#include <boost/log/attributes/scoped_attribute.hpp>
#include <boost/log/expressions.hpp>
#include <boost/log/expressions/keyword.hpp>
#include <boost/log/sources/global_logger_storage.hpp>
#include <boost/log/sources/severity_channe... |
#pragma once
#include <stdint.h>
#define XHCI_PORT_OFFSET 0x400
#define USB_CMD_RS (1 << 0) // Run/Stop
#define USB_CMD_HCRST (1 << 1) // Host Controller Reset
#define USB_CMD_INTE (1 << 2) // Interrupter enable
#define USB_STS_HCH (1 << 0) // HCHalted - 0 if CMD_RS is 1
#define USB_STS_HSE (1 << 2) // H... |
// $Id$
//
// (C) Copyright Mateusz Loskot 2008, mateusz@loskot.net
// Distributed under the BSD License
// (See accompanying file LICENSE.txt or copy at
// http://www.opensource.org/licenses/bsd-license.php)
//
#include <liblas/header.hpp>
#include <tut/tut.hpp>
#include "common.hpp"
// boost
#include <boost/cstdint.h... |
#ifdef _PSP_VER
#include "Vector3.h"
#include <libvfpu.h>
//--------------------Operators-----------------------//
Vector3& Vector3::operator =(const Vector3 &rhs)
{
_vec.x = rhs.X();
_vec.y = rhs.Y();
_vec.z = rhs.Z();
return *this;
}
bool Vector3::operator ==(const Vector3 &rhs)
{
return ( _vec.x == rhs.X()... |
// Created on: 1993-01-09
// Created by: CKY / Contract Toubro-Larsen ( TCD )
// 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
/... |
#pragma once
#include <pv/Exception.hh>
#include <cstdarg>
#include "visibility.h"
namespace pv {
class DSO_LOCAL Logger;
class Logger {
public:
virtual ~Logger() = default;
virtual void error(const Exception&) const noexcept = 0;
virtual void error(const char *, int, unsigned int,
const char * = "") cons... |
//
// EventReceiver.hpp for event receiver in /home/deneub_s/cpp_indie_studio
//
// Made by Stanislas Deneubourg
// Login <deneub_s@epitech.net>
//
// Started on Fri May 5 18:11:56 2017 Stanislas Deneubourg
// Last update Fri May 5 18:19:34 2017 Stanislas Deneubourg
//
#ifndef EVENTRECEIVER_HPP
#define EVENTR... |
// Created on: 1997-09-22
// Created by: Roman BORISOV
// Copyright (c) 1997-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 ... |
#ifndef _PCSORT_H_
#define _PCSORT_H_
template<class T>
inline void swap(T *x,T *y){
T t;
t=*x;
*x=*y;
*y=t;
}
template<class T>
void Bubble(T *data,int n){
int i,j;
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
if(data[j-1]>data[j])
swap(&data[j-1],&data[j]);
}
}
}
template<class T>
void Selection(T *data,i... |
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<string> binaryTreePaths(TreeNode* root) {
if(!root) return{};
vector<str... |
#pragma once
#include"Shaders.h"
#include"VertexBuffer.h"
#include"ConstantBuffer.h"
#include"MovementComponent.h"
#include"IndexBuffer.h"
#include"Material.h"
static const char* MODEL_PATH = "Models/";
static const char* ERROR_MODEL = "cube.obj";
class Model
{
enum class ModelFormat
{
ModelFormat_obj,
ModelFo... |
#include "StrLib.h"
#include <stdio.h>
#include <sstream>
#include <string>
int S2I(string & s, bool &check){
istringstream buffer(s);
int i=0;
if(buffer>>i) check = true;
else check = false;
return i;
}
string I2S(int i){
ostringstream buffer;
buffer<<i;
return buffer.str();
}
string Re... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2009 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
/** \file
*
* \brief Declare a memory policy manager class
*
* Th... |
#include "core/pch.h"
#ifdef MDEFONT_MODULE
#ifdef MDF_FREETYPE_SUPPORT
# ifdef MDF_FREETYPE_PCF_FONT_SUPPORT
#include "modules/mdefont/mdf_ft_pcf_ext.h"
#include "modules/unicode/unicode.h"
static inline uint16 get_word(void* buf)
{
byte* byte_buf = static_cast<byte*>(buf);
return static_cast<uint16>( *byte_buf ... |
#include "Firebase_Client_Version.h"
#if !FIREBASE_CLIENT_VERSION_CHECK(40319)
#error "Mixed versions compilation."
#endif
/**
*
* This library supports Espressif ESP8266, ESP32 and Raspberry Pi Pico (RP2040)
*
* Created July 20, 2023
*
* This work is a part of Firebase ESP Client library
* Copyrigh... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
// Author: Tatparya Shankar
// Implementation : Integer Partitioning
void printArray( int * array, int length )
{
cout << "Array :";
for( int i = 0; i < length; i++ )
{
cout << " " << array[i];
}
... |
#include<iostream>
using namespace std;
int main()
{
int n,k,i,j;
cin >> n;
for(i = n; i >= 1; i--)
{
for(k=i;k<n;k++)
cout << " ";
for(j=1;j<=i;j++)
cout << j;
cout << "\n";
}
return 0;
}
|
//
// NBody_gendata.cpp
// generate test data
//
//
#include<stdio.h>
#include<stdlib.h>
#include<fstream>
#include<string>
#include<iostream>
#include<sstream>
#include<math.h>
#include<vector>
using namespace std;
void createTestCase(int x, int maxLevel, string file) {
ofstream out;
double fx = (double)x... |
// BEGIN CUT HERE
// PROBLEM STATEMENT
// Consider a hexagonal grid with 6 sides, with the side
// lengths given by the int[] s (in the clockwise order), as
// shown in the following picture:
//
// Count the number of ways to color each cell with one of
// two colors, black or white, such that every non-border
// ... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 2004-2011 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"
#ifdef WIDGET_RUNTIME_SUPPORT
#include <unistd.h>
#include "de... |
#include <cctype>
#include <chrono>
#include <gsl/gsl>
#include <iostream>
#include <benchmark/benchmark.h>
#include <HistoryItem.h>
#include <HistoryItemModel.h>
#include <QStandardItemModel>
#include <FuzzySearch.h>
static size_t GetTimestamp()
{
auto duration = std::chrono::system_clock::now().time_since_epoch(... |
#ifndef _JYC_COMMON_H_
#define _JYC_COMMON_H_
#include <stdio.h>
#include <string.h>
#include <string>
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <vector>
#include <map>
#endif
|
#include <iostream>
using namespace std;
using ll = long long;
const int INF = 1 << 25;
int main() {
int N, M;
cin >> N >> M;
int a[M][N + 1], rev[M][N];
for (int i = 0; i < M; ++i) {
for (int j = 0; j < N; ++j) {
cin >> a[i][j];
--a[i][j];
rev[i][a[i][j]]... |
vector<int> Solution::solve(vector<int> &A) {
int n = A.size();
vector<int> suffix(n, 0);
int maxx = INT_MIN;
for (int i = n - 1; i >= 0; i--)
{
maxx = max(A[i], maxx);
suffix[i] = maxx;
}
vector<int> ans;
for (int i = 0; i < n - 1; i++)
{
if (A[i] > suffix[i ... |
#ifndef DEDVS_TYPES_H
#define DEDVS_TYPES_H
#include <cstdint>
#include <vector>
#include <chrono>
//EDVSTOOLS
#include "Edvs/Event.hpp"
namespace dedvs {
typedef std::chrono::high_resolution_clock::time_point ctp;
struct StreamInfo {
int x_resolution;
int y_resolution;
int fps;
bool mirror... |
#ifndef Second_HPP
#define Second_HPP
#include <QObject>
class Second : public QObject
{
Q_OBJECT
public:
Second();
~Second();
};
#endif
|
#pragma once
#include <string>
#include <AL/al.h>
enum EAudioSourceState
{
STATE_EMPTY,
STATE_STOP,
STATE_PLAY,
STATE_PAUSE,
STATE_REWIND
};
class AudioSource
{
public:
AudioSource(unsigned int& buffer);
void play(bool loop=false);
void pause();
void stop();
void rewind();
void free();
void set... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
//
// 1012.cpp
// baekjoon
//
// Created by 최희연 on 2021/06/29.
//
#include <iostream>
using namespace std;
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
int arr[51][51];
int visited[51][51];
void dfs(int M, int N, int x, int y){
if(visited[x][y] == 1)
return;
visited[x][y] = 1;
for(int ... |
#include "chunkblock.h"
#include "blockmanager.h"
ChunkBlock::ChunkBlock(Block_t id) :
id(id)
{
}
ChunkBlock::ChunkBlock(BlockId id) :
id(static_cast<Block_t>(id))
{
}
const Block &ChunkBlock::getBlock() const
{
return BlockManager::instance().getBlock(static_cast<BlockId>(id));
}
const BlockData &Chu... |
//
// Created by Brady Bodily on 2/27/17.
//
#ifndef BINGO_CARD_HPP
#define BINGO_CARD_HPP
#include <iostream>
#include <vector>
class Card {
public:
friend class CardTester;
friend class DeckTester;
Card(int cardSize, int numberMax, int cardIndex);
void print(std::ostream& out) const;
private:
... |
#ifndef PHYSICSLIST_HH
#define PHYSICSLIST_HH
#include "G4VModularPhysicsList.hh"
class PhysicsList : public G4VModularPhysicsList
{
public:
PhysicsList();
~PhysicsList();
protected:
void SetCuts();
};
#endif //PHYSICSLIST_HH
|
//----------------------------------------------------------------
// IconManager.cpp
//
// Copyright 2002-2004 Raven Software
//----------------------------------------------------------------
#include "../idlib/precompiled.h"
#pragma hdrstop
#include "Game_local.h"
#include "IconManager.h"
rvIconManager iconManage... |
#ifdef USES_P064
//#######################################################################################################
//#################################### Plugin 064: APDS9960 Gesture ##############################
//################################################################################################... |
#ifndef G_XMATH_H
#define G_XMATH_H
#include <stdlib.h>
#include <math.h>
namespace XMath {
// double version of rand() (in stdlib.h)
double dRand() {
return double(rand()) / RAND_MAX;
}
// norm of a vector (sqrt(x1*x1 + ... + xn*xn))
double dNorm(double* vec, int dim) {
double el... |
<<<<<<< HEAD
/*
==============================================================================
This file is part of the juce_core module of the JUCE library.
Copyright (c) 2016 - ROLI Ltd.
Permission to use, copy, modify, and/or distribute this software for any purpose with
or without fee is here... |
/*
* Copyright (c) 2021 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_DETAIL_IMMOVABLE_VECTOR_H_
#define CPPSORT_DETAIL_IMMOVABLE_VECTOR_H_
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <cstddef>
#include <ne... |
//
// Created by roy on 12/21/18.
//
#ifndef PROJECTPART1_SYMBOLTABLE_H
#define PROJECTPART1_SYMBOLTABLE_H
#include <unordered_map>
#include <string>
#include <mutex>
#include <iostream>
using namespace std;
/**
* This class is responsible for the storage of the variables which have
* assigned (double) values, bo... |
#ifndef CYCLISTDETECTOR_HPP
#define CYCLISTDETECTOR_HPP
#include "Detector.hpp"
#include "PointTracker.hpp"
#include "ObjectLocator.hpp"
class CyclistDetector: public Detector {
private:
RectangleTracker *old_tracker = nullptr;
RectangleTracker *new_tracker = nullptr;
ObjectLocator *object_locator = nullptr;
unsi... |
#include "Arduino.h"
#include <RZV_Blinking.h>
void setup_RZV_Blink(){
pinMode(LED_BUILTIN,OUTPUT);
}
void RZV_Blink(int durata){
digitalWrite(LED_BUILTIN,HIGH);
delay(durata);
digitalWrite(LED_BUILTIN,LOW);
delay(durata);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.