text
stringlengths
8
6.88M
#include "RelOp.h" void RelationalOp::WaitUntilDone() { pthread_join (operatorThread, NULL); } void RelationalOp::Use_n_Pages (int runlen) { this->runLength = runlen; return; } /************************************************************************************************** SELECT PIPE ************************...
// Copyright (c) 2018, Tobechukwu Osakwe. // // All rights reserved. // // Use of this source code is governed by an // MIT-style license that can be found in the LICENSE file. #include <ncurses.h> #include "JSEngine.h" tmacs::JSEngine::JSEngine(tmacs::EditorWindow *window, WINDOW* wnd) { this->window = window; ...
// Fill out your copyright notice in the Description page of Project Settings. #include "Savio.h" #include "MySavioProjectile.h" #include "GameFramework/ProjectileMovementComponent.h" AMySavioProjectile::AMySavioProjectile(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { PrimaryActorTick.b...
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <ctime> #include <memory.h> #include <cmath> #include <string> #include <cstring> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #inc...
#include<bits/stdc++.h> using namespace std; typedef long long ll; vector<vector<ll>> dp(1000,vector<ll>(1001,-1)); ll n; vector<ll> arr(1000); ll dp_rec(ll i,ll limit){ if(dp[i][limit]!=-1) return dp[i][limit]; if(i==n-1){ if(arr[n-1]<=limit) dp[i][limit] = arr[n-1]; else dp[i][limit] = 0; r...
#pragma once #include "GameObject.h" //*Class description*// class Round : public GameObject { public: Round(int x, int y); void virtual update(); void virtual render(); void virtual collided(int otherObjectID); };
/* Petar 'PetarV' Velickovic Algorithm: Prim's Algorithm */ #include <stdio.h> #include <math.h> #include <string.h> #include <iostream> #include <vector> #include <list> #include <string> #include <algorithm> #include <queue> #include <stack> #include <set> #include <map> #include <complex> #define MAX_N 101 using ...
#include "Animation.h" Animation::Animation(void) : maxFrames(0), oscillate(false), currentFrame(0), frameIncrement(1), frameDuration(100), //milliseconds oldTime(0) { } Animation::~Animation() { } void Animation::onAnimate(void) { if (oldTime + frameDuration > SDL_GetTicks())...
#include <iostream> #include <string> using namespace std; #ifndef PERSON_H #define PERSON_H class Person { private : string name; string ssnum; int age; public: Person(); Person(string pname, string pssnum, int page); ~Person(); string getName(); string getSSNum(); int getAge(); void setName(st...
#ifndef NUMBER_HPP #define NUMBER_HPP #include "var.hpp" class Number : public Var { public: Number(); Number(int val); /*Number virtual operator+(const Number& num) { } Number virtual operator=(const Number& num) { }*/ }; #endif
#include "queue.hpp" void validNumber(int& number) { while (std::cin.fail()) { std::cout << "Invalid Value: Try again!" << std::endl; std::cin.clear(); std::cin.ignore(256,'\n'); std::cout << "Please enter the intager number: "; std::cin >> number; } } void chooseFu...
#include <string.h> #include <iostream> #include <chord/rpcclient.hpp> #include <chord/transport.hpp> #include "../chord.pb-c.h" //===================================================================================== // Pack Arguments and Send Call //=================================================================...
#include<iostream> #include "Node.h" using namespace std; int main(){ Node *root=new Node(1); }
/* ============================================================================ Name : Eris.cpp Author : Vinicius Jarina Version : Copyright : Copyright (c) 2009 JarinSoft. (http://viniciusjarina.googlepages.com/) Description : Application entry point ======================================...
//in this version, free list has no use, since the only element to free is mutex. //in this version, old_list has no use, only a simple LRU is done.(all elements are moved to HIR) //in the next version, a queue is needed in order to change LRU to LIRS #ifndef SJTU_BUFFER_POOL_HPP #define SJTU_BUFFER_POOL_HPP #include...
// Created on: 2018-03-15 // Created by: Stephan GARNAUD (ARM) // Copyright (c) 1998-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 ...
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*- * * Copyright (C) 1995-2005 Opera Software ASA. 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 XPATH_SUPPORT #include "modules/xpath/src/...
#include <cassert> #include <iostream> #include <string> namespace ciphers { namespace caesar { inline char get_char(const int x) { return char(x + 65); } inline int get_val(const char c) { return int(c - 65); } std::string encrypt(const std::string &text, const int &shift) { std::string encrypted = ""; ...
// Created on: 1995-12-01 // Created by: EXPRESS->CDL V0.2 Translator // 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 te...
// Created by: Kirill GAVRILOV // Copyright (c) 2019 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 as published // by the Free Sof...
#include "Color.h" #ifdef _WIN32 #include <Windows.h> #include <iostream> #endif namespace Log { #ifdef __linux__ std::string Color (int Color, std::string Text) { switch (Color) { case BLACK: return "\x1B[30m" + Text + "\x1B[0m"; break; case RED: return "\x1B[31m" + Text + "\x1B[0m"; break; ...
#ifndef OGREFRAMEWORK_H #define OGREFRAMEWORK_H #include <OgreCamera.h> #include <OgreLogManager.h> #include <OgreRoot.h> #include <OgreViewport.h> #include <OgreSceneManager.h> #include <OgreRenderWindow.h> #include <OgreConfigFile.h> #include "FirstPersonNoClip.h" #include "InputHandling.h" class OgreFramework :...
/* XMRig * Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh> * Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * ...
// // Created by YCJ on 2020/7/6. // #include "GrammarAction.h" GrammarAction::GrammarAction(const string&fileName) { this->fin.open(fileName,ios::trunc); } void GrammarAction::genetQuat(const string& a, const string& b, const string& c, const string& d) { fin<<begin<<a<<this->separator<<b<<this->separator<<c...
/* * H_Hit.h * * Created on: Oct 3, 2018 * Author: vsevolod */ #ifndef SRC_H_HIT_H_ #define SRC_H_HIT_H_ #include <G4VHit.hh> //G4 #include "G4VHit.hh" #include "G4THitsCollection.hh" #include "G4Allocator.hh" #include "G4ThreeVector.hh" //my #include "HitDataStructure.hh" class H_Hit: public G4VHit { pu...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2012 Opera Software ASA. 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 HAS_SET_HTTP_DATA #include "module...
#pragma once class SpinMotor; class RotatingRoom : public hg::IComponent { public: virtual int GetTypeID() const { return s_TypeID; } static uint32_t s_TypeID; void LoadFromXML( tinyxml2::XMLElement* data ); void Init(); void Start(); void Update(); bool IsFinished() { return m_Finished; } void SpawnNex...
/************************************************************************ * @project : $rootnamespace$ * @class : $safeitemrootname$ * @version : v1.0.0 * @description : * @author : $username$ * @creat : $time$ * @revise : $time$ ****************************************************************...
/* * Copyright [2017] <Bonn-Rhein-Sieg University> * * Author: Torsten Jandt * */ #include <mir_planner_executor/actions/unstage/mockup_unstage_action.h> #include <mir_planner_executor/actions/mockup_helper.h> bool MockupUnstageAction::run(std::string& robot, std::string& platform, std::string& object)...
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// // Примеры строк, работы с ними, а так же элементарная арифметика // V 1.0 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// #include<iostream> #include <cmath> // Библиотека простых математических операций usi...
// // film.cpp // serialowabaza // // Created by Julia on 06.11.2018. // Copyright © 2018 Julia. All rights reserved. // #include <stdio.h> #include <fstream> #include "film.h" void film::save(std::fstream & plik){ try { plik<<"F\n"; ogladadlo::save(plik); plik<<PEGI<<"\n"; } catch ...
#pragma once // CNpcDialog 对话框 class CNpcDialog : public CDialog { DECLARE_DYNCREATE(CNpcDialog) public: CNpcDialog(CWnd* pParent = NULL); // 标准构造函数 virtual ~CNpcDialog(); // 对话框数据 enum { IDD = IDD_NPC_DIALOG }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持...
#include<bits/stdc++.h> using namespace std; #define maxn 5005 int dp[maxn]; int type[maxn]; int main() { int n, m; scanf ( "%d%d", &n, &m ); for ( int i = 1; i <= n; i++ ) { double x; scanf ( "%d%lf", &type[i], &x ); } for ( int i = 1; i <= n; i++ ) { int j = ty...
// Copyright (c) 2020 CS126SP20. All rights reserved. #define CATCH_CONFIG_MAIN #include <cinder/app/App.h> #include <mylibrary/battleship.h> #include <mylibrary/ship.h> #include <catch2/catch.hpp> // Ship Class TEST_CASE("Ship Get Size", "[ship class]") { SECTION("Ship A") { mylibrary::Ship ship_a("ship A",...
#include<bits/stdc++.h> using namespace std; int main(){ int t; string s; cin>>t; int x = 0; for (int i = 0; i < t; i++) { cin>>s; if (s[1]=='-') { x -= 1; } else { x += 1; } } cout<< x...
#pragma once #include "DoubleLinkedList.h" template <typename T> class Queue : public DoubleLinkedList<T> { using DoubleLinkedList<T>::first; using DoubleLinkedList<T>::removeFirst; using DoubleLinkedList<T>::append; public: using DoubleLinkedList<T>::size; using DoubleLinkedList<T>::empty; public: virtual ~Que...
#include "BetCoinProc.h" #include "Logger.h" #include "HallManager.h" #include "Room.h" #include "ErrorMsg.h" #include "BaseClientHandler.h" #include "ProcessManager.h" #include "GameCmd.h" REGISTER_PROCESS(CLIENT_MSG_BET_COIN, BetCoinProc) BetCoinProc::BetCoinProc() { this->name = "BetCoinProc"; } BetCoinProc::~Be...
// // Created by micky on 15. 5. 23. // #ifndef JUDGESERVER_GRADING_H #define JUDGESERVER_GRADING_H #include "logger.h" #include "question.h" #include "KillTimerTask.h" #include "result.h" #include "Compile.h" #include <iostream> #include <map> #include <unistd.h> #include <string.h> #include <string> #include <time...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i++) #define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}} #define show(x) {for(auto i: x){cout << i << " ";} cout...
#pragma once class GameUserManager : public CMultiThreadSync<GameUserManager> { public: GameUserManager(); ~GameUserManager(); private: map<DWORD, GameUser*> m_GameUserMap; DWORD m_CurrentUserCount; public: BOOL Begin(); BOOL End(); VOID AddUser(GameUser* user, DWORD UID); VOID RemoveUser(DWORD UID); GameU...
#include "WizardButtons.h" #include "ui_WizardButtons.h" using namespace RsaToolbox; WizardButtons::WizardButtons(QWidget *parent) : QWidget(parent), ui(new Ui::WizardButtons) { ui->setupUi(this); } WizardButtons::~WizardButtons() { delete ui; } QPushButton *WizardButtons::previous() const { ret...
#ifndef __RANDOMPOINTS2D_H__ #define __RANDOMPOINTS2D_H__ #include <vector> #include "../Point2D.h" class RandomPoints2D { public: RandomPoints2D(); virtual ~RandomPoints2D(); void setPointCount(int count); void setExtent(int xmin, int xmax, int ymin, int ymax); void generate(); void write(c...
#ifndef CURSEUR_CLASSIQUE_HPP #define CURSEUR_CLASSIQUE_HPP #include "Curseur.hpp" namespace enseirb{ class CurseurClassique: public Curseur{ private: public: CurseurClassique(Chaine &); void operator++ () ; void operator-- () ; bool fini(); void debut(); void fin(); ...
#include "GwFsm.h" #include "Monster.h" #include "Gwexecute.h" GwFsm::~GwFsm() { NotificationCenter::getInstance()->removeAllObservers(this); } GwFsm* GwFsm::createEventFsm(Monster* m_monster) { GwFsm* fsm = new GwFsm(); if (fsm && fsm->init(m_monster)) { fsm->autorelease(); } else { CC...
/* * The MIT License (MIT) * * Copyright (c) 2014 Matt Olan, Prajjwal Bhandari * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the r...
#ifndef WE_WRAPPER_MISC_H #define WE_WRAPPER_MISC_H #include "src/args.h" #include "src/dictionary.h" #include "src/matrix.h" #include "src/model.h" /** * WE's wrapper misc */ namespace WEWrapper { struct FastTextPrivateMembers { std::shared_ptr <fasttext::Args> args_; std::shared_ptr <fasttext...
#include <iostream> int main(int argc, char const *argv[]) { std::cout<<"Hi Again World!"; return 0; }
/** * created: 2013-4-7 22:10 * filename: FKRandomGenerator * author: FreeKnight * Copyright (C): * purpose: */ //------------------------------------------------------------------------ #pragma once //------------------------------------------------------------------------ #include <windows.h> #include <Win...
// Font block 'magistraltt16_cyrillic_1bpp_0x401_0x401' definition // // Bitmap data static const esU8 sc_magistraltt16_cyrillic_1bpp_0x401_0x401_data[] = { ________,________, _XXXXXXX,XX______, _XX_____,________, _XX_____,________, _XX_____,________, _XX_____,________, _XXXXXXX,XX______, _XX_____,________, ...
#ifndef CD_h #define CD_h #include "SaleableItem.h" class CD :public SaleableItem { public: CD(const char* pTitle, unsigned int unitPricePence, unsigned int runningTimeMinsp, unsigned int noOfTracksp); unsigned int getNewPrice(void); private: unsigned int runningTimeMins, noOfTracks; }; #endif
#include <iostream> #include <unordered_map> #include <vector> using namespace std; int n, rightJoker, leftJoker; unordered_map<char, int> rightBootMap; vector<vector<int>> rightIndex(26), leftIndex(26); string rightBoots, leftBoots; int solve() { int ans = 0, notFound = 0; vector<pair<int, int>> ansPairs; ...
#ifndef _TUTORIALSHIPVSTOWER_ #define _TUTORIALSHIPVSTOWER_ #include "ModeShipVSTower.h" //#define theTutorialShipVsTower TutorialShipVsTower::getInstance() class TutorialShipVsTower :public ModeShipVSTower { private: // true if we has to switch on other message bool m_bSwitchMessage; ...
class ItemSolder_DZE : ItemCore { scope = 2; displayName = $STR_EQUIP_SOLDER; model = "\nst\ns_dayz\items\solder\solder_dzn.p3d"; picture = "\nst\ns_dayz\items\solder\data\icon_solder_dzn_ca.paa"; descriptionShort = $STR_EQUIP_SOLDER_DESC; }; class ItemSolderBroken_DZE : ItemCore { scope = 2; displayName = $S...
#ifndef INPUTCONTEXT_H #define INPUTCONTEXT_H #include <qpa/qplatforminputcontext.h> class InputView; class InputContext : public QPlatformInputContext { Q_OBJECT public: InputContext(); ~InputContext(); // QPlatformInputContext interface public: void commit() override; ...
// http://oj.leetcode.com/problems/sum-root-to-leaf-numbers/ /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { void do_sum(TreeNode *root, int cur, int &sum) { ...
// Copyright 2017 Google Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, ...
#include <iostream> #include <stdio.h> using namespace std; int main() { int x = 5; int *j; j = &x; printf("%d \n", x); printf("%d \n", *j); printf("%d \n", j); return 0; }
#include "Structure.h" #include "Consts.h" #include "Token.h" #include "Variable.h" double fctr(double x) // Factorial { if (x < 0) { error("Factorial(value), value < 0 - Wrong operation"); } if (x != round(x)) { error("Factorial(value), value - Natural number"); } if (x =...
// Check that no errors occur when compiling without the plugin. // RUN: %clangxx -std=c++11 -fsyntax-only %s 2>&1 | FileCheck %s -allow-empty \ // RUN: --check-prefix=CHECK-NO-PLUGIN // CHECK-NO-PLUGIN-NOT: {{.*}}error{{.*}} // "not" is used here because compiling with our plugin SHOULD result in an // error (and ...
#include "TileMap.h" TileMap::TileMap() { //ctor } TileMap::~TileMap() { //dtor } bool TileMap::load(const std::string& tileset, sf::Vector2u tileSize, const int* tiles, unsigned int width, unsigned int height) { // load the tileset texture if (!m_tileset.loadFromFile(tileset)) ...
#pragma #ifndef WORLD_H #define WORLD_H #include <BFW/Scene.h> #include "Card.h" #include <BFW/text.h> //#include "BFW/Button.h" class World : public Scene { public: World(); virtual ~World(); virtual void update(float Deltatime); Card* card = nullptr; Card* card1 = nullptr; //Button* button; private: }; #...
// Created on: 1995-12-07 // Created by: Frederic MAUPAS // 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 GN...
#include <iostream> #include <vector> #include <cmath> using namespace std; vector<vector<int>> g; vector<bool> used; vector<int> parent; vector<int> h; vector<vector<int>> up; void dfs(int v) { used[v] = true; for (auto to : g[v]) { if (!used[to]) { parent[to] = v; h[to] = h[...
#include <iostream> #include <vector> #include <algorithm> #include <string> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); int n; std::cin >> n; for (int i = 0; i < n; ++i) { int r; std::string s; std::cin >> r >> s; ...
#pragma once #include "GameObject.h" #define NR_OF_CHAIN_LINKS 128 class Chain { private: bool m_visible; bool m_shooting; bool m_retracting; Timer m_timer; std::vector<GameObject*>* m_chainGObjects; std::vector<bool> m_retractedLinks; int m_nrOfUnretractedLinks; GameObject* m_hookGObject; GameObject* m_gau...
void rotate(vector<int>& nums, int k) { k = k % nums.size(); vector<int> tmp(nums.begin()+nums.size()-k, nums.end()); tmp.insert(tmp.end(), nums.begin(), nums.begin()+nums.size()-k); nums = tmp; }
#include<iostream> #include<fstream> #include<string> #include"stdio.h" using namespace std; int main() { string line,filename; cout<<" enter the file to be rearraged : "; cin>>filename; fstream myfile1_1(filename.c_str(),fstream::in); fstream myfile2("temporary.txt",fstream::out|fstream::app); if(myfile1_1.is_open...
// NLequationCalculatorDlg.cpp : implementation file // #include "stdafx.h" #include "NLequationCalculator.h" #include "NLequationCalculatorDlg.h" #include "NLequation.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ////////////////////////////////////...
#include "walkermodel.h" #include <boost/numeric/ublas/triangular.hpp> #include <boost/numeric/ublas/io.hpp> #include <algorithm> #include <math.h> using namespace boost::numeric::ublas; WalkerModel::WalkerModel() : Model() { // Change the model parameters here m_p.slope = -0.05; // Lower the shin weight...
#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 in std::cin #define out std::cout #define re...
#include "Operator.h" #include "Value.h" #include "Instruction.h" #include "Constants.h" #include "Operator.h" #include "Type.h" using namespace LLVM; Operator::Operator(llvm::Operator *base) : base(base) , User(base) { } inline Operator ^Operator::_wrap(llvm::Operator *base) { return base ? gcnew Operator(base) :...
#include<bits/stdc++.h> using namespace std; int main(){ int N, M; cin >> N >> M; int H[100000]; for(int i=0; i<N; i++){ cin >> H[i]; } bool good[100000];//道がつながっていないときもいい展望台なのでtrueで埋める for(int i =0; i < N; i++){ good[i] = true; } for(int i =0; i < M; i++){//道の数ぶん入力するのでM...
/* Funcion que se llama asi misma Tiene un caso base y un caso general */ #include <iostream> #include <conio.h> using namespace std; void menu(); int factorialNum(int); int main(){ char opcion; int numero; do{ menu(); cin>>opcion; fflush(stdin); switch(opcion){ case '1': ...
#pragma once #include <globals.h> #include <scene/materials/bsdf.h> #include <raytracing/ray.h> #include <scene/geometry/primitive.h> #include <QList> #include <scene/materials/medium.h> class Material; class BSDF; class Primitive; class PhaseFunction; class Medium; //struct MediumInterface; struct MediumInterface { ...
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QFile> #include <QTextStream> #include <QMessageBox> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { this-> ui->setupUi(this); connect(ui->pushButton, SIGNAL(clicked()), this, SLOT...
#ifndef _ANIMATION_H #define _ANIMATION_H #include <SDL/SDL.h> class Animation { public: Animation(); ~Animation(); void onAnimate(void); void setFrameDuration(int newDurationMs); //set frame length in ms void setCurrentFrame(int frame); const int getCurrentFrame(...
// // Created by Abiodun Quadri Adekunle on 17/10/2019. // #ifndef TICTACTOE_BOARD_H #define TICTACTOE_BOARD_H class Board { char positions[16]; public: Board(); void printBoard(); char* getPositions(); void checkResponse(char input); static int getUserResponse(); int setPosition(int gridN...
#include <sstream> #include "FeaturesView.h" FeaturesView::FeaturesView() { registerInput(_segments, "segments"); registerInput(_features, "features"); registerInput(_problemConfiguration, "problem configuration"); registerInput(_objective, "objective"); registerOutput(_painter, "painter"); } void FeaturesView:...
#include<iostream> #include<cmath> using namespace std; int T,n,a[50000]; int i,t,dp[50000]; int main(){ cin >> T ; while (T--) { cin >> n; for(int k = 0; k < n; k++){ cin >> a[k]; } dp[0] = 1; for( i = 1;i < n; i++ ){ dp[i] = 1; for(int j =0; j < i; j++ ){ if(a[i] <= a[j] ){ dp[i] = max ( d...
#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <map> typedef long long LL; typedef unsigned long long ULL; #define PI 3.141592653589...
// Fill out your copyright notice in the Description page of Project Settings. #include "HierarchyActor.h" // Sets default values AHierarchyActor::AHierarchyActor() { // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = t...
#include <iostream> #include <cstring> using namespace std; int main() { char str[32],ch[1]; int len,k(0),m(0); cin>>str>>ch; len=strlen(str); for(int i=0;i<len;i++) { if(str[i]==ch[0])k++; } if(k==0)cout<<"NULL"; else for(int i=0;i<len;i++) { if((str[i]=...
#include <librealsense2/rs.hpp> // Include RealSense Cross Platform API #include<iostream> #include<flightcv/flightcv.h> #include <pthread.h> #include <sys/types.h> #include <csignal> cv::VideoWriter writer; cv::VideoWriter dwriter; cv::VideoWriter cwriter; void singal_ctrlc(int singo){ writer.release(); dwrit...
/********************************************************************* This file is part of QtUrban. QtUrban 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 Software Foundation, version 3 of the License. QtUrban is d...
#pragma once #include <NetworkModel/NetworkModel/IOCP/IOCP.hpp> #include "../PacketManager/PacketManager.h" #include "../UserManager/UserManager.h" #include "../MonsterManager/MonsterManager.h" #include "../GridManager/GridManager.h" class IOCP final : public NETWORKMODEL::IOCP::CIOCP { private: std::chrono::system_c...
/* * AUTHOR: Carlo Pinciroli <cpinciro@ulb.ac.be> * * An example flocking controller for the loot-bot. * * This controller lets a group of loot-bots flock in an hexagonal lattice towards * a light source placed in the arena. To flock, it exploits a generalization of the * well known Lennard-Jones potential. The ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2011-2012 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef MODULES_OTL_REVERSEITERATOR_H #define MODULES_OTL_REVERS...
// Non Ordered linked-list // implementation simplest // add - o(1) // remove - o(n) // tick - o(n) // TAOCP - page 238 INFORMATION STRUCTURES // 2.2. LINEAR LISTS // 2.2.1. Stacks, Queues, and Deques // 2.2.3. Linked Allocation template<typename TAlloc> class LinkedListTimer { struct TimerItem { ui32 id; u...
// Fill out your copyright notice in the Description page of Project Settings. #include "WreckingBall.h" #include "_Components/NeuralInputComponent.h" #include "Libraries/GeneticFL.h" #include "GeneticAIGameModeBase.h" #include "NeuralNetwork/Manager/NeuralNetworkManager.h" #include "_Components/DamageatorComponent.h...
#include <iostream> using namespace std; int main(){ char a[3] = {'W','T','L'}; double max[3] = {0.0}; int maxindex[3] = {0}; double temp; for(int i = 0;i < 3;i++){ for(int j = 0;j < 3;j++){ cin>>temp; if(temp > max[i]){ max[i] = temp; maxindex[i] = j; } } } printf("%c %c %c %.2lf",a[maxin...
#ifndef __LIGHT_H__ #define __LIGHT_H__ #include "vector3.h" #include <string> #include <fstream> #include <vector> class Light{ public: Light(float x, float y, float z, int r, int g, int b); Vector3 Pos; //world coordinates int iR, iG, iB; }; #endif
#include <iostream> #include <fstream> #include <cmath> #include <cstdio> #include <cstdlib> #include "TFile.h" #include "TH1.h" #include "TH2.h" using namespace std; int main(int argc, char ** argv) { if (argc != 3) { cerr << "Wrong number of arguments. Instead use:\n" << "\tmake_ratios /path/to/his...
#ifndef MacOpFileChooser_H #define MacOpFileChooser_H class MacOpFileChooser : public OpFileChooser { public: virtual OP_STATUS ShowOpenSelector(const OpWindow* parent, const OpString& caption, const OpFileChooserSettings& settings); virtual OP_STATUS ShowSaveSelector(const OpWindow* parent, const OpString& caption,...
#include <algorithm> #include <cstring> #include <iostream> #include "parameter.h" #include "redutilcu.h" #include "red_constants.h" using namespace redutilcu; parameter::parameter(string& dir, string& filename, bool verbose) : filename(filename), verbose(verbose) { create_default(); string pa...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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. */ #include "core/pch.h" #ifdef WEBSERVER_SUPPORT #include "modu...
#pragma once #include <memory> #include "Geometry.h" class Scene; //ゲーム全体を制御するクラス class Game { private: Game(); //生成禁止 Game(const Game&); //コピー禁止 void operator=(const Game&)const; //代入禁止 ///シーン管理 std::shared_ptr<Scene> _scene; public: Size screen_size; static Game& Instance() { static Game instance; ...
#include "SystemDS.h" #include "Loader-inl.h" #include "Perlin-inl.h" #include <cmath> #include <glog/logging.h> #include <iostream> using namespace std; namespace ICG { const double PI = acos(-1); // Implementation of CoreCGSystem void CoreCGSystem::loadDataFromFile(const string &desFile) { if (!Loader::loadDesFi...
#ifndef _ROS_SERVICE_MotionPlan_h #define _ROS_SERVICE_MotionPlan_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" #include "sub8_msgs/Waypoint.h" #include "sub8_msgs/Trajectory.h" namespace sub8_msgs { static const char MOTIONPLAN[] = "sub8_msgs/MotionPlan"; class MotionPlanReque...
//************************************************************************************************************* // // ハッシュチェイン処理 [myhash_chain.h] // Author:IKUTO SEKINE // //************************************************************************************************************* #ifndef _MYHASH_CHAIN_H_ #def...
#ifndef LOGIN_H #define LOGIN_H #include <QMainWindow> #include <QDialog> #include <QWidget> #include <QFileInfo> #include <QGraphicsDropShadowEffect> #include <QColor> #include <QMessageBox> #include <QSqlDatabase> #include <QDebug> #include <QtSql> #include <QSqlQuery> #include "editdata.h" #include "generalwindow.h...