text
stringlengths
8
6.88M
//2.27 int i = -1, &r = 0; //nok. should refer to a variable. int * const p2 = &i2; //it's ok if i2 is not a const. const int i = -1, &r = 0; //not correct. const only apply the first variable const in * const p3 = &i2; //i2 should be a const value. const int * p1 = &i2; //ok const int & const r2; //should initialize c...
#include<cstdio> #include<algorithm> #define N 662150 const int mod = 1e9 + 7; typedef long long ll; ll ans[N]; int n,m,i,j,l1,r1,a[N],q[N],t,cnt;ll t1,t2,len[N]; struct Q{ int i,l,r,p,t; Q(){} Q(int _i,int _l,int _r,int _p,int _t){i=_i,l=_l,r=_r,p=_p,t=_t;} }b[N]; inline bool cmp(const Q&a,const Q&b){return a.i<...
// // Created by hw730 on 2020/6/8. // #ifndef DEFENCE_GAME_TOWER_H #define DEFENCE_GAME_TOWER_H #include"Position.h" #include"BulletFactory.h" class Tower { static int geneId(){static int ID = 0;ID++;return ID;} public: Tower():id(geneId()){} int getRange(){return range;} Position getPosition(){return...
// ****************** CHydroSimulatorClassFactory.h ******************************* // Generated by TwinCAT Target for MATLAB/Simulink (TE1400) // MATLAB R2019a (win64) // TwinCAT 3.1.4022 // TwinCAT Target 1.2.1237 // Beckhoff Automation GmbH & Co. KG (www.beckhoff.com) // ****************************************...
#pragma once class CTrianglePoints { public: CTrianglePoints(std::string file_name); ~CTrianglePoints(void); };
#include <iostream> #include "tools.h" #include "client.h" TEST(Client, Connection) { network::Client client; ASSERT_TRUE(client.Connect()); ASSERT_TRUE(client.Disconnect()); } TEST(Client, IsConnected) { network::Client client; ASSERT_FALSE(client.IsConnected()); } TEST(Client, Read) { netw...
#ifndef MASTERMIND_HPP_INCLUDED #define MASTERMIND_HPP_INCLUDED #include <cctype> /* toupper */ #include <cstdlib> /* rand */ #include <string> #include <algorithm> /* count, find_if, min */ #include <numeric> /* accumulate, inner_product*/ #include <functional> /* plus, equal_to */ #include <iostream> struct GameOv...
#pragma once #include "iobj.h" class cItem : public IObj { public: virtual void Init(); virtual void Update(); virtual void Render(); virtual void Release(); virtual void OnCollision( int nTargetType, IObj* pObj = NULL ); public: cItem(void); ~cItem(void); };
#pragma once #include "std_header.h" #include "global_utility.h" namespace shader { class shader { private: GLuint program; public: shader(std::string vertex_index, std::string fragment_index); void use() const; //获取着色器编号 const GLuint & getProgram() const; }; //全局着色器列表 const std::unordered_map <std::...
#include <stdlib.h> #include <iostream> #include <string> #include <vector> using namespace std; class ThreeSumZero { public: vector<vector<int> > threeSum(vector<int>& nums); void Test(); };
/* * ObjMesh.cpp * * Created on: 01 сент. 2017 г. * Author: Соня */ #include "ObjMesh.h" #include "Msg.h" ObjMesh::ObjMesh() { } ObjMesh::~ObjMesh() { } /* * ------------------------------------------ * Загрузка модели * v - вершина x,y,z,w * vt - текстурные координаты (u,v,w) ...
/********************************************************** * License: The MIT License * https://www.github.com/doc97/TxtAdv/blob/master/LICENSE **********************************************************/ #include "LuaGameState.h" #include "LuaUtils.h" namespace txt { const char* LuaGameState::className = "LuaGameSt...
#pragma once #include<string> #include<iomanip> #include<iostream> #include <map> #include <list> using namespace std; class AktivesVO { public: AktivesVO(); AktivesVO(string namestr); const string type = "AVO"; istream virtual & istreamInput(istream& in); static AktivesVO* ptObject(string sName); static void ...
#include "Data.h" #include <QDebug> #include "BookInfo.h" #include <QMessageBox> #include <QString> #include <QStringList> #include <QObject> Data::Data() { } Data::~Data() { all_hotel.clear(); } void Data::load_bookinfo(const string & s){ cout << 123123; all_book.clear(); ifstream is; is.open(s); ...
#include "pch.h" #include "constants.h" QSize const SmallMainWindowSize { 800, 480 }; QSize const SmallMainButtonSize { 218, 74 }; QSize const SmallMaximalRightHandPaneSize { 564, 424 }; QSize MainWindowSize { 1024, 600 }; QSize ...
#include <iostream> #include <algorithm> #include <vector> int inf = 2e9; struct sliding_window { std::vector<int> LL, RR; int rmax; sliding_window() { rmax = -inf; } void push_back(int xx) { RR.push_back(xx); rmax = std::max(rmax, xx); } void pop_front() { ...
/* NO WARRANTY * * BECAUSE THE PROGRAM IS IN THE PUBLIC DOMAIN, THERE IS NO * WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE * LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE AUTHORS * AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT * WARRANTY OF ANY KIND, EITHER E...
#include "Course.h" Course::Course(int _id, std::string _name, int _creditPoints): id(_id), name(_name), creditPoints(_creditPoints) {} std::ostream& operator<<(std::ostream& os, const Course& course){ os << "Course id: " << course.getId() << ", Course name: " << course.getName().c_str() << ", Credit points: " << co...
#include "protein.h" #include <iostream> #include <fstream> Protein::Protein() { // Изначально список пуст Head = Tail = nullptr; Count = 0; } Protein::Protein(const Protein &L) { Head = Tail = nullptr; Count = 0; // Голова списка, из которого копируем Elem *temp = L.Head; // Пока не ...
/** * Copyright (C) 2017 Alibaba Group Holding Limited. All Rights Reserved. * * * 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 * * ...
#include<bits/stdc++.h> using namespace std; int main() { int x; cin>>x; cout<<1-x<<"\n"; }
#include "ProgramStart.h" int main(void) { ProgramStart Pstart; Pstart.ProgramStartFunction(); }
#include "Map.h" #include <sc2api/sc2_map_info.h> #include <utils/GridUtils.h> #include <utils/UnitQuery.h> #include <fstream> #include <functional> namespace sc2::utils { Map::Map(SC2& sc2) : m_sc2(sc2) , m_pathing_grid(GridView{ m_sc2.obs().GetGameInfo().pathing_grid }) , m_placement_grid(GridView{ m_...
// // C++ Interface: sound_driver_manager // // Description: // // // Author: Juan Linietsky <reduzio@gmail.com>, (C) 2006 // // Copyright: See COPYING file that comes with this distribution // // #ifndef SOUND_DRIVER_MANAGER_H #define SOUND_DRIVER_MANAGER_H #include "engine/sound_driver.h" /** @author Juan Linietsk...
#include "worker.h" #include <iostream> int main() { Worker worker1("Ivanov", 0, 500, 0, "Vasily"); Worker worker2("Ivanov", 0, 500, 0, "Vasily"); Worker worker3("Popov", 3, 800, 2, "Ivan"); std :: cout << worker1.get_wage() << '\n' << worker2.get_expierence() << '\n' << worker1.get_surname() << '\n' <...
#include "PipelinePresenter.h" IPipelineEdgeModel *PipelinePresenter::SpawnEdge(IPipelineNodeModel &begin_model,IPipelineNodeModel &end_model) { NodePresenter *BeginNode = (NodePresenter *)begin_model.GetUserData(); EdgePresenter *NewPresenter = new EdgePresenter(&Visualizer,BeginNode->GetDataPresenter()); Pipelin...
#pragma once #include <iostream> #include <string> using namespace std; #include "olcConsoleGameEngineOOP.h" enum GAME_STATE { GAME_STATE_TITLE = 0x01, GAME_STATE_START = 0x02, GAME_STATE_EXIT = 0x03, GAME_STATE_ANIMATE = 0x04 }; enum ROTATION { LEFT = 0, TOP = 90, RIGHT = 180, DOWN = 270 }; struct sCell ...
#ifndef TINYENGINE_LTE_ITEXTURE_H_ #define TINYENGINE_LTE_ITEXTURE_H_ #pragma once #include <string> #include <SDL/SDL.h> #include "../LTE_Types.h" #include "../LTE_Utils.h" template <class T> class LTE_ITexture { public: LTE_ITexture() {} LTE_ITexture(const LTE_ITexture&) = delete; LTE_ITexture(const std::string...
#include<iostream> #include<string> #include"Stack.h" template<class T> void Reverse(Stack<T>&,int); int Getsize(string s); using namespace std; int main() { Stack<char> obj; string s; cout << "Enter line: "; cin >> s; int size = Getsize(s); for (int i = 0; i < Getsize(s); i++) { obj.AddElement...
#include<bits/stdc++.h> using namespace std; int main() { int m,n,i,k,ans=100000; cin>>n>>m; int a[m]; for(i=0; i<m; i++)cin>>a[i]; sort(a,a+m); n--, m-=n; //for(i=0;i<m-n;i++) ans=min(ans,(a[i+n-1]-a[i])); while(m--) ans=min(ans,a[m+n]-a[m]); cout<<ans; }
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** 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 the Free Software Foundation; either ...
#include <iostream> #include "printVector.hpp" int main() { std::vector<int> testVector{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; std::cout << "1: "; printVector1(testVector); std::cout << "\n2: "; printVector2(testVector); std::cout << "\n3: "; printVector3(testVector); std::cout <<...
#ifndef BUTTONSCLICK_H #define BUTTONSCLICK_H #include <string> #include <QString> #include <QLineEdit> class ButtonsClick { public: bool EqualityCheck(QString str); ButtonsClick(); double result_num; QString short_result; QString result; QString signmem; short action; ...
#include "StdAfx.h" #include "settings.h" QMap<QString, QVariant> Settings::mDefaultParameters; QMap<QString, QVariant> Settings::mParameters; /// \class SwiftModel /// \brief /// /// /// void Settings::loadSettings(const QString &inputpath, QByteArray *geometry) { QString path = inputpath; if (inpu...
#include "TravelDemand.h" #include "ui_TravelDemand.h" #include "myschedule.h" #include<windows.h> #include <QDebug> #include <QButtonGroup> #include <QDateEdit> #include<QFile> #include<QTextStream> #define num_city 15 #define road_size 45 TravelDemand::TravelDemand(QWidget *parent) : QDialog(parent), ui(new ...
#pragma once #include "Material.h" #include <random> /*! * \brief Class for a physically based brdf. Inspired by Disney's BRDF. * * See https://disney-animation.s3.amazonaws.com/library/s2012_pbs_disney_brdf_notes_v2.pdf */ class PBRMaterial : public Material { private: glm::vec3 baseColor; float ambient; flo...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.Devices.Adc.Provider.0.h" #include "Windows.Foundation.Collections.1.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Devices::Adc::Provider { ...
#include <iostream> #include <cstdio> #include <cmath> using namespace std; const double PI = acos(-1); double theta, x, y; int test; int main() { cin >> test; while (test--) { cin >> x >> y >> theta; double cos_theta = cos(theta * PI / 180.0); double sin_theta = sin(theta * PI / 180...
#ifndef PROXERIMAGEPROVIDER_H #define PROXERIMAGEPROVIDER_H #include <QQuickAsyncImageProvider> #include <QSharedPointer> #include <QThreadStorage> #include <imageloader.h> class ProxerImageResponse : public QQuickImageResponse { Q_OBJECT public: ProxerImageResponse(int _id, const QSize &_requestedSize); QQuickT...
template <typename T> T min(const T x, const T y) { if (x < y) { return x; } else { return y; } }
/* Name : Dopamine Drip Calculator v2 Author: Ben Rockhold Date: 03/08/15 Description: Dopamine drip calculator; requests desired dose and patient weight, checks for safety and returns drips per minute. Additionally, outputs user input and calculation output to a file "dosage_report.txt" */ #include <fstrea...
#include <climits> #include <cstdlib> #include <sys/stat.h> #include "queue.h" #ifndef MYGRAPHTYPE #define MYGRAPHTYPE using namespace std; static const int MAX_VERTICES = 50; static const int INFINITY = 10000; // Exception class used by GetVertexIndex and DeleteVertex when vertex is not found class NotFound{ }; //...
#include "VulkanException.h" #include "VulkanRenderer.h" #include "VulkanInstance.h" #include "VulkanDevice.h" #include "VulkanSwapchain.h" #include "VulkanShaderStage.h" #include "VulkanShader.h" #include "VulkanPipeline.h" #include "VulkanRenderPass.h" #include "VulkanCommandPool.h" #include "VulkanModelDat...
#include "SingletonBase.h" #include <iostream> SingletonBase::SingletonBase() { std::cout << "Singleton Base created!" << std::endl; } SingletonBase::~SingletonBase() { std::cout << "Singleton Base destroyed" << std::endl; }
#include <iostream> #include <string> using namespace std; // TLE,莫名其妙,以前写的C就不会,但是关掉sync也还是超时 // 链表的实现的唯一区别就是insert写两种,按道理时间开销差别不大 // 以后这种数据量比较大的,坚决用C没错的 struct ListNode { int data; ListNode *next; ListNode() { next = NULL; } }; ListNode *insert(ListNode *curr, int data) { ListNode ...
// ============================================================================= // Copyright 2012. // Scott Alexander Holm. // All Rights Reserved. // ============================================================================= #ifndef DECK_H #define DECK_H #include "card.h" short unsigned int const DEC...
/* * Copyright (C) 2007-2015 Frank Mertens. * * Use of this source is governed by a BSD-style license that can be * found in the LICENSE file. * */ #ifndef FLUXSYNTAX_REGEXPSYNTAX_H #define FLUXSYNTAX_REGEXPSYNTAX_H #include <flux/String> #include <flux/syntax/SyntaxDefinition> namespace flux { template<class>...
#include "ComponentSkinnedMesh.h" #include "glew\include\GL\glew.h" #include <gl\GL.h> #include "MathGeoLib/include/Math/float3.h" #include "imgui/imgui.h" #include "GameObject.h" #include "ResourceMesh.h" #include "ResourceBone.h" #include "Globals.h" #include "ComponentMaterial.h" #include "ResourceTexture.h" CL...
#pragma once #include <tudocomp/io.hpp> #include <tudocomp/Algorithm.hpp> #include <tudocomp/Literal.hpp> #include <tudocomp/Range.hpp> namespace tdc { class Coder { public: static inline constexpr TypeDesc type_desc() { return TypeDesc("coder"); } }; /// \brief Base for data encoders. /// /// Used...
#define PUSH_BUTTON_PIN 8 #define RELAY_1_PIN 2 #define RELAY_2_PIN 3 #define RELAY_3_PIN 4 #define RELAY_4_PIN 5 #define RELAY_5_PIN 6 #define RELAY_6_PIN 7 #define SHOW_DELAY 100 int relayPins[] = { RELAY_1_PIN, RELAY_2_PIN, RELAY_3_PIN, RELAY_4_PIN, RELAY_5_PIN, RELAY_6_PIN }; int state = 0; int previousButtonSt...
// // PartyVideoDJ - YouTube crossfading app // Copyright (C) 2008-2017 Michael Fink // /// \file IconList.hpp Icon list defines // #pragma once /// icons in IDB_ICONLIST enum T_enIcons { iconFilm = 0, iconArrow = 1, iconNext = 2, iconError = 3, }; inline void LoadIconList(CImageList& ilIcons, UINT uiBitm...
#include<bits/stdc++.h> using namespace std; bool minWindow(string s, string t) { unordered_map<char,int> window,need; for(char c : s) { need[c]++; } int left = 0,right = 0; int valid = 0; while(right < t.size()) { char c = t[right]; right++; if(need.count(c...
#include<bits/stdc++.h> using namespace std; #define mod 1000000007 #define sz 200009 #define pf printf #define pi(a) printf("%d\n",a) #define pl(a) printf("%I64d\n",a) #define sf scanf #define si(a) scanf("%d",&a) #define sl(a) scanf("%I64d",&a) #define pb push_back #define mp make_pair #d...
// Copyright (c) 2015 University of Szeged. // Copyright (c) 2015 The Chromium Authors. // All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SPROCKET_COMMON_CONTENT_CLIENT_H_ #define SPROCKET_COMMON_CONTENT_CLIENT_H_ #include <string> ...
#ifndef MOBILEPHONE_H #define MOBILEPHONE_H #include<string> using namespace std; class MobilePhone{ private: int ModelNo[100]; int Price[100]; string Maf[100]; int Quantity[100]; static int count; public: MobilePhone(); MobilePhone(int,int,string,int); // ~MobilePhone(); void A...
/**************************************** * * INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE * Copyright (C) 2019 Victor Tran * * 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 * the Free Software Foundati...
/* * Automovil.cpp * * Created on: Mar 5, 2013 * Author: j2deme */ #include "Automovil.h" Automovil::Automovil() { this->cilindros = 4; this->distancia = 0; this->choques = 1; srand(time(0)); } Automovil::~Automovil() { } int Automovil::getCilindros() const { return cilindros; } void Automovil::set...
//Arduino PWM Speed Control int E1 = 5; //motor 1 speed int M1 = 4; //motor 1 int E2 = 6; //motor 2 speed int M2 = 7; //motor 2 int FRAME_LENGTH = 15; int FRAME_START = 'A'; int FRAME_STOP = 'S'; void setup() { pinMode(M1,OUTPUT); pinMode(M2,OUTPUT); Serial.begin(57600); } void loop() { if (Serial.availabl...
#ifndef _HTTP_MULTIPART_CLIENT_H #define _HTTP_MULTIPART_CLIENT_H #include <string> #include "HttpClient.h" #include <threading/Condition.h> namespace Rhoban { class HttpMultipartClient : public HttpClient { public: HttpMultipartClient(); HttpMultipartClient(string type...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
#ifndef __CoxInfo #define __CoxInfo #include "scan.h" #include "LineFeatureSet.h" // // CPointCoxInfo类定义了一个扫描点的Cox数据。 // class CPointCoxInfo { public: CScanPoint* m_pScanPoint; // 指向扫描点的指针 CLineFeature* m_pLine; // 扫描点所对应的直线段的指针 float m_dDist; // 扫描点到直线的距离值 CPoint2d ...
#ifndef _HS_SFM_FUNDAMENTAL_LINEAR_8_POINTS_RANSAC_REFINER_HPP_ #define _HS_SFM_FUNDAMENTAL_LINEAR_8_POINTS_RANSAC_REFINER_HPP_ #include <utility> #include "hs_fit/ransac/ransac.hpp" #include "hs_sfm/fundamental/linear_8_points_calculator.hpp" namespace hs { namespace fit { template <typename _Sca...
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // # DARK PLUGIN - POWERED BY FIRE TEAM // # GAME SERVER: 99.60T (C) WEBZEN. // # VERSÃO: 1.0.0.0 // # Autor: Maykon // # Skype: Maykon.ale //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // # O Sen...
#include "CWEPolygon.h" #include "CWEMotion.h" #include "CWEMacroConstants.h" #include <algorithm> namespace CWE { // 2D表示用の射影変換行列 math::Float4x4 Polygon::m2DProj ={ 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 2.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f }; // デフォルトコンストラクタ Polygon::Polygon(): mResour...
#include "PhysicsManager.h" #include "Application.h" #include "Actors/Actor.h" #include "Movable.h" namespace liman { void PhysicsManager::UpdateMovables(int deltaTime) { for (ActorId id = INVALID_ACTOR_ID + 1; id < (unsigned int) g_pApp->GetGameLogic()->GetLevelManager()->GetNumActors(); id++) { Actor* p...
#include <iostream> #include <fstream> #include <string> using namespace std; struct sat { const int field1; const int field2; }; const sat sats[24] = { { 1, 5 }, { 2, 6 }, { 3, 7 }, { 4, 8 }, { 0, 8 }, { 1, 9 }, { 0, 7 }, { 1, 8 }, { 2, 9 }, { 1, 2 }, { 2, 3 }, { 4, 5 }, { 5, 6 }, { 6, 7 }, { 7, 8 ...
#include<bits/stdc++.h> using namespace std; long long solve(vector<long long>& arr,int n,long long A,long long B) { if(n==0) { return 0; } } int main() { int n; long long A,B; cin >> n >> A >> B; vector<long long> arr(n); for(int i=0;i<n;i++) { cin >> arr[i]; } cout << solve(arr,n,A,B) << endl; retu...
/** * Copyright (C) 2017 Alibaba Group Holding Limited. All Rights Reserved. * * * 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 * * ...
#include "SDL2DemoFramework.h" #include "Demo/DemoCollection.h" #include "Demo/Demo2D/StochasticTree2D.h" #include "Camera2D.h" int main(int argc,char *argv[]) { SDL2DemoFramework DemoFramework(800,600, new DemoCollection({ new StochasticTree2D(234), new StochasticTree2D(6332), ...
#pragma once #include <memory> #include <stdexcept> #include <string> #include <type_traits> #include <typeinfo> #include <utility> #include "drake/common/copyable_unique_ptr.h" #include "drake/common/drake_copyable.h" #include "drake/common/is_cloneable.h" #include "drake/common/nice_type_name.h" namespace drake { ...
//to do: //cross platform sleep // console meret megadasa(es megtartasa) //optimizalas //szepites /* vx es vy vektorban taroljuk hogy mennyivel kell valtoztatni a labda x es y koordinatajanak irannytenyezojet xv,xy=labda koordinatajat ezzel noveljuk/csokkentjuk v-vektor a palya, labdaval */ #include <iostream...
#include <bits/stdc++.h> const int MAX_N = 50 + 10 , MAX_M = 2500 + 10 , INF = 0x3f3f3f3f ; struct data {int x , y ;} ; std::vector<int> dis[MAX_M] ; std::vector<data> pt[MAX_M] ; int n , k ; int cal(data a , data b) { return abs(a.x - b.x) + abs(a.y - b.y) ; } int main() { scanf("%d %d" , &n , &k) ; for (int ...
#include <LEDMatrixDriver.hpp> // This sketch will 'flood fill' your LED matrix using the hardware SPI driver Library by Bartosz Bielawski. // Example written 16.06.2017 by Marko Oette, www.oette.info // Define the ChipSelect pin for the led matrix (Dont use the SS or MISO pin of your Arduino!) // Other pins are Ardu...
#ifndef REGISTRATIONFRAGMENT_H #define REGISTRATIONFRAGMENT_H #include "basefragment.h" #include <QLineEdit> #include <QPushButton> class RegistrationFragment: public BaseFragment { Q_OBJECT public: RegistrationFragment(); ~RegistrationFragment(); public slots: void WrongDataRegistration(); voi...
/* this code is the solution of beakjoon #11726 please refer below url for checking this problem,condition and example input/output https://www.acmicpc.net/problem/11726 */ #include <iostream> #include <algorithm> using namespace std; int main(void) { int dp[1001]; int num; dp[1]=1; dp[2]=2; dp[3]=3; cin>>nu...
#include "MainWindow.h" #include <QtWidgets/QApplication> #include <iostream> #include <cpr/cpr.h> #include "CURLDispatcher.h" #include "CURLRequest.h" #include "IHTTPRequest.h" #include "SpotifyAPI.h" #include "SpotifyFilter.h" #include <QtCore/qjsonobject.h> #include <QtCore/qjsondocument.h> #include "Tests.h" #inclu...
#pragma once #include <vector> #include "cocos2d.h" class MapSequences; struct SequenceInfo; class Player; class MoveAbleElem; class NpcController:public cocos2d::Ref { NpcController(); public: ~NpcController(); void randomGenElement(Player * pPlayer, cocos2d::Node * pRenderNode, float dt); void generateObsta...
/**************************************************************************** *文件名称: base_main.cpp *创建日期: 2017-9-15 *作 者: 郭世江 *修改记录: 2017-9-15 首次创建 *功能描述: 主函数文件 *****************************************************************************/ #include "base_station.h...
#pragma once #ifndef RL_SPACESHUTTLE_H #define RL_SPACESHUTTLE_H #include "../map.h" #include "../randomness.h" #include "../maputils.h" namespace RL { inline void CreateSpaceShuttle(CMap &level,const int& max_number_of_rooms=15, bool mirror_vertical=false, bool rooms_the_same=true) { const int room_min_size=3;...
#include "Profile.h" #include "json/rapidjson.h" #include "json/document.h" #include "json/reader.h" #include "json/stringbuffer.h" #include "json/prettywriter.h" #include "Utils.h" #include "cocos2d.h" #include <fstream> std::string user_id; #define RANDOM_UID_EVERY_TIME void load_profile(const std::string& path) {...
#pragma once #ifndef OI_H #define OI_H #include "WPILib.h" // this class defines the stuff we use to control the robot. OI stands for operator input. class OI { private: std::shared_ptr<Joystick> driverJoystick; //std::shared_ptr<Joystick> driverJoystick2; std::vector<JoystickButton*> driverBtns; //std::vector<Jo...
#pragma once #include <rose.h> #include "handlerTypes.h" //! Handles SgNullStatement class SgNullStatement_Handler : public StatementReversalHandler { public: SgNullStatement_Handler() { name_ = "SgNullStatement handler"; } virtual StatementReversal generateReverseAST(SgStatement* stmt, const EvaluationResult&...
/** * @file slam3d.h * @brief Provides specialized nodes and factors for 3D SLAM * @author Michael Kaess * @version $Id: slam3d.h 7610 2012-10-25 10:21:12Z hordurj $ * * Copyright (C) 2009-2013 Massachusetts Institute of Technology. * Michael Kaess, Hordur Johannsson, David Rosen, * Nicholas Carlevaris-Bianco a...
#include "object.h" using namespace lab3; Object::Object(const std::string &name, const std::string &description, int price, int volume, int weight) : name_(name), description_(description), price_(price), volume_(volume), weight_(weight) {} Object::~Object(){} // ** Accessors std::strin...
#ifndef __ItemMushroom_H__ #define __ItemMushroom_H__ #include "Item.h" class ItemMushroom : public Item { public: static ItemMushroom* create(CCDictionary* dict); bool init(CCDictionary* dict); bool _isDead; void die(); void move(float dt); void collision(); }; #endif
/* * SPDX-FileCopyrightText: 2008 Till Harbaum <till@harbaum.org> * * SPDX-License-Identifier: GPL-3.0-or-later */ /* http://josm.openstreetmap.de/svn/trunk/styles/standard/elemstyles.xml */ #include "josm_elemstyles.h" #include "josm_elemstyles_p.h" #include "color.h" #include "icon.h" #include "josm_presets....
/*----------------------------------------------------------------------- Matt Marchant 2015 - 2016 http://trederia.blogspot.com Robomower - Zlib license. This software is provided 'as-is', without any express or implied warranty.In no event will the authors be held liable for any damages arising from the use of thi...
class Solution { public: bool isValid(string s) { vector<char> temp; int i = 0; temp.push_back('$'); while(s[i]) { if(s[i] == '(' || s[i] == '{' || s[i] == '[' ) { temp.push_back(s[i]); } else if (s[i] == ')') { if(temp.back() =...
//快速幂的递归写法 typedef long long LL; //求 a^b &m 的递归写法 LL binarypow(LL a,LL b,LL m) { LL num; if(b==0) return 1; //a^0=1 if(b%2==1) return a*binarypow(a,b-1,m)%m; //为了便于二分,提出一个a后再二分,每次计算都求摸,避免大数 else { //b是偶数,二分求幂次 num=binarypow(a,b/2,m)%m; //先算出来一个值,递归调用再运用这个值,降低复杂度 return num*num % m; } }
// by thaiph99 #include <bits/stdc++.h> using namespace std; #define ll long long #define FOR(i, a, b) for (ll i = a; i <= b; i++) #define FORR(i, a, b) for (ll i = a; i >= b; i--) #define oo INT_MAX #define iosb \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie...
// // ArmatureManager.h // Boids // // Created by Xin Xu on 10/29/14. // // #ifndef __Boids__ArmatureManager__ #define __Boids__ArmatureManager__ #include <spine/spine-cocos2dx.h> class ArmatureData { public: spSkeletonData *_skeletonData; spAtlas *_atlasData; }; class ArmatureManager { public: virtu...
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) #define ok() puts(ok?"Yes":"No"); using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<vi> vvi; typedef vector<ii> vii; typedef vector<bool> vb; typedef vector<vb> vvb; typedef set<int> si; ty...
#include <Servo.h> #include <Metro.h>
#include "xor.hpp" #include "proton/rtparam.hpp" #include "proton/variant.hpp" #include "Includes/Logger.h" #include <string> #include <bits/stdc++.h> std::string Xor::encDec(const char* enc, int ln, bool mode) { char key = 0x41; //Any char will work std::string output; output.resize(ln); for (int i = 0; i ...
#include <iostream> #include <stdlib.h> #include <time.h> using namespace std; const int lin=4; const int col=3; int num[lin][col]; void ingreso (int num[lin][col]){ srand(time(0)); for (int l=0;l<(lin-1);l++) { for (int c=0;c<col;c++) { num[l][c]= 1 + rand() %(100-1); ...
// // mgmres.hpp // MgmresDemo // // Created by 吴越 on 16/5/7. // Copyright © 2016年 Yue Wu. All rights reserved. // #ifndef mgmres_hpp #define mgmres_hpp #include "SparseMatrix.hpp" #include <stdio.h> using namespace myg; // mgmres.hpp // // Thanks to Philip Sakievich for correcting mismatches between this HPP //...
// @copyright 2017 - 2018 Shaun Ostoic // Distributed under the MIT License. // (See accompanying file LICENSE.md or copy at https://opensource.org/licenses/MIT) #pragma once #include <distant/config.hpp> #include <distant/access_rights.hpp> #include <distant/type_traits.hpp> #include <distant/concepts/boolean_valid...
class Solution { public: bool lemonadeChange(vector<int>& bills) { vector<int> count(2,0); for(auto bill:bills) { if(bill == 5) count[0]++; else if(bill == 10) { if(count[0] <= 0) return false; else { ...
#include <bits/stdc++.h> using namespace std; struct cmp { bool operator()(pair<string, int> a, pair<string, int> b) { return a.second < b.second; } }; map<string, vector<string>> favoriteVideoGenre(int numUsers, map<string, vector<string>> users, ...