text
stringlengths
8
6.88M
#pragma once class AI_Rise : public Hourglass::IAction { public: void LoadFromXML( tinyxml2::XMLElement* data ); void Init( Hourglass::Entity* entity ); IBehavior::Result Update( Hourglass::Entity* entity ); IBehavior* MakeCopy() const; private: StrID m_LaserEntityName; hg::Entity* m_LaserEntity; Vector3 m...
/* bullet.cpp Author: xun liu */ #include "Bullet.h" Bullet::Bullet(){ } Bullet::Bullet(Player* player) { Vector2 playerVector = MathUtil::VectorFromAngle(player->GetRotation() + 90.0f); Vector2 pos = player->GetPosition(); pos += playerVector * (player->GetSize().Y * 0.5f); SetPosition...
#include <ionir/construct/identifier.h> namespace ionir { Identifiable::Identifiable(ionshared::Ptr<Identifier> identifier) : identifier(std::move(identifier)) { // } }
/*************************************************** This is a library for the PCA9535 i2c port expander These displays use I2C to communicate, 2 pins are required to interface Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing pro...
// 1006_2.cpp : 定义控制台应用程序的入口点。 //收费站 //每过一个收费站,都是拿走当时羊的一半,然后退还一只,等到老汉到达市场,就只剩下3只羊了。 //输入数据第一行是一个整数N,下面由N行组成,每行包含一个整数a(0<a<=30),表示收费站的数量。 //对于每个测试实例,请输出最初的羊的数量,每个测试实例的输出占一行。 #include<iostream> using namespace std; int main() { int n; cin >> n; while (n--) { int m; cin >> m; int sum = 3; for (int i = 0; i...
#include<bits/stdc++.h> using namespace std; char s[20000]; int r[50000],sa[50000],ra[20000],num[20000],p1[20000],p2[20000],ans[20000],n; void readit(){ scanf("%d",&n); scanf("%s",s); } void writeit(){ for (int i=1;i<=n;i++) printf("%d\n",ans[i]); } inline int pos1(int x,int t){ if (x%3==1) return x/...
/* * AdminConsoleRepositoryImpl.h * * Created on: Nov 11, 2017 * Author: cis505 */ #ifndef BE_SERVER_ADMINCONSOLEREPOSITORYIMPL_H_ #define BE_SERVER_ADMINCONSOLEREPOSITORYIMPL_H_ #include <signal.h> #include <iostream> #include <memory> #include <string> #include "BigTable.h" #include "../common/AdminCon...
/* Copyright (c) 2017 u-blox * * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "10050" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) #define MAXN 4000 int main(int argc, char const *argv[]) { #ifdef DBG freopen("uva" PROBLEM TESTC ".in", "r", stdin); freopen("uva" PROBLEM ".out", "w", stdout); #e...
#pragma once #include <algorithm> #include <vector> #include <string> #include <algorithm> #include <functional> #include <cctype> #include <locale> namespace IRCOptotron { namespace MiscStringHelpers { std::string &ltrim(std::string &s); std::string &rtrim(std::string &s); std::string &trim(std::string &s)...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2010 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 VEGA_SUP...
/*********************************************************\ * Copyright (c) 2012-2018 The Unrimp Team * * 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 wit...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) Opera Software ASA 2006 * */ #ifndef WEBSERVER_INDEX_H_ #define WEBSERVER_INDEX_H_ #ifdef NATIVE_ROOT_SERVICE_SUPPORT #include "modules/webserver/webserver_resources.h" #include "modules/webserver/webresource_base.h" cl...
// Copyright (c) 2016 Hadrian G. (a.k.a. Neolander) // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // This compile-only test case verifies that #2035 remains fixed #incl...
#include <iostream> #include <algorithm> #include <vector> using namespace std; struct greater1 { template<class T> bool operator()(T const &a, T const &b) const { return a > b; } }; int main() { int t, n, i, x; cin >> t; while(t--) { cin >> n; vector<int> a; for(i=0; i<n; ++i) { cin >> x; a.pu...
// /* By:Luckyblock */ #include<cstdio> #include<ctype.h> #define ll long long const int INF = (1<<30); const int MARX = 1e4+10; //============================================================= struct edge { int u,v,w,ne; }e[MARX<<4]; int n,m,num, head[MARX],dis[MARX]; bool vis[MARX]; //================...
#include <Compat/Command.hpp> #include <Helpers/TimeoutTerminate.hpp> #include <Tanker/Functional/TrustchainFactory.hpp> #include <Tanker/Version.hpp> #include <fmt/format.h> #include <memory> #include <docopt/docopt.h> using namespace std::string_literals; using namespace std::literals::chrono_literals; using Tan...
// Copyright (c) 2007-2021 Hartmut Kaiser // Copyright (c) 2013 Agustin Berge // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #pragma once #include <pika/config.hpp> #in...
#include "player.h" #include <string> using namespace std; Player::Player(){ ////cout << "Player Created!" << endl; } Player::~Player(){ ////cout << "Player Destroyed!" << endl; ////delete hand; } int Player::get_n_cards(){ return hand.get_n_cards(); } int Player::is_possible_play(Card & active_car...
#include <iostream> #include <string> #include <ctime> #include <cctype> #include <cstdlib> #include <unistd.h> class Base { public: virtual ~Base(){}; }; class A : public Base {}; class B : public Base {}; class C : public Base {}; void startSeed() { srand(time(NULL)); } Base *generate(void) { static int seed...
My submission link: https://www.codechef.com/viewsolution/11945590 #include <cstdio> int main() { int t, i, curMax, n, x, ans; scanf("%d",&t); while(t--){ scanf("%d",&n); if(n<1) { printf("0\n"); return 0; } scanf("%d", &curMax); for(i=1, ans=1;i<n;i++){ scanf("%d",&x); if(x<=curMax) curMax=x,...
#ifndef KEYS_H #define KEYS_H #include "std_lib_facilities.h" constexpr char quit = 'q'; constexpr char print = ';'; constexpr char number = '8'; constexpr char name = 'a'; constexpr char let = 'L'; constexpr char sqrtKey = 'S'; constexpr char powKey = 'P'; constexpr char help = 'h'; constexpr char logKey = 'l'; con...
#include "invoker.h" Invoker::Invoker(void) : executor(NULL), undoer(NULL) { } Invoker::Invoker(Command * executor) : executor(executor), undoer(NULL) { } Invoker::Invoker(Command * executor, Command * undoer) : executor(executor), undoer(undoer) { } void Invoker::execute(void) throw(int&) { if (NUL...
/* * Copyright (c) 2015-2021 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_DETAIL_SORTING_NETWORK_SORT31_H_ #define CPPSORT_DETAIL_SORTING_NETWORK_SORT31_H_ namespace cppsort { namespace detail { template<> struct sorting_network_sorter_impl<31u> { template< typename Rand...
#include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t, n, x, s, a, b; cin >> t; for (int i = 0; i < t; i++) { cin >> n >> x >> s; for (int j = 0; j < s; j++) { cin >> a >> b; if (a == x) ...
#include<bits/stdc++.h> using namespace std; int main(){ int N ,M ,X; cin >> N >> M >> X; vector<int>C(13); //値段の配列,0-indexなのに注意 vector<vector<int>>A(13,vector<int>(13)); //M冊の,N個のアルゴリズムの情報が入った配列 //入力 for(int i = 0; i < N; i++){ cin >> C.at(i); for(int j = 0; j < M; j++){ cin ...
//--------------------------------------------------------------------------- #include <vcl.h> //#include <windows.h> //--------------------------------------------------------------------------- // Important note about DLL memory management when your DLL uses the // static version of the RunTime Library: // // ...
#ifdef USE_OPENCV #include <opencv2/core/core.hpp> #include <fstream> // NOLINT(readability/streams) #include <iostream> // NOLINT(readability/streams) #include <string> #include <utility> #include <vector> #include "caffe/layers/triplet_db_data_layer.hpp" #include "caffe/layer.hpp" #include "caffe/util/benchmark.h...
#include <iostream> #include <cstdlib> using namespace std; main() { int tortuga = 1, liebre = 1, rt=0, rl=0; srand(time(0)); cout << "PUM !!! \nY ARRANCAN !!!" << endl; for(int i=1; i<=70; i++) cout << "_" ; cout << endl; while(liebre < 70 & tortuga < 70 & liebre != 70 & tortuga != 70) { rt = 1 + rand()...
#include<bits/stdc++.h> using namespace std; main() { int n, a[5000]; while(cin>>n) { int i, res=0, p[5000], s[5000], j=0; for(i=0; i<=5000; i++)s[i]=1; //for(i=0; i<=50; i++)printf("%d ",s[i]); for(i=0; i<n; i++)cin>>a[i]; for(i=n-1; i>=0; i--) { ...
// Copyright (c) 2019, Ryo Currency Project // // Portions of this file are available under BSD-3 license. Please see ORIGINAL-LICENSE for details // All rights reserved. // // Ryo changes to this code are in public domain. Please note, other licences may apply to the file. // // THIS SOFTWARE IS PROVIDED BY THE COPYRI...
#include "SeedStore.h" namespace P_RVD { void SeedStore::addInformation(SeedWeightPosition _swp, t_index _t) { seed_updating_map.insert(std::make_pair(_swp, _t)); update_information_nb++; if (seed_updating_map.size() != update_information_nb) { printf(" "); } } void SeedStore::addInformation(Vec...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * @author Arjan van Leeuwen (arjanl) */ group "desktop_util.hash"; include "adjunct/...
/*! \file main.cpp * \author Sergey Shershakov * \version 0.1 * \date 20.12.2019 * * Exam. Main module * */ #include "solut.h" #include <iostream> #include <fstream> void test1() { std::ifstream inpFile("input.txt"); NameEmployeeMap team = loadEmployeeData(inpFile); for (co...
#ifndef DESCEND_TASK_HPP_ #define DESCEND_TASK_HPP_ #include <ostream> #include <utility> #include <vector> #include <Eigen/Core> #include <glog/logging.h> #include "affine_hull.hpp" #include "common.hpp" #include "critical_point.hpp" #include "flow_complex.hpp" #include "update_ray.hpp" #include "utility.hpp" #incl...
extern "C" { #include <stdio.h> #include <string.h> } #include <stdlib.h> #include <iostream> #include "rtpsession.h" #include "rtppacket.h" #include "rtpudpv4transmitter.h" #include "rtpipv4address.h" #include "rtpsessionparams.h" #include "rtpsourcedata.h" using namespace jrtplib; using namespace std; extern "C" void...
#pragma once class CModelToolRenderTargetListener : public RenderTargetListener { public: CModelToolRenderTargetListener(); void preRenderTargetUpdate(const RenderTargetEvent& evt); void postRenderTargetUpdate(const RenderTargetEvent& evt); SceneNode* mpSkyBoxNode; }; class CModelTool : public CE...
#include <bits/stdc++.h> using namespace std; class TreeNode { public: TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int val) : val(val), left(nullptr), right(nullptr) {} TreeNode(int val, TreeNode *left, TreeNode *right) : val(val), left(left), right(right) {} int val; TreeNod...
/* -*- compile-command: "R CMD INSTALL .." -*- */ #include "denormalize.h" #include "coverage.h" #include <R.h> #include <R_ext/Rdynload.h> void denormalize_interface (char **bedGraph_file_vec, char **out_file_vec){ int status = denormalize(bedGraph_file_vec[0], out_file_vec[0]); if(status==ERROR_CANT_OPEN_INPUT_...
// // Created by tony on 2017/05/27. // #ifndef BOOTCAMP_PLAYER_H #define BOOTCAMP_PLAYER_H #include <cstdlib> #include <string> class Player { public: int get_Px() const; void set_Px(int _Px); int get_pY() const; void set_pY(int _pY); protected: int _Px; int _pY; int _iHp; int _iArmor; std::string _sW...
#ifndef RUNGE_KUTTA_HPP #define RUNGE_KUTTA_HPP #include "State.hpp" class RungeKutta { public: double m1, m2, k1, k2; RungeKutta() { this->m1 = 0.0; this->m2 = 0.0; this->k1 = 0.0; this->k2 = 0.0; } RungeKutta(double m1, do...
#include <iostream> #include <list> using namespace std; class Hashing { private: int bucket; list<int> *sc; public: Hashing(int n); void insertKey(int key); void delKey(int key); int hashFunction(int okey); void printHashTable(); }; //khoi tao gia tri cho bucket Hashing::Hashing(int n) ...
#include "surfaces.h" #define MAX_MARCHING_STEPS 500 #define EPSILON 0.0001 #define start 0.0 #define end 10000.0 bool Surface::Intersect(const Ray &ray, Intersection *isect) const { //Transform the ray Ray r_loc = ray.GetTransformedCopy(transform.invT()); float depth = start; for (int i = 0; i < MAX...
/** * Copyright (c) 2007-2012, Timothy Stack * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of ...
#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 <deque> #include <map> #include <functional> #include <numeric> #include <sstream> typ...
#include "ConcreteBuilder.h" ConcreteBuilder::ConcreteBuilder() {} ConcreteBuilder::~ConcreteBuilder() {} //每一个具体建造者都相对独立,而与其他的具体建造者无关 //因此可以很方便地替换具体建造者或增加新的具体建造者 //用户使用不同的具体建造者即可得到不同的产品对象 。 void ConcreteBuilder::BuildPartA() { m_prod->SetA(" A style"); // 不同的建造者,可以实现不同产品的建造 } void ConcreteBuilder::BuildPartB() { ...
#include <motion_primitive_library/planner/mp_map_util.h> using namespace MPL; template <int Dim> MPMapUtil<Dim>::MPMapUtil(bool verbose) { this->planner_verbose_ = verbose; if(this->planner_verbose_) printf(ANSI_COLOR_CYAN "[MPPlanner] PLANNER VERBOSE ON\n" ANSI_COLOR_RESET); } template <int Dim> void MPMap...
#ifndef BLOCBREAKINGLOOPONSUCCESS_H #define BLOCBREAKINGLOOPONSUCCESS_H #include "BlocLoop.h" namespace BehaviourTree { /* Decorator bloc. A loop bloc for executing a predefined number of time its connected childs Return the result of THE LAST execution of its child. */ class BlocBreakingLoop...
#include "DocumentExtractor.h" #include <algorithm> #include "utility.h" void DocumentExtractor::parseTagOrData(const std::string& tagordata) { if (tagordata[0] == '<') { const std::string& tag = tagordata; node->data += stringJoin(part); part.clear(); int closing = (tag[1] == '/') ? 1 : 0; std::strin...
#include <vector> #include <iostream> #include <queue> using namespace std; class Solution { public: vector<int> maxSlidingWindow(vector<int>& nums, int k) { int left = 0; int right = left+k-1; cout << nums.size() << endl; priority_queue<int> pq(nums.begin(), nums.begin()+k); ...
#include "graph.hpp" #include <cstdlib> auto genGraph() { constexpr int size = 1000; graph_t res(size, std::vector<int>(size)); for (auto& line : res) { for (auto& item : line) { item = rand(); } } return res; } int main() { const auto& execTime = [](const auto& start, const auto& finish) ...
#include<bits/stdc++.h> using namespace std; int main(){ long int n; int k; cin>>n>>k; for (int i = 0; i < k; i++) { string temp = to_string(n); // cout<<temp[temp.length()-1]<<endl; if(temp[temp.length()-1] == '0'){ n = n/10; } el...
/* @File: a_star.cpp * @Details: Class that finds the path with A* search algorithm */ class AstarAlgorithm { private: struct Cell { bool isObstacle = false; // Is the node an obstruction? bool isVisited = false; // Have we searched this node before? float distGlobalGoa...
#pragma once #include "StlFiles.h" class Global { public: static CStlString GetAppPath(); static BOOL DepartString(const CStlString& strTxt, const CStlString& strDim, CStlStrArray &arrPart); #ifdef _UNICODE static BOOL DepartString(const std::string& strTxt, const std::string& strDim, std::vector<s...
#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...
// // Created by OLD MAN on 2019/9/1. // #include<iostream> using namespace std; int main(){ int x , y ; cin >> x >> y ; if ( x >= -1 && x <= 1 && y >= -1 && y <= 1) cout << "yes" ; else cout << "no" ; }
/* -*- Mode: c++; tab-width: 4; 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. */ #ifndef SOURCEDESKTOPWINDOW_H #define SOURCEDESKTOPWINDOW_H #include "adjunct/quick...
#include "HeightMap.h" #include "DepthPass.h" #include "PenetrationPass.h" #include "JumpFlooding.h" #include "SnowDisplacement.h" #include "NormalGeneration.h" #include "SnowParametersBuffer.h" #include "Scene.h" #include "SnowPlane.h" #include <API/Code/Includes.h> #include <API/Code/UI/Dependencies/IncludeImGui.h>...
/*! * \file machine.cpp * \author Simon Coakley * \date 2012 * \copyright Copyright (c) 2012 University of Sheffield * \brief Implementation of model machine */ #include <QStringList> #include "./machine.h" Machine::Machine(int t, Machine *parent) { type = t; parentItem = parent; // itemData = data; ...
/* * FORMAT: * STRING (Conditions) - Must return boolean : * String can contain any amount of conditions, aslong as the entire * string returns a boolean. This allows you to check any levels, conditionss etc, * in any combination. For example: * "call cxp_coplev...
#pragma once /* This class manages all inputs available in the client. It allows to check the syntax of all inputs, get the data provided by the input chosen and displays their usage. */ #include "ACommand.hpp" #include <map> #include <string> #define FORMAT_INPUT "<input> [<args>]" class IInput; class InputMa...
#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...
#include<cstdio> #include<algorithm> int n,a[800000]; int main(){ int W,p=0,st,now=0,i,j,k; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",a+i); for(i=31-1/*max Digit*/,j=0;i>=0;i--){ for(k=j; k<n && !((a[k]>>i)&1); k++); if(k<n){ std::swap(a[j],a[k]); for(k=0;k<n...
#include "NotificationManager.hpp" #include <QDebug> #include <QGuiApplication> NotificationManager::NotificationManager(QObject *parent) : QObject(parent) { } NotificationManager *NotificationManager::instance() { static NotificationManager instance; return &instance; } void NotificationManager::removeNot...
#ifndef _LOADING_SCREEN_H_ #define _LOADING_SCREEN_H_ #include "../../Engine/Abstract/AbstractScreen.h" #pragma once class LoadingScreen : public AbstractScreen { public: LoadingScreen(); ~LoadingScreen(); void Load(HWND window); void UnLoad(); bool Render(); bool Update(DX::StepTimer const& timer); void Up...
#pragma once #include <ntddk.h> template <typename... Args> void log(const char* format, Args... args) { DbgPrintEx(0, 0, format, args...); }
#include<bits/stdc++.h> using namespace std; long long n,ans=0; int m; void readit(){ scanf("%lld",&n); } void writeit(){ printf("%lld",ans); } long long phi(int x){ long long t=x; for (int i=2;i<=m;i++) if (!(x%i)){ t=t/i*(i-1); while (!(x%i)) x/=i; } if (x>1) t=t/x*(x-1); return...
#include <SoftwareSerial.h> SoftwareSerial mySerial(10, 11); //Pin10 RX , Pin 11 TX connected to--> Bluetooth TX,RX #define Lamp1 2 #define Lamp2 3 //If Out to active Low change ON 0 and OFF 1 //If Out to active High change ON 1 and OFF 0 #define ON 1 #define OFF 0 char val; String statusLamp1,statusLamp2; void setu...
$NetBSD$ * include map to not break build since std::map is used --- src/lib/dhcpsrv/timer_mgr.cc.orig 2020-10-22 14:29:38.523508022 +0000 +++ src/lib/dhcpsrv/timer_mgr.cc @@ -12,6 +12,7 @@ #include <exceptions/exceptions.h> #include <functional> +#include <map> #include <utility> using namespace isc;
#include<bits/stdc++.h> using namespace std; #define maxn 1005 vector<string> vstr1,vstr2; int dp[maxn][maxn]; int main(){ int cnt=0; string a,b; while(getline(cin,a)){ cnt++; getline(cin,b); memset(dp,0,sizeof(dp)); vstr1.clear(); vstr2.clear(); ...
#include <iostream> #include <vector> #include <tuple> #include <algorithm> using std::vector; long long lcs2(vector<long long> &a, vector<long long> &b, int i, int j) { if((i == -1)||(j==-1)) { return 0; } else if (a[i] == b[j]) { return 1 + lcs2(a,b, i-1,j-1); } else { auto r1 = lcs2(a...
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #include "Project_152.h" #include "Project_152GameMode.h" #include "Engine.h" #include "Project_152Character.h" #include "CombatGrid.h" #include "InventoryItem.h" #include "ParentCombatCharacter.h" AProject_152GameMode::AProject_152GameMode() { // set defa...
#ifndef GOALEVENT_H #define GOALEVENT_H #include "EventObject.h" namespace gnGame { class GameScene; class GoalEvent : public EventObject { public: GoalEvent(const Vector2& _pos, GameScene* _gameScene); ~GoalEvent() = default; void onUpdate() override; void onEvent() override; ICollider& getCollider...
/* -*- 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_OPDATA_SEGMENTCOLLECTOR_H #define MODULES_OPDATA_...
#include "AlienNest.h" AlienNest::AlienNest(Player& t_player, sf::Vector2f t_position) : m_player(t_player), m_isAlive{true}, m_isMissileAlive{false}, m_missileVelocity{ -MAX_VELOCITY, 0.0f }, m_orientation{ 0.0f }, m_targetPosition{ 0.0f, 0.0f }, m_noOfPredators{ 0 }, m_secondsPassed{ 0 } { m_health = 4; //...
#include<bits/stdc++.h> #define si 1000000 typedef long long ll; using namespace std; int prime[si+5]; ll flag[si+5]; ll count_p[si+5]; int rev_n(int n) { int r = 0; int x = n; while(x!=0) { r = r+(x%10); x = x/10; } return r; } void seive() { ll i, j, val, cont=0, l; f...
#ifndef CHTTPDOWNLOADER_H #define CHTTPDOWNLOADER_H #include <QThread> class CHTTPBase; class CHTTPDownloader : public QThread { Q_OBJECT public: friend class CHTTPBase; CHTTPDownloader(QObject *parent = 0); ~CHTTPDownloader(); bool m_bStop; // 用来通知线程系统退出的事件,为了能够更好的退出线程 //下载文件 //strFileUrl - 文件URL str...
// // KString.hpp <Keepi> // // Made by Julien Fortin // contact <julien.fortin.it@gmail.com> // #ifndef __KSTRING__HPP__ #define __KSTRING__HPP__ #include <string> class KInteger; class KDouble; class KBool; class KString { private: static std::string TYPE; std::string __string; void __init(std::string);...
/* * Copyright (c) 2015-2018 Morwenn * SPDX-License-Identifier: MIT */ #include <catch2/catch.hpp> #include <cpp-sort/utility/buffer.h> #include <cpp-sort/utility/functional.h> TEST_CASE( "miscellaneous tests for buffer providers", "[utility][buffer]" ) { using namespace cppsort; SECTION( "fixed...
#include "../colorOperation.h" #include <iostream> #include <math.h> using namespace std; void rgb2hsv(int R, int G, int B, int &H, int &S, int &V){ int RGB[3]; RGB[RED] = R; RGB[GREEN] = G; RGB[BLUE] = B; float HSV[3]; rgb2hsv(RGB, HSV); H = (int)HSV[HUE]; S = (int)round(HSV[SAT]*10...
#ifndef CELL_AUTOMATA_ISING_SYSTEM_ISING_PARAMETER #define CELL_AUTOMATA_ISING_SYSTEM_ISING_PARAMETER using numerical_type = Default_simulator_traits::numerical_type; constexpr std::size_t system_side_num = 1000; constexpr std::size_t interval_calculation(system_side_num * 100); constexpr int random_...
#ifndef ObjectPickupExecutor_h #define ObjectPickupExecutor_h // standard includes #include <cstdint> #include <memory> #include <string> // system includes #include <Eigen/Dense> #include <actionlib/server/simple_action_server.h> #include <actionlib/client/simple_action_client.h> #include <control_msgs/GripperComman...
#include <DxLib.h> #include "Bomb.h" #include "object/Player.h" Bomb::Bomb() : Bomb(Ref::VectorZero) { } Bomb::Bomb(Vector2 pos) : GameObject(pos) { this->hitRange = 10000; WithKey("bomb"); } void Bomb::Init() { } void Bomb::Fin() { } void Bomb::Update() { GameObject::Update(); } void Bomb::Draw() const { ...
/* * Copyright (C) 2013 Tom Wong. All rights reserved. */ #include "gtapplication.h" #include "gtdocmanager.h" #include "gtmainsettings.h" #include "gtmainwindow.h" #include "gtusermanager.h" #include <QtCore/QCryptographicHash> #include <QtCore/QDebug> #include <QtCore/QDir> #include <QtCore/QPointer> #include <QtCo...
#include "pch.h" #include "Selector.h" namespace Hourglass { IBehavior * Selector::MakeCopy() const { Selector* copy = (Selector*)IBehavior::Create( SID( Selector ) ); copy->Clear(); for (unsigned int i = 0; i < NumBehaviors(); ++i) { copy->AddBehavior( m_ChildBehaviors[i]->MakeCopy() ); } return ...
// Solution 1 backtracking class Solution { public: vector<vector<int>> permute(vector<int>& nums) { vector<vector<int>> permutations; vector<int> permutation; permute(nums, permutations, permutation); return permutations; } private: void permute(const vector<int>& nums,...
#include <QGuiApplication> #include <QtQml> #include <QQuickStyle> // QuickQanava headers #include <QuickQanava.h> #include "applicationmanager.h" int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); QQuickStyle::setStyle("Material"); QQmlApplicationEngine engine; engine.addPluginPath...
// 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 General Public License version 2.1 as published // by the Free Software Foundation, with spe...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2007 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 SVG_SUPPORT #include "modules/s...
//--------------------------------------------------------------------------- #ifndef ClasesH #define ClasesH class Limpiar{ public: void limpiarRegistro(); void LimpiarModificar(); void LimpiarHistoria(); void LimpiarBuscar(); void LimpiarDatosLaborales(); void LimpiarC...
#include<stdio.h> #include<conio.h> #include<limits.h> using namespace std; int arr[100],aux[100],top,size,min; void push(int arr[],int a) { if(top == size-1) {printf("\n stack is full"); } else{ top++; arr[top] = a; if(a<min) ...
#ifndef COMMONS_H #define COMMONS_H #include <QObject> #include <QtCore> #include <QtGui> #include <QtWidgets> static QStringList cnList1 = QStringList() << QStringLiteral("零") << QStringLiteral("一") << QStringLiteral("二") << QStringLiteral("三") << QStringLiteral("四") << QS...
// Copyright (c) 2017-2022, University of Cincinnati, developed by Henry Schreiner // under NSF AWARD 1414736 and by the respective contributors. // All rights reserved. // // SPDX-License-Identifier: BSD-3-Clause #pragma once // [CLI11:public_includes:set] #include <cstdint> #include <exception> #include <limits> #i...
#include<iostream.h> #include<conio.h> #include<graphics.h> #include<string.h> #include<process.h> #include<fstream.h> #include<stdio.h> #include<dos.h> #include"H:PROJECTS\MOUSE.CPP" int gdriver = DETECT, gmode, errorcode; class KBC { int status; char quest[500]; struct option { int opno; char op[150]; }o1,o...
#pragma once #include "Map.h" #include "Player.h" class Player; class Map; class CoinManager { private: Map &map; public: int coinnum; CoinManager(Map &mapa); void coinsetter(); };
// // Package1.h // ClientGame // // Created by liuxun on 15/3/4. // // #include "stdafx.h" #ifndef __ClientGame__Package1__ #define __ClientGame__Package1__ class Package1: public PhysicsActor{ public: Package1(Vector2 position); virtual void Update(float dt); }; #endif /* defined(__...
/* * ===================================================================================== * * Filename: Cluster.cpp * * Description: cluster some funcs. * * Version: 1.0 * Created: 11.08.2010 15:54:52 * Revision: none * Compiler: gcc * * Author: Mikhail Pim...
#include <iostream> #include "BaseLayer.h" bool BaseLayer::init() { if (!CCLayerColor::initWithColor(ccc4(255,255,255,0))) { return false; } this->setTouchEnabled(true); //ÆôÓô¥Ãþ CCSprite* bg = CCSprite::create("back960_640_2.png"); // elastic effect ...
// Kristjan von Bulow Project 10 11/29/17 /* This .cpp handles the Knapsack class and its methods. */ #include "proj10_knapsack.h" #include<iostream> using std::ostream; using std::cout; using std::endl; #include<string> using std::string; #include <utility> #include<algorithm> using std::copy; using std::sort; #incl...
#pragma once #ifndef _LEAGUECHAMPIONDATABASE_H #define _LEAGUECHAMPIONDATABASE_H #include "common.h" #include "LeagueChampionData.h" /* * Contains a mapping of all the champions in League of Legends and any information that we * might need with regards to those champions. It loads this database from an XML file. ...