text
stringlengths
8
6.88M
#include <iostream> #include <vector> using namespace std; int partition(vector<int>& A, int left, int right, int who) { for (int i=left; i<right; ++i) { if (A[i] <= who) { swap(A[i], A[left]); left ++; } } return left - 1; } void quicksort(vector<int>& A, int left, int right) { if (left...
/** * A simple defragmentation program for a simulated file system. */ #include "Kernel.h" #include "DirectoryEntry.h" #include "Stat.h" #include <stdlib.h> #include <string.h> #define BUF_SIZE 4096 #define OUTPUT_MODE 0700 int main(int argc, char ** argv) { char PROGRAM_NAME[8]; strcpy(PROGRAM_NAME, "defrag"); ...
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */ #include "core/pch.h" #include "modules/ecmascript/carakan/src/es_pch.h" #include "modules/ecmascript/carakan/src/kernel/es_box.h" #include "modules/ecmascript/carakan/src/util/es_hash_table.h" static inline u...
#include "PropSystem.h" static PropSystem* _propSystem = NULL; PropInfo::PropInfo(const rapidjson::Value &json) { m_propNumber = json["ID"].GetInt(); m_iconNumber = json["Icon"].GetInt(); m_avatarNumber = json["AvatarID"].GetInt(); m_propName = json["Name"].GetString(); m_propType = json["Type"].GetInt(); m_dep...
//--------------------------------------------------------------------------- #ifndef shortcutsH #define shortcutsH //--------------------------------------------------------------------------- #include <Classes.hpp> #include <Controls.hpp> #include <StdCtrls.hpp> #include <Forms.hpp> #include <ComCtrls.hpp> #include ...
#ifndef FILE_IO_H #define FILE_IO_H #include "Common.h" #include "SupportVectorMachine.h" #include "Feature.h" #include "Detection.h" void saveToFile(const std::string &filename, const SupportVectorMachine &svm); void loadFromFile(const std::string &filename, SupportVectorMachine &svm); void saveToFile(const std::st...
// File: key.cpp // Written by Joshua Green #include "shared/fileio/fileio.h" #include "shared/db/db.h" #include "shared/str/str.h" #include <vector> #include <map> #include <string> #include <iostream> #include <process.h> #include <windows.h> using namespace std; const column TRANS_DATE_COL = column...
#include<cstdio> #include<cstring> #include<complex> #include<cmath> #include<algorithm> #define MAXN 263010 #define EPS 1e-8 using namespace std; typedef complex<double> cp; const double pi = acos(-1.0); char s1[MAXN],s2[MAXN]; cp x1[MAXN],x2[MAXN]; cp t1[MAXN],t2[MAXN]; cp x3[MAXN]; int ans[MAXN]; int n,m; void ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef DEFAULT_QUICK_BINDER_H #define DEFAULT_QUICK_BINDER_H #i...
/* File: WidgetApp.c (Based on BasicRAEL from CarbonSDK) Demonstrate getting Opera 7.2 up and running as a Widget from a CFM-based host application. */ #ifdef __MACH__ #include <Carbon/Carbon.h> #else #include <Carbon.h> #endif #include "WidgetApp.h" #include "OperaControl.h" #include "WidgetAppEvents.h" // Glob...
#include <iostream> #include <boost/filesystem.hpp> #include "lib/StreamSampler/StreamSampler.h" int main(int argc, char *argv[]) { const auto sample_sets_count = std::size_t {1}; const auto sample_count = std::size_t {1}; const auto source_dir = argc > 1 ? argv[1] : "."; if (boost::filesystem::exists(source_dir))...
#pragma once #include "../entity/entity.h" #include "../Components/Transform.h" #include "../Components/Renderer.h" class duiElement : public Entity { public: duiElement(void); virtual ~duiElement(void); virtual void Init(); virtual void Update(); Transform tf; Renderer render; void SetFocus(bool val); voi...
#include <iostream> #define validation \ while (std::cin.fail() || 0 >= size) { \ std::cout << "Invalid Value: Try again!" << std::endl; \ std::cin.clear(); \ std::cin.ignore(256,'\n'); \ std::cout << "Enter intager number( > 0): "; \ std::cin >> size; \ } #define inpu...
#include <iostream.h> #include <malloc.h> #include <math.h> #include <stdlib.h> #include <stdio.h> void initiarray( ); void initiones(); void display( float *r); void solve(); void backloop(); static float *p,*q; int N; void main() //利用要求矩阵和单位矩阵一起行变化,当要求矩阵成为单位矩阵时 { // 单位矩阵变成其逆矩阵 printf("...
typedef unsigned int addr_t; #include "guest.h" #include <stdlib.h> #include <stdio.h> //#include "arm_cpu.h" void guest_print_string(const char* str) { FILE* fd = fopen("C:\proc.txt", "a"); fwrite( str, strlen(str) + 1, 1, fd); fflush(fd); fclose(fd); printf("GUEST SAYS: %s\n", str); } int guest_abort(...
#include<iostream> #include <cmath> #include <cstdlib> using namespace std; int n, cnt=0; int *col; bool promissing(int i) { int k; bool sw; k = 1; sw = true; while (k < i && sw) { if (col[i] == col[k] || i - k == abs(col[i] - col[k])) sw = false; k++; } return sw; } void queen(int i) { int j; if (p...
#include "LandruActorVM/Fiber.h" #include "LandruActorVM/Library.h" #include "LandruActorVM/VMContext.h" #include <mutex> #include <GLFW/glfw3.h> #define LANDRUGL_EXPORTS #include "api.h" using namespace std; using namespace Landru; namespace { struct OnWindowClosed : public OnEventEvaluator { explicit O...
#pragma once #include "definitions.h" namespace lm { int lvl_to_int(lvl); }
#ifndef WORDDISPLAYFORMATTER_H #define WORDDISPLAYFORMATTER_H #include <sstream> #include <iomanip> #include <algorithm> #include <set> using namespace std; namespace view { // // Formats the given words to the style needed for the output summary // class WordDisplayFormatter { private: static const size_t COLUM...
#pragma once #ifndef _TABLE_UNIT_H_ #define _TABLE_UNIT_H_ #include <iostream> #include <string> #include <algorithm> using namespace std; enum class UnitType { SHIFT, REDUCE, ERROR, ACC }; class TableUnit { private: //表格单元类型 UnitType type; //表格值 size_t value; public: TableUnit(UnitType type, size_t value); ...
#include <bits/stdc++.h> #define ALL(x) x.begin(), x.end() #define MAX 1000010 using namespace std; typedef long long int LL; const int MOD = 1000000007; const double EPS = 0.0000000001; LL n; LL p = 9; int memo[MAX]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); memset(memo, -1, sizeo...
#pragma once #include <iostream> #include <string> #include "FBullCowGame.h" /* Console executable that makes use of the bull cow class. This acts as teh veiew in MVC patter,and is responsible for all user interaction. For the game logic see the FBullCowGame class */ using FText = std::string; using int32...
#include "operations.hpp" float suma(float A, float B) { float C = A + B; return C; } float resta(float A, float B) { float C = A - B; return C; } float multi(float A, float B) { float C = A*B; return C; } float div(float A, float B) { float C = A/B; return C; }
#include <iostream> #include <iomanip> #include <map> using namespace std; long long primes[1000000]; bool isPrime(long long num, int numprimes) { for(int i = 0; i < numprimes; i++) { if (num % primes[i] == 0) { return false; } } return true; } int main() { int numprimes = 1; primes[0] = 2; map<int, b...
#include "vector.h" #include <iostream> struct Complex { float x,y; }; int main() { Vector<int> ints = {1,2,3,4,5}; Vector<Complex> cvals = { {1., 2.}, {3., 4.}}; cvals.push_back({5., 6.}); for (Vector<Complex>::size_type i=0; i<cvals.size(); i++) { std::cout << "i = " << i << " value....
/** Underscore @file /.../Source/Kabuki_SDK-Impl/_App/App.h @author Cale McCollough @copyright Copyright 2016 Cale McCollough © @license http://www.apache.org/licenses/LICENSE-2.0 */ #include "App.h" using namespace _App; /** */ App::App (int initWidth, int initHeight) { if (initWid...
#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 ...
// Created on: 2014-03-17 // Created by: Kirill GAVRILOV // Copyright (c) 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 Lesser General Public License version 2.1 as pu...
#pragma once /***************************************************************** * Copyright (c) Dassault Systemes. All rights reserved. * * This file is part of FMIKit. See LICENSE.txt in the project * * root for license information. * *************************************...
// Created on: 2016-04-07 // Copyright (c) 2016 OPEN CASCADE SAS // Created by: Oleg AGASHIN // // 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 Lesser General Public License version 2.1 as publi...
#ifndef SRC_CLEANUP_H #define SRC_CLEANUP_H /** * Remove all children from this Trie - this Trie shall become a leaf. */ template<class T> void TrieNode<T>::clear() { if (!this->hasChildren()) { return; } for (int i = 0; i < children.size(); i++) { delete children[i]; } children.clear(); } /...
#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> #include <numeric> #include <ss...
#ifndef KEYREADER_H #define KEYREADER_H #include <QKeyEvent> class KeyReader { public: KeyReader(); static char _key_pressed; }; #endif // KEYREADER_H
// Fill out your copyright notice in the Description page of Project Settings. #include "SelfReplicator.h" // Sets default values ASelfReplicator::ASelfReplicator() { // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = t...
//===-- OR1KFixupKinds.h - OR1K Specific Fixup Entries ----------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
class MH60S; class MH60S_DZ : MH60S { displayName = "$STR_VEH_NAME_MH60"; vehicleClass = "DayZ Epoch Vehicles"; scope = 2; crew = ""; typicalCargo[] = {}; class TransportMagazines{}; class TransportWeapons{}; weapons[] = {"CMFlareLauncher"}; magazines[] = {"120Rnd_CMFlareMagazine"}; class Turrets; class Ma...
// Created on: 1992-10-20 // Created by: Remi GILET // Copyright (c) 1992-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 Les...
class G36K_Camo_DZ : G36C { model = "z\addons\dayz_communityweapons\g36\g36k_camo.p3d"; picture = "\z\addons\dayz_communityweapons\g36\data\w_g36k_camo_ca.paa"; displayName = $STR_DZ_WPN_G36K_CAMO_NAME; magazines[] = { 30Rnd_556x45_G36, 100Rnd_556x45_BetaCMag, 30Rnd_556x45_Stanag, 20Rnd_556x45_Stanag, 60...
#include "../include/MovePen.h"
// IP, ARP, UDP and TCP functions. // Author: Guido Socher // Copyright: GPL V2 // // The TCP implementation uses some size optimisations which are valid // only if all data can be sent in one single packet. This is however // not a big limitation for a microcontroller as you will anyhow use // small web-pages. The web...
#include <Arduino.h> #include "FSWebServer.h" #include "WIFI.h" #include "HTTPinit.h" #include "max7219display.h" #include "sensorsBME280.h" #include "FileConfig.h" #include "json.h" extern ESP8266WebServer HTTP; extern LedControl lc; extern TickerScheduler ts; void setup() { Serial.begin(115200); FS_init(); //...
#pragma once class field { private: char battlefield[10][10]; public: field(); char getFieldAtPosition(int, int); void setField(int, int, char); bool isTaken(int, int); bool canPlaceShip(int, int, int, int); void placeShip(int, int, int,int); }; /* 0 1 2 0 + + + 1 + + + 2 + + + */ /* YYYYYYY X X X */ ...
#include<cstdio> #include<iostream> using namespace std; int an[22][22][22]; int w(long long a,long long b,long long c) { if(a<=0 || b<=0 || c<=0) return 1; else { if(a>20 || b>20 || c>20) return an[20][20][20]=w(20,20,20); if(an[a][b][c]!=0) return an[a][b][c]; else ...
#include"slamBase.h" PointCloud::Ptr image2PointCloud(cv::Mat &rgb, cv::Mat &depth, CAMERA_INTRINSIC_PARAMETERS) { PointCloud::Ptr cloud(new PointCloud); for(int m=0; m<depth.rows; m++){ for(int n=0; n<dpeth.cols; n++){ ushort d = depth.ptr<ushort>(m)[n]; if(d<=0) ...
#pragma once #include "RaytracingObject.h" #include "ImageBMP.h" #include "Camera.h" #include "Sample.h" #include "Light.h" #include "Material.h" #include "Matte.h" #include "Phong.h" #include <vector> #include "Sphere.h" #include "Point_2D.h" #include "Plane.h" #include "Material.h" #include "Matte.h" #include "Phong....
#ifndef ITEM_HPP #define ITEM_HPP #include <QObject> class Item : public QObject { Q_OBJECT public: Q_SLOT void go(); }; #endif
#include "player.h" #include <terrain/terrain.h> #include <utils/timer.h> #include <info/info.h> namespace sloth { void Player::move(Terrain &terrain) { checkInputs(); float deltaFrameTime = static_cast<float>(Timer::deltaFrameTime); increaseRotation(0.0f, m_CurrentTurnSpeed * deltaFrameTime, 0.0f); float di...
#include "Inizialize.h" #ifdef _WIN32 string back_slash = "\\"; #else string back_slash = "/"; #endif //const cv::String WINDOW_NAME("Camera video"); cv::String WINDOW_NAME; int NumMaxFrame = 2; const int PictureWidth = 60; const int PictureHeight = 80; string Time, Data; int numDir; std::vecto...
class Solution { public: int rotatedDigits(int N) { int result = 0; vector<int> unpermittedNumbers = {3, 4, 7}; vector<int> rotationNumbers = {2, 5, 6, 9}; for(int i=1;i<=N;i++){ int num = i; int rotations = 0, unpermitteds = 0; while(num){ ...
/* SegaCDI - Sega Dreamcast cdi image validator. MRImage.cpp - Boot image compressor/decompressor. Sep 26th, 2014 */ #include "../stdafx.h" #include "MRImage.h" namespace Dreamcast { bool SaveMRToBMP(const char *pbBuffer, int dwBufferSize, const char *psFileName) { // Check if the buffer size ...
/***************************************************************************************************************** * File Name : AlternateSplitLL.h * File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\sites\geeksforgeeks\linkedlist\page03\AlternateSplitLL.h * Created on : Dec 22, 2013 :: 9:34:3...
#include <iostream> using namespace std; int main() { int t = 0; cin >> t; char c = '\0'; int depth = 0; c = getchar(); // flush '\n' at first while (t--) { depth = 0; while (1) { c = getchar(); if (c == '(') { depth++; } else if (c == ')') { depth--; } else { ...
#include "dirent.h" #include <stdio.h> #include <conio.h> #include <string.h> int main() { DIR *dir; struct dirent *ent; char arr[] = "C:\\Users\\pgunaraj\\Downloads\\DataR\\"; if ((dir = opendir(arr)) != NULL) { while ((ent = readdir(dir)) != NULL) { if (st...
//知识点:分治 /* By:Luckyblock 分析题意: 将 大矩阵分为四个 等大小矩阵 对左上角的 子矩阵进行处理 注意对 子矩阵的边界进行判断 */ #include<cstdio> #include<cctype> #define ll long long const int MARX = 1024+10; //============================================================= ll n,mul; bool map[MARX][MARX]; //========================================...
/* load / save the mesh attributes from file. */ #ifndef H_MESH_IO_H #define H_MESH_IO_H #include "Common.h" #include "Mesh.h" #include <string> namespace P_RVD { enum FileType { OBJfile = 0, PTXfile = 1 }; /* load the mesh attributes from the file meshpoints : true -- load a mesh flase -- load poin...
#pragma once #include"Lista.h" #include"Nodo1.h" #include"Productos.h" class Orden { //Se utiliza Quicksort para: //ordenar el tipo de producto void QuickSortTipo(Lista* lista, int start, int end); int DivideTipo(Lista* lista, int start, int end); //Se ordena por cantidad de producto void QuickSortCantidad(Lista...
#include "stdafx.h" #include "BaseApplication.h" #include "Config.h" //------------------------------------------------------------------------------------- BaseApplication::BaseApplication(void) : mRoot(0), mCamera(0), mSceneMgr(0), mWindow(0), mCursorWasVisible(false), mShutDown(fa...
#include <iostream> #include "List.h" using namespace std; char** split_string_into_words(char* str, int& words_count); void add_word_to_array(char**& words, char* new_word, int& words_count); void main(){ cout << "Hello world!" << endl; List* lst = new List(); char* str = new char[255]; cout << "Enter string...
/*================================================================================================= Author: Renato Farias (renatomdf@gmail.com) Created on: April 13th, 2012 Updated on: June 12th, 2012 About: This is a simple CPU implementation of the Jump Flooding algorithm from the paper "Jump Flooding in GPU With App...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2008 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 DESKTOP_TAB_H #define DESKTOP_TAB_H ...
#include<bits/stdc++.h> using namespace std; class Fraction{ private: int numerator; int denominator; public: Fraction(int numerator,int denominator){ this -> numerator = numerator; this -> denominator = denominator; } void simplify(){ int gcd = 1; int j = min(this -> numerator,this -> denomina...
#include <mqtt/subscriber/subcallback.h> void SubCallback::reconnect() { std::this_thread::sleep_for(std::chrono::milliseconds(100)); mqtt::connect_options connOpts; connOpts.set_keep_alive_interval(20); connOpts.set_clean_session(true); try { cli_.connect(connOpts, nullptr, *this); } c...
#include "_pch.h" #include "MObjCatalog.h" using namespace wh; using namespace wh::object_catalog; //------------------------------------------------------------------------- //------------------------------------------------------------------------- MObjCatalog::MObjCatalog(const char option) :TModelData<rec::CatC...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "458" #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 char symbol; ...
#pragma once #include <vulkan\vulkan.h> #include <vector> #include<functional> #include <glm\glm.hpp> #include <memory> #include "VkDeleter.h" #include "VkRelease.h" #include "VulkanDebug.h" #include "Builders\BufferInfoBuilder.h" #include <Systems\Graphics\IGraphicsPipeline.h> struct Buffer { VkBuffer buffer; VkBu...
#include <stdio.h> #include <iostream> #include <algorithm> using namespace std; typedef pair<int,int> pairs; int main(int argc, char *argv[]) { int t; scanf("%d",&t); for(int i = 0;i< t;i++) { int n; scanf("%d",&n); vector<pairs> kingdoms; int leftExtreme = 100001; ...
// // Created by tompi on 6/3/18. // #ifndef OPENCLDISPATCHER_AGGREGATION_H #define OPENCLDISPATCHER_AGGREGATION_H #pragma once #include "../../data_api.h" #include "../../kernel_api.h" #include "../../runtime_api.h" #include "../../ImportKernelSource.h" void IndexValue(cl_device_id _DEVICE, uint *_sorted_elements,...
/** * Given inorder and postorder traversal of a tree, construct the binary tree. * * Note: * You may assume that duplicates do not exist in the tree. */ /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL...
#pragma once #include <vector> #include <map> #include "cs225/PNG.h" #include "dsets.h" class SquareMaze{ public: // constructor SquareMaze(); ~SquareMaze(); bool isEdge(int x, int y, int dir); // prepare block I void blockI(int height, int width); // bfs search returning the distances vector std::vector<int>...
class Solution { public: int setBits(int N) { // only gravity will pull me down // Set Bits int res=0; while(N) { res += (N&1); N = N>>1; } return res; } };
#include <iostream> using namespace std; #define MAX 100 #define INFTY 10000001 #define WHITE 0 #define GRAY 1 #define BLACK 2 #define DEFLT 0 // 初期値 int M[MAX][MAX], d[MAX]; void dijkstra(int n){ int mincost, u, color[n], p[n]; for(int i=0; i<n; i++){ color[i] = WHITE; d[i] = INFTY; } d[DEFLT] = 0; ...
/* -*- 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/display/vis_dev.h" #incl...
int pirsensor = 0; void setup(){ pinMode(13, OUTPUT); pinMode(2, INPUT); } void loop(){ pirsensor = digitalRead(2); if (pirsensor==HIGH){ digitalWrite(13,HIGH); } else{ digitalWrite(13,LOW); } delay(10); }
#include "stdafx.h" #include "ThreadPool.h" #include "Interface.h" static unsigned int WINAPI ThreadPoolWorkThread(void *Param) { ((ThreadPool*)Param)->ThreadFunc(); return 0; } void ThreadPool::ThreadFunc() { UINT threadNumber = ::InterlockedIncrement(&m_threadNum); Log("ThreadPool the " << threadNumber << "th t...
#pragma once #include "Value.h" class Lexer; class SymbolTable; class Proto; class Func; class GC; class Pepper; class Parser { Proto *proto; SymbolTable *syms; Lexer *lexer; GC *gc; Parser(GC *gc, Proto *proto, SymbolTable *syms, Lexer *lexer); ~Parser(); int createUpval(Proto *pro...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * @author Arjan van Leeuwen (arjanl) */ #include "core/pch.h" #...
#include <Tanker/Revocation.hpp> #include <Tanker/BlockGenerator.hpp> #include <Tanker/Client.hpp> #include <Tanker/ContactStore.hpp> #include <Tanker/Crypto/Crypto.hpp> #include <Tanker/Crypto/Format/Format.hpp> #include <Tanker/DeviceKeyStore.hpp> #include <Tanker/Errors/Errc.hpp> #include <Tanker/Errors/Exception.h...
#ifndef _GetPlayInfo_H_ #define _GetPlayInfo_H_ #include "BaseProcess.h" class GetPlayInfo : public BaseProcess { public: GetPlayInfo(); ~GetPlayInfo(); virtual int doRequest(CDLSocketHandler *clientHandler, InputPacket *inputPacket, Context *pt); }; #endif
/* ** EPITECH PROJECT, 2021 ** Untitled (Workspace) ** File description: ** main */ #include <unistd.h> #include <signal.h> #include "SystemInfos.hpp" #include "UserInfos.hpp" #include "Date.hpp" #include "CoreInfos.hpp" #include "NetInfos.hpp" #include "ModuleManage.hpp" #include "Itop.hpp" void updateRam(std::atom...
#include "ChatRoom.h" #include <algorithm> #include "Person.h" Person* ChatRoom::PersonReference::operator->() const { return &people[index]; } void ChatRoom::broadcast(const string& origin, const string& message) { for (auto& p : people) if (p.name != origin) p.receive(origin, message); } ChatRoom::PersonRefe...
#include<iostream> #include<bits/stdc++.h> using namespace std; //Find the longest subarr with given sum //IDEA: store the first occurence of every prefix sum. int longestSubarr(int arr[],int n,int x){ unordered_map<int,int> mp; int preSum=0,res=0; for(int i=0;i<n;i++){ preSum+=arr[i]; if(p...
#include "EnumConverter.h" #include "Keng/GraphicsCommon/FilteringMode.h" #include "EverydayTools/Exception/CallAndRethrow.h" namespace keng::graphics::gpu { namespace { template<typename From, typename To> struct EnumFlagConverter { EnumFlagConverter(From from_) : ...
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int t, n, a[100], req, count, idx, curEle; vector<int> ans; cin >> t; while (t--) { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); req = n / 4...
#ifndef WEAPONS_H #define WEAPONS_H class Weapons { public: Weapons(const char*); string findWeapon(string); private: int readInfo(ifstream&); string weaps[20]; string weaps_hint[20]; int no_weaps; }; #endif /*WEAPONS_H*/
// Created on: 1991-10-10 // Created by: Jean Claude VAUTHIER // Copyright (c) 1991-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 t...
#define GLEW_STATIC #include "Angel.h" #include <math.h> #include <string> #include <iostream> #include <fstream> #include <vector> #include <stdio.h> using namespace std; void bufferGenerator(struct vec4 polygonPoints[],int polyPoints_size, struct vec4 colorPonts[],int colorPoints_size, struct mat4 , struct mat4); GL...
#pragma once #include "../Config.hpp" #include "../SecureWiper.hpp" #include "../Array.hpp" namespace accel::Crypto { class RC4_ALG { public: static constexpr size_t MinKeySizeValue = 1; static constexpr size_t MaxKeySizeValue = 256; private: SecureWiper<Array<uint8_t, 256>> _Init...
class Solution { public: int maxSubArray(vector<int>& nums) { if(nums==NULL) return -INT_MAX; int max=nums[0],curr=nums[0]; for(int i=1;i<nums.size();i++){ if(curr>0){ curr+=nums[i]; }else{ curr=nums[i]; } max= max(max, curr); } return max; } };
#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...
/*==================================================================== Copyright(c) 2018 Adam Rankin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitati...
#ifndef _ROS_sub8_msgs_PathPoint_h #define _ROS_sub8_msgs_PathPoint_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" #include "geometry_msgs/Point.h" namespace sub8_msgs { class PathPoint : public ros::Msg { public: geometry_msgs::Point position; float yaw; ...
#ifndef LIGHT_SOURCE_HPP #define LIGHT_SOURCE_HPP #include "../include/point.hpp" #include "../include/color.hpp" #include <string> #include <ostream> class light_source { public: light_source(); light_source(std::string const&,math3d::point const&, color const&, color const&); light_source(const light_so...
#include "PageSyncMaster.h"
vector<int> solution(int N, vector<int> &P, vector<int> &Q) { // write your code in C++14 (g++ 6.2.0) vector<bool> sieve(N+1, 1); // initialize as all 1 vector<int> rec(N+1, 0); // initialize as all 2 sieve[0] = 0; // if prime -> 1 sieve[1] = 0; int i = 2; while(i*i <= N) { if (sieve...
#include<iostream> #include<cstring> #define FOR0(i,n) for(i=0;i<n;i++) #define FOR(i,j,n) for(i=j;i<n;i++) #define FORD(i,j) for(i=j;i>=0;i--) #define MAX(a,b) (a)>(b)?(a):(b) #define MIN(a,b) (a)<(b)?(a):(b) using namespace std; int m,n; int table[10201][101]; int f[101],p[101]; int take(int value,int inde...
#include "MakeCustomIncludes.h" int main() { return MakeCustomIncludes(); }
#include <iostream> // knapsack #include "knapsackP.h" #include "knapsack.h" // TSP #include "route.h" #include "tsp.h" // real function #include "real_function.h" #include "real_vector.h" #include "island_EA.hpp" template <typename problem_class, typename solution_class> void solve_problem(size_t problem_size){ ...
#include <iostream> #include "CCSprite.h" using namespace std; int main() { CCSprite a(1), b(2), c(3); for (int i = 100; i < 106; i++) { new CCSprite(i); } CCSprite::traverseCCSprite(); return 0; }
// // Created by 钟奇龙 on 2019-05-12. // #include <vector> #include <iostream> using namespace std; void setNumIntoSupport(vector<int> &support,int num,int k){ vector<int> temp(32,0); int index = 0; while(num){ temp[index++] = num%k; num/=k; } for(int i=0; i<support.size(); ++i){ ...
#include <QCoreApplication> #include <iostream> class Base { public: virtual const char* getName() { return "Base"; } }; class Derived: public Base { public: virtual const char* getName() { return "Derived"; } }; int main() { Derived derived; Base &rBase = derived; std::cout << "rBase is a " << rBa...