text
stringlengths
8
6.88M
#pragma once #include <SFML/Graphics.hpp> #include <iostream> using namespace std; using namespace sf; #include "SettingsMgr.h" #include <iostream> #include <iomanip> #include <string> void die(string end); // finish this code; add functions, data as needed class SettingsUI { private: SettingsMgr *settingsMgr; publ...
/************************************************************* * > File Name : c1083_2.cpp * > Author : Tony * > Created Time : 2019/11/03 17:18:11 * > Algorithm : **************************************************************/ #include <bits/stdc++.h> using namespace std; inline ...
#include <cmath> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <unordered_map> #include <unordered_set> #include <vector> #include <set> #include <stack> #include <sstream> #include <string> using namespace std; struct TreeNode { int val; TreeNode* left; Tr...
#include "Com.h" #if 0 namespace Cache::Native { thread_local memcached_st *memc = 0; thread_local memcached_server_st *servers = 0; const char* memcached_error = 0; const char* GetLastError() {return memcached_error;} void InitMemcachedThread() { if (memc == NULL) { memcached_return rc; memc = memcached_crea...
/// /// \file Tools.h /// \brief /// \author PISUPATI Phanindra /// \date 01.04.2014 /// #ifndef TOOLS_H #define TOOLS_H #include <cmath> #include "MarkerData.h" namespace Tools { /// /// \brief wrap radians to PI /// \param input angle in radians /// \return angle between (-pi, pi] /// float ...
#ifndef BoxCollider_hpp #define BoxCollider_hpp #include <stdio.h> #include "Collider.hpp" class BoxCollider : public Collider { private: float xRange; float yRange; public: GameObject *parent; BoxCollider(float width, float height, GameObject *newParent); ~BoxCollider(); voi...
/*************************************************************************** listadimensiones.h - description ------------------- begin : mar 24 2004 copyright : (C) 2004 by Oscar G. Duarte email : ogduarte@ing...
#include "stdhdr.h" using namespace Singularity; namespace Singularity { namespace Tasks { #pragma region Static Variables DWORD CTaskPool::g_iTLSindex = TLS_OUT_OF_INDEXES; #pragma endregion #pragma region Constructors and Finalizers CTaskPool::CTaskPool() : m_iThreadCount(0), m_pThread...
#ifdef FASTCG_OPENGL #include <FastCG/Graphics/OpenGL/OpenGLUtils.h> #include <FastCG/Graphics/OpenGL/OpenGLTexture.h> #include <FastCG/Graphics/OpenGL/OpenGLExceptions.h> namespace FastCG { OpenGLTexture::OpenGLTexture(const Args &rArgs) : BaseTexture(rArgs) { auto target = GetOpenGLTarget(mType); ...
#include <pthread.h> #include <vector> #include <cstdio> #include <cstring> #include <unistd.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/types.h> #include <sys/time.h> #include <errno.h> std::vector<pthread_mutex_t> mutex_gather(3, (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER); //default: use backoff; oth...
#pragma once #include "BlockHandler.h" #include "Entities/Pickup.h" class cBlockLilypadHandler : public cClearMetaOnDrop<cBlockHandler> { typedef cClearMetaOnDrop<cBlockHandler> super; public: cBlockLilypadHandler(BLOCKTYPE a_BlockType) : super(a_BlockType) { } virtual bool CanBeAt(cChunkInterface & a_...
/** * * @file HumanoidFootprintManager.cpp * @author Naoki Takahashi * **/ #include "HumanoidFootprintManager.hpp" #include <stdexcept> #include "ConfigManager.hpp" #include "FootprintPlanner/ConstantRangeBasedHumanoid.hpp" #include "FootprintPlanner/CustomHumanoid.hpp" namespace FootStepPlanner { templ...
class Solution { public: double angleClock(int hour, int minutes) { // hour hand, referred to 00 double h = (hour % 12) + minutes / 60.0; // NOTE, 60.0 double hangle = 360.0 / 12 * h; double mangle = 360.0 / 60 * minutes; double angle = abs(mangle - ...
#include "stdafx.h" #include "StandardCard.h" StandardCard::StandardCard() { } StandardCard::~StandardCard() { }
class Solution { public: int rangeBitwiseAnd(int m, int n) { int diff = n - m; int i = 0; while (diff > 0) { diff /= 2; i++; } return n & ((m >> i ) << i); } };
#include<iostream> using namespace std; // 构造函数调用规则: // 默认情况下c++编译器至少给一个类添加三个函数 // 1.默认构造函数(无参,函数体为空) // 2.默认析构函数(无参,函数体为空) // 3.默认拷贝函数,对属性进行值拷贝 // 规则 // 1.如果用户定义有参构造函数,c++不再提供默认无参构造,但是会提供默认拷贝构造。 // 2.如果用户定义拷贝构造函数。c++不会再提供其他普通构造函数 class Person { public: //无参(默认构造函数) Person() { cout<<"默认构造函数"<<endl...
#include "../inc.h" /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode *rotateRight(ListNode *head, int k) { if(!head || !head->next || k <= 0) ...
#include<bits/stdc++.h> using namespace std; void solve2(vector<int>& top,int target,int& max_value,int cur,int index) { if(cur > target) { return ; } if(index==top.size()) { if(cur > max_value) { max_value = cur; } return ; } solve2(top,target,max_value,cur,index+1); solve2(top,target,max_value...
//$Id$ //------------------------------------------------------------------------------ // DataBucket //------------------------------------------------------------------------------ // GMAT: General Mission Analysis Tool // // Copyright (c) 2002 - 2015 United States Government as represented ...
// // Created by Peter Chen on 5/29/16. // #include "CWVisualDefinition.h" using namespace CubeWorld; CWVisualDefinition::CWVisualDefinition() { } CWVisualDefinition::~CWVisualDefinition() { } void CWVisualDefinition::Serialize(Serializer serializer) { }
#ifndef LZ78C_H #define LZ78C_H #include "Compressor.h" #include "HashTable.h" class LZ78C : public Compressor { public: LZ78C(FILE* output, int compressionLevel); protected: void feedRawByte(Byte arg); void onClosing(); private: HashTable* hashTable; int dictionarySize; int currentNode; int dictionaryMaxSize...
///CSE50-Data Communication Project ///Selective Reject CRC-16 Implementation ///Author: Razwan Ahmed Tanvir ///Email: razwantanvir8050@gmail.com ///================================================================================================================ ///=====================================...
#include<bits/stdc++.h> using namespace std; void replaceSpace(char *str,int length) { char ch[200]; int k = 0; for (int i = 0; i < length; i++) { if(str[i] != ' ') ch[k++] = str[i]; else { ch[k++] = '%'; ch[k++] = '2'; ch[k++] = '0';...
#include "ParseHelper.h" #include <string> #include <vector> #include <iostream> #include <sstream> void ParseVector( const std::string s , float* v ) { std::vector<std::string> elements; std::stringstream ss( s ); std::string item; while ( std::getline( ss , item , ',' ) ) { elements.push_back( item ); } f...
/* HC-SR04 Ping distance sensor: VCC to arduino 5v GND to arduino GND Echo to Arduino pin 7 Trig to Arduino pin 8 This sketch originates from Virtualmix: http://goo.gl/kJ8Gl Has been modified by Winkle ink here: http://winkleink.blogspot.com.au/2012/05/arduino-hc-sr04-ultrasonic-distance.html And modified f...
#include "KoreanMessage.h" #include "EnglishMessage.h" #include "LanguageImpl.h" #include <iostream> int main(int argc, char *argv[]) { std::shared_ptr<Message> korean_message = std::make_shared<KoreanMessage>(); std::shared_ptr<Message> english_message = std::make_shared<EnglishMessage>(); std::shared_p...
# ifndef JAVABACKENDCOMPILER_FILEUTIL_H_ # define JAVABACKENDCOMPILER_FILEUTIL_H_ # include <iostream> # include <fstream> # include <arpa/inet.h> static unsigned char * readCharsFromFileStream(std::ifstream &openFile, unsigned int length) { char * str = new char[length + 1]; openFile.read(str, length + 1); str[le...
#ifndef BLOGPOST_H #define BLOGPOST_H #include "App_WebBrowser.h" #include "Button.h" #include "Article.h" class GameWindow; class App_WebBrowser; class ComputerDesktop; class Textures; class Website; class Article; class Blogpost { public: Blogpost(GameWindow* gameWindowP, Website* websiteP, ComputerDesk...
/* Copyright (C) 2015 Willi Menapace <willi.menapace@gmail.com>, Simone Lorengo - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential * Written by Willi Menapace <willi.menapace@gmail.com> */ #ifndef CONDITION_INCLUDED #define CONDITI...
#ifndef RWTPAT_H #define RWTPAT_H /// @file RwtPat.h /// @brief RwtPat のヘッダファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2005-2011 Yusuke Matsunaga /// All rights reserved. #include "YmNetworks/bdn.h" #include "YmLogic/NpnMap.h" BEGIN_NAMESPACE_YM_NETWORKS class RwtNode; //////////////////////...
// // Created by Sweet Acid on 03.05.2021. // #include "Time.h" namespace Snow { float Time::time; float Time::deltaTime; }
/*========================================================================= Program: Visualization Toolkit Module: vtkFindCellStrategy.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This softwar...
#pragma once #include <GL/glew.h> #include <GLFW/glfw3.h> #include <stdlib.h> #include <stdio.h> #include <glm/glm.hpp> #include <glm/gtc/type_ptr.hpp> #include <iostream> class ShaderProgram { private: char* filetobuf(const char* file); void cleanup(); GLuint vertexshader; GLuint fragmentshader; ...
// This file has been generated by Py++. #ifndef ItemEntry_hpp__pyplusplus_wrapper #define ItemEntry_hpp__pyplusplus_wrapper void register_ItemEntry_class(); #endif//ItemEntry_hpp__pyplusplus_wrapper
#include<bits/stdc++.h> using namespace std; typedef long long ll; void solve(){ int n; cin>>n; vector<int>a(n); for(int i=0;i<n;i++) cin>>a[i]; sort(a.begin(),a.end()); int prev=a[0],c=1,ans=0; for(int i=1;i<n;i++){ if(prev==a[i]){ c++; } else{ ans=ans+min(prev-1,c); prev=a[i]; c=1; } ...
#ifndef CONTENTPAGE_H #define CONTENTPAGE_H #include <QWidget> #include <QLabel> #include <QScrollArea> #include "PlaylistElement.h" #include "PlaylistElementGUI.h" #include "Playlist.h" #include "PlaylistData.h" #include "ImageLoader.h" #include "ContentType.h" class ContentPage : public QWidget { Q_OBJECT private...
#include <iostream> using namespace std; int findMax(int A[], int size) { int max = INT32_MIN; for (int i = 0; i < size; i++) { if (A[i] > max) max = A[i]; } return max; } void countSort(int A[], int sizeof_array) { int max, i, j; int *c; max = findMax(A, sizeof_array); c = new int[max + 1]; for (i = 0...
#include "UI.h" #include "Chat.h" #include "main.h" #include "Chunk.h" #include "Blocks.h" #include "Player.h" #include "System.h" #include "Worlds.h" #include "Network.h" #include "Interface.h" #include "Inventory.h" #include <fstream> #include <numeric> #include <iostream> #include <GL/glew.h> #include <GLFW/glfw3...
#pragma once #include <sstream> #include <assert.h> #include <vector> #include <ctime> #include <cstring> enum ELogColor { ELC_Black, ELC_Red, ELC_Green, ELC_Blue, ELC_Cyan, ELC_Magenta, ELC_Yellow, ELC_White, ELC_Gray, ELC_HiRed, ELC_HiGreen, ELC_HiBlue, ELC_HiCyan, ELC_HiMagenta, ELC_HiYellow, ELC_...
/*********************************************************************** created: Mon Jan 12 2009 author: Paul D Turner *************************************************************************/ /*************************************************************************** * Copyright (C) 2004 - 2011 Pa...
// // Created by Liang on 2019-07-09. // #include <iostream> #include <vector> #include <queue> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} static TreeNode* buildByLevel(vector<int> nums, int null_target=0){ ...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ #define SYNC_INTERNAL_API_PUBLIC_TEST_FAKE_SYNC_MANAGER_H_ #include <string> #include "ba...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
#include "Package.h" #include <iostream> PackageA::PackageA() { m_package_name = "Package A"; } void PackageA::process() { std::cout << m_package_name << ", process()" << std::endl; } PackageB::PackageB() { m_package_name = "Package B"; } void PackageB::process() { std::cout << m_package_name << ",...
#include <bits/stdc++.h> #define ull unsigned long long #define ll long long #define il inline #define db double #define ls rt << 1 #define rs rt << 1 | 1 #define pb push_back #define mp make_pair #define pii pair<int, int> #define X first #define Y second #define pcc pair<char, char> #define vi vector<int> #define vl ...
#include "stack.hh" int main(void){ MyStack my_stack; my_stack.getSize(); my_stack.isEmpty(); cout<<"pushing data"<<endl; for(int i=100; i<110; i++){ my_stack.push(i); } my_stack.getSize(); my_stack.isEmpty(); my_stack.readStack(); cout<<"pulling data"<<endl; for(int i=0; i<8; i++){ cout<...
#include <iostream> using namespace std; int turno,horas,extras; char nombre[30]; double pago,pextras,pnormales; void datos(char nombre[],int &turno, int &horas, int &extras){ cout<<"Nombre del Empleado..: "; cin.getline(nombre,30); cout<<"Ingrese las horas trabajadas..: "; cin>>horas; cout<<"Ingr...
#include "main.h" //user edits //motor ports const int right_intake = 1; const int left_intake = 10; /////////////////////////////////////////////////////// //motor definitions Motor intake1(right_intake, MOTOR_GEARSET_36, 0, MOTOR_ENCODER_DEGREES); Motor intake2(left_intake, MOTOR_GEARSET_36, 1, MOTOR_ENCODER_DEG...
//////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006-2010 MStar Semiconductor, Inc. // All rights reserved. // // Unless otherwise stipulated in writing, any and all information contained // herein regardless in any format shall remain the sole proprietary of ...
/******************************************************************************** ** Form generated from reading UI file 'window.ui' ** ** Created by: Qt User Interface Compiler version 5.9.8 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************...
#include <ArduinoJson.h> #include <Arduino.h> JsonObject& parseJson(DynamicJsonBuffer& jsonBuffer,String json); bool arrContainsKey(JsonArray& arr,String key);
#include <cstdio> #include <cstdlib> #define MINDATA -100000 typedef int ElemType; typedef struct HNode { ElemType *Data; int Size; int Capacity; } HNode, *Heap; typedef Heap MinHeap; MinHeap CreateHeap(int maxSize) { MinHeap h = (MinHeap)malloc(sizeof(HNode)); h->Data = (ElemType*)malloc((maxSize+1)*sizeof(Ele...
#ifndef NODE_H #define NODE_H #include<iostream> using namespace std; template<class T> class Node{ private: T data; Node<T> *next; Node<T> *prev; public: Node(); T getData(); void setData(T data); Node<T>* getNext(); void setNext(Node<T>* temp); Node<T>* getPrev(); void setPrev(Node<T>* temp)...
#pragma once #include "Common.h" #include "vertexBufferObject.h" #include "vertexBufferObjectIndexed.h" #include "Texture.h" #include "Actor.h" class AActor; class AObject: public AActor{ private: //control points vector<glm::vec3> m_coffinTopVertices; vector<glm::vec3> m_coffinBotVertices; vector<glm::vec3> m_cof...
#ifndef BEAM_TREE_H #define BEAM_TREE_H #include <vector> #include <string> class TTree; class TFile; class BeamTree { public: BeamTree(){}; BeamTree(int startRun, int endRun, std::string desc="", bool isLS=false); virtual ~BeamTree(); void LoadData(); void InitTree(); void Process(); ...
#include <float.h> #include <iomanip> #include <iostream> using namespace std; int main() { cout << fixed << setprecision(5) << "max = " << FLT_MAX << endl; cout << fixed << setprecision(5) << "min = " << -FLT_MAX << endl; }
/* * Copyright (C) 2007-2015 Frank Mertens. * * Use of this source is governed by a BSD-style license that can be * found in the LICENSE file. * */ #ifndef FLUXTAR_ARREADER_H #define FLUXTAR_ARREADER_H #include <flux/tar/ArchiveReader> namespace flux { namespace tar { class ArReader: public ArchiveReader { pu...
#include<bits/stdc++.h> using namespace std; int main(){ int n,sum=0; int arr[105]; cin >> n ; for(int i=0;i<n;i++){ cin >> arr[i]; sum+=arr[i]; } if(sum%2)cout<<sum<<endl; else{ int f=0; int mini=INT_MAX; for(int i=0;i<n;i++) if(arr[i]%2){ f=1; mini=min(mi...
#pragma once #include <landstalker-lib/model/world.hpp> #include <landstalker-lib/model/entity_type.hpp> #include <landstalker-lib/tools/sprite.hpp> #include <landstalker-lib/md_tools.hpp> void extract_nigel_sprites(md::ROM& rom, const World& world) { EntityLowPalette palette_low = world.entity_types().at(0)->low...
#include "main.h" /**************************************************/ //user editable constants //motor ports const int left_front = 11; const int left_rear = 12; const int right_front = 19; const int right_rear = 20; //distance constants const int distance_constant = 620; //ticks per tile const double degree_consta...
#include<iostream.h> #include<conio.h> class emp { public: int no; char name[20],des[20]; void get() { cout<<"\n Enter the Employee No:"; cin>>no; cout<<"\n Enter the Employee Name:"; cin>>name; cout<<"\n Enter the Designation:"; cin>>des; } }...
#include "wizDatabaseManager.h" #include <QDebug> CWizDatabaseManager::CWizDatabaseManager(const QString& strUserId) : m_strUserId(strUserId) , m_dbPrivate(NULL) { } CWizDatabaseManager::~CWizDatabaseManager() { closeAll(); } bool CWizDatabaseManager::open(const QString& strKbGUID) { Q_ASSERT(!m_str...
#ifndef REMOVECOMPONENT_H #define REMOVECOMPONENT_H #include "command.h" #include "room.h" class RemoveComponent: public Command { public: RemoveComponent(Room *r); void execute(std::string s); protected: Room *_room; }; #endif // REMOVECOMPONENT_H
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
/*========================================================================= Program: ParaView Module: vtkSelection.h Copyright (c) Kitware, Inc. All rights reserved. See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; wi...
#include <winsock2.h> #include <iostream> #define SUCCESS 0 #define ERROR 1 #define END_LINE 0x0 #define SERVER_PORT 1500 #define MAX_MSG int main() { SOCKET socket = SOCKER return 0; }
#ifndef KARTA_H_INCLUDED #define KARTA_H_INCLUDED #include <iostream> #include "dinstring.cpp" using namespace std; class Karta{ protected: DinString mestoPolaska, mestoDolaska; float duzinaPutovanja, cenaKarte; int identifikatorKarte; public: Karta(); K...
/* * test_ros_wrapper.cpp * * Created on: Dec 5, 2016 * Author: silence */ #include "dragon_driver/propagate/propagate.h" #include "dragon_driver/middleware.h" #include "dragon_driver/hardware/hw_unit.h" #include "dragon_driver/util/parser.h" #include "dragon_driver/ros_wrapper.h" #include <iostream> int...
/** * @file TraversalOption.h * @author F. Gratl * @date 1/18/19 */ #pragma once #include <set> namespace autopas { /** * Possible choices for the cell pair traversal. */ enum TraversalOption { c08 = 0, sliced = 1, c18 = 2, c01 = 3, directSumTraversal = 4, slicedVerlet = 5, c18Verlet = 6, c01V...
/* KJL 12:27:18 26/06/98 - AvP_MenuGfx.hpp */ enum AVPMENUGFX_ID { AVPMENUGFX_CLOUDY, AVPMENUGFX_SMALL_FONT, AVPMENUGFX_COPYRIGHT_SCREEN, AVPMENUGFX_PRESENTS, AVPMENUGFX_AREBELLIONGAME, AVPMENUGFX_ALIENSVPREDATOR, AVPMENUGFX_SLIDERBAR, AVPMENUGFX_SLIDER, AVPMENUGFX_BACKDROP, AVPMENUG...
#include <vector> #include <iostream> #include <queue> using namespace std; // TREENODE CLASS CREATION template <typename T> class TreeNode{ public: int data; vector<TreeNode<int>*> children; TreeNode(int data){ this->data = data; } }; //TAKING INPUT A TREE RECURSIVELY TreeNode<int>* take...
// // Created by Will Smith on 4/12/18. // #include "Dodec.h" double Dodec::calcArea() { return 0; }
/*! *@FileName: KaiXinApp_PokeList.h *@Author: GoZone *@Date: *@Log: Author Date Description * *@section Copyright * =======================================================================<br> * Copyright ? 2010-2012 GOZONE <br> * All Rights Reserved.<br> * The file is generated by Kaixin_...
#ifndef GAMEWORLD_H #define GAMEWORLD_H #include "pacman-main.h" #include <iostream> /// bleeaaaaaaagh. Because you love it. #include <fstream> /// blaaaaaaaaargh. For ifstream. #include <vector> using namespace std ; // This GameWorld class is a // super-container for all // the game world data. ...
#include <stdlib.h> #include <iostream> #include "jvalue.h" using namespace std; int main() { const char *j1 = "{\"key3\":1.3E-3,\"key4\":false,\"key1\":1,\"key2\":\"test\"}"; jvalue *table; char *json; table = jvalue_read(j1, 0); json = jvalue_write(table, 0); cout << json << endl; free(json); jvalu...
#include<iostream> #include<string> #include <fstream> #include "Continent.h" #include "Country.h" #include "Map.h" #include <sstream> #include "SaveLoadMapComponent.h" #include "MapEditorComponent.h" using namespace std; Map SaveLoadMapComponent::readMap(string mapName){ string line; ifstream myfile; myfile.open(...
#ifndef CNFIMP_H #define CNFIMP_H /// @file CnfImp.h /// @brief CnfImp のヘッダファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2005-2011 Yusuke Matsunaga /// All rights reserved. #include "YmNetworks/BNetwork.h" BEGIN_NAMESPACE_YM_NETWORKS class ImpMgr; class ImpInfo; ///////////////////////////////...
#pragma once #define WIN32_LEAN_AND_MEAN #include <windows.h> class SystemController; class Display { private: LPCWSTR m_applicationName; HINSTANCE m_hinstance; HWND m_hwnd; SystemController* systemController; int screenWidth, screenHeight; bool done; void InitializeWindows(); v...
// // Copyright (c) 2003--2009 // Toon Knapen, Karl Meerbergen, Kresimir Fresl, // Thomas Klimpel and Rutger ter Borg // // 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) // // THIS FILE IS AUTOMATICALLY GENERATED ...
/* --COPYRIGHT--,BSD * Copyright (c) 2011, Texas Instruments Incorporated * 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 copy...
class Solution { public: vector<vector<int>> palindromePairs(vector<string>& words) { // vector<vector<int>>result; // for (int i = 0; i<words.size(); i++) { // for (int j = 0; j<words.size(); j++) { // if(i==j) // continue; // if(is_palindrome(words[i...
// // Created by wqy on 19-11-26. // #include "Type.h" namespace esc { void Type::setName(string _typeName) { this->typeName = _typeName; } }
//************************************************************************** //** //** 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 <fd/Laplacian.h> #include <fd/Utils.h> #include <cmath> PetscReal quad_spatial_func(PetscReal x, PetscReal y) { return std::sin(2*x)*std::sin(3*y); } int main(int argc, char **argv) { std::vector<std::tuple<PetscInt,PetscInt,PetscReal>> grid_params { {5,5,2.0}, {10,10,2.0}, ...
#include<bits/stdc++.h> using namespace std; int lcs3(char* a,char* b,int m,int n) { int** output = new int*[m+1]; for(int i=0;i<=m;i++) { output[i]=new int[n+1]; for(int j=0;j<=n;j++) { output[i][j]=0; } } // base case for(int i=0;i<=m;i++) // if n==0 { output[i][0]=0; } for(int i=0;i<=n;i++)...
//----------------------------------------------------------------------------- // Perimeter Map Compiler // Copyright (c) 2005, Don Reba // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met:...
#include <cstdio> // A+B C int main() { long long a, b, c, sum; int times = 0; bool flag = false; scanf("%d", &times); for(int i = 0; i < times; i++) { scanf("%lld %lld %lld", &a, &b, &c); sum = a + b; if(a < 0 && b < 0 && sum >= 0) { // 下溢 flag = false; } else if(a > 0 && b > 0 ...
#include "drake/systems/lcm/lcm_publisher_system.h" #include <cmath> #include <memory> #include <gtest/gtest.h> #include "drake/common/test_utilities/is_dynamic_castable.h" #include "drake/lcm/drake_lcm.h" #include "drake/lcm/drake_mock_lcm.h" #include "drake/lcm/lcmt_drake_signal_utils.h" #include "drake/lcmt_drake...
#ifndef __DATASTRUCTURES_H #define __DATASTRUCTURES_H enum EObjectType { TYPE_SPHERE, TYPE_PLANE }; //////////////////////////////////////// //class decls //////////////////////////////////////// class Ray; class sphere; class plane; class object; class vect; class color; struct light; //######################...
// // Created by wxy on 2018/2/25. // // // Created by wxy on 2018/2/25. // // // Created by wxy on 2018/2/24. // #include <unordered_set> #include <unordered_map> #include <vector> using namespace std; namespace p219 { class Solution { public: bool containsNearbyDuplicate(vector<int> &nums, int k...
#include <iostream> #include <bits/stdc++.h> struct TreeNode { int val; TreeNode * left; TreeNode * right; }; // 98. Validate Binary Search Tree class Solution { public: bool isValidBST(TreeNode* root) { if (!root) return true; return helper(root, LONG_MAX, LONG_MIN); } ...
// // LABOLATORIUM_NR-9.cpp // LABOLATORIUM_NR-9 // // Created by Paweł Gaborek on 15/04/2019. // Copyright © 2019 Paweł Gaborek. All rights reserved. // #include "LABOLATORIUM_NR-9.hpp"
#ifndef CDTMANAGER_H #define CDTMANAGER_H #ifdef SINGLE #define REAL float #else /* not SINGLE */ #define REAL double #endif /* not SINGLE */ #define VOID int #include "triangulation.h" #include "triangle.h" #include "poly.h" #include <QObject> #include <QPolygonF> #include <QPointF> #include <QLineF> #include <QVect...
#include <FastBVH.h> #include <gtest/gtest.h> #include <list> #include "Primitive.h" using namespace FastBVH; namespace { //! \brief This is just boilerplate code for google test //! to be able to run template tests. template <typename T> class BuildStrategyTest : public ::testing::Test { public: using List = s...
/* * imagine.c * * Created on: 2018年11月1日 * Author: x */ #include "terrain.h" #include "texture.h" #include <GL/glut.h> #include <stdio.h> #include <stdlib.h> #include <math.h> static float FRAND() // returns a number ranging from -1.0 to 1.0 { return ((float) rand() - (float) rand()) /...
/* * ===================================================================================== * * Filename: test.cpp * * Description: * * Version: 1.0 * Created: 09/16/2013 03:47:36 PM * Revision: none * Compiler: gcc * * Author: Shuai YUAN (galoisplusplus), y...
#ifndef CALCULATOR_H #define CALCULATOR_H #include "Move.h" #include "TaskManager.h" #include "Player.h" #include "ObjectManager.h" #include "Camera.h" namespace MP { class Calculator { private: void _computer_players_procedure(TaskManager& aMainTaskManager, SoundManager& aSoundManager, ObjectManager& aObiectMa...
#ifndef IMPBASE_H #define IMPBASE_H /// @file ImpBase.h /// @brief ImpBase のヘッダファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2005-2012 Yusuke Matsunaga /// All rights reserved. #include "YmNetworks/bdn.h" BEGIN_NAMESPACE_YM_NETWORKS class ImpMgr; class ImpInfo; ////////////////////////////////...
#pragma once #include "GameFramework/Actor.h" #include "Weapon.generated.h" UCLASS() class SPOOL_API AWeapon : public AActor { GENERATED_BODY() FTimerHandle TimerHandle_Fire; public: UPROPERTY(EditDefaultsOnly, Category = Firearm) float FireCooldown; UPROPERTY(EditDefaultsOnly, Category = Firearm) bool bA...
#ifndef __PRINTTAB_H__ #define __PRINTTAB_H__ #include "tabbase.h" enum class BuildPlatformState { Lowered, Raising, Raised, Lowering, }; inline constexpr int operator+( BuildPlatformState const value ) { return static_cast<int>( value ); } char const* ToString( BuildPlatformState const value ); cl...