text
stringlengths
8
6.88M
#include <pybind11/pybind11.h> #include <pybind11/eigen.h> #include <pybind11/stl.h> #include <rmf_traffic/agv/VehicleTraits.hpp> #include <rmf_traffic/Profile.hpp> namespace py = pybind11; using VehicleTraits = rmf_traffic::agv::VehicleTraits; using Profile = rmf_traffic::Profile; using ConstFinalConvexShapePtr = ...
/** * AddressBookType.h * [Insert Description of File] * * Written by: Mathew Larribas * Date: 11/13/2013 ******************************************************************************/ #include <iostream> #include <fstream> #include "orderedlinkedlist.h" #include "ExtPersonType.h" using namespace std; ...
//Inline function /* C++ inline function is powerful concept that is commonly used with classes. If a function is inline, the compiler places a copy of the code of that function at each point where the function is called at compile time. Any change to an inline function could require all clients of the function to ...
#ifndef ROSE_JAVA_SUPPORT #define ROSE_JAVA_SUPPORT // Remove this !! //extern SgGlobal *getGlobalScope(); extern SgGlobal *globalScope; extern SgClassType *ObjectClassType; extern SgClassDefinition *ObjectClassDefinition; // This is used for both Fortran and Java support to point to the current SgSourceFile. extern ...
#ifndef PARAMEDITOUTPUT_H #define PARAMEDITOUTPUT_H #include <QWidget> #include "configparams.h" namespace Ui { class ParamEditOutput; } class ParamEditOutput : public QWidget { Q_OBJECT public: explicit ParamEditOutput(QWidget *parent = nullptr); ~ParamEditOutput(); void setConfig(...
#ifndef OBJECT_H #define OBJECT_H #include"TextureManager.h" class Object { private: SDL_Rect src; SDL_Rect dest; SDL_Rect* source = &src; SDL_Rect* destination = &dest; SDL_Texture* Tex; public: SDL_Texture* getTexture(); SDL_Rect* getSrc(); SDL_Rect* getDest(); void setSrc(int x, int y, ...
#include <cassert> #include "TestUtils.h" #include "Utils.h" void cpp_class2_test::testAreEqualFloat() { const float mocka=100.0001f, mockb=100.f; const bool areEqual= cpp_class2::areEqual(mocka, mockb); assert(!areEqual); } void cpp_class2_test::testAreEqualDouble() { const double mocka = 100.0000001, mockb = ...
#ifndef CCONFIGMANAGER_H #define CCONFIGMANAGER_H #include "model/cdatetime.h" #include "model/cdatetimebuilder.h" class CConfigManager { public: enum DATE_DISPLAY_CONFIG { DATE_DISPLAY_CONFIG_LONG = 0, //default DATE_DISPLAY_CONFIG_SHORT, DATE_DISPLAY_CONFIG_MAX }; ...
#include <fstream> #include "cpu.h" #include "log.h" #include "font.h" #include "defines.h" chip8::CPU::CPU() : program_counter(START_ADDRESS) { log_subsys::Init(); for (size_t i = 0; i < 0x10; ++i) { table[i] = &CPU::OP_NOP; } for(size_t i = 0; i < 0xF; ++i) { table0[i] = &CPU::OP_NOP; } for (size_t i = 0;...
#ifndef NAIMP_H #define NAIMP_H /// @file NaImp.h /// @brief NaImp のヘッダファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2005-2012 Yusuke Matsunaga /// All rights reserved. #include "YmNetworks/bdn.h" BEGIN_NAMESPACE_YM_NETWORKS class ImpMgr; class ImpInfo; ////////////////////////////////////////...
#pragma once #include <vector> #include "geometry/Point.hpp" class IPositionable; class IPositionableListener { public: virtual void changed(IPositionable& ipos, const Point& newPosition) = 0; }; class IPositionable { Point position; const Point* oldPosition; std::vector<IPositionableListener...
// AUTHOR: Sumit Prajapati #include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define pb push_back #define mk ...
// CkSFtpDir.h: interface for the CkSFtpDir class. // ////////////////////////////////////////////////////////////////////// // This header is generated. #ifndef _CkSFtpDir_H #define _CkSFtpDir_H #include "chilkatDefs.h" #include "CkString.h" #include "CkMultiByteBase.h" class CkSFtpFile; #ifn...
/*************************************************************************** paginafuentes.cpp - description ------------------- begin : mar 24 2004 copyright : (C) 2004 by Oscar G. Duarte email : ogduarte@ing....
#ifndef _OBJECT_H_ #define _OBJECT_H_ #include<vector> #include "vertex.h" #include "box.h" #include "face.h" #include "material_lib.h" using namespace std; class Object { public: Object(std::string); void readObj(const char*filename,MaterialLib&matlib); void updateBoundingBox(); Box boundingBo...
#pragma once #pragma execution_character_set("utf-8") #include<iostream> #include<vector> #include<string> #include<queue> #include<unordered_map> using namespace std; //C++ O(n log(n - k)) unordered_map and priority_queue solution class Solution { public: vector<int> topKFrequent(vector<int>& nums, int k) { uno...
#include<iostream> using namespace std; int main() { int iNo1=10; int &ref1=iNo1; int &ref2=iNo1; int &ref3=iNo1; cout<<iNo1<<endl<<ref1<<endl<<ref2<<endl<<ref3; cout<<&iNo1<<endl<<&ref1<<endl<<&ref2<<endl<<&ref3; }
#include "physics\Singularity.Physics.h" namespace Singularity { namespace Physics { namespace Core { class BoundingCapsule { public: #pragma region Variables Vector3 Segment[2]; float Radius; float Height; #pragma endregion #pragma region Constructors an...
#include "IdleJoystickState.h" JoystickState * IdleJoystickState::getInstance() { if (IdleJoystickState::sInstance == NULL) { IdleJoystickState::sInstance = new IdleJoystickState(); } return IdleJoystickState::sInstance; } void IdleJoystickState::handleCoordinates(int nX, int nY, Joystick & joystick)...
#include "pangram.h" bool pangram::is_pangram(string s) { bitset<26> data; for (const auto& i : s) { if (isalpha(i)) { int j = tolower(i) - 97; data[j] = 1; } } return data.all(); }
#include "LoadMapTest.h" #include "tinyxml2.h" #include "Util.h" USING_NS_CC; Scene* LoadMapTest::createScene() { // 'scene' is an autorelease object auto scene = Scene::create(); // 'layer' is an autorelease object auto layer = LoadMapTest::create(); // add layer as a child to scene scene->addChild(layer); ...
#include <bits/stdc++.h> using namespace std; #define ar array #define ll long long const int MAX_N = 1e5 + 1; const ll MOD = 1e9 + 7; const ll INF = 1e9; //CF Round #721 (1527) ProgA - Practice void solve() { int n; cin>>n; if(n == 1){ cout<<0<<"\n"; return; } int i = 1; int curr = 1 << i; int res = cur...
// This file has been generated by Py++. // Copyright (c) 2004 Raoul M. Gough // // Use, modification and distribution is subject to 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) // // Header file methods.hpp // // Methods (and se...
/* Project: AltaLux plugin for IrfanView Author: Stefano Tommesani Website: http://www.tommesani.com Microsoft Public License (MS-PL) [OSI Approved License] This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the softwar...
#pragma once //#define PAR_SORT #define INT_SORT #include <vector> #include <algorithm> #include <numeric> #ifdef PAR_SORT #include <parallel/algorithm> #define PARSEQ __gnu_parallel #else #define PARSEQ std #endif #ifdef INT_SORT #include <tudocomp/util/IntSort.hpp> #endif #include <tudocomp/def.hpp> #include...
#include "stdafx.h" #include "ply/ply.h" #include "MxImage.h" #include "MxIsoSurface.h" #include "SurfaceRendering.h" #include "MxOpenGL.h" #include "MxImageIO.h" #include "MxFileIO.h" typedef struct Vertex { float x,y,z; float r,g,b; float nx,ny,nz; void *other_props; /* other properties */ } Vertex; typede...
#pragma once #include <malloc.h> #include <iostream> template<typename T, int align = alignof(T)> struct heapAligned { void* data = malloc(sizeof(T) + alignof(T) - 1); T* val = nullptr; heapAligned<T>() { if ((uintptr_t)data % align == 0) val = (T*)data; else val = data + (align + ((uintptr_t)data % ali...
//========================================================================== // LOGINSPECTOR.H - part of // // OMNeT++/OMNEST // Discrete System Simulation in C++ // //========================================================================== /*------------------------------------------...
#include <string> #include <iostream> namespace N { class C { private: std::string& first(){ // funzione #1 std::cout<< "1\n";} public: const std::string& first() const{ // funzione #2 std::cout<< "2\n";} std::string& last(){ // funzione #3 std::cou...
//$Id$ //------------------------------------------------------------------------------ // BuiltinGmatFunction //------------------------------------------------------------------------------ // GMAT: General Mission Analysis Tool // // Copyright (c) 2002 - 2015 United States Governmen...
#include "XLSearchTask.h" #include "XLSearchParameters.h" #include "../../EngineLayer/CommonParameters.h" #include "../DbForTask.h" #include "../FileSpecificParameters.h" #include "../MyTaskResults.h" #include "../MyFileManager.h" #include "../../EngineLayer/Ms2ScanWithSpecificMass.h" #include "../../EngineLayer/Globa...
/* 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...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "Components/ActorComponent.h" #include "PlayerWeapon.h" #include "PlayerInventory.generated.h" UENUM(BlueprintType) enum class EWeaponType : uint8 { LightWeapon UMETA(Display...
/** * Implementasi Binary Search Tree (ADT: BST) * yakni BST yang tidak menyimpan key duplikat (unique key) * * Dibuat dan ditulis oleh Bayu Laksana * -- tanggal 29 Februrari 2019 * Struktur Data 2020 * * Implementasi untuk Bahasa C */ #include <stdlib.h> #include <stdbool.h> #include <stdio....
#include <iostream> #include <cstdlib> #include <cstdio> #include <unistd.h> #include <csignal> #define FORE_BOLD "\e[1m" #define FORE_RED "\e[31m" #define FORE_GREEN "\e[32m" #define FORE_YELLOW "\e[33m" #define FORE_BLUE "\e[34m" #define FORE_MAGENTA "\e[35m" #define FORE_CYAN "\e[36m" #define RESET "\e[0m" #define...
/***************************************************************************************************** * 剑指offer第21题 * 定义栈的数据结构,请在该类型中实现一个能够得到栈中所含最小元素的min函数(时间复杂度应为O(1))。 * * Input: 数据栈 * Output: 数据栈的最小元素 * * Note: (结合例子分析比较直观) * 应用一个***辅助栈***,压的时候,如果A栈的压入比B栈压入大,B栈不压,,,,小于等于,AB栈同时压入, ...
#include<bits/stdc++.h> #include<limits.h> using namespace std; #define mod 1000000007 #define si(x) scanf("%d", &x) #define sll(x) scanf("%lld", &x) #define pi(x) printf("%d\n", x) #define pll(x) printf("%lld\n", x) #define ii pair<int, int> #define vi vector<int> #define vii vector<pair<int, int> > #define adjList v...
#include "gtest/gtest.h" #include "../../fff-master/fff.h" // add FFF interface dependecy DEFINE_FFF_GLOBALS // Initialize the framework // include external C-code files extern "C" { #include "drivers/hih8120.h" #include "drivers/mh_z19.h" #include "drivers/serial.h" #include "temp_hum_sensor.h" #include "co2.h" #inc...
//ÉîËÑ #include<stdio.h> #include<climits> #define MAX 201 char map[MAX][MAX]; int vis[MAX][MAX]; int n,m,ax,ay,minx; void dfs(int x,int y,int len) { if(x<0 || y<0 || x>=n || y>=m) return; if(len>=minx) return; if(map[x][y]=='#') return; if(vis[x][y]==1) return; if(...
/** * Copyright (c) 2017-present, Facebook, Inc. * All rights reserved. * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #include "bullet.h" #include "cmd_specific.gen.h" //static constexpr float kDistBullet = 0.3; // 子弹的体积 static c...
#ifndef ORDERSERVICE_H #define ORDERSERVICE_H #include "../REPO/OrderRepository.h" #include "../main.h" class OrderService { public: int viewOrderList(); void service_header(); void state_header(); private: OrderRepository orderRepo; }; #endif // ORDERSERVICE_H
#ifndef DEFINES_H_ #define DEFINES_H_ #include <functional> #include <cmath> #include "Tensor.h" namespace StaticNet { namespace Defines { // ------------------------------------------------------------ // Activation functions // -------------------------------------------------------...
#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...
// Fill out your copyright notice in the Description page of Project Settings. #include "SensorInteraction.h" #include "Components/BoxComponent.h" #include "Components/WidgetComponent.h" #include "TempCapstoneProject/PaladinCharacter.h" #include "TempCapstoneProject/RogueCharacter.h" // Sets default values ASensorIn...
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ // modified by Francisco Eduardo Balart Sanchez balart40@gmail.com // Original source from: src/network/examples/main-packet-header.cc #ifndef ESSOAPACKET_H #define ESSOAPACKET_H #include "ns3/ptr.h" #include "ns3/packet.h" #include "ns3/enum.h" #includ...
#include "algorithm/opticalflow_slam/include/opticalflow_slam.h" namespace OpticalFlow_SLAM_algorithm_opticalflow_slam{ /** * @brief create a op_slam, load system config , camera_config and dataset, * to filling slam_config_ , camera_config_ and image_left_right * input: * @param system_config_path run parame...
#include <bits/stdc++.h> using namespace std; using ll = long long int; using PLL = pair < ll, ll>; void solve(){ ll n, w; cin >> n >> w; vector < PLL > v(n); for (int i = 0; i < n; i++){ cin >> v[i].first; v[i].second = i; } sort(v.begin(), v.end()); vector < int > inds; ...
//cv_stereo_reconstru.cpp #include "opencv2/calib3d/calib3d.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/core/utility.hpp" #include <stdio.h> #include<iostream>//标准输入输出 //命名空间 using namespace cv; using namespace std; static void print_help() { ...
#include "AppDelegate.h" #include <GL/glew.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <random> #include <ctime> #include <cstdio> #include "GLProgram.h" #include "Shader.h" #include "Bitmap.h" #include "Texture2D.h" #include "Camera.h" #include "platform.hpp" ...
#include <bits/stdc++.h> using namespace std; bool validPos(int i){ return (i>=0 && i<9); } vector<int> getBlankSpace(vector<string> mp){ //returns vector [si,sj,ei,ej] int si=-1,sj=-1,ei=-1,ej=-1,nexti,nextj,diri=-1,dirj=-1; int dx[] = {-1,1,0,0}; int dy[] = {0,0,-1,1}; for(int i=0;i<10 && si...
// Created on: 2015-03-15 // Created by: Danila ULYANOV // Copyright (c) 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 pub...
#include <fstream> #include <iostream> #include <sstream> #include <vector> #include <string> #include "Eigen/Dense" #include "measurement_package.h" #include "tracking.h" int main() { /* We have a file with lines of data. The line could be either from RADAR or LIDAR. Consider each line a measurement package....
#ifndef FUZZYCORE_REFRESHVIEWEXCEPTION_H #define FUZZYCORE_REFRESHVIEWEXCEPTION_H #include "ViewException.h" class RefreshViewException : public ViewException { public: explicit RefreshViewException(const std::string &); }; #endif
#include <bits/stdc++.h> using namespace std; int main() { int n, ans = 0; cin>>n; while(n--) { int p, q; cin>>p>>q; if(q-p>=2) ans++; } cout<<ans<<endl; }
//----------------------------------------------- // // This file is part of the Siv3D Engine. // // Copyright (c) 2008-2018 Ryo Suzuki // Copyright (c) 2016-2018 OpenSiv3D Project // // Licensed under the MIT License. // //----------------------------------------------- # include <Siv3D/Script.hpp> # include <Siv3D/...
/usr/include/c++/4.4/./debug/safe_iterator.tcc
#include <iostream> #include "DefEnv.h" #include "AllTest.h" #if ENABLE_EXE int main() { #if ENABLE_TEST RunTest(); #endif return 0; } #endif
#include <bits/stdc++.h> using namespace std; class Solution { public: int minSteps(string s, string t) { if (s == t) return 0; map<char, int> m; for (char c : s) m[c]++; int ans = 0; for (char c : t) if (m.find(c) != m.end() && m[c] >...
#pragma once #include "../MetaMorpheusEngine.h" #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #include "../PeptideSpectralMatch.h" #include "../CommonParameters.h" #include "../MetaMorpheusEngineResults.h" using namespace Chemistry; namespace EngineLayer { namespace Modi...
#include<bits/stdc++.h> using namespace std; #define debug(x) cerr << #x << ": " << x << endl; #define iosbase ios_base::sync_with_stdio(false) #define tie cin.tie();cout.tie(); #define endl '\n' typedef pair<int, int> ii; typedef long long ll; #define T int t; cin >> t; while( t--) #define sT int t; scanf("%d", &...
/**************************************************************************** ** Meta object code from reading C++ file 'dialog.h' ** ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.8.0) ** ** WARNING! All changes made in this file will be lost! **************************************************************...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.cpp :+: :+: :+: ...
#include "../commonunion.h" #include <iostream> using namespace std; COMMONUNION(FooUnion,,foo) template<int I> struct isval { constexpr int foo(int i) const { return i==I; } }; template<int L, int H> struct allvals { typedef FooUnion<typename allvals<L,(H+L)/2>::type, typename allvals<(H+L)/2+1,H>::type> typ...
#pragma once #include <Arcane/Graphics/Lights/DirectionalLight.h> #include <Arcane/Graphics/Lights/PointLight.h> #include <Arcane/Graphics/Lights/SpotLight.h> namespace Arcane { class Shader; class DynamicLightManager { public: DynamicLightManager(); void BindLightingUniforms(Shader *shader); void BindStat...
vect::vect(){ x = 0.0f; y = 0.0f; z = 0.0f; } vect::vect(float ax, float ay, float az){ x = ax; y = ay; z = az; } vect::vect(const vect& a){ x = a.x; y = a.y; z = a.z; } //operations friend vect vect::operator+(vect a, vect b){ vect r; r.x = a.x + b.x; r.y = a.y + b.y; r.z = a.z + b.z; return r; } friend ...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; getchar(); while (N--) { vector<char> abertura; char c; bool ok = true; while (scanf("%c", &c), c != '\n') { if (c == '(' || c == '[' || c == '{') abertur...
#ifndef SSPEDITOR_LIGHTCONTROLLER_H #define SSPEDITOR_LIGHTCONTROLLER_H #include "Header.h" #include "GlobalIDHandler.h" class LightController { public: ~LightController(); void Initialize(); static LightController * GetInstance(); std::vector<Light*> * GetLights() { return &m_lights; }; std::vector<LIGHTING:...
/*************************************************************************** Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. 2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD FileName: QTSSStream.h Description: Abstract base class QTSSStream containing the protot...
#ifndef __HELLOWORLD_SCENE_H__ #define __HELLOWORLD_SCENE_H__ #include "cocos2d.h" #include "cocos-ext.h" #include "SimpleAudioEngine.h" //#include <CCScrollView/CCScrollView.h> #include "Macro.h" #include "GameSprite.h" #include "GameHero.h" class GameAnimtion; class GameSprite; class TemplateScene;...
#include<iostream> using namespace std; int main() { int i=10; try { int a=0; if(a==0) throw "division error"; i = i/a; } catch(string s) { cout << s << endl; } catch(...) { cout << "exception error" << endl; } cout << "end" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; const int epsilon = 256;//空的定义 const int Accepting = 257;//结尾定义,即可接受状态的位置 const int bel = 258;//在minDFA过程中标记属于哪个集合 class NFA { public: vector<int> nf[305][260]; int NfaId; NFA() { memset(nf, -1, sizeof nf); NfaId = 2; } void ...
class Solution { void DFSTraversal(unordered_map<string, multiset<string>> &table, string curr, vector<string> &result) { while(!table[curr].empty()) { string next = *table[curr].begin(); table[curr].erase(table[curr].begin()); DFSTraversal(table, next, result); }...
#include "Circular_SLList.h" template <typename T> Circular_SLList<T>::Node::Node(T data) { this->data = data; this->next = NULL; } //Constructor template <typename T> Circular_SLList<T>::Circular_SLList() { last = NULL; count = 0; } template <typename T> Circular_SLList<T>::Circular_SLList(initializer_list<T> l...
#include <RCSwitch.h> RCSwitch mySwitch = RCSwitch(); int hozdead= VALUE ; int verdead= VALUE ; int pos = 0; int oldpos=100; int val = 0; int val2 = 0; void setup() { Serial.begin(9600); mySwitch.enableTransmit(10); } void loop() { //Read JoyStick val = analogRead(0); val2 = analogRea...
#ifndef HTTP_UTILS_H #define HTTP_UTILS_H #include <httpserver.hpp> #include <megaapi.h> httpserver::http_response *make_msg_response(const std::string &msg, int status_code); // str_iter not used anywhere else using str_iter = std::vector<std::string>::const_iterator; s...
//二分法求根号2的近似值,利用函数f(x)=x^2 #include<stdio.h> const double eps=1e-5; //设置精度为10^-5 double function(double x); double calSqrt(double left,double right); int main() { printf("%f",calSqrt(1,2)); return 0; } double function(double x) { return x*x; } double calSqrt(double left,double right) { double mid; //区间中点 ...
//Not a competition Problem just a challenge to an easier problem with harder contraints #include <bits/stdc++.h> using namespace std; vector<long long int> a; long long int conInt(string); void rec(string, int); int main() { rec("", 1); sort(a.begin(), a.end()); //for(int i=0; i<a.size(); i++) cout<<a[i]<<endl;...
/************************************************************* Author : qmeng MailTo : qmeng1128@163.com QQ : 1163306125 Blog : http://blog.csdn.net/Mq_Go/ Create : 2018-03-29 19:57:11 Version: 1.0 **************************************************************/ #include <cstdio> #include <iostream> using namesp...
/// /// @file list_kmers_found_in_multiple_samples.cpp /// @brief Go over a list of k-mer DBs and output only k-mers appearing in at least /// N (defined by user) DBs. Then outputing the k-mers in a binary format. /// // Read all the sorted kmers files and collect statistics on them: // 1. In how many 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...
#include "gui.h" const int width_slider_max = 100; int width_slider; double width_ratio; const int height_slider_max = 100; int height_slider; double height_ratio; /// Matrices to store images Mat src; Mat dst; void on_trackbar_width(int, void*) { if (width_slider == 0){ width_slider = 1; } width_ratio = (dou...
#ifndef FASTCG_DEBUG_MENU_SYSTEM_H #define FASTCG_DEBUG_MENU_SYSTEM_H #ifdef _DEBUG #include <FastCG/Core/System.h> #include <unordered_map> #include <string> #include <functional> #include <cstdint> #include <cassert> namespace FastCG { struct DebugMenuSystemArgs { }; using DebugMenuItemCallback =...
#include "mainwindow.h" #include <QCoreApplication> #include <QPluginLoader> #include <QDir> #include <QDebug> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { loadPlugins(); } MainWindow::~MainWindow() { } void MainWindow::loadPlugins() { QDir dir = qApp->applicationDirPath(); qD...
class Solution { bool traverse(vector<vector<int>> &graph, int curr, vector<int> &visited, vector<int> &result) { if (visited[curr] == 0) { visited[curr] = 1; for (int i = 0, count = graph[curr].size(); i < count; i++) { int next = graph[curr][i]; if (...
/** * 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 <vector> using namespace std; long long solution(int N) { long long answer = 0; bool decimal[10000001] = { false }; for (int i = 2; i <= N; i++) { //2부터 N까지 if (!decimal[i]) //false 일때 더함 answer += i; for (int j = i; j <= N; j +=...
# define HEALBAGCONTROLLER_HPP # ifndef HEALBAG_HPP # include <healBag.hpp> # endif class healBagController : public sf::Drawable { using Map = sf::Sprite; public: healBagController(const sf::Time &, uint); uint getMaxBags() const; void setMaxBags(const uint &); void setScale(const sf::Vector2f &); vo...
/* 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...
#include <string> #include <vector> using namespace std; int solution(vector<vector<int>> board, vector<int> moves) { int answer = 0; vector<int> select; for (int j = 0; j < moves.size(); j++) { int num = moves[j] - 1; for (int i = 0; i < board.size(); i++) if (board[i][num] > 0) { if (!select.empt...
#include <stdio.h> #include <stdlib.h> #include <time.h> #include "aps.h" main(int iargc, char *argv[]){ //d=8 -> delta_chisq=15.5 //d=5 -> delta_chisq=11 int seed=99; int dim,ncenters; seed=atoi(argv[1]); dim=atoi(argv[2]); ncenters=atoi(argv[3]); char timingname[letters],outname[letters]; //what is the name of ...
#include "HelloWorldScene.h" #include "SimpleAudioEngine.h" #include"GameScene.h" #include"AppDelegate.h" USING_NS_CC; Scene* HelloWorld::createScene() { return HelloWorld::create(); } // Print useful error message instead of segfaulting when files are not there. static void problemLoading(const char* filename) { ...
#include "spis.h" consoleInput::consoleInput(int startX, int startY, string label, int maxNum) { win = newwin(maxNum + 1 + 2 + 2, INPUT_LIST_WIDTH + 3, startY, startX); mvwprintw(win, 0, 0, "%s", label.c_str()); wrefresh(win); numWin = winBorder(maxNum , INPUT_LIST_WIDTH + 1, startY + 2, startX + 1); wrefresh(num...
#include <iostream> #include <algorithm> #include <vector> #include <map> #include <string> #include <set> #include <cmath> #include <math.h> #include <unordered_map> #include <unordered_set> #include <cstring> #include <climits> #include <queue> #include <assert.h> using namespace std; int N,K; int main(){ int T...
#ifndef __TEST_OBJECTS_H #define __TEST_OBJECTS_H class User; #include "ReplicaManager2.h" // NetworkIDManager2 is in the namespace RakNet using namespace RakNet; // Soldier is a class that a User can create class Soldier : public Replica2 { public: // All created soldiers static DataStructures::Li...
// SETUP NOTES: // This test uses 4 buttons, 4 POTS, a breadboard and 10 optional LED's. // // Termainl: // - You should connect your TinyPICO to a proper ANSI terminal such as TeraTerm and set the baud rate to 115200 // - ASCII escape codes are used to control advanced debug output // // Expander Setup: // - P...
#ifndef DATASTRUCTURE_TESTBINARYTREE_H #define DATASTRUCTURE_TESTBINARYTREE_H // 包含要测试的数据类型头文件 #include "binaryTree.h" // 设置值类型为char型 using ValueType = char; // 空字符设置为'#' const ValueType NULL_VALUE = '#'; // 测试主函数 void testBinaryTree() { constexpr int size = 100; // 选择的操作 int operation = -1; // 一个辅助变量 ...
#ifndef DESTROYABLEBODY_HPP #define DESTROYABLEBODY_HPP #include "..\Box2D_v2.0.1\Box2D\Include\Box2D.h" #include <SFML/Graphics.hpp> #include <iostream> #include <sstream> #include <math.h> #include <vector> #include "Object.hpp" #include "TempObjectHandler.hpp" using namespace std; using namespace sf; ...
#include<bits/stdc++.h> using namespace std; int vet[1000]; int main(){ int t; scanf("%d", &t); while(t--){ int n; scanf("%d", &n); for(int i=0; i<n*4; i++){ scanf("%d", &vet[i]); } sort(vet, vet+(4*n)); n*=4; int valor = 0; if(vet[0] != vet[1] || vet[n-1] != vet[n-2]){ pu...
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) cin>...
// includes #include <iostream> #include <cstdlib> #include <ctime> // using std's using std::cout; using std::cin; using std::endl; // globals bool quitGame = false; char playerChoice = ' '; int playerChips = 1000; int betAmount = 0; int reelResults[3]; // function prototypes void DisplayPlayerChips(int chips); voi...