text
stringlengths
8
6.88M
#include <iostream> #include <queue> #include <algorithm> using namespace std; int M, N, H; int nMap[100][100][100]; int nCheck[100][100][100]; int dz[6] = { -1, 1, 0, 0, 0, 0 }; int dy[6] = { 0, 0, -1, 1, 0, 0 }; int dx[6] = { 0, 0, 0, 0, -1, 1 }; int nResult; int main(void) { queue < pair<int, pair<int, int...
/* * Copyright 2019 Nagoya University * * 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 agree...
// orthelloGame.cpp : 此檔案包含 'main' 函式。程式會於該處開始執行及結束執行。 // #include "pch.h" #include <iostream> #include <fstream> #include <string> #include <sstream> #include <vector> #include <iomanip> #include <windows.h> #include <wchar.h> using namespace std; //---------------------------------------------------- struct team {...
#include "timingMode.h" #include <chrono> namespace lab { using namespace std::chrono_literals; constexpr std::chrono::nanoseconds timestep(16ms); event<void(std::chrono::steady_clock::time_point&)> evt_timing_update; void TimingMode::update(lab::GraphicsRootWindow&) { using clock = std::...
#include <iostream> using namespace std; int a[10010]; bool sumNum(int sum, int i, int k, int n) { if (sum == k) return true; if (i == n) return false; return sumNum(sum + a[i], i + 1, k, n) || sumNum(sum, i + 1, k, n); } int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; ...
#include <bits/stdc++.h> #include <fstream> #include<string> #define M 5 #define N 7 //#define MAX 5 using namespace std; int coordinate; vector<int> final_x, final_y; // Function returns true if the // move taken is valid else // it will return false. int isSafe(int x, int y, char arr[M][N], bool visited[M][N]){...
#include "SwirlDeformer.h" #include <maya/MItGeometry.h> #include <maya/MPoint.h> #define _USE_MATH_DEFINES #include <math.h> #include <maya/MFnUnitAttribute.h> #include <maya/MDistance.h> MTypeId SwirlDeformer::typeId(0x0033A); MString SwirlDeformer::typeName("swirl"); MObject SwirlDeformer::startDist; MObject Swirl...
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- * * Copyright (C) Opera Software ASA 2002 - 2012 */ #include "core/pch.h" #include "modules/ecmascript/carakan/src/es_pch.h" #include "modules/ecmascript/carakan/src/compiler/es_parser.h" #include "modules/ecmascript/carakan/src/compile...
/* 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 BASE_THREADING_SIMPLE_THREAD_H_ #define BASE_THREADING_SIMPLE_THREAD_H_ #include <memory> #include <tuple> #include <utility> #include "base/callback.h" #include "base/threading/thread.h" namespace base { class TaskRunner; class SimpleThread : public Thread { public: class SimpleThreadDelegate : public T...
#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> typedef long long LL; typedef unsigned long long ULL; #defin...
#include "FourierPrinterSystem.h" #include "EverydayTools/Preprocessor/ExpotImport.h" extern "C" { void EXPORT __cdecl CreateSystem(void** result) { *result = new simple_quad_sample::FourierPrinterSystem(); } }
#include "PhysicsComponent.h" #include "TransformComponent.h" #include "MeshComponent.h" namespace Game { PhysicsComponent::PhysicsComponent() { } PhysicsComponent::~PhysicsComponent() { } void PhysicsComponent::update() { if (mConfigured) { Transform transform = mPhysicsObject->transform().fromPhysic...
#include "StdAfx.h" #include "BallPhysics.h" #include "Config.h" BallPhysics::BallPhysics(GameLogic* gameLogic) :gameLogic(gameLogic) { gravity = Ogre::Vector3(0.0f, -9.81f, 0.0f); position = Ogre::Vector3(0.0f, 0.6f, 0.0f); speed = Ogre::Vector3::ZERO; spin = Ogre::Vector3::ZERO; out = true; } ...
#include <gtest/gtest.h> #include <string> #include "../include/conveyor.h" class ConveyorSimple : public ::testing::Test { protected: virtual void SetUp() override { } virtual void TearDown() override { } }; // rec1 is 26 bytes, rec2 is 284 bytes const std::string rec1 = "abcdefghijklmnopqrstuvwxyz"; const...
#include <iostream> using namespace std; int a, b; int main() { cin >> a >> b; int relt = b - a; int total = 0; for (int i=1; i<relt; i++) { total += i; } cout << total - a; }
#include "MonitorarAPI.cpp" #include <vector> using namespace std; int main(int argc, char *argv[]){ /* aqui faz todas as configurações para os gio de entrada e saída */ long freeMem, maxMen; float percent; ifstream infoMem, infoPid; ifstream cpuLog; string aux; power light = off; int monitor...
#pragma once #include "..\Common\Pch.h" class Direct3D { public: Direct3D(); ~Direct3D(); void Initialize(); void Clear(FLOAT r = 0.2F, FLOAT g = 0.2F, FLOAT b = 0.2F, FLOAT a = 1.0F); void Present(); // Get, Set ID3D11Device* GetDevice(); ID3D11DeviceContext* GetContext(); void SetDefaultRenderTarget(...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2008 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * @author Patricia Aas (psmaas) */ #ifndef UI_NODE_H #define UI_...
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <ctime> #include <memory.h> #include <cmath> #include <string> #include <cstring> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #inc...
#include "utilityBase.h" utilityBase::utilityBase(const State& current, const StochProc& stoch, const EquilFns& fns) : curSt(&current), curStoch(stoch), curFns(fns) { } utilityBase::~utilityBase() { } double utilityBase::consUtil(double consumption){ return utilityFunctions::integer_power(consumptio...
#include <iostream> #include <string> #include <boost/program_options.hpp> #include <boost/asio.hpp> #include "Server.hpp" #include "Database.hpp" #include "DatabaseServerApi.hpp" namespace po = boost::program_options; int main(int argc, char* argv[]) { po::variables_map vm; po::options_description desc{...
#include "gromacsoptionfile.h" #include <QHBoxLayout> #include <QLineEdit> #include <QPushButton> #include <QFileDialog> #include <QFile> GromacsOptionFile::GromacsOptionFile(bool inputFile, QWidget *parent, QString value) : GromacsOptionEnter(parent, value), _gromacsToolsDefinition(GromacsToolsDefinition::Get...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2012 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef HISTORY_DELAYED_SAVE_H #define HISTORY_DELAYED_SAVE_H #...
/* Name: Copyright: Author: Hill Bamboo Date: 2019/9/1 9:56:00 Description: --> input 5 1 3 1 1 2 --> expected 1 2 3 2 4 5 2 5 */ #include <bits/stdc++.h> using namespace std; const int maxm = 2000 + 10; const int maxn = 1000 + 10; int ans[maxm]; int tree[maxn]; int m, n; int main() { cin >> n; for (int i = 0; i...
#include "bilinear_form.hpp" #include <cmath> #include <map> #include <set> #include "datastructures/multi_tree_view.hpp" #include "gmock/gmock.h" #include "gtest/gtest.h" #include "integration.hpp" #include "operators.hpp" #include "space/initial_triangulation.hpp" #include "space/triangulation.hpp" #include "space/...
#include <bitset> #include <cassert> #include <iostream> #include <wiringPi.h> #include <wiringPiSPI.h> typedef unsigned char uchar; typedef unsigned int uint; typedef uint16_t u16; using namespace std; void method1(){ uchar data[2]; wiringPiSPIDataRW(0, data, 2); // discard auto ms = micros(); //u16 v; whil...
#include "fetch.hh" #include "sql.h" #include "sqlext.h" #include "nctypes.hh" namespace NC { inline nc_variant_t get_value_at(nanodbc::result* result, int col_no) { if (result->is_null(col_no)) { return boost::blank(); } int datatype { result->column_datatype(col_no) }; switch (datatype) {...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
#include <cppunit/extensions/HelperMacros.h> #include "cppunit/BetterAssert.h" #include "io/AutoClose.h" using namespace std; using namespace Poco; namespace BeeeOn { class AutoCloseTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(AutoCloseTest); CPPUNIT_TEST(testBlock); CPPUNIT_TEST(testTryCatch); CPPUN...
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ //bfs -written by myself class Codec { public: // Encodes a tree to a single string. string serialize(TreeNode* roo...
#pragma once #include <vector> namespace hdd::gamma { class RawData { public: RawData(const std::string& filename); uint32_t Inputs() const; uint32_t Outputs() const; uint32_t Vectors() const; uint32_t Series() const; const std::vector<double>& operator[](...
#ifndef OPTIONAL_H #define OPTIONAL_H template<typename T> class optional { public: optional(void) : _initialized(false) {} optional(const T& val) : _initialized(true) { ::new (_data.data()) T(val); } ~optional(void) { if (_initialized) data()->~T(); } T& opera...
#include <iostream> #include <string> #include <fstream> #include <vector> #include <sstream> #include <Eigen/Core> #include <Eigen/Dense> #include <Eigen/Cholesky> #include <Eigen/SVD> #include <sophus/se3.hpp> void convertSE3ToTf(const Eigen::VectorXf &xi, Eigen::Matrix3f &rot, Eigen::Vector3f &t) { // rotati...
class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { sort(nums.begin(), nums.end()); vector< vector<int> > res; int N = nums.size(); for(int i=0;i<N;i++){ if(i > 0 && nums[i-1] == nums[i]) continue; int target = -nums[i]; int l = i+1, r = N-1; ...
// Created on: 1998-08-18 // Created by: Yves FRICAUD // Copyright (c) 1998-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 L...
#ifndef HW_264_ENCODER_H #define HW_264_ENCODER_H #include "MediaEncoder.h" #include "HwMediaEncoder.h" //from libhwcodec #include "SwsScale.h" //硬编码: YUV->h264 //////////////////////////////////////////////////////////////////////////////// class CHw264Encoder : public CMediaEncoder { public: CHw264Encoder(AVCode...
#include<MsTimer2.h> //左右电机码盘 #define ENCODER_R1 3 #define ENCODER_R2 4 #define ENCODER_L1 2 #define ENCODER_L2 5 //左右电机PWM波以及电机正负极接入 #define PWML_R 10 #define INL_R1 A2 #define INL_R2 A1 #define PWML_L 9 #define INL_L1 A4 #define INL_L2 A3 #define PERIOD 10 //从前进方向的最左边开始排序红外传感器引脚 #define trac1 A0 #define trac2 A5 ...
#include "Observer.h" #ifndef __Observer_H #error [E030] Не определен заголовочный файл Observer.h #endif /*int main() { Subject subj; DivObserver divObs1(&subj, 4); // 7. ?????? ??????????? ????? DivObserver divObs2(&subj, 3); // ? ???? ???????????? ModObserver modObs3(&subj, 3)...
#include "nickmodel.h" NickModel::NickModel(): nick(""), pass(0), connected(false), connectionId(false) { } NickModel::NickModel(const QString& nick_p, quint64 pass_p): nick(nick_p), pass(pass_p), connected(false), connectionId(0) { } void NickModel::connect(quint64 id) { connec...
/* * SvrConfig.h * * Created on: Jun 11, 2017 * Author: root */ #ifndef SVRCONFIG_H_ #define SVRCONFIG_H_ #include <string> using namespace std; typedef struct sLogConf { bool base; bool info; bool debug; bool warning; bool error; bool fatal; bool display; int fileLen; string filePath; string m...
// // Created by dbond on 20.10.18. // #ifndef IPC_NDK_WORKERTHREAD_H #define IPC_NDK_WORKERTHREAD_H #include <atomic> #include <thread> #include <string> #include <queue> #include <android/looper.h> class WorkerThread { public: virtual ~WorkerThread(); void init(const char * c_appname, const char * c_shmna...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> using namespace std; const int maxn = 1e5 + 10; int a[maxn],b[maxn]; int f[maxn],s[maxn]; int n,m,l; ...
#include <arpa/inet.h> #include <netinet/in.h> #include <Poco/Exception.h> #include <Poco/Net/IPAddress.h> #include "net/IPAddressRange.h" using namespace BeeeOn; using namespace Poco; using namespace Poco::Net; IPAddressRange::IPAddressRange(const IPAddress& address, const IPAddress& mask) { if (address.family() ...
#include "gtest/gtest.h" #include <sstream> #include <boost/scoped_ptr.hpp> #include "wali/domains/matrix/Matrix.hpp" #include "fixtures-boolmatrix.hpp" #include "matrix-equal.hpp" using namespace testing::boolmatrix; namespace wali { namespace domains { TEST(wali$domains$matrix$BoolMatrix$$constructorAndMatrix, ...
#ifndef GRAV_OBJ #define GRAV_OBJ #include <iostream> #include <string> #include <vector> #include "Vector.h" #include <SDL/SDL.h> #include <SDL/SDL_gfxPrimitives.h> #include "Parameters.h" #include <SDL/SDL.h> #include <SDL/SDL_image.h> #include <SDL/SDL_ttf.h> #include <iostream> #include <vector> #include "Vector....
// Copyright (c) 2019 The NavCoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "daoproposeanswer.h" DaoProposeAnswer::DaoProposeAnswer(QWidget *parent, CConsultation consultation, ValidatorFunc valid...
#ifndef FEATURE_H #define FEATURE_H #include "Common.h" #include "PascalImageDatabase.h" #include "ParametersMap.h" using namespace cv; typedef std::vector<float> Feature; typedef std::vector<Feature> FeatureCollection; //! Feature Extraction Class /*! This class implements an abstract feature ext...
// // Created by 송지원 on 2020/06/29. // //바킹독 9강 BFS. boj2178 바킹독님 버젼 //여기서 굳이 vis 배열을 쓰지 않고 dist 배열을 -1로 초기화 해놓고 -1이면 방문하지 않았던 곳, -1이 아니면 방문한 곳 이렇게 구분! //그리고 board를 "string board[102];"로 정의하면 굳이 귀찮은 ㅇ일 안하고 이전코드처럼 쓸 수 있음! //-> 다만 값 비교할때 숫자가 아니라 문자임을 주의!! //fill 함수 사용법 : fill(dist[i], dist[i]+m, -1); #include <iostr...
#include "_pch.h" #include "PathPatternEditor.h" #include "dlgselectcls_ctrlpnl.h" using namespace wh; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- // TmpStrPathItem //-----------------------------------...
#include <iostream> #include <thread> #include <memory> #include <unistd.h> using namespace std; class Thread { public: Thread() :isClearThreadInUse(false) { thr.reset(new std::thread()); } ~Thread() { thr->join(); } void start() { std::unique_lock<std::mutex> lock(clearMutex); ...
#pragma once #include <iostream> #include <string> #include <vector> using namespace std; enum ITEM { ITEM_EMPTY, ITEM_MONSTERBALL, ITEM_POTION, ITEM_ANTIDOTE, ITEM_PARLYZEHEAL, ITEM_BURNHEAL, ITEM_ICEHEAL, ITEM_AWAKENING, ITEM_FULLHEAL }; struct tagItemInfo { ITEM itemKind; string name; string descript...
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) Triad National Security, LLC. This file is part of the // Tusas code (LA-CC-17-001) and is subject to the revised BSD license terms // in the LICENSE file found in the top-level directory of this distribution. // ////...
#include <iostream> inline double square(double x) { return x * x; } int main() { using namespace std; double a, b; double c = 13.0; a = square(5.0); b = square(4.5 + 7.5); cout << "a = " << a << ", b = " << b << "\n"; cout << "c = " << c; cout << ", c squared = " << square(c++) << "\n"; cout << "Now c = " ...
#include<iostream> #include<vector> #include<algorithm> using namespace std; struct ListNode { int val; ListNode* next; ListNode(int x) : val(x), next(NULL) {} }; void Init_ListNode(ListNode* head, vector<int> vec) { if (vec.size() == 0) { head = NULL; return; } ListNode* p; p = head; p->val = vec[0]; for...
#include <iostream> #include <cmath> #include "Double.h" /** * Evaluate a function u given as linear combination of shape function * values in a single quadrature point * * \param[in] u \fk^3$ values, coefficients for the linear combination * \param[in] phi \f$k$ values of shape functions in a single * quadrature poin...
#include "SimG4Core/DD4hepGeometry/interface/DD4hep_DDDWorld.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "DetectorDescription/DDCMS/interface/DDDetector.h" #include "DDG4/Geant4Converter.h" #include "DDG4/Geant4GeometryInfo.h" #include "DD4hep/Detector.h" #include "G4RunManagerKernel.hh" #inc...
#ifndef DEVICESETTINGS_H #define DEVICESETTINGS_H #include <QObject> #include <QQmlEngine> class DeviceSettings { Q_GADGET Q_PROPERTY(QString apName READ apName WRITE setApName) Q_PROPERTY(QString apPass READ apPass WRITE setApPass) Q_PROPERTY(quint8 devId READ devId WRITE setDevId) Q_PROPERTY(QS...
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup(){ player.load("dog.mp4"); player.play(); for (int i = 0; i < 16; i++) { table[i] = ofRandom(0, 255); } } //-------------------------------------------------------------- void ofApp::upda...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #include "core/pch.h" #if defined DRAG_SUPPORT || defined USE_...
// Created on: 1993-08-25 // 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...
#ifndef _MODEL_WF_H_ #define _MODEL_WF_H_ #include "Model.h" using namespace std; class ModelWF : public Model{ private: vector<Individual> dst; unsigned int processDNAGenes(unsigned int marker_pos, ProfileMarker &marker, Pool *pool, mt19937 &generator); unsigned int processMSGenes(unsigned int marker_pos, P...
#pragma once #include "Point.hpp" #include <vector> #include <glm/glm.hpp> #include "Volume.hpp" #include "AABB.hpp" using namespace std; using namespace glm; /* * CLASS PointCloud */ template <class PointT> class PointCloud { public: // List of point cloud points vector<Point<PointT>> points; // Bounding box A...
#pragma once #include"ybBasicMacro.h" NS_YB_BEGIN template<class T> class Buffer2D { public: typedef T ElementType; Buffer2D(int width, int height,bool init=0) :_width(width), _height(height) { _buffer = new T[_width*_height]; if (init) { memset(_buffer, 0, sizeof(T)*_width*_height); } } T* Element(in...
#include <conio.h> #include <stdio.h> void main () { clrscr(); int A[5][5], a=0, r, c; gotoxy(25,8); printf("SYMMETRIC MATRIX\n\n"); printf("\n\n\tMatrix A"); printf("\n\nEnter No. of Rows: "); scanf("%d",&r); printf("\n\nEnter No. of Columns: "); scanf("%d",&c); ...
#ifndef _PLATE_1D_ORTHOBUILDER_ #define _PLATE_1D_ORTHOBUILDER_ 1 #include "plate_var_types.h" #include "VarVect.h" #include <iostream> #include <vector> #include <Eigen/Eigen> #include <complex> using std::cout; using std::endl; using std::vector; using std::complex; using namespace Eigen; class SolInfo { public: ...
#ifndef UTIL_HPP #define UTIL_HPP #include <iostream> #include <fstream> #include <unistd.h> #include <limits.h> #define PI 3.14159 #define DEGREES_TO_RADIANS(d) ((d) * PI/180.f) #define RADIANS_TO_DEGRESS(r) ((d) * 180.f/PI) #define ARRAY_SIZE(ar) (sizeof((ar))/sizeof((ar)[0])) #define RANDOM(min, max) ((min) + ...
#include "AvatarView.h" #include <iostream> #include "MyGL.h" #include <sstream> AvatarView::AvatarView() : m_curAnim(NULL), m_flip(false) { } AvatarView::~AvatarView() { //clean anims? } void AvatarView::addAnim(const std::string& name, RectangleMesh *mesh) { m_anim.insert(std::pair<std::string, RectangleMes...
#ifndef JSON_HH #define JSON_HH #include "jansson/jansson.h" #include <memory> namespace ten { typedef std::shared_ptr<json_t> json_ptr; } // end namespace ten #endif // JSON_HH
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2005 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef DOM_SVGOBJECT_H #define DOM_SVGOBJECT_H #ifdef SVG_DO...
#ifndef LOOKAHEAD_THINKER_H_INCLUDED #define LOOKAHEAD_THINKER_H_INCLUDED #include "tracker_thinker.h" struct LookaheadThinker final : TrackerThinker { protected: Response decideResponse(int guess) const override; }; #endif // LOOKAHEAD_THINKER_H_INCLUDED
// // Ordenamiento.cpp // Ordenamiento // // Created by Daniel on 01/09/14. // Copyright (c) 2014 Gotomo. All rights reserved. // #include "Ordenamiento.h"
/* * tinyweb.cc * * Created on: Dec 11, 2012 * Author: suntus * 主程序流程 * 1.打开系统日志,设置成静态 * 2.初始化记时器,记录系统运行时间 * 3.初始化服务器:建立套接字,设置监听... * 4.主循环 * { * fork()... * } * 5.关闭http server对象 * 6.关闭系统日志 * 7.退出 *包括在这里定义初始化函数Init() */ #include "tinywe...
#pragma once #ifndef GAME_OVER_SCREEN_H #define GAME_OVER_SCREEN_H #include "Screen.h" #include "Texture.h" #include "GamePlayScreen.h" class GameOverScreen:public Screen { private: Texture* title; int time; TTF_Font *font; public: void start(SDL_Renderer*) override; void handleEvents(float&) override; void upd...
#include "generalwindow.h" #include "ui_generalwindow.h" GeneralWindow::GeneralWindow(QDialog *parent) : QDialog(parent), ui(new Ui::GeneralWindow) { ui->setupUi(this); //Тінь фрейму QGraphicsDropShadowEffect *shadow_effect1 = new QGraphicsDropShadowEffect(this); shadow_effect1->setOffset(0, 0...
#ifndef _GetTableDetailProc_H_ #define _GetTableDetailProc_H_ #include "BaseProcess.h" class GetTableDetailProc :public BaseProcess { public: GetTableDetailProc(); virtual ~GetTableDetailProc(); virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket, Context* pt); virtual int doResponse(C...
/* author chonepieceyb, operatiing-system lab2 2020年 03月 31日 星期二 21:24:51 CST */ #include<iostream> #include <sys/types.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include<string> #include <sys/ipc.h> #include <sys/shm.h> #define MAX_SEQUENCE 50 // fbi 最大的个数 using namespace std; ...
#pragma once namespace BroodWar { namespace Api { namespace Enum { //direct mapping public enum class Latency { SinglePlayer = 2, LanLow = 5, LanMedium = 7, LanHigh = 9, BattlenetLow = 14, BattlenetMedium = 19, BattlenetHigh = 24 }; } } }
#include <iostream> #include <fstream> #include <cmath> #include <vector> #include <cstdio> #include <ctime> #include <cstring> #ifdef _WIN32 #include <SDL.h> #include <SDL_image.h> #include <SDL_ttf.h> #include <SDL_mixer.h> #elif defined __unix__ #include <SDL2/SDL.h> #include <SDL2/SDL_image.h> #include <SDL2/SD...
#include<iostream> #include<string.h> using namespace std; char stack[100]; int top=-1 , size=100; int push(int data) { if(top==size-1) { cout<<"Overflow! "; } else { top++; stack[top]=data; } } char pop() { if(top==-1) { cout<<"Underflow"; } else { int data=stack[top]; top--; return data; } }...
// // main.cpp // baekjoon // // Created by Honggu Kang on 2020/06/20. // Copyright © 2020 Honggu Kang. All rights reserved. // //#include <iostream> #include <stdio.h> //#include "DrawStar.h" #include "womenPres.h" int main(int argc, const char * argv[]) { // std::cout << "Hello, World!\n"; /* Drawing st...
//知识点:树上差分, 树链剖分,lca /* By:Luckyblock 首先,这是个不可做的神仙题 考虑部分分: si=ti 10分: 每个人的起点和终点相同,第0秒时即到达终点 由于一个人到达终点后 ,就不可被观察到 所以 可以观察到人的观察员, 只有wj=0的观察员. 则需要找到所有 起点与 wj=0的观察员相同的人. wj=0 10分: 观察员只会在第0秒观察. 也就是说, 只有 起点 与 观察员所在点 相同的人 , 才会被观察到. */ #include<cstdio> #include<ctype.h> #include<vector> const int MARX...
#include <iostream> #include <vector> using namespace std; void test(int x) { } int a; int b; int main() { int x = 10; int y = 20; int z; cout << "x: " << x << endl; cout << "&x: " << &x << endl; cout << "&y: " << &y << endl; cout << "&z: " << &z << endl; cout << "&a: " << &a << endl; cout << "&...
// // devicesettingsuit.hpp // AutoCaller // // Created by Micheal Chen on 2017/7/17. // // #ifndef devicesettingsuit_hpp #define devicesettingsuit_hpp //设备状态管理相关的用例 #include "testbase/BaseTest.h" #include "cocos2d.h" DEFINE_TEST_SUITE(DeviceManageerTests); static const char *users[] = {"XXX1000", "xxx1001", "x...
#pragma once #include "bricks/imaging/image.h" #include "bricks/imaging/bitmap.h" namespace Bricks { namespace Imaging { class Subimage : public BitmapImage { protected: AutoPointer<Image> image; BitmapImage* bitmap; u32 offsetX; u32 offsetY; u32 width; u32 height; public: Subimage(BitmapImage* ima...
#ifndef BASE_H #define BASE_H #include <QDebug> #include <QSqlQuery> #include <QSqlError> #include <QObject> #include <QDateTime> class Base : public QObject { Q_OBJECT Q_PROPERTY(QDateTime createdAt READ getCreatedAt NOTIFY propChanged) Q_PROPERTY(QDateTime updatedAt READ getUpdatedAt NOTIFY propChanged...
#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...
// Copyright Lionel Miele-Herndon 2020 #pragma once #include "CoreMinimal.h" #include "ShooterStarterGameModeBase.h" #include "KillEmAllGameMode.generated.h" /** * */ UCLASS() class SHOOTERSTARTER_API AKillEmAllGameMode : public AShooterStarterGameModeBase { GENERATED_BODY() public: void PawnKilled(APawn* Paw...
#pragma once #include "gameNode.h" #define PI 3.141592 #define DEGREE(p) (PI/180*(p)) struct tagBoss { image* _img; image* _explosion; RECT _rc; float width; float height; bool isActive; bool isDie; float speed; int e_count; int e_index; bool e_move; float x; float y; float angle; float angle2; int hp; ...
#include "Scene.h" #include <fstream> #include <string> #include <iostream> using namespace std; void Scene::addLight(PointLight light) { lightList.push_back(light); } void Scene::getpoint(string a, int(&b)[3]) { //cout << a << endl; int temp = 0; int num = 0; int p = 0; while (num < a.length()) { if (a[num] ...
#include <iostream> #include <cmath> #include <iomanip> using namespace std; /* Problema 1.1 Complejidad de tiempo: O(1) */ int main() { int casos; cin >> casos; for (int i = 0; i < casos; i++) { int lado; cin >> lado; float altura = lado * sqrt(3) / 2; cout << fixed << setprecision(2); cout << altura ...
#include <iostream> #include <climits> using namespace std; void floyd(int D[100][100], int n) { for (int k = 0; k < n; k++) { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (D[i][k] != INT_MAX && D[k][j] != INT_MAX) D[...
#ifndef LAB2_MAIN_H_H #define LAB2_MAIN_H_H #include <c++/array> #include <c++/iostream> #include "matrix.h" using namespace std; using matrix::Matrix; using T = double; const int N = 8; const int M = 8; int main(); void doTask(); void doResearch(int pRange); Matrix<T, N, M> findMatrixR(Matrix<T, N, M> matrix); ...
//: C12:AutomaticOperatorEquals.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 #include <iostream> using namespace std; class Cargo { public: Cargo& operator=(const Cargo&) { cout ...
#include<iostream> using namespace std; //find out all the inversions in an array void MERGE(int* a, int* sorted, int start, int mid, int end,int& count) { //we divide the array into two parts,the letf array and the right array //the index of the left array int startL = start; int endL = mid; //the index of th...
#include"conio.h" #include"stdio.h" void main(void) { clrscr(); getch(); }
#include <iostream> using namespace std; #include "game.h" main() { cout<<" ~AKINATOR THE GENIE~ "<<endl; cout<<"THINK ABOUT ANY TEACHER AND I WILL TRY TO GUESS IT"<<endl; string start="yes"; system("pause"); while(start=="yes"||start=="YES"||start=="Yes") { game a; a.start(); cout<<endl<<"...
#include<iostream> #include<cstdio> #include<vector> #include<map> #include<string> #include<cstring> #include<algorithm> using namespace std; const int pri[] = {3,5,7,11,13,17,19,23,29,31,37}; int use[30],num[30],n,ans = 0; void print() { for (int i = 1;i < n; i++) printf("%d ",num[i]); printf("%d\n...
#include "RTClib.h" #include <zeroseg.h> // one of my fantabulous libraries #include <Timezone.h> // https://github.com/JChristensen/Timezone #include <debounce.h> // a project here that does falling buttons typedef unsigned long ulong; //typedef unsigned long micros_t; typedef ulong ms_t; typedef uint32_t u32; ///...
#include <iostream> using std::cout; using std::endl; #include <vector> using std::vector; #include <string> using std::string; #include <sstream> using std::istringstream; #include <fstream> using std::ifstream; struct PersonInfo { string name; vector<string> phones; }; int main(int argc, char** argv) { ...