text
stringlengths
8
6.88M
#include <iostream> using namespace std; int findfirstoccurence(int arr[],int n,int x); int findlastoccurence(int arr[],int n,int x); int main() { //code int T; int n,x; cin>>T; for(int i=0;i<T;i++){ cin>>n>>x; int arr[n]; for(int j=0;j<n;j++){ cin>>arr[j]; } if(f...
// // Created by griha on 09.12.17. // #include "misc/logger.hpp" #include <boost/log/trivial.hpp> #include <boost/log/utility/setup/file.hpp> #include <boost/log/utility/setup/common_attributes.hpp> #include "misc/filesystem.hpp" namespace griha { namespace hsm { namespace log = boost::log; namespace...
// Created on: 1993-05-14 // Created by: Bruno DUMORTIER // Copyright (c) 1993-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GN...
//============================================================================ // Name : Writer.h // Author : kdjie // Version : 1.0 // Copyright : @2015 // Description : 14166097@qq.com //============================================================================ #pragma once #include "EVComm.h" ...
//By SCJ #include<bits/stdc++.h> using namespace std; #define endl '\n' #define maxn 1005 struct P{ int t,x,y; }p[maxn]; int n,my[maxn]; vector<int> G[maxn]; bool used[maxn]; bool dfs(int v) { for(int u:G[v]) { if(used[u]) continue; used[u]=1; if(my[u]==-1||dfs(my[u])) { my[u]=v;return true; } } retur...
#include "Map.h" Map::Map() { } Map::~Map() { } void Map::addSnake(Snake snk) { snakes.push_back(snk); } void Map::addApple(Apple apl) { std::cout<<"adding apl"<<std::endl; apples.push_back(apl); } void Map::refreshMap() { for(int i = 0; i < (int)snakes.size(); i++) { snakes[i].mov...
// // BitStream.h // superasteroids // // Created by Cristian Marastoni on 31/05/14. // // #pragma once #include <string.h> #include "NetTypes.h" #include <string> class BitStream { public: BitStream(); BitStream(uint8 *data, size_t size, bool read=false); BitStream(const uint8 *data, size_t size); ...
#include "stdafx.h" #include "ProtoBufTest.h" #include <fstream> #include "acctest.pb.h" #include "person.pb.h" using namespace std; using namespace myPbMsg; //#ifdef NDEBUG //#pragma comment(lib, "../google/bin/Release64/libprotobuf.lib") //x64版本 //#else //#pragma comment(lib, "../google/bin/Debug64/libprotobufd.l...
// ========================================================================== // Wrapper code to interface g_Element // ========================================================================== // (C)opyright: // // Jochen Lang // SITE, University of Ottawa // 800 King Edward Ave. // Ottawa, On., K1N 6N5 // ...
/* * Name - Erin Coots * Date - November 4th, 2016 * File - Test.cpp * Description - LinkedListOfInts tests */ #include <iostream> #include <string> #include "Test.h" using namespace std; Test::Test(){} void Test::runTests(){ cout << "\n-------------------\n"; cout << " RUNNING TESTS "; cout << "\n-------...
#include <EEPROMString.h> #include <EEPROM.h> EEPROMString::EEPROMString(int start, int size, int qty) { _start = start; _size = size; _qty = qty; } void EEPROMString::begin() { _eeprom_size = _size * _qty; EEPROM.begin(_eeprom_size); } void EEPROMString::save(int index, String value) { int ...
#ifndef MAC_WIDGET_INFO_H #define MAC_WIDGET_INFO_H #include "modules/skin/IndpWidgetInfo.h" typedef enum { kOperaScrollbarStyleFull, kOperaScrollbarStyleSimplified } OperaScrollbarStyle; class MacWidgetInfo : public IndpWidgetInfo { public: /** Se OpWidget.h for parameter details. */ virtual void GetPreferedSi...
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define FOR(i, n) for (ll i = 0; i < n; i++) #define FOR1(i, n) for (ll i = 1; i < n; i++) #define FORn1(i, n) for (ll i = 1; i <= n; i++) #define FORmap(i, mp) for (auto i = mp.begin(); i != mp.end(); i++) #define vll vector<ll> #define vs ve...
#define _USE_MATH_DEFINES #include <cmath> #include <iostream> class Point { private: friend std::ostream& operator<<(std::ostream& os, const Point& point) { return os << "x: " << point.x << " y: " << point.y; } friend class PointFactory; // Use a factory as constructor is private! Point(...
#ifndef COMMON_THREADING_THREAD_H_ #define COMMON_THREADING_THREAD_H_ #include <functional> #include <pthread.h> #include "common/base/nocopy.h" namespace common { typedef pthread_t ThreadId; typedef pthread_attr_t ThreadAttr; typedef std::function<void()> Functor; // thread in toft is quite fussy class Thread { ...
// Created on: 2016-02-04 // Created by: Anastasia BORISOVA // Copyright (c) 2016 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...
/*! @file LogVol_GammaSourceCasing.hh @brief Defines mandatory user class LogVol_GammaSourceCasing. @date August, 2012 @author Flechas (D. C. Flechas dcflechasg@unal.edu.co) @version 1.9 In this header file, the 'physical' setup is defined: materials, geometries and positions. This class defines the exp...
#include <SoftwareSerial.h> #include <Sprite.h> #include <Matrix.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C mylcd(0x27,16,2); SoftwareSerial mySerial(10, 11); // RX, TX //libraries http://duinoedu.com/dl/lib/dupont/sprite/ //libraries http://duinoedu.com/dl/lib/dupont/matrix/ Matrix mesLeds...
#include <boost/math/special_functions/next.hpp> #include <boost/random.hpp> #include <limits> #include "caffe/common.hpp" #include "caffe/SpeedUp/math_functions_sparse.hpp" #include "caffe/util/math_functions.hpp" #include "caffe/util/rng.hpp" #include "caffe/util/benchmark.hpp" namespace caffe { template <typ...
; #include <iostream> #include <conio.h> using namespace std; int ShowMatrix() { int row=2, column=2; int matrix[2][2] = { {8, -4} , {-6, 2} }; cout<<"The matrix is:"<<endl; for(int i=0; i<row; ++i) { for(int j=0; j<column; ++j) cout<<matrix[i][j]<<" "; cout<<endl; } } ...
#include <iostream> #include <cppunit/extensions/HelperMacros.h> #include <Poco/AutoPtr.h> #include <Poco/DOM/DOMParser.h> #include <Poco/DOM/Document.h> #include "util/SecureXmlParser.h" #include "cppunit/BetterAssert.h" using namespace std; using namespace Poco; using namespace Poco::XML; namespace BeeeOn { clas...
#ifndef _CONFIGURE_H_ #define _CONFIGURE_H_ #include <time.h> #include <unistd.h> #include <string> #include "Typedef.h" #include "Game/GameConfig.h" class Configure :public GameConfig { Singleton(Configure); public: bool LoadGameConfig(); public: UINT16 m_robotId; //第几个机器人服务器 //连接大厅的ip和端口 std::string ...
/** BasicHTTPClient.ino Created on: 24.05.2015 */ #include <Arduino.h> #include <SoftwareSerial.h> #include <ESP8266WiFi.h> #include <ESP8266WiFiMulti.h> //for input-output SoftwareSerial NodeMCU(D2,D3); //SoftwareSerial NodeMCU(D3,D2); /* * HTTP Client POST Request * Copyright (c) 2018,...
#ifndef _PLATE_1D_ADAMSBASHFORTH_ #define _PLATE_1D_ADAMSBASHFORTH_ 1 #include "plate_var_types.h" #include <vector> #include <iostream> #include <fstream> #include <complex> using std::vector; using std::cout; using std::endl; using std::ofstream; using std::complex; class ABPrevPhis { public: ABPrevPhis(); ~ABPr...
#include <SmartDB.h> namespace qy { SmartDB::SmartDB() : dbHandle_(NULL) , connected_(false) , code_(0) {}; SmartDB::SmartDB(const std::string& filename) { Open(filename); }; bool SmartDB::Open(const std::string& filename) { code_ = sqlite3_open(filename.data(), &dbHandle_); if (SQLITE_OK == code_) { conne...
#ifndef AWEAPON_HPP # define AWEAPON_HPP #include <iostream> class AWeapon { private: AWeapon(void); std::string name; int shoot_cost; int damage_hit; public: AWeapon(std::string const & name, int apcost, int damage); AWeapon(AWeapon const & src); virtua...
#pragma once #include "bricks/java/jobject.h" #include "bricks/java/jmethoddelegate.h" #include "bricks/collections/array.h" namespace Bricks { namespace Java { namespace Internal { template<typename T> struct JArrayTypeConversion; #define BRICKS_JAVA_JARRAYTYPECONVERSION(T, JT) \ template<> struct JArrayTypeConv...
// // Created by 송지원 on 2020/07/17. // #include <iostream> using namespace std; int N, R, C; void func(int r, int c, int n, int CNT) { if (n == 1) { for (int i=0; i<2; i++) { for (int j=0; j<2; j++) { if (r+i == R && c+j == C) cout << CNT + 2*i + j; // cout <<"(...
#include<iostream> #include<deque> using namespace std; void DFS(int v); int visited[5]= {0}; int arc[5][5]= { {0,0,1,1,0}, {0,0,1,0,0}, {1,1,0,1,0}, {1,0,1,0,1}, {0,0,0,1,0} }; int main() { DFS(4); } void DFS(int v) { visited[v]=1; cout<<(v+1); for(int i=0; i<5; ++i) { if(arc[v][i]==1) { if(visited[i]!=...
//#include <SFML/Graphics.hpp> //#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") #include <conio.h> #include "Game.h" #include <fstream> string Path = "D:\\Ali\\Repos\\Quest\\Quest\\Quest\\"; //--------------------------------------------------------------------------------------- bool loadTextu...
#ifndef __VIVADO_SYNTH__ #include <fstream> using namespace std; // Debug utility ofstream* global_debug_handle; #endif //__VIVADO_SYNTH__ #include "sbl_ur_2_opt_compute_units.h" #include "hw_classes.h" struct img_img_update_0_write0_merged_banks_12_cache { // RAM Box: {[-2, 1920], [-1, 1080]} // Capacity: 19...
#include "basedataview.h" #include "qcustomplot.h" #include "statdatatool.h" #include <QComboBox> CBaseDataView::CBaseDataView(QWidget *parent) : CStatViewBase(parent) { // m_mapFileName["frequency.dat"] = StatItemInfo("频率", "Hz"); // m_mapFileName["rms_vol.dat"] = StatItemInfo("电压有效值", "V"); // m_mapFile...
/* Copyright (c) 2014 Mircea Daniel Ispas This file is part of "Push Game Engine" released under zlib license For conditions of distribution and use, see copyright notice in Push.hpp */ #pragma once #include "Math/Math.hpp" #include "Serialization/Serialize.hpp" #include <cmath> namespace Push { struct Vector ...
#include <stdio.h> #include <iostream> #include <math.h> #include <algorithm> #include <memory.h> #include <set> #include <map> #include <queue> #include <deque> #include <string> #include <string.h> #include <vector> typedef long long ll; typedef long double ld; typedef unsigned long long ull; const ld PI = acos(-1.)...
#include <Adafruit_NeoPixel.h> #include "Words.h" const int8_t PROGMEM fireBears[] = { 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0,...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> using namespace std; typedef long long ll; #define INF 10e10 #define rep(i,n) for(int i=0; i<n; i++) #define r...
/** * heap.h * Heap class -- implements a min heap with ability to change a weight already in the heap. * * Entries in the heap are keyed by a unique string so the weight can subsequently be changed * and so when the min weight is dequeued it can also be identified by its key for use by the client. * * Min heap....
#include <cassert> #include <cmath> #include <iomanip> #include <iostream> #include <type_traits> #include <unistd.h> #include <unordered_set> #include <string> #include <vector> unsigned in_row = 0; void row_check() { in_row++; // TODO: Make this dynamic if(in_row >= 8) { std::cout << std::en...
// Include necessary modules for Adafruit motor shield #include <Wire.h> #include <Adafruit_MotorShield.h> #include "utility/Adafruit_PWMServoDriver.h" #define A_pin 2 #define B_pin 3 #define num_ticks 1440 // Create the motor shield object with the default I2C address Adafruit_MotorShield AFMS = Adafruit_MotorShield...
#include <SoftwareWire.h> #include "ssd1306_lib.h" SSD1306 screen; void setup() { // put your setup code here, to run once: SSD1306_Init(&screen, 2, 3); while(SSD1306_Loop(&screen)) delayMicroseconds(100); Serial.begin(9600); } void loop() { // put your main code here, to run repeatedly: SSD1306_Display...
#include "globals.h" #include "physics.h" #include "game.h" #include "math_extra.h" #include <math.h> /** * Allocate and initialize a new Goal object. * * * @param[in] x The x location of the goal * @param[in] y The y location of the goal * @return The newly initialized goal. */ ...
/**************************************************************** File Name: phase4.C Author: Tian Zhang, CS Dept., Univ. of Wisconsin-Madison, 1995 Copyright(c) 1995 by Tian Zhang All Rights Reserved Permission to use, copy and modify this software must be granted by the author ...
#include<bits/stdc++.h> using namespace std; class Solution { public: vector<vector<int>> minimumAbsDifference(vector<int>& arr) { vector<vector<int>> ans; sort(arr.begin(), arr.end()); int min_diff = abs(arr[1]-arr[0]); for(int i=0;i<arr.size()-1;i++) { ...
#ifndef EXTENSION_SUPERSONIC_H #define EXTENSION_SUPERSONIC_H namespace extension_supersonic { int SampleMethod(int inputValue); } #endif
#include "time.h" #include <iostream> #include <sdl/SDL.h> double time::_time_prev = 0; double time::_time_fps_prev = 0; uint time::_fps = 0; float time::_dt = 0; double time::get_time() { return SDL_GetPerformanceCounter() * 1000 / (double)SDL_GetPerformanceFrequency(); } float time::get_delta_time() {...
#pragma once #include "Parametrizable.h" class ExampleWidget : public QWidget, public Parametrizable { Q_OBJECT public: ExampleWidget(QWidget * parent = nullptr); };
#pragma once #include "../../Toolbox/Types.h" #include "../Dependencies/OpenGL.h" namespace ae { /// \ingroup graphics /// <summary>When the texture will be sampled, determine how to chose the pixel color.</summary> /// <remarks>https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexParameter.xhtml</remark...
#include <bits/stdc++.h> using namespace std; const int maxn = 100010; int n, m, ans, f[maxn]; int main() { scanf("%d%d", &n, &m); int x, y; for (int i = 1; i <= m; i++) { scanf("%d", &x); if (x == 0) { scanf("%d%d", &x, &y); for (int i = x; i <= y; i++) f[i] ^= 1; } else { scanf("%d%d", &x, &y)...
// Longest Increasing Sequence #include <bits/stdc++.h> using namespace std; #define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define ll long long int n; vector<int> v,dp; void solve(){ cin>>n; v.resize(n); dp.resize(n); for(int i=0;i<n;i++){ cin>>v[i]; } int best=0; ...
// Copyright (c) 1991-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published ...
#pragma once class RotatingRoom; class ShiftingPlatform : public hg::IComponent { public: virtual int GetTypeID() const { return s_TypeID; } static uint32_t s_TypeID; void LoadFromXML( tinyxml2::XMLElement* data ); void Start(); void Update(); void OnEvent(const StrID& eventName); void Extend(); void Re...
#pragma once class CommunityLayer { public: CommunityLayer(); ~CommunityLayer(); };
/* Name: 链式 a + b Copyright: Author: Hill Bamboo Date: 2019/9/9 15:45:23 Description: 归并排序 + 处理最后的carry */ #include <bits/stdc++.h> using namespace std; struct ListNode { int val; ListNode* next; ListNode(int v) : val(v), next(nullptr){ } }; void printList(ListNode* list) { ListNode* ph = list; cout << "...
#include "producteur.h" /// @brief Le constructeur par défaut attribue les valeurs passée en paramètre. /// /// Constructeur de la classe Producteur /// /// @param n nom de l'utilisateur /// @param pren prenom de l'utilisateur /// @param pc @ref PointDeCollecte à associé à ce compte Producteur::Producteur(std::string ...
#if !defined (_8259_H_) #define _8259_H_ #include <stddef.h> #include <stdint.h> #define PIC1 0x20 /* IO base address for leader PIC */ #define PIC2 0xA0 /* IO base address for follower PIC */ #define PIC1_COMMAND PIC1 #define PIC1_DATA (PIC1+1) #define PIC2_COMMAND PIC2 #define PIC2_DATA (PIC2+1) #define ICW1_IC...
#include "regex.h" Automaton autoOr(Automaton A, Automaton B) { A.s->addTrans(0, B.s); B.t->addTrans(0, A.t); return A; } Automaton autoSeq(Automaton A, Automaton B) { A.t->addTrans(0, B.s); A.t = B.t; return A; } Automaton autoStar(Automaton A) { A.s->addTrans(0, A.t); A.t->addTrans(0, A.s); retur...
#include <iostream> #include <vector> #include "KDTree.h" const static float pointList[7][2] = { {3, 4}, {5, 6}, {9, 1}, {1, 6}, {20, 5}, {7, 300}, {9, 8} }; int main() { auto v = PointList(); for (int i = 0; i < 7; ++i) { auto a = glm::vec3( pointList[i][0], pointList[i][1], 0 ); v.push_back(a...
#ifndef HEADER_CURL_MULTIIF_H #define HEADER_CURL_MULTIIF_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * |...
// Copyright (c) 2020 albestro // // 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) #include <pika/init.hpp> #include <pika/testing.hpp> #include <atomic> #include <string> #i...
#include <ros/ros.h> #include <ros/package.h> #include <memory> #include <iostream> #include <fstream> #include <string> #include <vector> #include <exception> #include <io_lib/io_utils.h> #include <dmp_lib/DMP/DMP_eo.h> #include <kf_lib/EKF.h> #include <math_lib/quaternions.h> #include <dmp_kf_test/utils.h> using n...
#include "Renderer.h" #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> glm::vec3 cameraPos = glm::vec3(0.0f, 0.0f, -3.0f); glm::vec3 cameraFront = glm::vec3(0.0f, 0.0f, -1.0f); glm::vec3 cameraUp = glm::vec3(0.0f, 1.0f, 0.0f); Renderer::Renderer(Model* model, Shader* shad...
// Created on: 1992-09-28 // Created by: Remi GILET // Copyright (c) 1992-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 Les...
/********************************************************************************** General Neck Header file Has overall class definition and private and public functions. This class will change if a new neck mechanism is implemented (recommended). Edited by Ethan Lauer on 4/8/21 ********...
#pragma once #include <memory> #include <type_traits> #include "EverydayTools/Array/ArrayView.h" #include "EverydayTools/Exception/CallAndRethrow.h" #include "EverydayTools/Exception/ThrowIfFailed.h" #include "RangedFunction.h" #include "WaveBuffer.h" template < typename T, bool interpolate, typename = std...
// Generated from Expr.g4 by ANTLR 4.8 #pragma once #include "antlr4-runtime.h" #include "ExprVisitor.h" /** * This class provides an empty implementation of ExprVisitor, which can be * extended to create a visitor which only needs to handle a subset of the available methods. */ class ExprBaseVisitor : public...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2012 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #include "core/pch.h" #if defined(VEGA_USE_ASM) && defined(ARCHITECTU...
#ifndef SDAIHEADER_SECTION_SCHEMA_SCHEMA_CC #define SDAIHEADER_SECTION_SCHEMA_SCHEMA_CC // This file was generated by fedex_plus. You probably don't want to edit // it since your modifications will be lost if fedex_plus is used to // regenerate it. #include <SdaiSchemaInit.h> #include "scl_memmgr.h" void HeaderSch...
#pragma once #include <functional> #include <Poco/AutoPtr.h> #include <Poco/Util/TimerTask.h> namespace BeeeOn { class LambdaTimerTask : public Poco::Util::TimerTask { public: typedef std::function<void(void)> TaskCall; typedef Poco::AutoPtr<LambdaTimerTask> Ptr; LambdaTimerTask(TaskCall call); void run() ove...
#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <iostream> #include <queue> #include <set> #include <vector> #include <fstream> #include <string> int min(int x, int y) { if (x <= y) return x; return y; } using namespace std; deque<int> runningValues(0); const in...
/* Name: 走方格 Copyright: Author: Hill Bamboo Date: 2019/9/9 16:34:52 Description: */ #include <bits/stdc++.h> using namespace std; const int maxn = 100; int ans[maxn][maxn]; class Robot { public: // int countWays(int x, int y) { // ans[1][1] = 1; // return walk(x, y); // } // dp method ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef MODULES_SCOPE_SCOPE_INTERNAL_PROXY_H #define MODULES_SCOPE_SCO...
/* * Copyright (c) 2011 Pierre-Etienne Bougué <pe.bougue(a)gmail.com> * Copyright (c) 2011 Florian Colin <florian.colin28(a)gmail.com> * Copyright (c) 2011 Kamal Fadlaoui <kamal.fadlaoui(a)gmail.com> * Copyright (c) 2011 Quentin Lequy <quentin.lequy(a)gmail.com> * Copyright (c) 2011 Guillaume Pinot <guillaume.pino...
/**************************************************************** * TianGong RenderLab * * Copyright (c) Gaiyitp9. All rights reserved. * * This code is licensed under the MIT License (MIT). * *****************************************************************/ #pragma once #include "Window/WindowHelper....
/* ***** BEGIN LICENSE BLOCK ***** * FW4SPL - Copyright (C) IRCAD, 2009-2011. * Distributed under the terms of the GNU Lesser General Public License (LGPL) as * published by the Free Software Foundation. * ****** END LICENSE BLOCK ****** */ #include <fwDataTools/Image.hpp> #include <itkIO/itk.hpp> namespace fwIt...
#include "Real.h" Real::Real(){ } string Real::toString(){ return ""; }
#include "ArrivalEvent.h" #include "..\Rest\Restaurant.h" ArrivalEvent::ArrivalEvent(int eTime, int oID, ORD_TYPE oType):Event(eTime, oID) { OrdType = oType; } ArrivalEvent::ArrivalEvent(int eTime, int oID, char ty, int size, double money):Event(eTime, oID) { OrdMoney = money > 0 ? money : 0; order_size = size > ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2006 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef FORMRADIOGROUPS_H #define FORMRADIOGROUPS_H #include ...
/* -*- 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. * * Morten Rolland, mortenro@opera.com */ #ifndef MEMORY_GROUP_H #defi...
//: C14:Inheritance.cpp // Kod zrodlowy pochodzacy z ksiazki // "Thinking in C++. Edycja polska" // (c) Bruce Eckel 2000 // Informacje o prawie autorskim znajduja sie w pliku Copyright.txt // Proste dziedziczenie #include "Useful.h" #include <iostream> using namespace std; class Y : public X { int i; // I...
#include <iostream> #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <ncurses.h> using namespace std; int main() { int a, b; scanf("%d %d", &a, &b); if (a>= 0 && a <= b && b <= 100) { for (int i = a; i <= b; i++) { printf("%d\n", i); } ...
#include "node.h" #include "codegen.h" #include "parser.hpp" using namespace std; Value *CodeGenBlock::findLocal(std::string name) { if (locals.find(name) == locals.end()) { return parent ? parent->findLocal(name) : nullptr; } else { return locals[name]; } } /* Compile the AST into a modu...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ #ifndef __FL_TEMP_H__ #define __FL_TEMP...
#include <iostream> using namespace std; int main() { int n, a[100], required, cur, i; bool success; cin >> n; for(int i = 0; i < n; i++) cin >> a[i]; for(cur = 0; cur <= 100; cur++) { success = true; //subtract first one required = a[0] - cur; for( i = ...
#ifndef PPJ_PARSE_H #define PPJ_PARSE_H #include <string> #include <vector> using namespace std; bool parseInt(string s, int &res); bool parseChar(string s, int &res); bool parseString(string s, vector<int> &res); #endif
#include<iostream> #include<algorithm> #include<vector> using namespace std; class Solution { public: int findMin(vector<int>& nums) { //基本思想:二分查找 int left=0,right=nums.size()-1; while(left<right) { int mid=(left+right)/2; if(nums[right]==nums[mid]) ...
#include<iostream> #include"../game/game.h" Game::Game() { std::cout << "constructor\n"; } void Game::init_all() { std::cout << "initializing\n"; } void Game::start() { std::cout << "Start!\n"; }
//#include "stdafx.h" //CRITICAL header information #include "data_both.h" #include "define_host.h" #include "function_host.h" #include "function_both.h" // remove this if logadd is not needed // b111 build tiles void cleararea(int x, int y, int lengthx, int lengthy); void buildwall(int x, int y, int length, int ...
#include "RogueAttack.h" RogueAttack::RogueAttack(Unit* instance): Attack(instance) {} void RogueAttack::attack(Unit* enemy) { enemy->takeDamage(this->instance->getDmg()); }
#include<bits/stdc++.h> #define MAX 10 using namespace std; int a[100]; int n; void input(){ cin >> n; for(int i = 0; i < n; i++) cin >> a[i]; } int main(){ freopen("XYZ.inp", "r", stdin); freopen("XYZ.out", "w", stdout); input(); int s = 0; bitset<MAX> myBit[100]; for (int i = 0; i < n; ++i) {...
//////////////////////////////////////////////////////////////////////////////// #include "extrude_mesh.h" #include <polyfem/MeshUtils.hpp> #include <igl/all_edges.h> #include <igl/boundary_loop.h> #include <igl/bfs_orient.h> #include <igl/orient_outward.h> #include <igl/triangle/triangulate.h> #include <igl/copyleft/t...
#include "Matrix.hpp" using namespace cv; using namespace uipf; // get content (returns a cloned version of Mat by default) // this is due to prevent overwriting accidentally Mat Matrix::getContent(bool bAutoClone /*= true*/) const{ if (bAutoClone) return matrix_.clone(); else return matrix_; } // sets the con...
#pragma once #include "proto/data_base.pb.h" #include "proto/data_event.pb.h" #include "proto/config_shop.pb.h" using namespace std; namespace pd = proto::data; namespace pc = proto::config; namespace nora { namespace scene { class role; pd::result mys_shop_free_refresh_good...
#include <iostream> void reverseString(std::string& str, int size) { char* ptr1 = nullptr; char* ptr2 = nullptr; for (int i = 0; i < size / 2; ++i) { ptr1 = &str[i]; ptr2 = &str[size - i - 1]; char tmp = *ptr1; *ptr1 = *ptr2; *ptr2 = tmp; } } int main() { ...
#include<iostream> using namespace std; int main(){ //input int *hash = new int[1005]; for(int i=0;i<1005;++i){ hash[i] = 0; } int n; cin>>n; for(int i=0;i<n;++i){ int number; cin>>number; for(int j=0;j<number;++j){ int temp; cin>>tem...
#include <iostream> #include <vector> typedef long long ll; int n; ll table[21][21]; ll Combination(ll n, ll r) { if(n == r || r == 0) { return 1; } if(table[n][r] > 0) { return table[n][r]; } return table[n][r] = Combination(n - 1, r - 1) + Combination(n - 1, r); } ll factor...
#include <vector> #include <string> #include <iostream> #include <fstream> #include <sstream> #include <list> #include <algorithm> #include <sstream> #include <set> #include <cmath> #include <map> #include <stack> #include <queue> #include <stdio.h> #include <string.h> #include <time.h> using namespace std; #define M...
#ifndef ADD_CONNECTOR_H #define ADD_CONNECTOR_H #include "Action.h" #include "..\Statements\Connector.h" //Add Connector Action //This class is responsible for // 1 - Getting the first stat. coordinates from the user // 2 - Getting the second stat. coordinates from the user // 3 - Creating an object of Connector cla...
#pragma once #include <iterator> void QuickSort(size_t low, size_t high, std::vector<int>& data) { if (data.empty() || data.size() == 1 || low >= high) { return; } int base = data[low]; size_t lowTemp = low; size_t highTemp = high; while (lowTemp < highTemp) { while (data[highTemp] >= base&& highTemp > lowT...
#include <SFML/Graphics.hpp> #include <SFML/Audio.hpp> #include <SFML/Audio/Music.hpp> #include "GlobalniePer.h" #include "Racket.h" #include "Ball.h" #include <string> #include <time.h> //! #include <Windows.h> //! Racket left(1); Racket right(0); Ball ball; float speed = 0; //! ...
#ifndef FORMAVERAGEDEVIATION_H #define FORMAVERAGEDEVIATION_H #include <QWidget> #include <QComboBox> #include <QDoubleSpinBox> namespace Ui { class FormAverageDeviation; } class FormAverageDeviation : public QWidget { Q_OBJECT public: explicit FormAverageDeviation(QWidget *parent = 0); ~FormAverageDeviatio...