text
stringlengths
8
6.88M
#include "../include/Map.h" #include "../include/GameScene.h" #include "../include/Camera.h" #include "../include/TextureManager.h" #include "../include/EnemyManager.h" #include "../include/EventManager.h" #include "../include/ItemManager.h" #include "../include/Item.h" #include "../include/ShotEnemy.h" #include "../in...
/* Copyright (c) 2015, Vlad Mesco All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the follo...
// -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- /* Strings referenced in adjunct/m2_ui/. * * Comment lines of both forms valid in C++ are ignored. Preprocessor * directives are allowed: the #if-ery around each string tag should reflect the * #if-ery around its use in the indicated file(s). Strings tags may...
#ifndef CONFIGURATIONREADERTEST_H #define CONFIGURATIONREADERTEST_H #include <QTemporaryFile> #include "AutoTest.h" namespace common { namespace util { namespace tests { class ConfigurationReaderTest : public QObject { Q_OBJECT public: ConfigurationReaderTest(); private Q_SLOTS: void initTestCase(); ...
#include <stdlib.h> #include <tuple> class Player; class Room; class Tile { private: bool empty; bool wall; public: Tile(bool e, bool w); bool isWall(); bool isEmpty(); char represent(); }; typedef Tile * TilePtr ; class World { private: int width; ...
#include <math.h> double gauss(double m,double mr,double sigma) { return(exp(-pow(m - mr,2)/(2 * pow(sigma,2)))); }
#include<iostream> #include<cmath> using fptr = double(double); double f(double x); double gaussian(double x); double deriv(double x); double bisection( double xl, double xu, double eps, fptr fun ); double newton(double x0, double eps, fptr fun, fptr fderiv); int main(int argc, char **argv) { double xl=-1.0; dou...
#include <iostream> #include <cstdlib> #include "Scan.h" #include "Source.h" #include "Parser.h" using namespace std; int Trace::call_level = 0; int Trace::trace_on = 0; int Trace::show_symbols = 0; int options = 0; int main(int argc, char* argv[]) { if (argc < 2) { cout << "Niewystarczajace argumenty wykonania...
#pragma once #define MAX_NUM_GUN 3 class Health; namespace Hourglass { class Entity; class Transform; } class PlayerComp : public Hourglass::IComponent { public: virtual int GetTypeID() const { return s_TypeID; } void LoadFromXML( tinyxml2::XMLElement* data ); virtual void Init(); virtual void Start(); virtu...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "10192" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) int main(int argc, char const *argv[]) { #ifdef DBG freopen("uva" PROBLEM TESTC ".in", "r", stdin); freopen("uva" PROBLEM ".out", "w", stdout); #endif string one,...
#include <cstdlib> #include <cstdio> using namespace std; int main() { // for (int i = 8;i <= 10; ++i) // for (int j = 2;j <= 4;++j) // for (int k = 2;k <= 4;++k) // { // char command[233]; // sprintf(command, "mkdir %d_%d_%d", i, j, k); // system(command); // } for (int i = 8;i <= 10; ++i) ...
#include "Raycaster.h" #include "Renderer/Renderer.h" std::vector<ColliderComponent*> current_colliders = std::vector<ColliderComponent*>(); // Only returns normal opposite of direction bool raycast(glm::vec2 from_position, glm::vec2 direction, float distance, RaycastHit& hit) { for (int i = 0; i < current_collider...
#include <iostream> using namespace std; int signInversion(int a){ int sign = a > 0 ? 1 : -1; int delta = sign; int res = 0; while(a != 0){ bool diffSign = (a + delta > 0) != (a > 0); if(a + delta != 0 && diffSign){ delta = sign; } res += delta; a += ...
//Calculate the differences and return if is a valid region bool indel_find_valid(float value1, float value2, float min_cover, float threshold) { //Calculate the first difference float diff1 = (value2 != 0) ? value1 / value2 : 1; //Calculate the second difference float diff2 = (value1 != 0) ? value2 / value1 :...
#ifndef CARD_H #define CARD_H #include <cstdlib> #include <iostream> using namespace std; class Card{ private: int suit; int rank; public: string get_card_suit(); int get_card_rank(); void set_card_suit(string); void set_card_rank(int); }; #endif
#pragma once #define PHNT_MODE PHNT_MODE_KERNEL #define PHNT_VERSION PHNT_THRESHOLD #include <ntifs.h> #include <phnt.h> #include <cstddef> #include <cstdint> #include "nt/memory.h" #include "nt/portable_executable.h" #include "nt/reference.h" namespace nt { void* kernel_base_address(); std::size_t kernel_base...
/* leetcode 136 * * * */ #include <string> #include <unordered_set> #include <algorithm> using namespace std; class Solution { public: int singleNumber(vector<int>& nums) { int ans = 0; for (auto i:nums) { ans = ans ^ i; } return ans; } }; /*********************...
#include "inilib.h" int main(int argc, char **argv) { ///> н¨xml INI::registry reg("c:\\1.ini"); reg["section1"]["user"] = "siren1"; reg["section1"]["email"] = "siren186@163.com"; reg["section2"]["user"] = "siren2"; reg["section2"]["date"] = "2014-05-12"; reg.file_write(); return 0...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2005 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef SVG_ANIMCONTEXT_H #define SVG_ANIMCONTEXT_H #ifdef S...
#include "testApp.h" #include "omp.h" //-------------------------------------------------------------- void testApp::setup(){ ofSetLogLevel( OF_LOG_ERROR ); ofSetVerticalSync( true ); ofSetFrameRate( 60 ); ofSetTextureWrap( GL_REPEAT ); TIME_SAMPLE_SET_FRAMERATE( 30.0f ); TIME_SAMPLE_SET_DRAW_LOCATI...
#include <iostream> using namespace std; //for print function of list struct Node { int data; Node *left, *right; }; //a recursive function for converting a binary tree into a sorted linked list //uses the root of the tree and the head pointer of list void treeSorter(Node* root, Node** head_ref) { // base case ...
/* * SOCCERV3.c * * Created: 2017-010-02 * Author: JEON HAKYEONG (전하경) * * History * * 2017-10-02 * Migration From AtmelStudio. * */ //카메라 유무 설정 //#define CameraExist true //카메라가 있음. #define CameraExist false //카메라가 없음. // // 키 입력 값 // #define ENTER (~PINB & 0x40) //ENTER KEY 입력 값 #define PREV (...
#ifndef __CHIDOUHU_CONCURRNECY_MUTEX_H__ #define __CHIDOUHU_CONCURRNECY_MUTEX_H__ #include <pthread.h> namespace chidouhu { class MutexLock { public: MutexLock(); ~MutexLock(); void lock(); int trylock(); void unlock(); pthread_mutex_t* getPthreadMutex(); private: pthread_mutex_t mutex_;...
#pragma once #include <sys/ioctl.h> #include <cstdint> class I2CDevice { public: I2CDevice(int busFileDescriptor, int address); bool Write(const uint8_t* data, uint16_t dataSize); bool Read(uint8_t* data, uint16_t dataSize); private: int _busFileDescriptor; };
//矩阵乘法 logn求fib数列第n项 POJ 3070 #include<iostream> #include<queue> #include<vector> #include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> #define mod 10000 using namespace std; struct Matrix{ int num[2][2]; }; int n; Matrix operator *(const Matrix &a,const Matrix &b){ Matrix res={0,0,...
#include <iostream> #include <string> #include <cstring> #include <sstream> #include <vector> #include <algorithm> #include <iterator> #include <fstream> //files #include <errno.h> //errors #include <stdio.h> //printf #include <unistd.h> // sys calls #include <sys/types.h> // O_ constants #include <sys/ipc.h> // IPC...
#include"QInt.h" #include"Convert.h" QInt::QInt(){ for (int i = 0; i < LENGTH; i++) { data[i] = 0; } } QInt& QInt::operator =(unsigned int x) { for (int i = 0; i < 3; i++) { data[i] = 0; } data[3] = x; return *this; } QInt& QInt::operator~() { QInt res; for (int i = 0; i < LENGTH; i++) { res.data[i]...
#include "Classifier.hpp" Classifier::Classifier(int processorId, Conf &cfg) : ConfigReader(processorId, cfg) { }
#include "Fence.hpp" Elysium::Graphics::Fence::Fence(GraphicsDevice * GraphicsDevice) : Elysium::Core::Object(), _WrappedGraphicsDevice(GraphicsDevice->_WrappedGraphicsDevice), _WrappedFence(_WrappedGraphicsDevice->CreateWrappedFence()) { } Elysium::Graphics::Fence::~Fence() { // delete all the objects we ...
#include "stdafx.h" #include "Main.h" Main::Main(const int width, const int height) : width(width), height(height), size(width*height*4), PixelArray(PixelData(width, height)) { PixelArray.addSeed(0, 0, 130); PixelArray.addSeed(0, height-1, 130); PixelArray.addSeed(0, height-1, 130); PixelArray.addSeed(width-1, he...
#ifndef __SANDBOX_WRAP_H__ #define __SANDBOX_WRAP_H__ #include <nan.h> #include <vector> #include "sandbox.h" class SandboxWrap : public Nan::ObjectWrap { friend class SandboxInitializeWorker; friend class SandboxExecuteWorker; friend class SandboxFinalizeWorker; public: static void Init(v8::Local<v8::Object...
// Copyright (c) 2007-2021 Hartmut Kaiser // Copyright (C) 2011 Vicente J. Botet Escriba // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #pragma once #include <cstddef> ...
#pragma once class AI_FireLaser : public Hourglass::IAction { public: void LoadFromXML( tinyxml2::XMLElement* data ); void Init( Hourglass::Entity* entity ); IBehavior::Result Update( Hourglass::Entity* entity ); IBehavior* MakeCopy() const; private: hg::Transform* m_Laser; float m_Timer; float m_Duratio...
// Fill out your copyright notice in the Description page of Project Settings. #include "S05_TestingGrounds.h" #include "PatrolLoop.h" TArray<AActor*> UPatrolLoop::GetPatrolRoute() const { return PatrolRoute; }
// Jakins, Christopher // cfj2309 // 2019-10-05 #include <iostream> using namespace std; int main( int argc, char *argv[] ) { // Put an output statement here that prints "Hello, world!" // followed by a newline. std::cout << "Hello, world!" << std::endl; }
/* * Copyright (c) 2014-2019 Detlef Vollmann, vollmann engineering gmbh * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) */ #include "canvas.hh" #include "pathShape.hh" #include "rectangle.hh" #include "text...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- // // $Id$ // // Copyright (C) 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" #include "opml.h" #include "adjunct/m2/src...
// // Car.cpp // w06_h02_pathfollow // // Created by Kris Li on 10/13/16. // // #include "Car.hpp" Car::Car(){ size = 5; } void Car::init(){ pos.x = ofRandom(50,150); pos.y = ofRandom(250,350); vel = ofPoint(ofRandom(-3,3),ofRandom(-3,3)); } ofPoint Car::seek(ofPoint _end){ ofPoint desi...
#include "stdafx.h" #include "TypeInQuestion.h" #include "utils.h" namespace qp { CTypeInQuestion::CTypeInQuestion(std::string const& description, std::set<std::string> const& answers, double score) :CQuestion(description, score) { for (auto answer : answers) { std::string answerWithoutExtraSpaces =...
/* Copyright (c) DataStax, Inc. 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, so...
/* Author: Manish Kumar Username: manicodebits Created: 20:19:31 10-06-2021 */ #include <bits/stdc++.h> using namespace std; #define int long long #define PI 3.141592653589 #define MOD 1000000007 #define FAST_IO ios_base::sync_with_stdio(false), cin.tie(0) #define deb(x) cout << "[ " << #x << " = " << x << "...
#include<iostream> #include<vector> using namespace std; //luon luon co tham chieu moi chay duoc vi moi dau la rac thi minh muon them thi phai dan de cho no chuyen doi void nhap(vector<int> &a) { for(int i=1;i<=10;i++) { a.push_back(i); } } //xuat theo kieu binh thuong void exportnormal(vector<int> ...
#ifndef __DECISIONTREE_H__ #define __DECISIONTREE_H__ #include "dtreetypedefs.h" #include <vector> #include <set> #include "discretize.h" #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include "treenode.h" class DecisionTree{ public: Decis...
/* * Tool Assist with Arduino * Copyright (C) 2015 Gabriel Aumala * * 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 2 of the License, or * (at your option) any later versio...
#include <stdio.h> int main(){ int math = 90; int korean = 95; int english = 96; int sum = math + korean + english; // 여기서 순간적으로 sum 은 실수가 된다. double avg = (double)sum / 3; printf("%f\n", avg); }
#include "qifunctionmanager.h" namespace qEngine { /************************* qIFunctionManager::qIFunctionManager ************************** description: Constructor, reserves space for the function vectors access: public ------------------------------------------------------------------------------------------ ...
/* Problem => Given an unsorted array A of size N of non-negative integers, find a continuous subarray which adds to a given number S. Brute Force: @ Find sum of all possible subarryas, If any of the sum equates to S, output the starting and ending index of the Subarray. @ Time complexity: O(n^2) */ ...
// // Created by Zakhar on 08.03.2017. // #include <cmath> #include <iostream> #include "CentroidDecomposition.h" #include "Auxiliary.h" namespace Algorithms { // // CentroidDecomposition constructors & desctructors // CentroidDecomposition::CentroidDecomposition(arma::mat &mx) : Src(mx), Load(mx.n...
/**************************************** @_@ Cat Got Bored *_* #_# *****************************************/ #include <bits/stdc++.h> #define loop(i,s,e) for(int i = s;i<=e;i++) //including end point #define pb(a) push_back(a) #define sqr(x) ((x)*(x)) #define CIN ios_base::sync_with_stdio(0); cin.tie(0); #d...
#include "CCamera.h" CCamera &TheCamera = *(CCamera *)0xB6F028; float& CCamera::m_fMouseAccelVertical = *(float *)0xB6EC18; float& CCamera::m_fMouseAccelHorzntl = *(float *)0xB6EC1C;
#ifndef __ARRAY_QUEUE_H__ #define __ARRAY_QUEUE_H__ #include <iostream> template <class T> class ArrayQueue { public: ArrayQueue(); ~ArrayQueue(); void Add(T value); T Front(); T Pop(); int Size(); bool IsEmpty(); private: T *arr; int count; protected: int MAXSIZE; }; template <class T> ArrayQueue<T>::...
#include "smithers.h" #include "player_utils.h" #include <zmq.hpp> #include <m2pp.hpp> #include <json/json.h> #include <iostream> #include <sstream> #include <random> #include <algorithm> namespace { std::string gen_random_string(const size_t len) { char s[len]; static const char alphanum[] = "...
class Solution { public: bool isOneEditDistance(string s, string t) { int l1 = s.length(), l2 = t.length(); if(abs(l1-l2) > 1) return false; bool flag = false; if(l1 == l2){ for(int i = 0; i < l1; ++i){ if(s[i] != t[i]){ if(!flag) flag ...
#include <iostream> #include <vector> #include "TextPosition.h" using namespace std; size_t findDistanceBetweenPositions(vector<string> const& text, TextPosition pos1, TextPosition pos2) { size_t dist = 0; for (size_t i = 0; i < size(text); i++) { for (size_t j = 0; j < size(text.at(i)); j++) { TextPositio...
// Tom Koole // 2011-11-18 // Project Euler #17 // ugly but it works #include <stdio.h> #include <stdlib.h> #include <string> // ascii value #define ZERO 48 std::string lookUp(int i); int main() { std::string words = ""; for(int i = 1; i <= 1000; i++) { std::string word = lookUp(i); words += word; } printf...
#pragma once #include "common.h" #include "streams/streams.h" #include <string> #include <vector> NAMESPACE_BEGIN(NAMESPACE_BINTABLE) class BaseOperation { public: std::string operation_type; virtual void operator()() = 0; virtual ~BaseOperation() = default; }; class NoOperation : public BaseOperation ...
#pragma once #include "tool.h" #include "glm.hpp" #include "GL/glew.h" class ShaderProgram; class PointLightTool : public VRTool { public: PointLightTool(); ~PointLightTool(); bool init() override; void shutdown() override; void activate() override; void deactivate() override; void update( float dt ) overri...
#include<iostream> #include"time.h" Time operator-(const Time &time1,const Time&time2){ Time tmp; tmp.secondintotal=time1.secondintotal-time2.secondintotal; tmp.hour=tmp.secondintotal/3600; tmp.minute = (tmp.secondintotal-tmp.hour*3600)/60; tmp.second = tmp.secondintotal%60; return tmp; } bool ...
/* * Copyright (C) 2013 Tom Wong. All rights reserved. */ #ifndef __GT_DOC_NOTE_H__ #define __GT_DOC_NOTE_H__ #include "gtdocrange.h" GT_BEGIN_NAMESPACE class GtDocNoteMsg; class GT_BASE_EXPORT GtDocNote : public GtObject { public: enum NoteType { InvalidNote, Highlight, Underline ...
#include <iostream> #include <map> #include <string> #include <vector> #include <algorithm> #include <functional> #include <errno.h> #include <sstream> using namespace std; #define MAX 99999 class FloorBoards { public: int addLine(int now,int prev,int obs,int sizeX) { int cnt = 0; bool isHorizon = false; fo...
#include "SnowPlane.h" SnowPlane::SnowPlane( ae::Texture& _HeightMap, ae::Texture& _NormalMap, float _Size, Uint32 _SubdivisionWidth, Uint32 _SubdivisionHeight ) : ae::PlaneMesh( _Size, _SubdivisionWidth, _SubdivisionHeight ), m_Shader( "../../../Data/Projects/Snow/SnowVertex.glsl", "../../../Data/Projects/Snow/Snow...
/********************************************************************** ** Description: This function uses a pointer to accept the address of an array of int and the umber of elements in the array is passed as a seoarate integer parameter. The function asks the user dynamically allocate an array that is twice as long...
/* * LSST Data Management System * Copyright 2014-2015 AURA/LSST. * * 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 published by * the Free...
#ifndef PLAYER_H #define PLAYER_H #include "hand.h" using namespace std; /****************************************************** ** Class: Player ** Purpose: A class to hold all of the relevant ** variables that make up a player object, as well as ** all of its necessary functionality. ******************************...
#pragma once #include <qwidget.h> #include "HandlerButton.h" class UtilitiesLabel : public QWidget { public: UtilitiesLabel(); };
#include <bits/stdc++.h> using namespace std; string ltrim(const string &); string rtrim(const string &); vector<string> split(const string &); /* * Complete the 'minimizeMeetingCost' function below. * * The function is expected to return an INTEGER. * The function accepts following parameters: * 1. INTEGER N ...
#ifndef GUNNER_H #define GUNNER_H #include "Player.h" class Object; class Gunner : public Player { public: Gunner(const char*, const char*); Gunner(const Gunner&); virtual void update(void); Object* fire(void); void trigger(Vector); void rotateBullet(Vector); char whichClass(void); private: Object* modelBu...
#include <iostream> #include <sstream> #include <cstdlib> #include <cstdio> #include <vector> #include <queue> #include <deque> #include <stack> #include <list> #include <map> #include <iomanip> #include <set> #include <climits> #include <ctime> #include <complex> #include <cmath> #include <string> #in...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2006 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(SVG_SUPPORT) && defined(SVG...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Luca Venturi ** ** This class is the implementation of a contex...
#include <bits/stdc++.h> using namespace std; #define endl '\n' typedef pair<int,int> pii; typedef long double ld; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; const int maxn=10000005; const int INF=0x3f3f3f3f; const double pi=acos(-1.0); const double eps=1e-9; t...
// Copyright 2011 Yandex #include <limits> #include <vector> #include "ltr/data/utility/data_set_statistics.h" using std::fill; using std::max; using std::min; using std::numeric_limits; namespace ltr { namespace utility { template <typename TElement> void getFeaturesMinMaxValues(const DataSet<TElement>& dataset, ...
/*! \file */ //Copyright 2011-2016 Tyler Gilbert; All Rights Reserved #ifndef STRING_HPP_ #define STRING_HPP_ #include <iface/link.h> #include <cstring> #include <cstdlib> #include <cstdio> #include "Data.hpp" #include "StringUtil.hpp" namespace var { /*! \brief String class * \details This is an embedded friend...
#include "NameLabel.h" using namespace RsaToolbox; /*! * \class RsaToolbox::NameLabel * \brief The %NameLabel class handles identifiers that include * both a name and a label. * * %NameLabel is primarily a data type for resources that * have both a name and a label as identifiers. For example, * a Vector Netwo...
# include<iostream> # include<cmath> using namespace std; int convert(int n,int sB) { int pwr = 0,sum = 0,d = 0; while(n > 0) { d = n % 10; n = n / 10; sum = sum + d * pow(sB,pwr); pwr = pwr + 1; } return sum; } int getBase(int num) { int base = 0; while(num > 0) { base = max(base,num % 10); num /=...
#include "stdafx.h" #include "editor.h" #include "frame.h" const TCHAR *EditorHost::ClassName = TEXT("EditorHost"); EditorHost::EditorHost(MainFrame& frame) : frame_(frame) { } bool EditorHost::Create(LPCSTR lpWindowName, int x, int y, int width, int height, Window *parent) { DWORD dwExStyles...
#pragma once namespace qp { class CQuestionReview; }
#include <stdio.h> #include <stdlib.h> #include <iostream> using namespace std; void printArray(int arr[], int n); bool isSwap(int arr[], int prev, int next) { return (arr[prev] > arr[next]) ? true:false; } int almostBinarySearch(int arr[], int start, int end, int X) { if (end > start) { int middle = start + (e...
#ifndef FAHRZEUG_H_ #define FAHRZEUG_H_ #include <string> #include <iostream> extern double dGlobaleZeit; class Fahrzeug{ protected: double p_dGesamtStrecke; double p_dGesamtZeit; double p_dGeschwindigkeit; double p_dMaxGeschwindigkeit; public: Fahrzeug(); Fahrzeug(std::string); ...
#include "elog/formatters/colored_formatter.hpp" #include "elog/severity.hpp" #include <iomanip> #include <sstream> namespace elog { ColoredFormatter::ColoredFormatter() { } ColoredFormatter::~ColoredFormatter() { } std::string ColoredFormatter::format(const Record& record) { std::stringstream l...
// // Created by abel_ on 04-07-2022. // #include <bits/stdc++.h> using namespace std; class Heap{ public: int arr[100]; int size; Heap(){ size = 0; arr[0] = -1; } void insert(int value) { size = size + 1; int index = size; arr[index] = value; whil...
#pragma once #include <SoundAssetId.h> #include <MusicAssetId.h> namespace irrklang { class ISoundEngine; } namespace breakout { class AudioManager { public: static AudioManager& Get(); void PlaySound(ESoundAssetId soundId); void PlayMusic(EMusicAssetId musicId); private: AudioManager(); ~AudioMan...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * LispC Expression base class * A Scheme expression is composed of LISTS and ATOMS * LIST is vector * ATOM is a Number or a Symbol (string) * LAMDA is a function bound to an environment * * * * * * * * * * * * * * * * * * * * * * *...
//Accepted. Time-0.180s #include <bits/stdc++.h> using namespace std; #define ll long long #define vll vector<ll> int main() { ll n,q,t,a; t=0; while(cin>>n>>q) { if(n==0 && q==0) break; t++; cout<<"CASE# "<<t<<":\n"; vll v; vll:: iterator it; for(ll i=...
#include<bits/stdc++.h> using namespace std; using ll=long long; #define maxn 5005 int n,s,e; int nextl[maxn]; ll ans; ll a[maxn],b[maxn],c[maxn],d[maxn],x[maxn]; ll dis[maxn][maxn]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cin>>n>>s>>e; for(int i=1;i<=n;i++) cin>>x[i]; ...
#include "MySolution1.h" #include <fstream> #include <cstdio> #include <vector> #include <ctime> #include <limits> #include <iomanip> using namespace std; int main(){ CreateTest(1); int NumberOfQueries; vector<int> arr; int operation; int lenght; long long MyRSQValue, StupidRSQValue; int index, newValue, be...
#include "Zoom.h" #include "..\ApplicationManager.h" #include "..\GUI\Input.h" #include "..\GUI\Output.h" #include <sstream> using namespace std; //constructor: set the ApplicationManager pointer inside this action Zoom::Zoom(ApplicationManager *pAppManager,char c):Action(pAppManager) { type=c; } void Zoom::ReadAc...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2009 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 HAS_SET_HTTP_DATA #include "modules...
#include "camera.h" #include "window.h" std::weak_ptr<entity> camera::_current; std::weak_ptr<entity> camera::get_current() { return _current; } void camera::set_current(std::weak_ptr<entity> cam) { _current = cam; } camera::camera(): _fov(glm::radians(90.0f)), _near(0.1f), _far(1000.0f) { ...
#include "fenetrejeu.h" #include "skull.h" #include "boss.h" #include "collisionmanager.h" #include <qdir.h> #include <string> #include <iostream> #include <sstream> using std::string; using namespace sf; using std::stringstream; FenetreJeu::FenetreJeu(VideoMode vid, string title, Character character, string file, st...
#include <iostream> #include <fstream> void printContentsOfFile() { std::string line; std::ifstream myFile("data.txt"); if (myFile.is_open()) { while (getline(myFile, line)) { std::cout << line << std::endl; } myFile.close(); } else { std::cout << "Unable to open...
/* -*- 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. */ #ifndef DOM_EXTENSIONS_TABAPICACHEDOBJECT_H #define DOM_EXTENSIONS_...
#include "msg_0xfc_encryptionkeyresponse_tw.h" namespace MC { namespace Protocol { namespace Msg { EncryptionKeyResponse::EncryptionKeyResponse() { _pf_packetId = static_cast<int8_t>(0xFC); _pf_initialized = false; } EncryptionKeyResponse::EncryptionKeyResponse(const ByteArray& _sharedSecret, const ByteArray& _ver...
/* * File: JsonListModel.h * Author: jay * * Created on March 26, 2014 */ #ifndef JSONLISTMODEL_H #define JSONLISTMODEL_H #include <QAbstractListModel> #include <QStringList> #include <QJsonDocument> class QJsonListModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY( QJsonDocumen...
#include<bits/stdc++.h> using namespace std; struct TreeNode { int val; TreeNode* left, *right; TreeNode():val(0),left(nullptr),right(nullptr) { } TreeNode(int x): val(x),left(nullptr), right(nullptr) { } TreeNode(int x, TreeNode* left, TreeNode* right): val(x),left(left),right(right) { } }; class Solution ...
/* https://www.codechef.com/FEB16/problems/CHEFDETE/ */ #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int t; cin >> t; vector<int> vec(t); vector<int> vec_str(t); for(int i=0; i<t; i++) { vec_str[i] = i + 1; } for(int i=0; i<t; i++) { cin >> vec[i]; if(ve...
#ifdef __cplusplus #define __STDC_LIMIT_MACROS #define __STDC_FORMAT_MACROS #include <minisat/core/Solver.h> #include <minisat/utils/System.h> using namespace Minisat; typedef Solver *solver; typedef vec<Lit> *vect; #else typedef void *solver; typedef void *vect; #endif #ifdef __cplusplus extern "C" { #endif vect mi...
/* -*- 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" #include "modules/encodings/decoders/utf8...