text
stringlengths
8
6.88M
// // main.cpp // TEST // // Created by ruby on 2017. 10. 13.. // Copyright ยฉ 2017๋…„ ruby. All rights reserved. // #include <iostream> #include <fstream> #include "ToppingList.hpp" #include "DoughList.hpp" #include "EdgeList.hpp" #include "Topping.hpp" #include "Dough.hpp" #include "Edge.hpp" using namespace std; b...
/* * This software split a media file (in Container such as MKV, FLV, AVI...) * to video and audio bitstream. * In this example, it demux a MPEG2TS file to H.264 bitstream * and AAC bitstream. */ #include <stdio.h> #define __STDC_CONSTANT_MACROS extern "C" { #include "libavformat/avformat.h" }; /* FIX: H.264 i...
#include "SymbolStorage.hpp" #include <cstdlib> using wali::printKey; namespace opennwa { namespace details { //Constructors SymbolStorage::SymbolStorage( ) { //Epsilon is always a symbol of the NWA. addSymbol( EPSILON ); } SymbolStorage::SymbolStorage( const SymbolStorage & othe...
#include "Card.h"
#include "TileDefinitionDialog.hpp" #include "ui_TileDefinitionDialog.h" #include "LevelManager.hpp" #include <Tileset.hpp> using namespace Maint; TileDefinitionDialog::TileDefinitionDialog(Tileset const*tileset, LevelManager* levelManager, TextureManager* textureManager, QWidget *parent) : QDialog(parent), ...
#ifndef CDOUBLESLIDER_H #define CDOUBLESLIDER_H #include <QDialog> class DoubleSlider : public QWidget { Q_OBJECT public: DoubleSlider(QWidget* parent = 0); void setRange(float min, float max); void setSingleStep(float step); enum State{ MinHandle,MaxHandle,None}; float minValue() const; ...
// // simulator.hpp // QueueSimulation // // Created by Quincy Copeland on 3/29/19. // Copyright ยฉ 2019 Quincy Copeland. All rights reserved. // #ifndef simulator_hpp #define simulator_hpp #include <iostream> #include <string> #include <vector> #include <queue> #include <array> #include <unordered_map> #define N...
/*! * \file Material.cpp * * \author Stanley * \date October 2016 * * */ #include "pch.h" #include "Material.h" #include "Core\FileUtils.h" #include "Texture.h" #include "CommonDef.h" Hourglass::MaterialManager Hourglass::g_MaterialManager; void Hourglass::MaterialManager::Init() { LoadMateriales("Assets/M...
//===-- context.h - OpenCL Context ------------------------------*- C++ -*-===// // // TODO (Zhongliang): Add a license. // //===----------------------------------------------------------------------===// /// /// \file /// \brief This file contains the definition of OpenCL context class. /// //===----------------------...
#include <GL/glut.h> #include "Object3d.h" Object3d::Object3d() { } Object3d::Object3d(int id1, bool visible1, Posizione pos1) { idTexture = id1; visible = visible1; posizione = pos1; } void Object3d::setPosizione(Posizione pos1) { posizione = pos1; } Posizione Object3d::getPosizione() { retur...
// // Bell.hpp // final_sketch2 // // Created by Kris Li on 12/1/16. // // #pragma once #include "ofMain.h" class Bell { public: Bell(); void init(ofPoint pos); void update(float _rad1, float _rad2); void draw(); ofPoint getLink(int _loop); ofMesh bell; float rad1, r...
#ifndef wali_MERGE_FN_GUARD #define wali_MERGE_FN_GUARD 1 /** * @author Akash Lal * @author Nicholas Kidd */ #include "wali/Common.hpp" #include "wali/ref_ptr.hpp" #include "wali/IMergeFn.hpp" #include <iostream> namespace wali { class MergeFn; //typedef ref_ptr< MergeFn > merge_fn_t; class MergeFn : publ...
#ifndef APPROX_FUNCTIONS_H #define APPROX_FUNCTIONS_H #include <vector> #include "lorentz.h" // Xsection scalar approx_X22(std::vector<double> params); scalar approx_X22QQbar(std::vector<double> params); scalar approx_dX22_max(std::vector<double> params); #endif
/* * DecrementaService.cpp * * Created on: 10/12/2019 * Author: Jean */ #include <DecrementaService.h> DecrementaService::DecrementaService() { // TODO Auto-generated constructor stub a = 0; } void DecrementaService::decrementa(Contador *ContadorSeg, Contador *ContadorSegD, Contador *ContadorMin, Contad...
// Created on: 1996-02-13 // Created by: Jacques GOUSSARD // Copyright (c) 1996-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 G...
#include "guest.h" /*void guest_call(uint32_t call, void* data) { uint32_t magic = CALL_MAGIC; asm volatile("mov r0, %0\n" "mov r1, %1\n" "mov r2, %2\n" "bxj r0\n" : : "r"(call), "r"(data), "r"(magic) : "memory", "r0", "r1", "r2"); } */ void guest_prepare_buffer_read(const void...
#ifndef _MSG_0XC9_PLAYERLISTITEM_STC_H_ #define _MSG_0XC9_PLAYERLISTITEM_STC_H_ #include "mcprotocol_base.h" namespace MC { namespace Protocol { namespace Msg { class PlayerListItem : public BaseMessage { public: PlayerListItem(); PlayerListItem(const String16& _playerName, bool _online, int16_t _ping); size_t s...
#include "electionresult.h" EAnalyzer::ElectionResult::ElectionResult(int NCandidates) :candidates(NCandidates), PeopleVotedInAdvance(0), PeopleTookAbsenteeBallots(0), PeopleTookAbsenteeBallotsFromTEC(0), PeopleVotedWithAbsenteeBallots(0), AbsenteeBallots(0), Absente...
/*********************************************************\ * 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...
#include <stdio.h> #include <iostream> #include <stdlib.h> #include <time.h> #include <opencv2/opencv.hpp> using namespace cv; using namespace std; #define channel 3 /*double activation(const double sigma) { return 1/(1+exp(-sigma)); } */ Mat Max_pooling(int F_row, int F_col, double **...
#pragma once #include "proto/data_base.pb.h" #include "proto/data_condition.pb.h" #include "proto/data_player.pb.h" #include <set> using namespace std; namespace pd = proto::data; namespace nora { namespace scene { class role; void condition_merge(pd::condition_array& a, con...
// -*- LSST-C++ -*- /* * LSST Data Management System * Copyright 2015 LSST Corporation. * * This product includes software developed by the * LSST Project (http://www.lsst.org/). * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as pu...
#include <cstdlib> #include <cstdio> #include "library.h" #include "json/json.h" using namespace std; int main(int argc, char* argv[]) { if (argc < 7) { cout << "ERROR: invalid input parameters!" << endl; cout << "Please enter <schema_file> <input_file> <output_file> <mem_capacity> <k> <sorting_attributes>...
class Solution { public: int findMaxConsecutiveOnes(vector<int>& nums) { if(!nums.size()) return 0; int maxx = 0, now=nums[0], res=0; for(int i=0;i<nums.size();i++){ if(nums[i]==1) maxx++; else maxx=0; res = max(maxx, res); } return res; } };
#ifndef POPRIGHT_H #define POPRIGHT_H #include <QString> #include <cmath> #include "operation.h" class PopRight : public Operation { public: PopRight(); ~PopRight(void); double compute(const double input) const override; QString toQString() const override; }; #endif // POPRIGHT_H
#include <iostream> #include <vector> #include <queue> #include <algorithm> using namespace std; #define int long long int #define ld long double #define F first #define S second #define P pair<int,int> #define pb push_back #define endl '\n' const int N = 1e5 + 5; vector <int> Graph[N]; bool visited[N] = {false}; ve...
#include <bits/stdc++.h> using namespace std; int arr[100009],i,N,M,x,p=1,b,saltos,queda,ultimo,pudo; char c; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> N >> M; arr[1] = -1; for(i=0;i<N;i++){ cin >> c; if(c == '0'){ b++; }else{ ar...
#include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <sys/mman.h> #include "hwlib.h" #include "socal/socal.h" #include "socal/hps.h" #include "socal/alt_gpio.h" #include "hps_0.h" #include "can.hpp" #include <limits.h> #define HW_REGS_BASE ( ALT_STM_OFST ) #define HW_REGS_SPAN ( 0x04000000 )...
#include <QDebug> // RsaToolbox includes #include "General.h" #include "VnaPowerSweep.h" #include "VnaChannel.h" #include "Vna.h" using namespace RsaToolbox; // Qt includes // #include <Qt> /*! * \class RsaToolbox::VnaPowerSweep * \ingroup VnaGroup * \brief The \c %VnaPowerSweep class * configures and controls a...
#include "Jogo.h" Jogo::Jogo() { } Jogo::~Jogo() { destroy_bitmap(buffer); // Destrรณi a imagem; } void Jogo::Inicializar() { buffer = create_bitmap(800, 600); M1.setbuffer(buffer); M1.Inicializar(); /* As funรงรตes foram colocardas nesse mรฉtodo "Inicializar", porque, caso c...
#pragma once #include "PrimeFinder.h" class Sieve : public PrimeFinder { // Inherited via PrimeFinder virtual std::string name() override; virtual int* find(int min, int max, int* size) override; };
//==================================================================================== // @Title: COMRADE //------------------------------------------------------------------------------------ // @Location: /game/battle/include/cComrade.cpp // @Author: Kevin Chen // @Rights: Copyright(c) 2011 Visio...
๏ปฟ#ifndef _FATFS_H #define _FATFS_H #include "disk.h" #include "integer.h" #define LD_WORD(ptr) (WORD)(*(WORD*)(BYTE*)(ptr)) #define LD_DWORD(ptr) (DWORD)(*(DWORD*)(BYTE*)(ptr)) #define ST_WORD(ptr,val) *(WORD*)(BYTE*)(ptr)=(WORD)(val) #define ST_DWORD(ptr,val) *(DWORD*)(BYTE*)(ptr)=(DWORD)(val) class FATFS { public...
/******************************************************* cache.cc Ahmad Samih & Yan Solihin 2009 {aasamih,solihin}@ece.ncsu.edu ********************************************************/ #include <stdlib.h> #include <assert.h> #inclu...
//--------------------------------------------------------------------------- #ifndef ObjPoolH #define ObjPoolH #include "alist.h" #include <deque> //--------------------------------------------------------------------------- //ๆŒ‡้’ˆๅฏน่ฑก ็ฎก็†ๆฑ , ๆ”ฏๆŒ้šๆœบๅฟซ้€Ÿๅญ˜ๅ–,ๆ”ฏๆŒๅฟซ้€ŸๆŸฅๆ‰พ็ฉบ้—ฒๅฏน่ฑกๅ’Œ้‡Šๆ”พ็ฉบ้—ฒๅฏน่ฑก //็‰นๆ€ง(่ฎพ่ฎก็›ฎๆ ‡): //ๅŸบไบŽAListๅฎž็ŽฐๆŒ‡้’ˆๅฏน่ฑก็ฎก็†,ๅนถไธ”ไฝฟ็”จไธ€ไธชdequeๆฅ็ฎก็†ๅทฒๅˆ†้…ๅ’Œๆœชๅˆ†้…ๅฏน่ฑก...
/* -*- 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. */ #include "core/pch.h" #include "modules/pi/OpSystemInfo.h" #inc...
// includes, system #include <algorithm> #include <cassert> #include <cmath> // includes, project #include "distribution.h" using namespace std; red_random::red_random(uint32_t seed) : idx(0) { I[ 0] = seed & 0xffffffff; for(int i = 1; i < 624; ++i) { I[i] = (1812433253*(I[i-1]^I[i-1]>>30)+i...
/** * File Matrix.cpp * Description: implementation of Matrix class * */ #include "Matrix.hpp" // construct an identity matrix as mat Matrix::Matrix() { for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { if (i == j) this->mat[i][j] = 1; else this->mat[i][j] = 0; } } ...
#include "PrecisionRecall.h" using namespace std; static void computePrecisionRecallForThreshold(const vector<float> &gt, const vector<float>& preds, float threshold, int nGroundTruthDetections, float& precision, float& recall) { // Compute tp, fp, fn, tn int truePos = 0, trueNeg = ...
// Created on: 1993-01-09 // Created by: CKY / Contract Toubro-Larsen ( Kiran ) // 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...
#ifndef GNSCREENMESHOBJECT_H #define GNSCREENMESHOBJECT_H class GNSCREENMESH_ENTRY GnScreenMeshObject { public: GnScreenMeshObject(); ~GnScreenMeshObject(); protected: private: }; #endif // GNSCREENMESHOBJECT_H
// // 10.cpp // REVIEW BAGUS // // Created by Mikha Yupikha on 16/10/2016. // Copyright ยฉ 2016 Mikha Yupikha. All rights reserved. // #include <iostream> using namespace std; int main() { int month, year; cout<<"Please input the number of month (1-12): "; cin>>month; if (month<1 || month...
#include "stdafx.h" #include "MainGame.h" #include "TestScene.h" MainGame::MainGame() { SUBWIN->Init(); } MainGame::~MainGame() { } HRESULT MainGame::Init() { GameNode::Init(); isDebug = false; IMAGE->AddImage("restore", "images/restore.bmp", 0, 0, 50, 50, true, RGB(255, 0, 255)); IMAGE->AddImage("bg", "im...
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0;i<(n);i++) #define for1(i,n) for(int i=1;i<=n;i++) #define FOR(i,a,b) for(int i=(a);i<=(b);i++) #define FORD(i,a,b) for(int i=(a);i>=(b);i--) const int INF = 1<<29; const int MOD=1073741824; //#define pp pair<ll,ll> typedef long long int ll; bo...
#include "stdio.h" #include "conio.h" #include "string.h" int fibonacci(int n){ int a=n,b=0,i; printf("\nFibonacci Series for the given number is:\n\n"); for(i=1; i<=10; i++){ a=a+b; b=a-b; printf(" %d ",b); } } void main(){ clrscr(); int number; printf("Enter any number: "); ...
#include "stdafx.h" #include "Win32Utils.h" Win32Utils::Win32Utils() { } Win32Utils::~Win32Utils() { } // Return current working directory (with trailing backslash) string Win32Utils::GetCurrentWorkingDirectory() { string folder; const DWORD buffsize = 2048; char buffer[buffsize + 1]; DW...
#ifndef INSERTMODE_H #define INSERTMODE_H #include "Mode.h" class InsertMode:public Mode { public: InsertMode(); virtual void update(const Ogre::FrameEvent&); virtual void init(); virtual bool keyReleased(const OIS::KeyEvent &keyEventRef); virtual bool keyPressed(const OIS::K...
#pragma once #include "Render/DrawPass/BaseDrawPass.h" #include "Render/DrawSubPass/Geometry2DSubPass.h" #include "Render/DrawSubPass/GeometrySubPass.h" #include "Render/DrawSubPass/SkyBoxSubPass.h" #include "Render/DrawSubPass/GuiSubPass.h" namespace Rocket { class ForwardGeometryPass : implements BaseDrawPass ...
#ifndef GNSMGROUP_H #define GNSMGROUP_H class GNMESH_ENTRY Gn2DNode : public Gn2DMeshObject { GnDeclareRTTI; GnDeclareStream; protected: GnTObjectArray<Gn2DMeshObjectPtr> mChildern; public: Gn2DNode(gtuint uiChildSize = 0); virtual ~Gn2DNode(){}; void AttachChild(Gn2DMeshObject* pObject); virtual void Update(...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2003-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 "core/pch.h" #if defined _NATI...
#include "ResultLayer.h" ResultLayer::ResultLayer() { } ResultLayer::~ResultLayer() { } bool ResultLayer::init() { if (!Layer::init()) return false; return true; }
#include <iostream> #define abs(n) (n<0?-(n):n) int main() { int sumSq = 0; for (int n = 1; n <= 100; n++) sumSq += n * n; int sqSum = 50 * 101; sqSum *= sqSum; std::cout << abs(sumSq - sqSum) << "\n"; }
#include <iostream> #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <ncurses.h> #include <string> using namespace std; void doPrint(int n, char sChar) { for (int i = 0; i < n; i++) { printf("%C", sChar); } } int main() { int h, w, r, n; freopen("labiec3...
// ------------------------------------------------------------------------------------------------ // File name: Parser.h // Author: Marc Ochsenmeier // Email: info@winitor.net // Web: www.winitor.net // Date: 20.08.2011 // // Description: This file contains a set of Interfaces that can be used to inquire the...
#include <iostream> #include <cstdlib> #include <string> #include "manager.h" using namespace std; Manager::Manager():_name("Manager"), _number("1"){ } Manager::Manager(string name = "Manager",string number = "1"):_name(name),_number(number) { } void Manager::PrintOperations() { cout<<"\t++++++++++++++++++++++++++...
#include<bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #define inf 1073741823 using namespace std; using namespace __gnu_pbds; struct ope{ int t,x; }; ope o[200000]; int ans[200000],n,tot=0; void readit(){ scanf("%d",&n); for (int i=1;i<=n;i++) scanf("%d%d...
#include "PBRPipeline.h" #include "RenderTarget.h" #include "SceneManager.h" #include "engine_struct.h" #include "ResourceManager.h" #include "pass.h" #include "RenderSystem.h" #include "TextureManager.h" #include "EGLUtil.h" #include <random> #include "Image.h" #include "Texture.h" void PBREffect::Init() { auto& rt...
๏ปฟ#include "item/conn_line.h" #include <QStyleOptionGraphicsItem> #include <QPainter> #include <boost/range/adaptors.hpp> #include <boost/range/algorithm_ext.hpp> #include <boost/range/algorithm.hpp> #include <QPolygonF> #include <base/lang/scope.hpp> #include <QGraphicsScene> using namespace boost::adaptors; using na...
#include <iostream> #include <string> #include "cifrado.h" using std::string; using namespace std; int main() { string mensaje="MIRA ESA COLINA "; monobi algo; string cifrado=algo.cifrar(mensaje); cout<<cifrado<<endl<<endl; string descifrado=algo.descifrar(cifrado); cout<<descifrado<<endl; return 0; }
#include "nt.h" #include <intrin.h> void* nt::kernel_base_address() { return *reinterpret_cast<void**>(reinterpret_cast<std::uintptr_t>(PsLoadedModuleList) + 0x30); } std::size_t nt::kernel_base_size() { return *reinterpret_cast<std::size_t*>(reinterpret_cast<std::uintptr_t>(PsLoadedModuleList) + 0x40); } std::...
#ifndef STRING_REVERSE_HPP #define STRING_REVERSE_HPP #include <string> #include <algorithm> namespace String { static constexpr void reverse(const std::string &str) { std::reverse(str.begin(), str.end()); } static constexpr void reverse(const std::string &str, size_t reverseSize) { ...
//็Ÿฅ่ฏ†็‚น:BFS/ๅ›พ่ฎบ /* ๆฌฒๆฑ‚ๅพ—ๅˆฐ่พพๆฏไธช็‚น็š„ ๆœ€็Ÿญ่ทฏ ็š„ๆกๆ•ฐ ๆ˜พ็„ถ, ๆฏไธช็‚น็š„ๆœ€็Ÿญ่ทฏๆกๆ•ฐ = ๆ‰€ๆœ‰็ˆถไบฒ็‚น็š„ๆœ€็Ÿญ่ทฏๆกๆ•ฐ ไน‹ๅ’Œ ๆ‰€ๆœ‰่พนๆƒๅ€ผ้ƒฝไธบ1 ๆ‰€ไปฅๅฏไปฅ้€š่ฟ‡BFSๆฅ่งฃๅ†ณ ๅฝ“่ฎฟ้—ฎๅˆฐ่ฟ™ไธช่Š‚็‚นๆ—ถ๏ผŒ ๅฆ‚ๆžœๆ˜ฏ็ฌฌไธ€ๆฌก่ฎฟ้—ฎ๏ผŒ ็”ฑไบŽๆ˜ฏไปŽ่ตท็‚น1 ๅผ€ๅง‹BFS, ๆ‰€ไปฅไน‹ๅ‰่ฎฟ้—ฎ็š„ๆ—ถๅ€™,่ทฏๅพ„้•ฟๅบฆไธไผšๆฏ”ไน‹ๅŽ่ฎฟ้—ฎๅฐ ๅฐ†่ฟ™ไธช่Š‚็‚น็š„็ญ”ๆกˆ+=ไป–็ˆถ่Š‚็‚น็š„็ญ”ๆกˆ๏ผŒ ๅนถๅฐ†ๆญค่Š‚็‚นๅ…ฅ้˜Ÿ๏ผ› ๅฆ‚ๆžœๆ˜ฏ็ฌฌไบŒๆฌก่ฎฟ้—ฎ ไธ”ๅฝ“ๅ‰็š„่ท็ฆป็ญ‰ไบŽไน‹ๅ‰่ฎฐๅฝ•็š„่ท็ฆป๏ผŒ ่ฏดๆ˜Ž่ฟ™ๆ˜ฏ็ฌฌไบŒๆกๆœ€็Ÿญ่ทฏ๏ผŒ ๅŒๆ ท๏ผŒๅฐ†่ฟ™ไธช่Š‚็‚น็š„็ญ”ๆกˆ+=ไป–็ˆถ่Š‚็‚น็š„็ญ”ๆกˆ๏ผŒ ไฝ†ไธ้œ€่ฆๅ…ฅ้˜Ÿไบ†ใ€‚ */ #include<cstdio> #include<ctype.h> #include<...
// // BangManager.hpp // // Created by Yajun Shi // // The manager of the game, controls game flow. // Records points, generates enemies and bullet packages. // #include "stdafx.h" class BangManager : public GameManager { public: BangManager(); void Reset(); void GameOver(); virtual void Update(fl...
void empty(void) { /* empty */ }
// ้—ฎ้ข˜็š„ๆ่ฟฐ๏ผš็Žฏๅฝข้“พ่กจๆ’ๅ€ผ // ็ป™ๅฎšไธ€ไธชๅ…ƒ็ด ๆœ‰ๅบ็š„็Žฏๅฝข้“พ่กจ๏ผˆไปฅvector็š„ๅฝขๅผ๏ผ‰๏ผŒๅฐ†ไธ€ไธชๆ–ฐ็š„ๅ…ƒ็ด valๆ’ๅ…ฅๅˆฐ้“พ่กจไธญ๏ผŒ่ฆๆฑ‚ไฟๆŒ้“พ่กจไพๆ—งๆœ‰ๅบ // ่ฆๆฑ‚ๅ…ˆๆž„้€ ๅ‡บ็Žฏๅฝข้“พ่กจๅ†่ฟ›่กŒๆ’ๅ€ผ // ้“พ่กจไธบ็ฉบ๏ผ›้“พ่กจไธไธบ็ฉบ // ๆต‹่ฏ•็”จไพ‹ๆœ‰4็ป„๏ผš // 1ใ€็ฉบ้“พ่กจ val = 2 // ่พ“ๅ…ฅ๏ผšNULL 2 // ่พ“ๅ‡บ๏ผš2 // 2ใ€้ž็ฉบ้“พ่กจ val = 2 // ่พ“ๅ…ฅ๏ผš{1,3,4,5,7} 2 // ่พ“ๅ‡บ๏ผš1,2,3,4,5,7 // 3ใ€้ž็ฉบ้“พ่กจ val = 8 // ่พ“ๅ…ฅ๏ผš{1,3,4,5,7} 8 // ่พ“ๅ‡บ๏ผš1,3,4,5,7,8 // 4ใ€้ž็ฉบ้“พ่กจ...
#include <algorithm> #include <iostream> #include <queue> #include <string> #include <tuple> #include <vector> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); while (true) { int w, h; std::cin >> w >> h; if (w == 0 && h == 0) {...
#include <iostream> #include <algorithm> using namespace std; typedef unsigned long long int ll; int n, *a, *b; ll sum1 = 0, sum2 = 0, res = 0; void nhap(){ cin >> n; a = new int[n]; b = new int[n]; int i; for(i = 0; i < n; i++){ cin >> a[i]; sum1 = sum1 + a[i]; } for(i = ...
#include "ccameraslist.h" #include "ui_ccameraslist.h" DISABLE_COMPILER_WARNINGS #include <QStringBuilder> RESTORE_COMPILER_WARNINGS CCamerasList::CCamerasList(QWidget *parent) : QDialog(parent), ui(new Ui::CCamerasList) { ui->setupUi(this); } CCamerasList::~CCamerasList() { delete ui; } void...
#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #include <numeric> typed...
#ifndef __VIVADO_SYNTH__ #include <fstream> using namespace std; // Debug utility ofstream* global_debug_handle; #endif //__VIVADO_SYNTH__ #include "mp23_1_opt_compute_units.h" #include "hw_classes.h" struct in_in_update_0_write0_merged_banks_4_cache { // RAM Box: {[0, 127], [0, 127], [0, 63]} // Capacity: 13...
/* -*- Mode: c++; tab-width: 4; 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. * * @author Arjan van Leeuwen (arjanl) */ #ifndef UNIX_WIDGET_PAINTER_H #define UNIX_W...
#include "driver.h" std::string Driver :: getName() { return jina; }
#include "comn.h" #include "city_forecast.h" #ifndef CITY_STATIS #define CITY_STATIS class stat_result { public: int avail_days; std::vector<int> min_t, min_t_high, min_t_low, max_t, max_t_high, max_t_low; std::vector<int> rain_all; std::vector<int> rain_right, rain_empty, rain_miss;...
#pragma once #include "controller.h" #include <chrono> #include <SFML/Window.hpp> #include <SFML/Graphics.hpp> class SFMLController : public Controller { private: sf::RenderWindow *window; Point<int> offset; bool _isLeftPressed, _wasLeftPressed; bool _isRightPressed, _wasRightPressed; Point<int> mousePos, ...
// // Runner.cpp // GLFW3 // // Created by William Meaton on 09/12/2015. // Copyright ยฉ 2015 WillMeaton.uk. All rights reserved. // #include "Runner.hpp" float Runner::r = 1; float Runner::g = 1; float Runner::b = 1; float Runner::a = 1; int Runner::keysPressed =0; int Runner::mbsPressed = 0; Runner::Runner(float ...
#include <iostream> #include <vector> using namespace std; int main() { std::pair<string,int> p1,p11; std::pair<float,int> p2; p1.first = "dae"; p1.second =20; p11.first = "somchai"; p11.second = -5; p2.first = 2.33; p2.second = 9999; p1 = p11; //p2 = p1; p11.first = "xxx"; cout << p1.fi...
#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 <cstdio> #include <cstdlib> #include <cstring> #include <numeric> #include <bits...
#include "global.h" #include "siet.h" /* void sir_na_z_vidale(short i,short j,short k,short smer,short zi,short zj,short zk) { Bod b(smer,i,j,k); b.sirFD(zi,zj,zk); if (b.t>-1) { pq.push(b); at[i][j][k] = b.t; } } void Bod::sir() { //vyber najmensieho prvku z haldy a sirenie vlny z neho if ((i =...
#ifndef QTEXCEL_H #define QTEXCEL_H #include <QObject> #include <QFile> #include <QString> #include <QStringList> #include <QVariant> #include <QAxBase> #include <QAxObject> typedef unsigned int UINT; class QtExcel { public: QtExcel(); QtExcel(QString xlsFile); ~QtExcel(); public: bool Open(UIN...
#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...
// RsaToolbox includes #include "General.h" #include "VnaMarker.h" #include "VnaChannel.h" #include "Vna.h" using namespace RsaToolbox; // Qt includes // #include <Qt> /*! * \class RsaToolbox::VnaMarker * \ingroup VnaGroup * \brief The \c %VnaMarker class * is used to control a marker * on a trace. */ VnaMar...
/* -*- coding: utf-8 -*- !@time: 2020/3/6 21:21 !@author: superMC @email: 18758266469@163.com !@fileName: 0051_building_product_array.cpp */ #include <environment.h> class Solution { public: vector<int> multiply(const vector<int> &A) { if (A.empty()) return A; vector<int> b(A.siz...
#ifndef _YTOPEN_SDK_ #define _YTOPEN_SDK_ #include <string> #include <vector> class ytopen_sdk { public: typedef struct AppSign { uint32_t app_id; std::string secret_id; std::string secret_key; uint32_t expired; std::string user_id; ...
#include "stdlib.h" #include "stdio.h" int main(int argc, char **argv) { int *arr = new int[12]; return 0; }
๏ปฟ// VideoManager.cpp : ๅฎšไน‰ๅบ”็”จ็จ‹ๅบ็š„ๅ…ฅๅฃ็‚นใ€‚ // #ifdef WIN32 #include <shlobj.h> #endif #include "framework.h" #include "VideoManager.h" #include "VMDef.h" #include "shlwapi.h" #define MAX_LOADSTRING 100 #pragma comment(lib, "shlwapi.lib") // ๅ…จๅฑ€ๅ˜้‡: HINSTANCE hInst; // ๅฝ“ๅ‰ๅฎžไพ‹ WCHAR szTitle[MAX_LOA...
#define BOOST_SP_DISABLE_THREADS #include <iostream> #include <iomanip> #include <dax/Types.h> #include <dax/cont/Scheduler.h> #include <dax/cont/arg/ExecutionObject.h> #include <dax/exec/WorkletMapField.h> #include <dax/cont/Timer.h> #include "Point3D.h" #include "tests/RandomPoints3D.h" #include "PointLocator.h" #...
#ifndef SCENE_HPP #define SCENE_HPP #include <list> #include "shape.hpp" #include "light_source.hpp" #include "camera.hpp" #include "material.hpp" #include <string> #include <map> struct scene { public: scene(); scene(std::string const& datei); scene(const scene& orig); virtual ~scene(); void rend...
#pragma once #include"TorreTeamA.h" #include<list> class ListTorreTeamA { public: ListTorreTeamA(); ~ListTorreTeamA(); list<TorreTeamA*> list_TorreA; void Agregar(int x, int y, int vida, Bitmap^bmp); void Mostrar(Graphics^gr, Bitmap^bmp); }; ListTorreTeamA::ListTorreTeamA() { } ListTorr...
#include <iostream> #include "Q02.h" using namespace std; void CreateWeightGraphMatrix(MGraph *G) { G->numEdges = 15; G->numVertexes = MAXSIZE; /* ่ฏปๅ…ฅ้กถ็‚นไฟกๆฏ๏ผŒๅปบ็ซ‹้กถ็‚น่กจ */ G->vexs[0] = 'A'; G->vexs[1] = 'B'; G->vexs[2] = 'C'; G->vexs[3] = 'D'; G->vexs[4] = 'E'; G->vexs[5] = 'F'; ...
/* * @lc app=leetcode id=990 lang=cpp * * [990] Satisfiability of Equality Equations * * https://leetcode.com/problems/satisfiability-of-equality-equations/description/ * * algorithms * Medium (40.64%) * Likes: 213 * Dislikes: 3 * Total Accepted: 8.5K * Total Submissions: 20.8K * Testcase Example: '...
# include "eoJsonUtils.h" # include <serial/Parser.h> # include <string> namespace eoserial { void printOn(const eoserial::Persistent& obj, std::ostream& out) { eoserial::Object* jsonThis = obj.pack(); jsonThis->print( out ); delete jsonThis; } void readFrom(eoserial::Persistent& obj, std::istream& _is...
/* ** WormWithWeapon.cpp for cpp_indie_studio in /home/lopez_i/cpp_indie_studio/WormWithWeapon.cpp ** ** Made by Loรฏc Lopez ** Login <loic.lopez@epitech.eu> ** ** Started on jeu. juin 15 19:15:02 2017 Loรฏc Lopez // Last update Sun Jun 18 16:27:36 2017 Stanislas Deneubourg */ #include "Worms/Worm.hpp" void Worm::wo...
/* XMRig * Copyright 2018-2020 SChernykh <https://github.com/SChernykh> * Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com> * * 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 Fr...
#include <iostream> #include <vector> #include <unordered_map> #include <queue> using namespace std; class Solution { public: int ladderLength(string beginWord, string endWord, vector<string>& wordList) { // str -> word, bool -> visited unordered_map<string, bool> dict; int n = wordList.size(...
#ifndef __PENALTY_FORCE_H__ #define __PENALTY_FORCE_H__ #include <Eigen/Core> #include "Force.h" #include <iostream> class TwoDScene; class PenaltyForce : public Force { public: PenaltyForce( const TwoDScene &scene, const scalar stiffness, const scalar thickness ); virtual ~PenaltyForce(); virtual void ad...
#ifndef MAIN_CPP #define MAIN_CPP #include "ros/ros.h" #include "std_msgs/String.h" #include "am2315.hpp" int main(int argc,char ** argv){ ros::init(argc, argv, "am2315_node"); std::string i2cBus("/dev/i2c-1"); std::string zoneId("Greenhouse"); am2315Sensor s(i2cBus,zoneId); try{ ros::NodeHandle n; ros:...
#include "MoveFactory.h" #include "MoveManager.h" namespace Move { IMoveManager* createDevice() { return MoveManager::getInstance(); } }
#include <cstdio> #include <arpa/inet.h> #include <sys/socket.h> #include <unistd.h> using namespace std; int main(){ int sockfd; int bind_flag; int bytes_received; socklen_t addrlen; char buffer[1024]; struct sockaddr_in server_address; struct sockaddr_in client_address; server_address.sin_family = AF_IN...
/* SPDX-FileCopyrightText: 1997 Bernd Johannes Wuebben <wuebben@kde.org> SPDX-FileCopyrightText: 1999 Preston Brown <pbrown@kde.org> SPDX-FileCopyrightText: 1999 Mario Weilguni <mweilguni@kde.org> SPDX-License-Identifier: LGPL-2.0-or-later */ #ifndef K_FONT_CHOOSER_H #define K_FONT_CHOOSER_H #include ...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define show(x) for(auto i: x){cout << i << " ";} typedef long long ll; int n; vector<string> dic; void fds(int bitinfo, string s){ if (s.size() == n){ dic.push_back(s); return; ...