text
stringlengths
8
6.88M
// // Created by wiktor on 23.03.18. // #ifndef JIMP_EXERCISES_CCOUNTER_H #define JIMP_EXERCISES_CCOUNTER_H #include <string> #include <memory> #include <map> namespace ccounter{ typedef struct Counter{ std::map<std::string, int> ctr; int size; }Counter; std::unique_ptr<Counter> Init(); ...
#include "..//Public/Weapons/WeaponActor.h" #include "Net/UnrealNetwork.h" #include "..//Public/Character/Player/PlayerCharacter.h" #include "Camera/CameraComponent.h" #include "Kismet/KismetMathLibrary.h" #include "Kismet/GameplayStatics.h" #include "DrawDebugHelpers.h" AWeaponActor::AWeaponActor() { PrimaryActorTi...
#ifndef __SPRITE_MANAGER__ #define __SPRITE_MANAGER__ #include "Common.h" #include "GraphicApi.h" #include "Sprites.h" #include "FileUtils.h" #include "3dStuff.h" #include "GraphicLoader.h" #include "SDL_video.h" // Font flags #define FT_NOBREAK ( 0x0001 ) #define FT_NOBREAK_LINE ...
#include <stdio.h> #include <iostream> using namespace std; int main(int argc, char *argv[]){ int arr[2][3] = {{1,2,3},{4,5,6}}; // the original array address cout<< "Array addr : arr=" << arr << endl; cout<< "Array addr : arr[0]=" << arr[0] << endl; cout<< "Array addr : &arr[0]=" << &arr[0] << en...
#include "manager.h" Manager::Manager(float m,const string &name,int id) { monthlyPay=m; this->name=name; number=id; employeeMax++; } void Manager::pay() { money=monthlyPay; } void Manager::show() { cout << title << name << setw(10) << number << setw(10) << money << endl; }
#include<iostream> #include<algorithm> using namespace std; struct Edge { int a, b; //边两个顶点的编号 int cost; //该边的权值 }edge[6000]; int village[120]; int sum; // 生成树权重之和 int findRoot(int p) { // 找到根节点 if (village[p] == p) { return p; } else { int tmp = findRoot(village[p]); villa...
class Solution { public: string minWindow(string s, string t) { string res = ""; int left = 0, cnt = 0, minleft = -1, minlen = INT_MAX; // left: left index of slide window // unordered_map<char, int> m; // method 1: using hashmap vector<int> m(128, 0); // method 2: 128/256 ASCII char...
#include "Point.cpp" using namespace std; vector<P> CH(vector<P> &ps) { // front() back() is same sort(ps.begin(), ps.end()); vector<P> ret; int m = 0; for (int i = 0 ; i < ps.size() ; i++) { while (m >= 2 && (ps[i] - ret[m - 2]) % (ret[m -1] - ret[m - 2]) < -EPS) ret.pop_back(), m--; ret....
#include <iostream> #include "Graph.h" #include "dirGraph.h" #include <vector> #include <time.h> using namespace std; void buildNWordGraph( Graph&, bool, int ); bool hamming_time( string , string ); int main( int argc, char **argv){ int n = 1, ec = 0; bool done = false; Graph *nwords; vector<int> sor...
#ifndef LIGHT_H #define LIGHT_H #include <glm/glm.hpp> #include "renderer/shader.h" namespace renderer { class Light { public: Light(glm::vec3 direction, glm::vec3 colour); void Render(Shader* p_shader); private: glm::vec3 m_direction; glm::vec3 m_colour; }; } #endif
/*----------------------------------------------------------------------- Matt Marchant 2015 - 2016 http://trederia.blogspot.com Robomower - Zlib license. This software is provided 'as-is', without any express or implied warranty.In no event will the authors be held liable for any damages arising from the use of thi...
// // Created by 梁栋 on 2019-05-10. // #include <iostream> #include <vector> using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution { public: ListNode* reverseListRecursively(ListNode* head, ListNode*& lastNode){ if(head->next == ...
#include <gtest/gtest.h> #include "kth_cprog_template_container.hpp" typedef Vector<int> Vec; typedef Vector<int>::iterator Iterator; typedef Vector<int>::const_iterator ConstIterator; typedef Vector<int>::reverse_iterator ReverseIterator; typedef Vector<int>::const_reverse_iterator ConstReverseIterator; TEST(VectorI...
/* Copyright 2017-2018 All Rights Reserved. * Gyeonghwan Hong (redcarrottt@gmail.com) * * [Contact] * Gyeonghwan Hong (redcarrottt@gmail.com) * * 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 Lic...
// $Id: GlobalVariableSymbol.h,v 1.3 2013-05-14 21:52:52 ist164787 Exp $ -*- c++ -*- #ifndef __MF_SEMANTICS_GLOBALVARIABLESYMBOL_H__ #define __MF_SEMANTICS_GLOBALVARIABLESYMBOL_H__ #include <string> #include "semantics/Symbol.h" class GlobalVariableSymbol : public VariableSymbol { public: const std::string TYPE = "G...
#include <iostream> #include <cstring> using namespace std; bool neighbors(size_t i, size_t j){ size_t x = i^j; return (x&(-x)) == x; } int main() { size_t n; size_t aux; while(cin >> n){ int weights[1<<n]; for(int i=0; i<(1<<n); i++){ cin >> aux; ...
#include "uiabout.h" // UIAbout::UIAbout( QWidget * parent, Qt::WFlags f) : QDialog(parent, f) { setupUi(this); } //
//#include "ResourceZipFile.h" // //#include "../../Utilities/Memory/Memory.h" // //namespace liman { // // bool ResourceZipFile::Open() { // m_pZipFile = NEW ZipFile; // // bool retValue = false; // // return retValue; // } // // // TODO: Implement // int ResourceZipFile::GetRawResourceSize(const Resource &resource...
/* PrNetRomManager.h - Library for managing data in the flash rom of PrNet nodes. Created by Dwyane George, March 12, 2016, Adapted version from Nazmus Saquib, October 7, 2015 Social Computing Group, MIT Media Lab */ #ifndef PrNetRomManager_h #define PrNetRomManager_h #include "Arduino.h" #define SETTINGS_FLAS...
#include "Subject.h" Subject::Subject() { } Subject::~Subject() { } void Subject::Notify(unsigned int entityID, EVENT newEvent) { std::map<unsigned int, Observer*>::iterator itr; for (itr = this->m_observers.begin(); itr != this->m_observers.end(); itr++) { itr->second->React(entityID, newEvent); } } void...
#ifndef _IMAGE_TEXTURE_HPP_ #define _IMAGE_TEXTURE_HPP_ // ImageTexture{ // exposedField MFString url [] // field SFBool repeatS TRUE // field SFBool repeatT TRUE // } #include <vector> #include "PixelTexture.hpp" class ImageTexture : public PixelTexture { private: vector<string> _url; ...
/* ID: zrh331 PROG: fracdec LANG: C++ */ #include <iostream> #include <stdio.h> #include <map> #include <string.h> #include <algorithm> #include <assert.h> #include <iomanip> using namespace std; #define maxint 2147400000 int x, y, ret=0, n=0, tmp=0, t=0, st=0; int a[1000000], mark[200000]; char s[100...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.Devices.Usb.0.h" #include "Windows.Foundation.0.h" #include "Windows.Storage.Streams.0.h" #include "Windows.Foundation.1.h" #include "Windows.Storage.Stre...
#include <iostream> #include <string> using namespace std; int main(){ string s1 = "abcde"; cout << s1.empty() << endl; //0 비어있으면 1 반환 cout << s1.length() << endl; //5 문자열의 길이 s1.clear(); //string 비워주기 cout << s1 << endl; //아무것도 없는 빈칸 반환 s1 = "a...
#include "utility.h" const double Utility::SMALL_DOUBLE_STEP = 1.0e-10; const double Utility::DOUBLE_LARGE = 1000000000.0; const int Utility::INT_LARGE = 20000; const string Utility::className = "Utility"; double Utility::changePrecision(double number, int precision) { assert(precision >= 0); int d = precisi...
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main() { int lightX; // the X position of the light of power int lightY; // the Y position of the light of power int initialTX; // Thor's starting X position int initialTY; // Thor's starting Y posit...
class Solution { public: int countNumbersWithUniqueDigits(int n) { int conbination = 9,result = 1; n = min(n,10); for(int i = 1;i <= n;i++) { result += conbination; conbination = conbination*(10-i); } return result; } };
#include <bits/stdc++.h> using namespace std; int const ALPHA = 10; struct Node { int to[ALPHA] ; bool bad; int link = 0; Node(){ bad = 0; for(int i = 0; i < ALPHA ; i++) to[i] = 0; } }; vector<Node> t(1); void add(string &s){ int v = 0; for(auto x : s){ if(!t[v].to[x-'0']){ t[v].to[x-'0'] = t.size...
#pragma once #include <Arcane/Graphics/Texture/Cubemap.h> #include <Arcane/Graphics/Camera/CubemapCamera.h> #include <Arcane/Graphics/Renderer/Renderpass/RenderPass.h> #include <Arcane/Graphics/Renderer/Renderpass/ShadowmapPass.h> namespace Arcane { class Shader; class Scene3D; class ForwardProbePass : public Ren...
#include "cont_cpn_buf.h" #include "explicit_fdm_contcpn.h" #include "cn_fdm_contcpn.h" #include <cmath> #include <iostream> /* Security functions */ /* Constructors and destructor */ ContCpnBuf::ContCpnBuf() { } ContCpnBuf::ContCpnBuf(double principal, double coupon, double maturity, double barrier, double buff...
#include<bits/stdc++.h> // g++ -std=c++17 -Wl,-stack_size -Wl,0x10000000 main.cpp #define mt make_tuple #define mp make_pair #define pu push_back #define INF 1000000001 #define MOD 1000000007 #define EPS 1e-6 #define ll long long int #define ld long double #define fi first #define se second #define all(v) v.begin(),v.e...
#include <gtest/gtest.h> #include <FormatID.h> #include <EventType.h> namespace tests { namespace formatIDTestSuite { using ::id::attribute::Base; using ::id::type::UInt8; using ::id::type::UInt16; TEST(FormatIDTestSuite, ValueCompTest) { ValueType vT0(UInt8::value(), 1, 1, false); AttributeType aT0(Base::...
#include <Arduino.h> #include <SPI.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> #include "Structs.h" #include <RaceHandler.h> #include <LightsController.h> #include <LCDController.h> LiquidCrystal_I2C lcd(0x27,20,4); #define SENSOR_1_PIN 3 #define SENSOR_2_PIN 2 #define LIGHT_PIN_1 4 #define LIGHT_PIN_2 11 #...
#include "RakTimer.h" RakTimer::RakTimer(void) { timerLength=1000; Start(); } RakTimer::RakTimer(int lengthInMilliseconds) { timerLength=lengthInMilliseconds; Start(); } RakTimer::~RakTimer(void) { } void RakTimer::SetTimerLength(int lengthInMilliseconds) { timerLength=lengthInMill...
/* plumbing.h -*- C++ -*- Rémi Attab (remi.attab@gmail.com), 30 Mar 2014 FreeBSD-style copyright and disclaimer apply General class plumbing. Autoom */ #include "reflect.h" #pragma once namespace reflect { /****************************************************************...
#ifndef _WRL_MAINWINDOW_HPP_ #define _WRL_MAINWINDOW_HPP_ #include <string> #include <QMainWindow> #include <QTimer> #include <QGridLayout> #include "io/AppLoader.hpp" #include "io/AppSaver.hpp" #include "WrlGLWidget.hpp" #include "WrlToolsWidget.hpp" QT_FORWARD_DECLARE_CLASS(QOpenGLWidget) class WrlMainWindow : ...
#include "DrawingManager.h" #include <iterator> DrawingManager::DrawingManager() { isGLPushed = false; } DrawingManager::~DrawingManager(void) { } void DrawingManager::addDrawingObject(DrawingObject* drawingObject, int at) { if (at == -1) { this->drawingObjects.push_back(drawingObject); } else { this->d...
#pragma once #include "CMath.h" #include "CError.h" #include "CGeneral.h" #include "StringHelper.h" class CHandler { protected: CGeneral * V_General; CMath * V_Math; public: CHandler(); virtual ~CHandler(); };
#include <iostream> #include <string> #include <iomanip> #include <cstdlib> #include <sstream> #include "../../io/io.h" #include "game.h" void Game::printStatus(int x, int y) { this->lg3.lock(); std::vector<std::vector<std::string>> actionPrefix = { {" ", " ", " ", " ", " "}, ...
#include <iostream> using namespace std; class AGE // 类定义 { public: int year; int month; int day; }; class STUDENT // 类定义 { public: char name[20]; int num; AGE birthday; float score; }; void main() { STUDENT stu; stu.birthday.year = 1988; cout<<stu.birthd...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "PlatformMoviment.h" #include "Components/ActorComponent.h" #include "PlatformMoviment.h" #include "DoorComponent.generated.h" DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOpenDoor); UCLASS( ClassGroup=(Custom), meta=(Bluepri...
#include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include "opencv2/core/core.hpp" using namespace cv; using namespace std; int main() { int i, j; Mat a(400, 400, CV_8UC3, Scalar(255, 0, 0)); for (i = 0; i < 400; i++) { for (j = 0; j < i + 1; j++...
/*************************************************************************** * Filename : Texture.cpp * Name : Ori Lazar * Date : 29/10/2019 * Description : Implementation of a texture wrapper for this engine. .---. .'_:___". |__ --==| [ ] :[| |__| I=[| / / ____| |-/.____.' /___\ /___\...
#include<iostream> using namespace std; /** * Leia um conjunto de pares de valores M e N (parar quando algum dos valores for menor ou igual a zero). * Para cada par lido, mostre a sequencia do menor até o maior e a soma dos * inteiros consecutivos entre eles (incluindo M e N). */ int main() { int n, m, i, j, s...
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** 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 ...
#include <iostream.h> #include <list> void print(list <char> ); main(){ list <char> l; list <char>::iterator p; l.push_back('o'); l.push_back('a'); l.push_back('t'); p=l.begin(); cout <<" "<< *p<<endl; print(l); l.insert(p, 'c'); cout <<" "<< *p<<endl; print(l); l.e...
#include <bits/stdc++.h> #define ll long long using namespace std; typedef tuple<ll, ll, ll> tp; typedef pair<ll, ll> pr; const ll MOD = 1000000007; const ll INF = 1e18; template <typename T> void print(const T &t) { std::copy(t.cbegin(), t.cend(), std::ostream_iterator<typename T::value_type>(std::co...
//Write code that declares two vectors as arrays of double precision floating //point numbers of length 3 and assigns values to each of the entries. Extend //this code to that it calculates the scalar product of these vectors and prints //it to the screen. Finally, extend the code so that it prints the Euclidean //nor...
#pragma once #ifndef FIVE_H #define FIVE_H #include "figure.h" class Five : public Figure { public: Five(); Five(Point a, Point b, Point c, Point d, Point e); Point Center() const override; double Area() const override; std::ostream& Print(std::ostream& out) const override; std::istream& ...
#include "DependencyGraph.h" Graph::Graph() {}; Graph::Graph(vector<rulez>& rules) { for (size_t i = 0; i < rules.size(); ++i) { this->adjList.emplace(i, Node()); } createAdjList(rules); } /** * Performs Depth First Search (dfs) on graph * * @return vector<int> postOrderNums */ vector<int> Gra...
/******************************************************************* * CS 307 Programming Assignment 2 * Author: Benjmin hoang * Desc: traffic simulation * Date: 4/15/2017 * I attest that this program is entirely my own work *******************************************************************/ #include "...
class Solution { void generateValidString(string &V, stack<char> &S) { for (int i = 0; i < V.length(); i++) { if (V[i] != '#') { S.push(V[i]); } else { if (!S.empty()) { S.pop(); } } } } ...
#include "../headers/operateureval.h" #include "../headers/controleur.h" const OperateurEval& OperateurEval::evaluate(Pile& pile) const { if (pile.taille() >= getArite()) { try { dynamic_cast<Programme&>(pile.top()); } catch(exception&) { try ...
#include<stdexcept> using std::runtime_error; //Exceptions void error(const char*);
/* vim:tabstop=4:expandtab:shiftwidth=4 * * Idesk -- Util.h * * Copyright (c) 2005, FixXxeR (avelar@gmail.com) * 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 ...
/* *********************************************************** * JLMD++ A C++ version of LJMD motived by LAMMPS. * http://sites.google.com/site/akohlmey/software/ljmd and http://lammps.sandia.gov/ * * Some routines are taken in whole or in part from LJMD * or LAMMPS. This software is distributed under the *...
// Header for the ToDoList class // Includes default constructor and methods needed in this class #pragma once #include "DisplayableComponent.h" class ToDoList : public DisplayableComponent { public: ToDoList(); void addComponent(std::string, std::tm, bool); void display(); };
#include <iostream> #include <vector> using namespace std; #include "solution.h" int main() { vector<int> arr1 = {1, 2, 2, 1, 1, 3}; vector<int> arr2 = {1, 2}; vector<int> arr3 = {-3, 0, 1, -3, 1, 1, 1, -3, 10, 0}; Solution sol; cout << sol.uniqueOccurrences(arr1) << endl; cout << sol.uniqueOccurrences(...
#include "MyEngineTest.h" using namespace EngineLayer; using namespace NUnit::Framework; namespace Test { void MyEngineTest::TestMyEngine() { MetaMorpheusEngine *level0engine = new TestEngine(0); level0engine = new TestEngine(0); level0engine->Run(); delete level0engine; } MyEngineT...
#include "sysconfig.h" #include "sysdeps.h" #include "zfile.h" #include "fsdb.h" #include "threaddep/thread.h" #include "chdtypes.h" #include "corefile.h" int core_fseek(core_file *file, INT64 offset, int whence) { return zfile_fseek(file, offset, whence); } file_error core_fopen(const TCHAR *filename, UINT32 open...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.UI.Xaml.2.h" WINRT_EXPORT namespace winrt { namespace Windows::UI::Xaml { template <typename H> struct impl_ApplicationInitializationCallback : implements<impl_ApplicationI...
/* * SPDX-FileCopyrightText: (C) 2018-2022 Matthias Fehring <mf@huessenbergnetz.de> * SPDX-License-Identifier: BSD-3-Clause */ #ifndef C_UTILS_LANGSELECT_P_H #define C_UTILS_LANGSELECT_P_H #include "langselect.h" namespace Cutelyst { class LangSelectPrivate { public: static void _q_postFork(Application *app)...
#ifndef __EVSUMHOOK_HPP #define __EVSUMHOOK_HPP #include <epecur/geometry.hpp> #include <epecur/loadfile.hpp> #include <epecur/types.hpp> const chamber_id_t MAX_CHAMBER_ID = 16; const wire_id_t WIRES_COUNT = 200; class EvSumHook: public LoadHook { private: Geometry geom; public: uint chambers[MAX_CHAMBER_ID][WI...
#include<iostream> #include<string> #include<algorithm> using namespace std; string add(string a, string b) { reverse(a.begin(), a.end()); reverse(b.begin(), b.end()); int len_a = a.length(); int len_b = b.length(); a += string(10010 - len_a, '0'); b += string(10010 - len_b, '0'); int max = len_a > len_b ? len_...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<vi> vvi; typedef vector<ii> vii; typedef vector<bool> vb; typedef vector<vb> vvb; typedef set<int> si; typedef map<string, int> msi; typed...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once WINRT_EXPORT namespace winrt { namespace ABI::Windows::Gaming::Preview::GamesEnumeration { struct GameListChangedEventHandler; struct GameListRemovedEventHandler; struct IGameListEntry; stru...
class Solution { public: static bool cmp(const vector<int>& a, const vector<int>& b) { // 贪心算法 return a[1] < b[1]; // 右边界从小到大排序 } int eraseOverlapIntervals(vector<vector<int>>& intervals) { if (intervals.size() == 0) return 0; // 特判 sort(intervals.begin(), intervals.end(), cmp...
#pragma once #include "layer.h" #include <unordered_map> namespace transprecision_floating_point { using model_layer = std::unique_ptr<layer>; template<typename Loss> struct deep_model { explicit deep_model(Loss loss); deep_model& operator+=(model_layer&& layer); deep_model& operator-=(std::string layer_nam...
#include<cstdio> #include<iostream> #include<algorithm> #include<cstring> using namespace std; int main() { int a,b,c; scanf("%d-%d-%d",&a,&b,&c); printf("%d-%02d-%02d",c,a,b); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; long int x = 4294967295; while(t--) { long int n, ans; cin>>n; ans = x-n; cout<<ans<<endl; } }
class Solution { public: int countPrimes(int n) { if(n <= 0) return 0; if(n == 1) return 0; vector<bool> dp(n, true); dp[0] = false; // n = 0; dp[1] = false; // n = 1; int cur = 2; while(cur <= sqrt(n)) { if(dp[cur] == false) { ...
#include <iostream> using namespace std; class Chain; class ChainNode { friend class Chain; private: int data; ChainNode* link; public: ChainNode(int element = 0, ChainNode* next = 0) { data = element; link = next; } }; class Chain { private: ChainNode* first; public: int Length(); // 책163p 1번 노드 개수 void C...
#include <iostream> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/features2d/features2d.hpp> #include <opencv2/nonfree/features2d.hpp> #include <opencv2/calib3d/calib3d.hpp> #include "gui.h" #include "seam_carv.h" #include "seam_carv_dynamic.h" #include "seam_carv_rand...
#include <bits/stdc++.h> using namespace std; char maze[100][100]; bool vis[100][100]; int dir[4][2] = { {-1,0}, {0, -1}, {1,0}, {0, 1}}; int n, m, ans; struct node { int x; int y; int d; node(int xx, int yy, int dd) { x = xx; y = yy; d = dd; } }; bool in(int x, int y) { ...
// // MaterialExporter.h // FbxAwdExporter // // Created by Pierre Lepers on 11/11/2014. // // #ifndef __FbxAwdExporter__MaterialExporter__ #define __FbxAwdExporter__MaterialExporter__ #include "NodeExporter.h" class MaterialExporter : public NodeExporter { public: virtual bool isHandleObject( FbxObject* ); ...
// ***************************************************************** // This file is part of the CYBERMED Libraries // // Copyright (C) 2007 LabTEVE (http://www.de.ufpb.br/~labteve), // Federal University of Paraiba and University of São Paulo. // All rights reserved. // // This program is free software; you can redist...
/******************************************************************************* * app/interface_test.cpp * * Copyright (C) 2016-2017 Sebastian Lamm <lamm@ira.uka.de> * Copyright (C) 2017 Daniel Funke <funke@ira.uka.de> * * All rights reserved. Published under the BSD-2 license in the LICENSE file. *************...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
/* this is the solution of #1377 https://www.acmicpc.net/problem/1377 */ #include <iostream> #include <algorithm> #include <vector> using namespace std; int main(){ int n; scanf("%d",&n); vector<pair<int,int>> a(n); for(int i=0;i<n;i++){ cin>>a[i].first; a[i].second=i; } sort(a.begin(),a.begin()+n)...
// by thaiph99 #include <bits/stdc++.h> using namespace std; #define ll long long #define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORR(i, a, b) for (ll i = a; i >= (ll)(b); i--) #define iosb ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t,n,a[4]; bool solve() { int xorSum = a[1]; ...
class Solution { public: string replaceSpace(string s) { string result = ""; for(char ch:s){ if(ch == ' '){ result += "%20"; } else result += ch; } return result; } };
#include "CannonRush.h" #include <SC2.h> #include <Utils.h> #include <iostream> #include <sstream> #include <numeric> #include <glm/glm.hpp> #include <utils/UnitQuery.h> constexpr float pylon_radius = 6.5f; constexpr float pylon_radius_squared = pylon_radius * pylon_radius; using namespace sc2; CannonRush::~CannonR...
#include<stdio.h> #include<malloc.h> #include<stdlib.h> //#include<conio.h> struct node{ int data; struct node *link; }; int main(){ int n,i; struct node *Head,*p; Head=NULL; printf("enter the no of items"); scanf("%d",&n); Head=(node *)malloc(sizeof(node)); scanf("%d",&(Head->data)); Head->link...
#include <stdafx.h> #include <TywLib\math\GLXMath.h> //Game Includes #include "AIPlayerView.h" #include "AI\Pathing.h" AIPlayerView::AIPlayerView(std::shared_ptr<PathingGraph> pPathingGraph): IGameView(), m_pPathingGraph(pPathingGraph) { } AIPlayerView::~AIPlayerView() { }
#include <istream> #include <iostream> #include "net/MessageConnect.h" #include "net/MCByteBuffer.h" using namespace std; namespace inexor { namespace net { bytes MCByteBuffer::xchrbuf(int reading_, size_t size) { reading = reading_; buf_pt = 0; bytes xb(size); buf.swap(xb); return xb; } ...
#include<iostream> using namespace std; int main(){ int arr[6][6]; for(int i=0;i<6;i++){ for(int j=0;j<6;j++){ cin>>arr[i][j]; } } int sum=0; int max=-9999999; for(int i=0;i<4;i++){ for(int j=0;j<4;j++){ sum = 0; sum= arr[i][j]+arr[i][j+1]+arr[i][j+2]+arr[i+2][j]+arr[i+2][j+1]+...
// // Created by Administrator on 2020/6/30. // #include "jni_interface.h" #include "audio_recorder.h" #include "audio_player.h" #include "audio_effect.h" #include "audio_common.h" #include <jni.h> #include <SLES/OpenSLES_Android.h> #include <sys/types.h> #include <cassert> #include <cstring> struct EchoAudioEngine {...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "ExplosiveBarrel.generated.h" class UStaticMeshComponent; class USHealthComponent; class UParticleSystem; class USoundCue; class URadialForceComponent; class ...
#include "setting_window.h" #include "ui_setting_window.h" setting_window::setting_window(QWidget *parent) : QMainWindow(parent), ui(new Ui::setting_window) { ui->setupUi(this); db = QSqlDatabase::database("setting"); if(!db.isOpen()){ if(db.open()){ qDebug()<<"open"; ui->sta...
#pragma once #include <microhttpd.h> #include <string> #include <map> #include <netinet/in.h> #define THREADPOOL_SIZE 1 class HttpRequestState; class HttpRequestHandler; using Headers = std::map<std::string, const char*>; using QueryString = std::map<std::string, const char*>; struct HttpRequest { HttpRequest(); ...
class Solution { public: int maxArea(vector<int>& height) { int l = 0; int r = height.size() - 1; int res = 0; while(l < r) { int tmp = min(height[l], height[r]); res = max(res, (r - l) * min(height[l], height[r])); if (tmp == height[l]) ...
#include "lion.h" #include <vector> #include <string> Lion::Lion( int x, int y ) : Critter(x, y, 10){ mMissedMeal = 0; } Lion::~Lion(){} int Lion::getMissedMealCount( ) const{ return this->mMissedMeal; } void Lion::setSteps(int steps){ this->mSteps = steps; } Critter* Lion::findNeighbo...
// // main.cpp // https://open.kattis.com/problems/twostones // // Created by Sofian Hadianto on 26/12/18. // Copyright © 2018 Sofian Hadianto. All rights reserved. // #include <bits/stdc++.h> using namespace std; int main(int argc, const char * argv[]) { ios::sync_with_stdio(false); cin.tie(NULL); ...
#include <iostream> #include <condition_variable> #include <thread> #include <chrono> #include <future> #include <cstdlib> std::condition_variable cv; std::mutex cv_m; int i = 0; bool done = false; void clearScreen() { #ifdef WIN32 system("cls"); #else system("clear"); #endif } void yellow() { std::cout << "yell...
#pragma once #include "character.h" #include "defs.h" #include "camera.h" #include "bullet.h" #include "gunBullets.h" #include <iostream> class Enemy : public character { public: Enemy(sf::Vector2f position = sf::Vector2f(0, 0)); ~Enemy(); void update(int, int, float, sf::Vector2f& , sf::Vector2...
#include "CameraManager.h" #include "DirectZob.h" CameraManager::CameraManager() { m_cameras.clear(); std::string n = "EditorCam"; CreateCamera(n, Vector3(50, -50, 50), Vector3(0, 0, 0), Vector3(0, 1, 0), 45.0f); m_curCam = m_cameras[0]; } CameraManager::~CameraManager() { for (int i = 0; i < m_cameras.size(); i...
#pragma once #include <memory> #include <vector> #include <thread> #include "server/Listener.hpp" #include "server/Types.hpp" namespace bs { class Server { public: Server(const std::string& host, Port port, int threadsNum); int Run(); private: Host m_host; Port m_port; int m_threadsNum; }; } // namespace...
#pragma once #include <memory> #include <tudocomp/meta/Config.hpp> #include <tudocomp/meta/Meta.hpp> namespace tdc { class Algorithm { Config m_config; public: template<typename T, typename... Args> static inline std::unique_ptr<T> instance( std::string config_str, Meta meta, Ar...
#ifndef INOUT_H #define INOUT_H #include <string> using namespace std; class inout { private: public: inout (); void readtext_example(double *, int, int, int); void printArray(double *x, int n); void print2Array(double *x, double *y, int n); void printArray2d(double *x, int ...
/* * Copyright (C) 2012-2016 Open Source Robotics Foundation * * 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 a...