text
stringlengths
8
6.88M
////////////////////////////////////////////////////////////////////// ///Copyright (C) 2011-2012 Benjamin Quach // //This file is part of the "Lost Horizons" video game demo // //"Lost Horizons" is free software: you can redistribute it and/or modify //it under the terms of the GNU General Public License as published ...
#ifndef OP_TEXTCOLLECTION_H #define OP_TEXTCOLLECTION_H #include "modules/widgets/optextfragmentlist.h" #include "modules/widgets/OpWidget.h" #include "modules/widgets/UndoRedoStack.h" #ifdef INTERNAL_SPELLCHECK_SUPPORT #include "modules/spellchecker/opspellcheckerapi.h" #endif // INTERNAL_SPELLCHECK_SUPPORT #include ...
#include<iostream> using namespace std; int main(){ int a=10; int b=20; cout<<a<<" "<<b; int sum=0; sum=a+b; //sum=30 b=sum-b; // b= 30-20=10 a=sum-a; // a= 30-10=20 cout<<endl<<a<<" "<<b; }
#pragma once #include<SFML/Graphics.hpp> using namespace sf; class checkbox { public: checkbox(sf::Vector2f size, sf::Vector2f Rsposition); ~checkbox(); RectangleShape checkboxtest; void Update(Vector2f Rsposition); void Draw(RenderWindow& window); const Vector2f& getPosition() const; const FloatRect getGlobalb...
// Fill out your copyright notice in the Description page of Project Settings. #include "MyStructs.h" #pragma once #include "GameFramework/Actor.h" #include "CBGBlock.generated.h" //就是打碎方块 生成的可拾取的方块 会在地上浮动 UCLASS() class FIGHTWITHBLOCK_API ACBGBlock : public AActor { GENERATED_BODY() public: // Sets default valu...
#include<bits/stdc++.h> using namespace std; int main(){ int s=0; int arr[5]={1,4,2,5,3}; int n=5; for(int p=1;p<=n;p+=2) { for(int i=0;i<n-p+1;i++) { for(int j=i;j<i+p;j++) {s+=arr[j];} } } cout<<s; return 0; }
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // // Copyright (C) 1995-2004 Opera Software AS. All rights reserved. // // This file is part of the Opera web browser. It may not be distributed // under any circumstances. #include "core/pch.h" #ifdef IRC_SUPPORT #include "irc-urlparser...
#include <iostream> using namespace std; class Point { private: int xpos, ypos; public: Point(int x = 0, int y = 0) : xpos(x), ypos(y) {} void showPosition() const { cout << '[' << xpos << ", " << ypos << ']' << endl; } //Point * 3 Point operator*(int times) { Point pos(xpos*times, ypos*times); return pos; ...
#include "gmock/gmock.h" #include "gtest/gtest.h" #include "MockIOUtils.h" #include <string> #include <vector> using std::string; using std::vector; using ::testing::Return; using ::testing::Invoke; using ::testing::ElementsAre; using ::testing::UnorderedElementsAre; using ::testing::NiceMock; using ::testing::_; T...
#include "AppraisedRange.h" // :: Constants :: const QString LOWER_RANGE_VALUE_KEY = "lowerRangeValue"; const QString UPPER_RANGE_VALUE_KEY = "upperRangeValue"; const QString RESULT_KEY = "result"; // :: Implementation :: struct AppraisedRange::Implementation { Range range; QString result; }; // :: Lifecycle ...
#include "EnumFieldDescriptorContainer.h" #include <sstream> using namespace std; using namespace google; using namespace protobuf; QWidget * EnumFieldDescriptorContainer::getWidget(QWidget * parent) { if(m_comboBox == NULL) { m_comboBox = new QComboBox(parent); if (m_type == Fie...
#include <mex.h> #include <omp.h> #include <immintrin.h> float calc_function(float* w, float* x, int in_dim_i_begin, int in_dim_i_end) { // calucuration int in_dim_i; float* w_ptr = w + in_dim_i_begin; float* x_ptr = x + in_dim_i_begin; __m256 w_x8_1; __m256 x_x8_1; __m256 wx_x8_1; __m256 sum_x8_1; __m2...
#include "WinApplication.h" #include "..\resource.h" #include <aeString.h> #include <aeGraphicsAPI.h> #include <aeMath.h> #define STRINGIFY(x) #x #define EXPAND(x) STRINGIFY(x) namespace aeEngineSDK { WinApplication* ApplicationHandle = nullptr; aeLinearColor Color(0.5f, 0.5f, 0.5f, 1.0f); AE_RESULT WinApplicatio...
/* Compare two linked lists A and B Return 1 if they are identical and 0 if they are not. Node is defined as struct Node { int data; struct Node *next; } */ int CompareLists(Node *headA, Node* headB) { // This is a "method-only" submission. // You onl...
#ifndef _OPENCV_H_ #include<opencv2/opencv.hpp> #define _OPENCV_H_ #endif #ifndef _TRANSF_H #define _TRANSF_H void DWT(IplImage *pImage, int nLayer); void IDWT(IplImage *pImage, int nLayer); int mydwt(cv::Mat& _src, int _nlayer); int myidwt(cv::Mat& _src, int _nlayer); void embed(const std::string& infile, const std...
#ifndef MAP_HEADER #define MAP_HEADER #include "Node.h" #include "Singleton.h" #include "Logger.h" #include "ObjectInfo.h" #include "Npc.h" #include "TileInfo.h" #include "NPCInfo.h" #include <map> #include <vector> #include "TurnInfo.h" #ifdef _DEBUG #define BOT_LOGIC_DEBUG_MAP #endif #ifdef BOT_LOGIC_DEBUG_MAP #de...
#include <algorithm> #include <iostream> #include <string> #include <vector> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); int n, m; std::cin >> n >> m; std::vector<std::string> hear; while (n--) { std::string s; std...
//all the leftnodes of any nodes is smaller and right nodes are greater; #include<iostream> #include<queue> #include<stack> using namespace std; struct BstNode{ int data; BstNode *left; BstNode *right; }; BstNode * getNewNode(int data) { BstNode *newNode = new BstNode(); newNode->data=data; newNode->left=newNode-...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) 2009-2011 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef GSTMEDIAPLAYER_H #define GST...
#include "../idlib/precompiled.h" #pragma hdrstop #include "Game_local.h" #include "ai/AI.h" #define RECORD_STATE_TRACE_LEN 2048.0f class rvGamePlayback { public: rvGamePlayback( void ); ~rvGamePlayback( void ); void RecordData( const usercmd_t &cmd, idEntity *source ); private: int mStart...
//This is main class to control the whole program. #ifndef _MAINCONTROLLOR_ #define _MAINCONTROLLOR_ #pragma comment(lib, "winmm.lib") #include <iostream> #include <fstream> #include <sstream> #include <algorithm> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2\opencv...
// ofile.h #ifndef OFILE_H #define OFILE_H #include <fstream> #include <string> #include <unordered_map> #include <utility> #include <vector> #include "BlobCrystallinOligomer/config.h" #include "BlobCrystallinOligomer/shared_types.h" #include "Json/json.hpp" namespace ofile { using config::Config; using sh...
// kumaran_14 //https://www.hackerrank.com/challenges/short-palindrome/problem #include <bits/stdc++.h> using namespace std; #define f first #define s second #define p push #define mp make_pair #define pb push_back #define foi(i, a, n) for (i = (a); i < (n); ++i) #define foii(i, a, n) for (i = (a); i <= (n); ++i) #def...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 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> #ifdef DOM_JIL_API_SUPPORT #ifdef DAPI_...
#ifndef SPECIFICATIONS_H #define SPECIFICATIONS_H #include <string> enum class HP { SOLDIER = 100, DEMON = 100, ROGUE = 85, BERSERKER = 120, VAMPIRE = 110, WEREWOLF = 200, WIZARD = 80, HEALER = 50, PRIEST = 60, WARLOCK = 105, NECROMANCER = 90 }; enum class DMG { SOLDIE...
#ifndef xsafeContainer_h__ #define xsafeContainer_h__ #include <map> #include <mutex> #include <unordered_map> #include <set> #include <list> #include <vector> #include <queue> #include <deque> #include <assert.h> #define X_LOCK_GUARD(a) std::lock_guard<std::mutex> lck(a) class CxClassMutex { prote...
/** Segment tree with following operations: MULTIPLY SEGMENT [L;R] to X ADD X TO SEGMENT [L;R] GET SUM ON SEGMENT [L;R] Sources: https://discuss.codechef.com/t/addmul-editorial/11233 https://codeforces.com/blog/entry/16719?locale=ru **/ #include <iostream> #define int long long using namespace std; const int N = 20...
/*! * \file arrow.h * \author Simon Coakley * \date 2012 * \copyright Copyright (c) 2012 University of Sheffield * \brief Header file for arrow used in stategraphs */ #ifndef ARROW_H_ #define ARROW_H_ #include <QGraphicsLineItem> #include "./graphicsitem.h" #include "./mpre.h" #include "./mpost.h" #include "./me...
#include "RedisLogic.h" //#include "RedisAccess.h" #include "Logger.h" #include "StrFunc.h" #include "Util.h" #include "md5.h" #include <inttypes.h> #include "JsonValueConvert.h" #include "Helper.h" #include "Lib_Ip.h" #include "CConfig.h" #include "SqlLogic.h" #include "TcpMsg.h" namespace RedisLogic { static std:...
#include <iostream> using namespace std; // swap kth node from front and end; //intresting case: // x and y are same // x and y are next to each other // x and y are not present typedef struct Node { int key; Node *next; Node(int x) { key = x; next = NULL; } } Node; Node *insert(N...
/* * @lc app=leetcode.cn id=329 lang=cpp * * [329] 矩阵中的最长递增路径 */ // @lc code=start #include<iostream> #include<vector> #include<algorithm> #include<list> using namespace std; class Solution { public: int longestIncreasingPath(vector<vector<int>>& matrix) { if(matrix.size()==0)return 0; int ...
// ======================================= // Unit : TCPUtils objects // Version: 1.0.0.0 (build 2016.09.02) // Author : Kyee Ye // Email : kyee_ye(at)126.com // Copyright (C) Kyee workroom // ======================================= #include "TCPObjs.h" namespace TCPUtils { /* begin namespace */ /...
#include <SoftwareSerial.h> SoftwareSerial xbeeSerial(2, 3); //RX, TX const int button = 5; //button const int redLed = 10; //red led const int greenLed = 9; //green led const int pot = 0; //potentiometer int potVal = 0; //value of the potentiometer int buttonState = LOW; //starting value of button //String f...
#ifndef CHAPTER_ONE_STUDNET_H #define CHAPTER_ONE_STUDNET_H #include <string> #include <iostream> using namespace std; struct Student { std::string name; int score; bool operator<(const Student &other) { return score < other.score; } friend std::ostream &operator<<(ostream &os, Studen...
#include <vector> #include <string> #include <iostream> #include <fstream> #include <sstream> #include <list> #include <algorithm> #include <sstream> #include <set> #include <cmath> #include <map> #include <stack> #include <queue> #include <stdio.h> #include <string.h> #include <numeric> #define L_INF (100000000000000...
#ifndef INDEXBUFFER_H #define INDEXBUFFER_H #include <Common.h> class CIndexBuffer final { public: CIndexBuffer(); ~CIndexBuffer(); void bind() const; void unbind() const; void updateData(GLsizeiptr size, const void *data, GLenum usage); private: GLuint _ibo; }; #endif // INDEXBUFFER_H
#ifndef EDGE_H_ #define EDGE_H_ #include <iostream> using namespace std; class Edge{ private: int v, w; public: Edge(int v, int w):v(v), w(w){}; int getV() const{ return v; } int getW() const{ return w; } }; ostream& operator<< (ostream& os, const Edge& edge){ os << edge...
#include "gtest/gtest.h" #include "FirstNorm.h" #include "InfinityNorm.h" #include "EuclideanNorm.h" using namespace std; TEST(FirstNormTests, equalsMatricesTest) { matrix m(10,10); for(int i = 0; i < 10; i++) { for(int j = 0; j < 10; j++) { m.setValue(i,j ,i); } } matrix m2(10,10); ...
#include "stdio.h" #include "string.h" main() { char str[30]="****A*B**CD*EF***"; char *p1,*p2,*q; int n; p1=str; while(*p1=='*') p1++; p2=p1; n=strlen(str)-1; q=str+n; while(*q=='*') q--; while(p1<=q) if(*p1!='*') *p2++=*p1++; else p1++; while(*q) *p2++=*q++; *p2='\0';...
#ifndef __PRECOMPILED_H__ #define __PRECOMPILED_H__ #ifdef __cplusplus // RAVEN BEGIN // nrausch: conditional cvar archive flag so that the pc build will archive certain cvars #ifdef _XENON #undef _WINDOWS #define PC_CVAR_ARCHIVE CVAR_NOCHEAT //so it doesn't clobber #else #define PC_CVAR_ARCHIVE CVAR_ARCHIVE #endif...
#include <iostream> #include <string> #include <vector> #include "Room.h" #include "Container.h" #include "../rapidxml/rapidxml.hpp" #include "../rapidxml/rapidxml_utils.hpp" #include "../rapidxml/rapidxml_print.hpp" #include <cstring> using namespace std; using namespace rapidxml; Room::Room(xml_node<> * RoomTag, ve...
#include <cstdio> #include "imp_queue.h" const uint MAX = 100; /*question: * use two stack to implement a queue */ //int main(){ // InitStack(); // for(uint i = 0 ; i < MAX; ++i){ // PushData(i); // } // for(uint i = 0; i < MAX; ++i){ // DATA temp; // PopData(temp); // printf("%d time dequeue %d\n",i,temp); // }...
#pragma once #include "Person.h" class PersonAddressBuilder; class PersonJobBuilder; class PersonBuilder { // This is the object we are building up. Person p; protected: // This is a reference to the object we are building up (defined in the private // section). This will be seen and used by the...
#include<iostream> #include<cstdio> #include<string> using namespace std; int poss() {for (int i) } int main() {freopen("p1116.in","r",stdin); freopen("p1116.out","w",stdout); int t,n; cin >> t; for (int j = 1; j <= t; j++ ) {memset(route,0,sizeof(route)); cin >> n;getchar; for (int i = 1; i <=...
#include <cstdio> #include <iostream> #include <vector> #include <string> #include <stack> #include <unordered_map> #include <unordered_set> #include <queue> #include <algorithm> #define INT_MAX 0x7fffffff #define INT_MIN 0x80000000 using namespace std; vector<string> letterCombinations(string digits){ vector<strin...
/* ########################################################################################### // cNVMe - An Open Source NVMe Device Simulation - MIT License // Copyright 2017 - Intel Corporation // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated document...
/* * httpsession.cc * * Created on: Dec 12, 2012 * Author: suntus * 处理一次请求时所用的操作 */ #include "httpsession.h" HttpSession::HttpSession(int connfd) { fd = connfd; max_fdset = connfd + 1; //设置所监视的描述符的上限 //清空read_set与所有的可读描述符的联系 FD_ZERO(&read_set); FD_SET(fd, &read...
/* * DHT Temperature and humidity monitoring using ESP32 and askSensors Iot service * Description: This examples connects the ESP32 to wifi, and sends Temperature and humidity to askSensors IoT platfom over HTTP GET Request. * Author: https://asksensors.com, 2018 * github: https://github.com/asksensors */ // i...
#ifndef WAY_H #define WAY_H #include "Strategy.h" //Strategy design pattern class Way { public: Way(Strategy* strategy_): m_strategy(strategy_){} ~Way() { if (m_strategy) delete m_strategy; } void setWay(Strategy* strategy_) { if (m_strategy) delete m_strategy; m_strategy = strategy_; } Strategy* getWay...
/** * created: 2013-3-22 23:13 * filename: FKWinFileIO * author: FreeKnight * Copyright (C): * purpose: */ //------------------------------------------------------------------------ #pragma once //------------------------------------------------------------------------ #include "FKBaseDefine.h" #include <vec...
//Using greedy. Time-0.000s #include <bits/stdc++.h> using namespace std; #define ll long long #define vll vector<ll> int main() { ll t,n,ans; string s; cin>>t; for(int i=0;i<t;i++) { cin>>n>>s; cout<<"Case "<<i+1<<": "; ans=0; for(int i=0;i<n;i++) { ...
// Created on: 1995-05-30 // Created by: Xavier BENVENISTE // 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 terms of the ...
#include <stdlib.h> #include <vector> #include <iostream> #include "PrecipitationSystem.h" #define MAX_DENSITY 100 #define RAND (1.0f * rand() / RAND_MAX) PrecipitationSystem::PrecipitationSystem(unsigned int texture_) { texture = texture_; } void PrecipitationSystem::update() { timer++; //Check If...
#include "Field.h" #include "Sight.h" #include "Force.h" #include "Gravity.h" #include "UniversalForce.h" #include "UniversalTorque.h" #include "Object.h" #include "PlayerNeo.h" #include "Gunner.h" #include "MoveEvent.h" #include "CrashEvent.h" #include "ForceEvent.h" #include "Define.h" #include <QTimer> #include...
// Copyright (c) 2017-2018, Karbo developers // // This file is part of Karbo. // // Karbo is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any l...
#ifndef CALLING_CONTEXT_HH #define CALLING_CONTEXT_HH #include <iostream> #include <vector> #include <memory> struct calling_context { mutable std::shared_ptr<std::vector<std::exception_ptr>> exceptions; calling_context() : exceptions(std::make_shared<std::vector<std::exception_ptr>>()) { } calling...
#include "pch.h" #define _USE_MATH_DEFINES #include <math.h> #include <iostream> #include "TerrainGenerator.h" #include <vector> TerrainGenerator::TerrainGenerator(){} double TerrainGenerator::random() { m_Z = (m_A * m_Z + m_C) % m_M; //Give us a number between 0 and 1 //Need to write (double) (at least on one mem...
#ifndef CALGROUP_PANEL_H #define CALGROUP_PANEL_H #include "CalGroupsModel.h" #include "getCalGroupDialog.h" #include <QWidget> #include <QItemSelectionModel> namespace RsaToolbox { namespace Ui { class CalGroupPanel; } class CalGroupPanel : public QWidget { Q_OBJECT public: explicit CalGroupPanel(QWidge...
#pragma once #include <mutex> #include <thread> #include <condition_variable> #include <string> #include <queue> #include <unordered_map> #include <functional> #include <list> #include "message.h" #include "types.h" #include "ipc_medium.h" namespace Petunia { class Petunia { public: explicit Petunia(IPCMedi...
#include<stdio.h> int main(){ int n; long long int ans=1; while(~scanf("%d",&n)){ ans=1; for(int i=0;i<n-2;i++){ ans=(ans%1000000009*3%1000000009)%1000000009; } ans=ans*4%1000000009; printf("%d\n",ans); } }
#pragma once #include <DirectXMath.h> #include <wrl/client.h> // Used for ComPtr - a smart pointer for COM objects #include <vector> #include "DXCore.h" #include "Mesh.h" #include "GameEntity.h" #include "Camera.h" #include "SimpleShader.h" #include "SpriteFont.h" #include "SpriteBatch.h" #include "Lights.h" #include...
#include<bits/stdc++.h> using namespace std; typedef long long ll; main() { ll n; while(cin>>n) cout<<(2*n)-(n/2)<<endl; return 0; }
/*! * \file machinemodel.cpp * \author Simon Coakley * \date 2012 * \copyright Copyright (c) 2012 University of Sheffield * \brief Implementation of machine transition function table */ #include <QtGui> #include <QXmlStreamWriter> #include "./machinemodel.h" State * MachineModel::addState(QString name) { /*s...
//#include <limits.h> #include "../../Polynomial.h" #include "../../SylvesterMatrix.h" #include <gtest/gtest.h> class PolynomialTests : public ::testing::Test { protected: Polynomial * Pol, * Pol2; virtual void SetUp() { double p[3]; p[0] = 5; p[1] = 3; p[2] = 2; Pol = ...
#include <stdio.h> #include <iostream> #include <strings.h> #include <cstring> struct FileReader { FILE* file; int size; int filelen() { fseek(file, 0, SEEK_END); size = ftell(file); rewind(file); return size; } void read(char* *buffer) { file = fo...
/* -*- Mode: c++; tab-width: 4; 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. * * Arjan van Leeuwen (arjanl) */ #include "core/pch.h" #include "adjunct/quick/manag...
#include "add_control_noise.h" // import file to test #include <cmath> #include <sstream> #include <algorithm> #include "configfile.h" #include "typedefs.h" #include "ut.hpp" using namespace boost::ut; using namespace boost::ut::bdd; int main() { "add_noise"_test = [] { // since this is random, it is a bit hard t...
#include <nan.h> #include <string> #include "webp/encode.h" #include "webp/decode.h" #include "./dec/pngdec.h" #include "./dec/jpegdec.h" #include "./dec/imageio_util.h" #include "./encode_worker.hpp" #include "./errors_msg.h" #include "./util.hpp" void FreeMemory(char *data, void *hint); class EncodeWorker : pu...
/*Problem: Faded Palindromes Link: https://www.codechef.com/SEPT16/problems/RESCALC Author: Jono */ #pragma warning(disable:4786) #define _CRT_SECURE_NO_WARNINGS #pragma comment(linker, "/stack:16777216") #include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio(false); #define endl '\n' ...
#include "msg_0xce_scoreboardobjective_stc.h" namespace MC { namespace Protocol { namespace Msg { ScoreboardObjective::ScoreboardObjective() { _pf_packetId = static_cast<int8_t>(0xCE); _pf_initialized = false; } ScoreboardObjective::ScoreboardObjective(const String16& _objectiveName, const String16& _objectiveValu...
//think too long class Solution { public: vector<string> generateAbbreviations(string word) { int len = word.size(); if(len == 0) return {""}; vector<string> abbrs; abbrs.push_back(word); helper(word, "", abbrs, len); return abbrs; } void helper(string w,...
#include "header.h" int main() { srand(time(NULL)); //controls import file format requirements int invalidRowCount = 0; int nounRowSize = 5; int verbRowSize = 9; int adjRowSize = 2; int prepRowSize = 3; //create base import vectors string germanFileLocation = "data_files/germa...
/* SuperBullet.cpp Author: xun liu */ #include "SuperBullet.h" SuperBullet::SuperBullet(Player* player) { Vector2 playerVector = MathUtil::VectorFromAngle(player->GetRotation() + 90.0f); Vector2 pos = player->GetPosition(); pos += playerVector * (player->GetSize().Y * 0.5f); SetPosition(pos)...
#include "mato.hpp" int main(int argc, char *argv[]) { Mato mato; mato.run(argc, argv); }
/* * observable.h * * Created on: Aug 19, 2014 * Author: ushnish * Copyright (c) 2014 Ushnish Ray All rights reserved. */ #ifndef OBSERVABLE_H_ #define OBSERVABLE_H_ namespace measures{ template <class T> class Observable { protected: core::WalkerState<T>& state; string baseFileName; FILE* log; pu...
// // Created by Lee on 2019-04-23. // #include "ImagePool.h" #include "ImageDownloader.h" std::unordered_map<std::string, QPixmap> ImagePool::pixmapPool; bool ImagePool::doesExist(QString uri) { auto iterator = pixmapPool.find(uri.toStdString()); return (iterator != pixmapPool.end()); } void ImagePool::me...
#pragma once #include <unordered_set> template <typename T> class CHSMalloc { public: using TPointer = T*; using TBase = T; private: //解放忘れを防ぐために確保したバッファのポインタを保存する std::unordered_set<void*> AllocSet; HANDLE hHeap; public: CHSMalloc ( ) { hHeap = GetProcessHeap ( ); } ~CHSMalloc ( ){...
#include <cassert> #include <iostream> #include <limits> #include <embree2/rtcore.h> #include <embree2/rtcore_ray.h> #include <glad/glad.h> #include <GLFW/glfw3.h> #include "tbb/tbb.h" #include "FullscreenQuad.h" #include "Material.h" #include "Mesh.h" #include "PPMImage.h" #include "Random.h" #include "Renderer.h" ...
/* * This file is part of OctoMap - An Efficient Probabilistic 3D Mapping * Framework Based on Octrees * http://octomap.github.io * * Copyright (c) 2009-2014, K.M. Wurm and A. Hornung, University of Freiburg * All rights reserved. License for the viewer octovis: GNU GPL v2 * http://www.gnu.org/licenses/old-licen...
#include "ATDFile.hpp" #include "moc_ATDFile.cpp" int main() { Object obj; return 0; }
// Copyright (c) 2007-2017 Hartmut Kaiser // // Part of this code has been adopted from code published under the BSL by: // // (C) Copyright 2006-7 Anthony Williams // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or cop...
#include "OurLand.h"
/************************************************************* Programm listen localhost:1112 *************************************************************/ #include <stdio.h> #include "sys/types.h" #include "sys/socket.h" #include "netinet/in.h" int set_nonblock(int fd) { int flags; #if defined(O_NON...
#include <cstdlib> #include <iostream> #include <fstream> #include <cmath> #include <ctime> #include <string> #include <mpi.h> using namespace std; int main(int argc, char *argv[]) { /*<trace_folder>*/ if (argc != 2) { cerr << ">Unexpected quantity of arguments, check your comand string." << endl...
// O(m+n) m-num of row, n- num of col // We can rule out one row or one column each time, so the time complexity is O(m+n). class Solution { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { if(matrix.size() == 0 || matrix[0].size() == 0) return false; //from top right corner ...
#include "clientequeue.h" #include <cstddef> ClienteQueue::ClienteQueue() { //ctor this->start = NULL; this->end = NULL; } ClienteQueue::~ClienteQueue() { //dtor this->free(); } Cliente* ClienteQueue::retrieve() { if (!start) return NULL; Cliente* value = star...
#include <iostream.h> /* * ¶ÓÁнṹ * */ const static int QUEUE_SIZE = 13; class Queue { public: Queue(void) { Construct(); } virtual bool Construct(void); bool In(int); int Out(void); bool IsEmpty(void) const; bool IsFull(void) const; virtual ~Queue(); private: int* queue; int rear, front; bool empt...
/*! * \file Main.cpp * \brief Main file * \author Pierre-Jean Besnard & Louis Billaut * \version 1.0 */ #include <stdio.h> #include <iostream> #include <vector> #include <GL/glut.h> #include "include/CLI11.hpp" #include <fstream> #include <string> #include <jsoncpp/json/json.h> #include "Raytracer.h" int H = 1024...
#pragma once class BoundingSphere { vec4 _center; GLfloat _radius; public: BoundingSphere(void); BoundingSphere(vec4 center, GLfloat radius){ _center = center; _radius = radius; }; ~BoundingSphere(void); vec4 getPos(){ return _center; }; float getRadius(){ return _radius; }; void setPos(vec4 cent...
#include <DxLib.h> #include "Config.h" #include "Resource.h" Resource* Resource::GetInstance() { static Resource res; return &res; } void Resource::Load() { //if (AddFontResource("resources/font/wlcmaru2004emojip.ttf") <= 0) { // MessageBox(NULL, "Font Load Failed.", "", MB_OK); //} //Font = CreateFontToHandle...
#include <iostream> #include <cstdio> using namespace std; int main() { int n; while (cin >> n) { int m; int cnt = 0; for(int i = 0; i < n; i++) { cin >> m; cnt ^= m; } if(cnt == 0) printf("second\n"); else printf("first\n"); } return 0; }
#include <iostream> using namespace std; char ch; void printPatternTRAIN() { cout << "\n"; for (int i = 0; i < 8; i++) { //for t cout << " "; for (int t = 0; t < 8; t++) { if (i < 2 && t < 8) { cout << ch; } if (i > 1 && t < 3) { cout << " "; } if (i > 1 && t > 2 && t < 5) { ...
// // Created by biega on 24.03.2018. // #include <stddef.h> #include "objectmap.h" int ObjectMap::getSize() { return objsize; } ObjectMap::ObjectMap() { objsize=0; } Tile ***ObjectMap::getObjMap() { return objectmap; }
#pragma once #include "Shape.h" class Circle : public Shape { public: Circle(int xx, int yy, int rr); virtual void show(); private: int r; };
#include <cstdio> using namespace std; long long a,b; int main() { scanf("%lld %lld",&a,&b); printf("%lld\n%lld",b,a); }
#include <cstdio> #include <iostream> #include <vector> #include <string> #include <stack> #include <unordered_map> #include <unordered_set> #include <queue> #define INT_MAX 0x7fffffff #define INT_MIN 0x80000000 using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : va...
#include <iostream> using std::cout; using std::cin; using std::endl; #include <vector> using std::vector; int main() { int i; vector<int> v; while(cin>>i) { v.push_back(i); } auto it1 = v.begin(); auto it2 = v.end(); it2--; for(; it2 >= it1; it1++, it2--) { i...
// // AcidHeader.h // SRXvert // // Created by Dennis Lapchenko on 11/05/2016. // // #ifndef ACIDHEADER_H_ #define ACIDHEADER_H_ #include "AcidUtils.h" #include "AcidAudioBuffer.h" #include "AcidAudioBufferSource.h" #include "AcidResampler.h" #include "AcidGranulator.h" //#include "../JuceLibraryCode/JuceHeader.h...
#include "Globals.h" #include "Application.h" #include "ModuleRender.h" #include "ModuleTextures.h" #include "ModulePlayer.h" #include "ModuleInput.h" #include "ModuleFadeToBlack.h" #include "ModuleParticles.h" #include "ModuleAudio.h" #include "ModuleSceneWater.h" #include "ModuleWelcomeScreen.h" #include "ModuleEnem...
#include <cstdio> #include <iostream> #include <vector> #include <string> #include <stack> #include <unordered_map> #include <unordered_set> #include <queue> #include <algorithm> #define INT_MAX 0x7fffffff #define INT_MIN 0x80000000 using namespace std; bool isCross(int x1,int y1,int x2, int y2){ if(x1 == x2 || y1 ...