text
stringlengths
8
6.88M
#include "game_controller.h" GameController::GameController() { } GameController::~GameController() { delete(pPinIo); delete(pSocketServer); delete(pButtonController); delete(pLampController); delete(pCoilController); delete(pDelayedEventController); } void GameController::startup() { ...
#include <esp_now.h> #include <WiFi.h> uint8_t broadcastAddress[] = {0xAC, 0x67, 0xB2, 0x36, 0xEB, 0xEC}; float smoke; float fire; float vibration; String success; typedef struct struct_message { float smke; float fir; float vib; } struct_message; struct_message sensorReadings; // Callback when data is ...
/* * Copyright (C) 2017 ~ 2017 Deepin Technology Co., Ltd. * * 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 version 3 of the License, or * any later version. * * This program is ...
#include <string> #include <iostream> #include <algorithm> using namespace std; string S; int gx, gy; int walk(int W, int X, int Y, int Z) { int posx = 0; int posy = 0; int ans = 0; //printf("%d%d%d%d\n",W,X,Y,Z); if (posx == gx && posy == gy) { ans = 1; } for (int i = 0; i < S...
#define GLUT_DISABLE_ATEXIT_HACK #include <windows.h> #include <math.h> #include <stdlib.h> #include <stdio.h> #include <iostream> #include <vector> #include <list> #include <GL/glut.h> #include <GL/glext.h> #include "TextureManager.h" using namespace std; #define RED 0 #define GREEN 0 #define BLUE 0 #define ALPHA 1...
// This file was generated based on '/Users/r0xstation/Library/Application Support/Fusetools/Packages/Fuse.Launcher.Maps/1.3.1/Maps/MapsLauncher.uno'. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.h> namespace g{namespace Fuse{namespace LauncherImpl{struct MapsLauncher;}}...
#pragma once #include "SupportFunctions.h" template<typename T> class RationalTemplated { public: RationalTemplated(T numerator = 0, T denominator = 1):m_Numerator(numerator),m_Denominator(denominator){}; template<typename U> RationalTemplated(const RationalTemplated<U>& a):m_Numerator(a.GetNumerator()),m_Denominat...
/* XMRig * Copyright 2010 Jeff Garzik <jgarzik@pobox.com> * Copyright 2012-2014 pooler <pooler@litecoinpool.org> * Copyright 2014 Lucas Jones <https://github.com/lucasjones> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2016 Jay D Dee <jayddee246@gmail.com> * C...
#ifndef wali_wpds_LAZY_TRANS_GUARD #define wali_wpds_LAZY_TRANS_GUARD 1 /*! * @author Akash Lal * @author Nicholas Kidd * */ #include "wali/Common.hpp" #include "wali/wfa/DecoratorTrans.hpp" #include "wali/graph/InterGraph.hpp" #include "wali/wpds/ewpds/ETrans.hpp" struct FWPDSSourceFunctor; namespace wali {...
#ifndef _BULLET_H #define _BULLET_H #include "../Physics/PhysicsEntity.h" #include "../Timer.h" class Bullet : public PhysicsEntity { private: const int OFFSCREEN_BUFFER = 10; Timer* mTimer; float mSpeed; Texture* mBullet; public: Bullet(bool friendly); ~Bullet(); void Fire(Vector2 pos); void Reload(); ...
#ifndef _Pinball_ #define _Pinball_ #include "Module.h" #include "SDL/include/SDL.h" #include "ModuleTextures.h" struct Sprite; class Pinball: public Module { public: Pinball(Application* app, bool start_enabled=true); ~Pinball(); void OnCollision(PhysBody* bodyA, PhysBody* bodyB); bool Start(); bool CleanUp...
#include "Barrage.hpp" #include "Bullet.hpp" #include <algorithm> namespace game { Barrage::Barrage(size_t size) { //前もってメモリを確保して、高速化を図る bullets.reserve(size); } Barrage::~Barrage() { } void Barrage::AddMakeBullet(const BulletInfo& bInfo) { //bInfoをもとにして //bulletを組み立てる auto bullet=std::make_uniq...
#include <Arduino.h> #include "gfx.h" #include "DisplayUtils.h" /** * @brief Load a set of mouse calibration data * @return A pointer to the data or NULL on failure * * @param[in] instance The mouse input instance number * @param[in] data Where the data should be placed * @param[in] sz The size in byt...
#pragma once //使用するヘッダー #include "GameL\SceneObjManager.h" //使用するネームスペース using namespace GameL; extern float g_px; extern float g_py; //オブジェクト : ゴールブロック class CObjgoalblock : public CObj { #define ALL_BLOCK_SIZE (32.0f) public: CObjgoalblock(float x,float y); ~CObjgoalblock() {}; void Init(); //イ二シャライズ void Ac...
#include "CCGreePlatform.h" #include "CCGreeFriendCode.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxGreePlatform.h" #include "jni/Java_org_cocos2dx_lib_Cocos2dxGreeFriendCode.h" #include "jni/JniHelper.h" #define JAVAVM cocos2d::JniHelper::getJavaVM() using namespace cocos2d; NS_CC_GREE_EXT_BEGIN static bool ...
// Created on: 1997-01-03 // Created by: Christian CAILLET // Copyright (c) 1997-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 ...
#include "SimpleList.h" #include <type_traits> template<class T> void destroy(T element) { // do nothing } template <class T> void destroy(T* element) { // delete the pointer type delete element; } template<class T> SimpleList<T>::SimpleList(){ numElements = 0; elements = new T[CAPACITY]; } temp...
/** * Implementation of KalmanFilter class. * * @author: Hayk Martirosyan * @date: 2014.11.15 */ #include <iostream> #include <stdexcept> #include "kalman.hpp" KalmanFilter::KalmanFilter( double dt, const Eigen::MatrixXd& A, const Eigen...
#include "errorhandler.h" #include "conversions.h" ErrorHandler::ErrorHandler(){ error = false; } ErrorHandler::ErrorHandler(string rTag){ error = false; rootTag = rTag; } void ErrorHandler::addError(string message, int code){ errorMsgs.push_back(message); errorCodes.push_back(code); error = true; } bool Err...
#include <iostream> #include <sstream> #include <cstdio> #include <cmath> #include <cstring> #include <cassert> #include <cctype> #include <string> #include <vector> #include <list> #include <set> #include <map> #include <queue> #include <stack> #include <algorithm> #include <functional> using namespace std; #define ...
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { string S; cin >> S; string ans = ""; while (!S.empty()) { if (S.length() % 2 == 0) { ans.push_back(S.back()); S.pop_back(); } else { ans.push_back(S.front()...
/* * µ¥Á´±íɾ³ýÖØ¸´ÔªËØ */ #include <bits/stdc++.h> using namespace std; struct ListNode{ int data; ListNode *next; ListNode(int x):data(x),next(NULL){} }; class Solution{ public: ListNode* delete_repeated_elements(ListNode *head){ if(head == NULL){ return head; } ...
// // Created by Asicoder on 16/04/2019. // #include "Uva547.h"
#pragma once #include <iberbar/Network/Headers.h> #include <iberbar/Utility/Result.h> #include <string> #include <functional> #include <optional> namespace iberbar { namespace IO { class ISocketClient; struct USocketOptions; extern "C" { //__iberbarNetworkApis__ CResult Initial(...
// Created on: 1995-12-01 // Created by: EXPRESS->CDL V0.2 Translator // Copyright (c) 1995-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the te...
#pragma once #include <vector> #include <string> #include <unordered_map> #include <iostream> #include <algorithm> #include "DocumentExtractor.h" #include "Tokenizer.h" #include "utility.h" typedef std::unordered_map<std::string, unsigned int> TFC_t; /// Structure représentant le contenu d'un document (un article d...
#ifndef REGULARGRID_H #define REGULARGRID_H #include "Grid.h" class RegularGrid : public Grid { Q_OBJECT public: explicit RegularGrid(QObject *parent = 0); ~RegularGrid(); static QString GetGridName() {return "Regular Grid";} PointCloudT *getCloudData(int row, int col); void run(); protected: int ...
#include <iostream> #include "Player.h" #include "Game.h" /// <summary> /// @author Peter Lowe /// @version 1.0 /// @date may 2016 /// /// </summary> Player::Player() { } //pete was hgere Player::~Player() { }
#include <string> #include <cstdlib> using namespace std; int main(int argc, char *argv[]) { // Invoke the Java program with the passed arguments. string cmd = "java -cp OthelloFramework.jar TestGame"; argv++; while (--argc) { cmd += " "; cmd += *(argv++); } return system(cm...
// Measure pions! #include <iostream> #include <iomanip> // to set output precision. #include <cmath> #include <string> #include <sstream> #include <complex> #include <random> #include <cstring> // should be replaced by using sstream #include "generic_inverters.h" #include "generic_inverters_precond.h" #include "gen...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 2004-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: Patryk Obara */ #include "core/pch.h" #ifdef WIDGET_RUNTIME_SUPPORT #incl...
#ifndef GAME_H_INCLUDED #define GAME_H_INCLUDED #include "Board.h" #include "BasePiece.h" #include <cstring> class Game { private: std::string input1, input2; //user input Color colorOnTurn; bool moveSucceed; Position moveFrom; Position moveTo; void displayIntro(); void d...
#include<stdio.h> int main() { int a = 0,b = 0,c = 0,i,j; int A[4][5]; for(i=0;i<5;i++) { for(j=0;j<4;j++) { scanf_s("%d",&A[j][i]); } } for(i=0;i<5;i++) { for(j=0;j<4;j++) { a = a + A[j][i]; } if(a > c) { c = a; b = i + 1; } a = 0; } printf("%d %d",b,c); return 0; }
#include <iostream> #include <string> using namespace std; int main() { int N, num = 1, area = 1; cin >> N; while(true){ if(N <= num) break; num += area * 6; area++; } cout << area; return 0; }
// // Created by 钟奇龙 on 2019-05-10. // #include <iostream> #include <string> #include <vector> using namespace std; /* * 括号字符串的有效性 */ bool isValid(string s){ int status = 0; for(int i=0; i<s.size(); ++i){ if(s[i] != '(' && s[i] != ')'){ return false; } if(s[i] == ')' && --...
// https://oj.leetcode.com/problems/word-search/ class Solution { int M; int N; bool dfs(vector<vector<char> > &board, string &word, int str_idx, int row, int col, vector<vector<bool> > &visited) { if (str_idx == word.size()) { return true; } ...
#include "float.hpp" #include <cstdlib> #include <cmath> namespace geometry { Float::Float() { this->value = 0.0; } Float::Float(Float* a) { this->value = a->getValue(); } Float::Float(long double val) { this->value = val; } Float::Float(std::string s) { //return "Float {" + std::to_string(value) +...
#ifndef WORKER_POOL_H #define WORKER_POOL_H #include <SDL2/SDL.h> template <class T, int N> constexpr int ArrayLength(const T (&a)[N]) { return N; } struct WorkerPool { struct Work { void (*fn)(void *); void *data; }; static_assert(sizeof(int) >= 4, "int is less than 32 bits!"); ...
/* Copyright 2021 University of Manchester 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 writing, ...
// // Created by Benoit Hamon on 10/4/2017. // #pragma once #include <boost/function.hpp> #include <boost/thread/thread.hpp> #include "IModule.hpp" #include "IModuleCommunication.hpp" typedef boost::shared_ptr<IModule> (module_t)(IModuleCommunication *); class ModuleManager { public: ModuleManager(IModuleCom...
/*! * \file Reader.h * \brief Define JSON readers * \author Pierre-Jean Besnard & Louis Billaut * \version 1.0 */ #include <stdio.h> #include <iostream> #include <vector> #include "Scene.h" #include <fstream> #include <string> #include <jsoncpp/json/json.h> /*! \class Reader * \brief Allows to create a JSON file...
#ifndef MASTERS_PROJECT_AMERICANIMPLICITHEATEQMETHOD_H #define MASTERS_PROJECT_AMERICANIMPLICITHEATEQMETHOD_H #include "EuroImplicitHeatEqMethod.hpp" template<typename X> class AmericanImplicitHeatEqMethod : public EuroImplicitHeatEqMethod { public: AmericanImplicitHeatEqMethod(Option<X> *_option, X _S_min, X _S_...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Form.cpp :+: :+: :+: ...
#include <pybind11/pybind11.h> #include <pybind11/stl.h> #include <pybind11/numpy.h> #include <vector> #include <opencv2/core.hpp> #include <opencv2/imgcodecs.hpp> #include <opencv2/highgui.hpp> // ------------- // pure C++ code // ------------- std::vector<double> length(const std::vector<double>& pos) { size_t ...
#include<cstdio> #include<iostream> #include<vector> #include<algorithm> using namespace std; int main(){ int n; scanf("%d", &n); int w,s; int res =0; for(int i=0;i<n;i++){ scanf("%d%d", &w,&s); res += w*s; } cout<<max(res,0)<<endl; return 0; }
/*********************************************************\ * 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...
/** Copyright (c) 2018 Mozart Alexander Louis. All rights reserved. */ #ifndef __ARCHIVE_UTILS_HXX__ #define __ARCHIVE_UTILS_HXX__ /** * Archive Attributes */ #define __ARCHIVE_NAME__ "evz.archive" #define __ARCHIVE_ROOT__ "xScripts/" /** * Archive Password Parts */ #define __ARCHIVE_PART1__ 0x51277094 #define _...
#pragma once #include "aePrerequisitesUtil.h" #include "aePrerequisitesEngine.h" namespace aeEngineSDK { enum struct AE_ADD_ON_ID { AE_RENDERER }; class aeGameObject; class AE_ENGINE_EXPORT aeGOAddOn { friend class aeGOFactory; public: aeGOAddOn(); aeGOAddOn(const aeGOAddOn& AO); ~aeGOAddOn(); pu...
#include "stdafx.h" #include "AIEditNode.h" #include "../GameCursor.h" // THIS IS CAMERA. #include "../../GameCamera.h" #include "AIEditNodeInequ.h" #include "AIEditNodeButton.h" #include "AIEditNodeTechnique.h" #include "AIEdtiNodeAbnormalState.h" #include "AIEditNodeProcess.h" #include "AIEditNodeOrder.h" AIEditNo...
#include"token.h" token::token(int t_id, string t_name, string v):token_id(t_id),token_name(t_name),value(v) { } token::~token() { } int token::getTokenID() { return token_id; } ostream& operator<<(ostream& output, const token& t) { output << '(' << t.token_id << ',' << t.token_name << ',' << t.value << ')'; retu...
// // Created by 钟奇龙 on 2019-05-11. // #include <iostream> #include <vector> #include <string> using namespace std; int minCut(string s){ if(s.size() == 0) return 0; vector<vector<bool> > mark(s.size(),vector<bool> (s.size(),false)); vector<int> dp(s.size()+1); dp[s.size()] = -1; for(int i=s.size()...
#pragma once #include <iostream> class Piece; class Location { private: bool bIndex; // possible indexes to move Piece *mPieceInfo; // piece info pointer public : Location(); ~Location(); void SetIndex(); void DelIndex(); bool GetIndex() const; void SetPiece(Piece *pieceInfo); void DelPiece(); Piece* GetP...
#ifndef AWS_PARSER_H #define AWS_PARSER_H /* * aws/parser.h * AwesomeScript Parser * Author: Dominykas Djacenka * Email: Chaosteil@gmail.com */ #include <iostream> #include <istream> #include <map> #include <ostream> #include <stack> #include <string> #include "nodes/nodes.h" #include "reference.h" #include "to...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; P m[501][501]; int main(){ int r, c, k; cin >> r >> c >> k; vector<string> v(r); for(int i=0; i<r; i++) cin >> v[i]; for(int i=0; i<r; i++){ for(int j=0; j<c; j++){ for(int y=i; y>=0; y--){ ...
#include<iostream> #include<cmath> using namespace std; int main() { int t,l,k,i,j,T; string s1; cin>>t; scanf("%*c"); for(T=0;T<t;T++) { getline(cin,s1); string s2,s3; int pal=1; for(i=0;i<s1.length();i++) { if(s1[i]>='a'&&s1[i]<='z'||s1[i]>='A'&&s2[i]<='Z') s2.append(s1,i,...
#pragma once #include <dirent.h> #include <sys/stat.h> #include "bricks/core/returnpointer.h" #include "bricks/collections/iterator.h" #include "bricks/io/types.h" #include "bricks/io/filepath.h" namespace Bricks { namespace IO { class Stream; namespace FileType { enum Enum { Unknown = DT_UNKNOWN, File = DT_R...
#include <Tanker/Groups/Manager.hpp> #include <Tanker/Crypto/Crypto.hpp> #include <Tanker/Crypto/Format/Format.hpp> #include <Tanker/Errors/AssertionError.hpp> #include <Tanker/Errors/Errc.hpp> #include <Tanker/Errors/Exception.hpp> #include <Tanker/Format/Format.hpp> #include <Tanker/Groups/GroupEncryptedKey.hpp> #in...
#include "kinect.hpp" #include "conversion.hpp" #include "util.hpp" #include <cstddef> #include <cstdint> #include <cstdio> #include <filesystem> #include <fstream> #include <future> #include <iostream> #include <iterator> #include <string> #include <string_view> #include <system_error> namespace mik { using std::si...
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <fstream> #include <boost/lexical_cast.hpp> using namespace std; using namespace boost; // shapes -> circle, square // renderer -> raster, vector // -> 2x2 cartesian product struct Renderer { virtual void render_circle(float x, fl...
#include "_pch.h" #include "ModelClsPath.h" #include "ModelBrowser.h" using namespace wh; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //------------------------------------------------------------------...
#include "gtest/gtest.h" #include "wali/wfa/WFA.hpp" #include "fixtures/SimpleWeights.hpp" #include "fixtures/StringWeight.hpp" #include "fixtures/Keys.hpp" #include "fixtures.hpp" using namespace testing; using namespace testing::ShortestPathWeights; using wali::wfa::WFA; using wali::sem_elem_t; using wali::WALI_EPS...
#ifndef POINT1F_H_INCLUDED #define POINT1F_H_INCLUDED #include "Point.h" template <typename type> class container1{ public: union{ type array[1]; struct{ type x; }; }; }; template <typename type> class Point1 : public Point<container1<type>, 1> { public: Point1( type x...
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE /** * @brief A classe MainWindow é a janela principal do programa, * onde está disposta toda a interface e suas funcionalidades. */ class MainWindow : public QMainWi...
// PrioQueue.hpp #ifndef __PRIOQUEUE__HPP__ #define __PRIOQUEUE__HPP__ #include "PQElmt.hpp" class PrioQueue { private: PQElmt* queue; int neff; int maxEl; public: PrioQueue(); PrioQueue(int maxEl); PrioQueue(const PrioQueue& pq); ~PrioQueue(); void push(PQElmt el); // Menambahkan elemen ke array q...
using namespace std; class Host{ public: string ip; string mac; };
#ifndef SHADERFINDER_H #define SHADERFINDER_H #include <string> #include <set> #include <map> #include <utility> #include "Configfile.h" class ShaderFinder { public: /** Default constructor */ ShaderFinder(); /** Default destructor */ virtual ~ShaderFinder(); bool Init(); ...
#include<bits/stdc++.h> using namespace std; using ll=long long; ll mod_mul(ll x,ll y,ll mod) { x%=mod; y%=mod; ll t=0; while(y) { if(y&1) t=(t+x)%mod; x=(x<<1)%mod; y>>=1; } return t; } ll mod_pow(ll x,ll n,ll mod) { x%=mod; ll re...
#include <iostream> #include <ros/ros.h> #include <mavros_msgs/PositionTarget.h> #include <geometry_msgs/Point.h> #include <geometry_msgs/Point32.h> geometry_msgs::Point positionmsg; bool got_position = false; mavros_msgs::PositionTarget waypoint; void callback(const geometry_msgs::Point32& msg) { double x = msg.x;...
//--------------------------------------------------------------------------- //更新记录 #ifndef srvthreadH #define srvthreadH //--------------------------------------------------------------------------- #include <Classes.hpp> #include <ScktComp.hpp> //注意 //线程池每个线程的堆栈大小只有32K class CServerSocket; enum ThreadState{tsWAIT,t...
/*==================================================================== Copyright(c) 2018 Adam Rankin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitati...
#ifndef DOUBLE_INTEGRATION_HPP #define DOUBLE_INTEGRATION_HPP #include "Function.hpp" #include <cmath> // Curvature for configuration 1. This is the default. double c1(double x, double b) { return (sin(x) + cos(x) + (cos(x) - sin(x))*b)/2.0; } double det1(double x, double l1, double l2) { return (l2 - l1)...
//---------------------------------------------------------------- // VehicleController.cpp // // Copyright 2002-2004 Raven Software //---------------------------------------------------------------- #include "../../idlib/precompiled.h" #pragma hdrstop #include "../Game_local.h" #include "Vehicle.h" /* =============...
/* Copyright 2020 The TensorFlow Authors 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 Unless required by applicable law or ag...
/* * SDEV 340 Week 12 Problem 2 * Extension of pc1 SimpleLinkedList class that provdes a method returning the index of a found item, instead of just a boolean * Benjamin Lovy */ // To avoid redefining "main", instead of including SimpleLinkedList // I just copied the relevant parts of pc1's code into this file, and ch...
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QFileDialog> #include <QImage> #include "morphology.h" #include <QtDebug> #include "imageutil.h" #include <QResizeEvent> #include <QTransform> #include "anl.h" #include "templates/tarrays.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ...
#include <vector> #include <cmath> #include <sstream> #include <string> #include <iostream> #include <boost/math/special_functions/bessel.hpp> #include <boost/math/special_functions/bessel_prime.hpp> #include <fstream> #include "rd.hpp" #include "interp.hpp" #include "models.hpp" #include "RK4.hpp" using namespace ...
// https://oj.leetcode.com/problems/generate-parentheses/ class Solution { // nr_open/nr_close: # of open/close paranthesis generated void do_generate(vector<string> &ret, string &buf, int nr_open, int nr_close, int n) { if (nr_open + nr_close == 2 * n) { ret.push_back(buf); ret...
#include <iostream> class Vector { private: int erk = 0; int* arr; int tamp = 0; int i = 0; int* newArr(int size, int& er) { int* array; if(size == 1) { array = new int [er * 2]; for(int j = 0; j < i; ++j) { ...
#include "processslot.h" #include <QDebug> #include <game.h> extern Game* game; ProcessSlot::ProcessSlot(QObject* parent) { Q_UNUSED(parent) setRect(0,0,100,100); setPen(QPen(Qt::PenStyle::DashLine)); process = nullptr; }
#include <bits/stdc++.h> using namespace std; class Solution { public: string minWindow(string s, string t) { int n = s.size(); int m = t.size(); int left = 0; int right = 0; int tcounter = m; int start = 0; int len = INT_MAX; unordered_map<char, int...
#include <math.h> #include "Globals.h" #include "Application.h" #include "ModuleTextures.h" #include "ModuleRender.h" #include "ModuleParticles.h" #include "ModuleCollision.h" #include "ModuleSceneTemple.h" #include "ModuleKatana.h" #include "ModuleEnemies.h" #include "ModuleInterface.h" #include "ModuleAudio.h" #inclu...
struct P{double x,y;}p[2005],s[2005]; double dis(P a,P b) { return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y); } P operator-(P a,P b) { P t;t.x=a.x-b.x;t.y=a.y-b.y;return t; } double operator*(P a,P b) { return a.x*b.y-a.y*b.x; } bool operator<(P a,P b) { double t=(a-p[1])*(b-p[1]); if(t==0)return dis(a,p[1])<dis(b,p...
// Created on: 1993-01-09 // Created by: CKY / Contract Toubro-Larsen ( SIVA ) // 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 ...
#include <iostream> #include <stdlib.h> #include <cstdio> #include "h_seqlist.h" #include "seqlist.cpp" using namespace std; int main() { SeqList <int> List1(100); while(1) { int value ; int num ;//序号 int x ;//输入的值 int m ;//保存输入序号 List1.Menu(); cin>>m; switch(...
// // Created by JACK on 9/15/2015. // #ifndef CEF02B_MATRIX_H #define CEF02B_MATRIX_H #include <stdlib.h> /* error: 0 -no error * 1 - size incompatible * 2 - no memory * 3 - memory exist * 4 - object crated succesfuly * */ class Matrix{ int **ptr; int nRow; int n...
#include "stdio.h" #include "conio.h" void main () { clrscr(); int i; printf("\n\n\t"); for (i=1; i<=40; i++) printf("%c",'\xDB'); getch(); }
#include <Windows.h> #ifndef __HSCOMPTR__ #define __HSCOMPTR__ template <typename T> class HSComType : public T { private: //IUnknown インタフェースクラス メンバの2つをprivateにする virtual ULONG STDMETHODCALLTYPE AddRef ( void ) = 0; virtual ULONG STDMETHODCALLTYPE Release ( void ) = 0; }; template <typename T> class HSComPtrB...
#include"head_info.h" #include<time.h> #include<stdlib.h> #include<iostream> #include<bitset> #define MAX 10 int main(){ //排序算法 //int s[MAX],i; //srand((unsigned)time(0)); //for ( i=0;i<MAX;i++ ) // s[i] = rand()%100; //showArray(s,MAX); //shell_sort(s,MAX); ////quick_sort_norecursion(s,0,MAX-1); //showAr...
// // STLVectorUtility.h // Author: Michael Bao // Date: 9/4/2015 // #pragma once #include <vector> #include <utility> namespace STLVectorUtility { template<typename T1, typename T2> void SplitVectorOfPairs(const std::vector<std::pair<T1, T2>>& input, std::vector<T1>& output1, std::vector<T2>& output2) { output1...
#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...
//g++ 5.4.0 // Moulik Aggarwal - www.github.com/moulikcipherx //all header file included #include <bits/stdc++.h> //for STL library using namespace std; //hamming distance of two strings int hamming(string str1, string str2) { int count = 0; for(int i = 0; i< str1.length(); i++) { if(str1[i] != ...
/* * bracesInit.cpp * * Created on: May 9, 2016 * Author: bakhvalo */ #include "gtest/gtest.h" #include <type_traits> class bracesInit { public: int x {1}; int y = 2; // int z(0); not compiles. }; TEST(BraceInitUnitTest, class_private_fields_init) { bracesInit brIn; ASSERT_EQ(1, brIn.x); ASSERT_EQ(2...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** 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 ** */ #include "cor...
#include <unistd.h> #include <arpa/inet.h> #include <qt5/QtCore/QByteArray> #include <qt5/QtCore/QDataStream> #include <qt5/QtNetwork/QTcpSocket> #include <qt5/QtNetwork/QHostAddress> #include <qt5/QtWidgets/QFileDialog> #include <qt5/QtWidgets/QMessageBox> #include "mainwindow.h" #include "ui_mainwindow.h" struct ...
#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <sstream> #include <string.h> #include <queue> #include <vector> #include <set> #include <map> #include <numeric> typedef long long LL; typedef unsigned lon...
#ifndef WIDGETCONTROL_HPP #define WIDGETCONTROL_HPP #include "Worker.hpp" #include <QApplication> #include <QThread> #include <QWidget> namespace Ui { class WidgetControl; } class WidgetControl : public QWidget { Q_OBJECT public: explicit WidgetControl(QWidget *parent = nullptr); void setupWidget(QWidget *wi...
#pragma once #include <vector> using namespace std; class Account { private: double initialInvestment = 0.00; double monthlyDeposit = 0.00; double interestRate = 0.00; int numberOfYears = 0; std::vector<double> yearlyBalance = { 0.00 }; std::vector<double> yearlyInterestEarned = { 0.00 }; public: void Set...
#include "game.h" Game::Game(QGraphicsScene * s) { this->s = s; } void Game::makeBios() { // 5개의 생명체 생성. for (int i = 0; i < 5; i++) { int prob = rand() % 100 + 1; if (prob >= 0 && prob <= 70) // 70%의 확률로 Feed 생성. { bios.push_back(dynamic_cast<Bio*>(new Feed(s)))...
// Copyright Epic Games, Inc. All Rights Reserved. /*=========================================================================== Generated code exported from UnrealHeaderTool. DO NOT modify this manually! Edit the corresponding .h files instead! ========================================================================...
#include <vector> #include <iostream> #include <unistd.h> #include <omp.h> double conta_complexa(int i) { return 2 * i; } int main() { int N = 100000000; std::vector<double> vec(N); #pragma omp parallel for default(none) shared(vec) shared(N) for (int i = 0; i < N; i++) { vec[i] = conta_complexa(i); } /...