text
stringlengths
8
6.88M
//===-- OR1KRegisterInfo.cpp - OR1K Register Information --------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
class BrowningHP_DZ: M9 { scope = 2; displayName = $STR_DZ_WPN_BROWNING_HP_NAME; descriptionShort = $STR_DZ_WPN_BROWNING_HP_DESC; model = "\RH_de\RH_browninghp.p3d"; picture = "\RH_de\inv\browninghp.paa"; begin1[] = {"\RH_de\sound\browninghp.wss",0.794328,1,700}; soundBegin[] = {"begin1",1}; drySound[] = {"\ca...
class Ka60_GL_BASE_PMC; class Ka60_GL_PMC: Ka60_GL_BASE_PMC { class Turrets; class MainTurret; }; class Ka60_GL_PMC_DZ: Ka60_GL_PMC { displayName = "$STR_VEH_NAME_KA60"; vehicleClass = "DayZ Epoch Vehicles"; scope = 2; crew = ""; typicalCargo[] = {}; radartype = 0; class TransportMagazines{}; class Transpor...
#include <iostream> #include <fstream> using namespace std; class liczba_zad { int liczba; public: int odwroc_liczbe(); bool czy_suma_jest_palindromem(); private: string zamien_liczbe_na_string(); string odwroc_liczbe_str(string liczbastr); bool czy_palindrom_string(str...
#include "stdafx.h" #include "ICMP.h" BOOL ICMP::Write(BYTE *link) { IP::Write(link); memcpy(link + 20, &m_type, 1); memcpy(link + 21, &m_code, 1); memcpy(link + 22, &m_checksum, 2); memcpy(link + 24, &m_id, 2); memcpy(link + 26, &m_seq, 2); memcpy(link + 28, m_data, 64); return TRUE; } BOOL ICMP::Read(BYTE *...
#ifndef POINTDECOLLECTE_H #define POINTDECOLLECTE_H #include <vector> #include "produit.h" #include "gestionnaireproduits.h" class Producteur; /** @brief La classe PointDeCollecte. ** ** Elle contient un constructeur, le lieu, un @ref GestionnaireProduits, et un bool qui définit si il est ouvert ou fermé. ** **...
#include <conio.h> #include <stdlib.h> #include <stdio.h> #include <time.h> #include <string.h> #include <math.h> #include <locale.h> #include <ctype.h> int x = 0; float p1,p2,media; int main() { printf("\nInsira a p1\n"); scanf("%f",&p1); p2=((15-p1)/2); printf("\nO alun...
/**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the demonstration applications of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding...
#include "ofApp.h" using namespace cv; using namespace ofxCv; //-------------------------------------------------------------- void ofApp::setup(){ ofSetFullscreen(false); ofSetVerticalSync(false); ofSetFrameRate(200); screenFbo.allocate(viewWidth, viewHeight); screenFbo.begin(); ofClear(50, 0, 0, 255); sc...
#pragma once #include "bricks/core/types.h" #if BRICKS_CONFIG_LOGGING_ZOMBIES #include "bricks/core/sfinae.h" #endif #include <stdlib.h> namespace Bricks { class Object; class String; namespace Internal { class ReferenceCounter { private: u32 referenceCount; ReferenceCounter() : referenceCount(1) { ...
#ifndef ASS2_COMPLETE_H #define ASS2_COMPLETE_H #include "Question.h" #include <bits/stdc++.h> using namespace std; class Complete : public Question { private: static int Com_num; int Q_ID; public: Complete() { Com_num++; Q_ID = Q_num; } int getQuestionNumber()...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include "mp4v2/mp4v2.h" #include "sps_pps_parser.h" #include "Mp4Parser.h" #define NL_LOGE printf static unsigned const samplingFrequencyTable[16] = { 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, ...
// Copyright (c) 2021 ICHIRO ITS // // 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 limitation the rights // to use, copy, modify, merge, publish, di...
#include <iostream> #include <string> #include <cstdio> #include <memory.h> #include <string.h> #include <cmath> #include <cstdlib> #include <ctime> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <functional> #include <climits> typedef long long LL; type...
// vnqdptd.cpp : 定义 DLL 应用程序的导出函数。 // #include "vnqdptd.h" ///------------------------------------------------------------------------------------- ///从Python对象到C++类型转换用的函数 ///------------------------------------------------------------------------------------- void getInt(dict d, string key, int *value) { if (d.h...
#pragma once #include <string> using namespace std; class Complejo{ private: int real, imag; public: Complejo(); Complejo(int r, int i); int getReal(); int getImg(); Complejo operator+ (Complejo operando){ return suma(*this, operando); } ...
//camera zoom mode #include<iostream> #include<SFML\graphics.hpp> #include<GL\glew.h> #include "inc\LoadShaders.h" using namespace std; using namespace sf; const int CheckPeriodms=20; const int RefreshTimeMaxms=30; const int Time_BufsPerInput=0;//this doesnot sem to affect performance but why?? const int ProcessTime...
#include <iostream> #include <vector> #include <list> #include <queue> #include <algorithm> #include <iomanip> #include <map> #include <string> #include <cstdio> #include <cstring> using namespace std; struct Rank { int id; char name[10]; int score; }; bool comps(Rank& a, Rank& b) { if (a.score != b.score) ...
#ifndef GNDX9DATASTREAM_H #define GNDX9DATASTREAM_H #include "GnMeshData.h" class GnDX9DataStream; class GNDIRECTX9RENDERER_ENTRY GnDX9MeshData : public GnMeshData { protected: enum { MAX_DECLARATION_SIZE = 10, }; protected: LPDIRECT3DVERTEXDECLARATION9 mpDeclaration; public: GnDX9MeshData(); virtual ~GnDX9...
/* ----------------------------------------------------------------------------------------- Laboratory : POO2 - Laboratoire 14 File : cstring.h Author : Thomas Benjamin, Gobet Alain Date : 22.03.2018 Class : POO - A Goal : Declaration of a class String similar to std::string Remark(s...
// Created on: 1993-01-13 // Created by: CKY / Contract Toubro-Larsen ( Deepak PRABHU ) // Copyright (c) 1993-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 ...
//===================================== Bibliotecas E Definições ===================================== #include <EEPROM.h> //EEPROM #include <SPI.h> //Biblioteca necessária para comunicação SPI #include <SD.h> //Biblioteca necessária para comunicação SD card #include <Wire.h> ...
#include "stdafx.h" #include "CMemory.h" #include <chrono> #include <fstream> #include <thread> #include <unordered_map> #include "alt-log.h" #include "scripting/CScriptManager.h" using namespace alt; std::wstring _moduleDir; static std::wstring GetModulePath(HMODULE module) { DWORD size = MAX_PATH; std::vector<wc...
// 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 published // by the Free Software Foundation, with special ...
// Fill out your copyright notice in the Description page of Project Settings. #include "Population.h" #include "Specimen.h" #include "../NeuralNetwork/Manager/NeuralNetworkManager.h" #include "../NeuralNetwork/NeuralNetwork.h" #include "../NeuralNetwork/Objects/Neuron/Neuron.h" #include "../NeuralNetwork/Objects/Syn...
/*Team name: KitKat*/ #include <iostream> #include <queue> #include <cstdio> using namespace std; queue<int> q; int main(){ int t, n, m, curmin, served, maxwait, totalwait, mechtime; double ave; cin >> t; for(int tc = 1; tc <= t; tc++){ cin >> n; curmin = served = 0; ...
// // autotestscene.cpp // AutoCaller // // Created by Micheal Chen on 2017/7/28. // // #include "autotestscene.hpp" #include "autocontroller.hpp" #include "platform/CCApplication.h" #include "imcases.hpp" #include "talkservice.hpp" USING_NS_CC; using namespace ui; using namespace std; cocos2d::Scene* IMAutoTestS...
#pragma once #include "Interface/IRuntimeModule.h" #include "Common/ConfigLoader.h" namespace Rocket { Interface IApplication : implements IRuntimeModule { public: IApplication() : m_IsRunning(true) {} virtual ~IApplication() = default; virtual void LoadConfig(const Ref<ConfigLoade...
#include "settingdialog.h" #include "ui_settingdialog.h" SettingDialog::SettingDialog(QWidget *parent) : QDialog(parent), ui(new Ui::SettingDialog) { ui->setupUi(this); } SettingDialog::~SettingDialog() { delete ui; } void SettingDialog::setMaxH(const int & val) { ui->barMaxH->setValue(val); } v...
#include "town.h" /*---------------------------------------------------------- If given a char value the constructor will initialize the map array to the char, otherwise set to 'G' ----------------------------------------------------------*/ Town::Town(char type){ map = new char*[H_ACRE]; for (int i = 0; i ...
#include "f3lib/io/TerrainIncReader.h" #include <fstream> #include <sstream> #include <iostream> #include <codecvt> #include <regex> bool f3::io::readTerrainInc(const std::string& filepath, f3::types::TerrainTextureIdMap& terrainIdMap) { std::wifstream ifs(filepath.c_str()); ifs.imbue(std::locale(ifs.g...
#ifndef RANDOM_NUMBER_GENERATOR_H #define RANDOM_NUMBER_GENERATOR_H class RandomNumberGenerator { public: RandomNumberGenerator(unsigned int seed); void setSeed(unsigned int seed); void reset(); int getInt(int min, int max); float getFloat(float min = 0.0f, float max = 1.0f); bool getBool(); private: int ge...
void defineCor(int pwmRed, int pwmGreen, int pwmBlue){ //setColor(pwmRed,pwmGreen,pwmBlue); /* if (msg == "1"){ digitalWrite(Rele1, HIGH); }else if (msg == "2"){ digitalWrite(Rele1, LOW); }else if (msg == "3"){ digitalWrite(Rele2, HIGH); }else if (msg == "4"){ digitalWrite(R...
#ifndef WHILENODE_H #define WHILENODE_H #include <vector> #include <string> #include <iostream> #include "Node.hpp" using namespace std; class WhileNode : public Node { private: Node *condition = nullptr; Node *value = nullptr; public: WhileNode(Node *condition, Node *value); /** isinteger checks ...
// SPDX-FileCopyrightText: 2021 Samuel Cabrero <samuel@orica.es> // // SPDX-License-Identifier: MIT #include <Buzzer.h> #include "armoring.h" #include "config.h" #include "global.h" #include "auth.h" TArmoring::TArmoring() { } const char *TArmoring::name() const { return STATE_ARMORING_STR; } bool TArmoring::tim...
#include "engine/graphics/ProgressBar.hpp" ProgressBar::ProgressBar(int total, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int x_pos, int y_pos){ x = x_pos; y = y_pos; red = r; green = g; blue = b; alpha = a; progressBar = new SDL_Rect(); BarBoundary = new SDL_Rect(); progressTimer = new LT...
#include <catch2/catch.hpp> #include <replay/vector2.hpp> using namespace replay; TEST_CASE("vector2: Can read values from single-parameter ctor") { v2<float> v{ 4.32f }; REQUIRE(v[0] == 4.32f); REQUIRE(v[1] == 4.32f); } TEST_CASE("vector2: Can read values from multi-parameter ctor") { v2<float> v{7...
// // Boat.hpp // GAME2 // // Created by ruby on 2017. 11. 11.. // Copyright © 2017년 ruby. All rights reserved. // #ifndef Boat_hpp #define Boat_hpp #include <iostream> #include "Object.hpp" using namespace std; class Boat : public Object { private: bool hasShot; int crtX, crtY; public: Boat(){} ...
#include <iostream> #include <fstream> #include <string> #include <sstream> using namespace std; const int DENOM = 7; const int RMAP[DENOM][2] = {{'I', 1}, {'V', 5}, {'X', 10}, {'L', 50}, {'C', 100}, ...
//Слова называются анаграммами, если одно из них можно получить перестановкой букв в другом. //Например, "eat" и "tea" — анаграммы, потому что состоят из одних и тех же букв в разном порядке. //Даны пары слов. Проверьте, можно ли назвать слова в каждой паре анаграммами. //Формат ввода: //Сначала дано число пар слов N...
#include "stdafx.h" #include "powerUp.h" #include "consoleFunctions.h" #include <iostream> using namespace std; void powerUp::powerUpTypeRandomize() { powerUpType = rand() % 3; } int powerUp::getPowerUpType() { return powerUpType; } int powerUp::getPowerUpX() { return powerUpX; } int powerUp::getPowerUpY() { ...
#include "bishop.h" #include "board.h" //Implementation of Bishop class, includes functions that get all possible moves for the rook (based on how to piece is allowed to move following the conventional rules of chess) void bishop::setMoves(board* bin) //gets possible moves { for( int xdir = -1; xdir <= 1; xdir +=2 ) ...
#include "compiler/steps.hpp" #include "compiler/exceptions.hpp" #include "shared/optional_apply.hpp" #include "vm/instruction_pointer.hpp" #include <boost/variant/apply_visitor.hpp> #include <utility> #include <tuple> #include <sstream> namespace perseus { namespace detail { namespace clean = perseus::detai...
#include "../inc.h" #include "../linear/matrix.h" #include "../linear/square.h" #include "../linear/vector.h" #include "affine.h" #include "line.h" #include "surface_plane.h" #include <math.h> #include <initializer_list> #include <vector> #ifndef CLASS_TRANSFORM #define CLASS_TRANSFORM #if defined(_T) && !defined(_3D...
//Copyright Yandex 2012 #ifndef LTR_CLIENT_UTILITY_DATA_INFO_H_ #define LTR_CLIENT_UTILITY_DATA_INFO_H_ #include <string> using std::string; /** * Contains the information about the dataset, including * name of the dataset, approach in the dataset, * the format of the dataset and the file name. */ struct DataInf...
#include<iostream> #include<vector> #include<algorithm> #include<ctime> #include<cstdlib> #include<set> using namespace std; void row(vector<int> &v, set<int> &s, int i) { int r = i / 9; for(int j = 0; j<9; j++) { if(v[r*9+j] !=0) { s.insert(v[r*9+j]); } } } void...
#pragma once #include "../controls/RollupCtrl.h" #include "../DecalEntity.h" enum E_TERRAIN_PAINT_TYPE { E_TERRAIN_PAINT_NULL_TYPE, E_TERRAIN_ADD, E_TERRAIN_MINUS, E_TERRAIN_PAINT_TYPE_COUNT }; class CTerrainPaintTool : public CEditTool { public: DECLARE_DYNCREATE(CTerrainPaintTool) CTer...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ #ifndef __SSLCIPHSPEC_H #define __SSLC...
// 0922_16.cpp : 定义控制台应用程序的入口点。 //进制转换 //输入一个十进制数N,将它转换成R进制数输出。 //输入数据包含多个测试实例,每个测试实例包含两个整数N(32位整数)和R(2<=R<=16, R<>10)。 //为每个测试实例输出转换后的数,每个输出占一行。如果R大于10,则对应的数字规则参考16进制(比如,10用A表示,等等)。 #include<iostream> using namespace std; int main() { char a[50]; char s[17] = "0123456789ABCDEF"; int N, R; while (cin >> N >> R) ...
/****************************************************** Main Application *****************************************************/ #include "Qwerty3D-PC.h" using namespace Noise3D; Qwerty::RenderModule::RenderModule(): mTimer(Noise3D::Ut::NOISE_TIMER_TIMEUNIT_MILLISECOND) { } Qwerty::RenderModule::~RenderMod...
#define BOOST_TEST_MODULE BajkaTestProgram #define BOOST_TEST_DYN_LINK #include <boost/test/unit_test.hpp> #include <iostream> #include <Pointer.h> #include "Events.h" //#include "helpers/TestObserver.h" //#include "helpers/TestObservable.h" //#include "helpers/TestEvent.h" BOOST_AUTO_TEST_SUITE (EventTest); /** ...
#include <bits/stdc++.h> using namespace std; typedef vector<char> VC; typedef vector<VC> VVC; VVC MAPA; int R,C,Npuentes,i,j; int movs[4][2]= {{0,1},{0,-1},{1,0},{-1,0}}; int busca(short int r, short int c){ int regreso=1; if(r>=1 && r <=R && c>=1 && c<=C){ if(MAPA[r][c]!='.'){ if(MAPA[r]...
#define EPSILON_CLOSE_WITH_FWPDS 1 /*! * @author Evan Driscoll */ #include "wali/Common.hpp" #include "wali/DefaultWorklist.hpp" #include "wali/wfa/WFA.hpp" #include "wali/wfa/State.hpp" #include "wali/wfa/TransFunctor.hpp" #include "wali/wfa/Trans.hpp" #include "wali/wfa/WeightMaker.hpp" #include "wali/regex/AllRe...
#ifndef CSIDEBARWIDGET_H #define CSIDEBARWIDGET_H #include <QFrame> QT_BEGIN_NAMESPACE class QVBoxLayout; class QButtonGroup; QT_END_NAMESPACE class CSideBarWidget : public QFrame { Q_OBJECT public: CSideBarWidget(QWidget *parent); ~CSideBarWidget(); void addTab(const QString& text, const QChar& icon); void i...
// we are defining a fake i960Zx series processor, this processor does not exist but will be what I'm calling my simulated design // It has an SALIGN value of 4 like the i960Kx,i960Sx, and i960MC processors /// @todo figure out the arcada library to allow for QSPI and SDCard simultaneous interaction and write an examp...
// Example 6.1 : Buil-in arrays, std::array, simple algorithms // Created by Oleksiy Grechnyev 2017 // Class Tjej is used here, it logs Ctors and Dtors #include <iostream> #include <string> #include <array> #include <experimental/array> #include <algorithm> #include <memory> //#include "Tjej.h" using namespace std;...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2008 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 <stdio.h> #include <string.h> #i...
#include "DX11RenderSystem.h" #include "d3d11.h" #include "DX11Utils.h" #include "DX11InputLayout.h" #include "DX11GpuProgram.h" #include "DX11DatatypeHelper.h" #include "DX11RenderTarget.h" #include "DX11VertexBuffer.h" #include "DX11IndexBuffer.h" #include "DX11GpuVertexData.h" namespace HW{ DX11RenderSystem* g_pDX...
#include "BrickManager.h" #include <iostream> /* Constructor for brick manager. procRandom is used to set the randomness of powerups. This constructor initializes the vectors bricks and powerUps. */ BrickManager::BrickManager(int procRandom) { bricks = std::vector<Brick*>(); powerUps = std::vector<Power...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "12563" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) #define MAXN 10000 int main(int argc, char const *argv[]) { #ifdef DBG freopen("uva" PROBLEM TESTC ".in", "r", stdin); freopen("uva" PROBLEM ".out", "w", stdout); #...
#ifndef MAT_H_INCLUDED #define MAT_H_INCLUDED #include <math.h> #include "GL/gl.h" template <typename T=GLfloat> union _vec4 { T m[4]; struct { T x, y, z, w; }; }; template <typename T=GLfloat> union _vec3 { T m[3]; struct { T x, y, z; }; }; template <typename T=GLfl...
#pragma once #include "utils/ptts.hpp" #include "proto/config_buff.pb.h" #include "utils.hpp" #include <string> using namespace std; namespace pc = proto::config; namespace nora { namespace config { using buff_ptts = ptts<pc::buff>; buff_ptts& buff_ptts_instance(); ...
#include <iostream> #include <cstring> #define TempMessageLen 500 static char MsgBuffer[1000]; typedef struct { int len; char logo[5]; char type[5]; char hawq_version[20]; char psql_version[10]; char os_version[40]; char macaddr[20]; char reserverd[10]; } load_req; #define HQ_VERSION "oushu 4.0.0.0" #defin...
// Based on NVIDIA's OptiX implementation of 2009. // Code modified by Jeppe Revall Frisvad, 2013. #define SOLUTION_CODE #include <cmath> #include "CGLA/Vec4f.h" #include "CGLA/Vec3f.h" #include "CGLA/Vec2f.h" #include "GLGraphics/GLHeader.h" #include "skymodel.h" #include <thread> #include <QTime> using namespace ...
#ifndef COUNTERS_HPP #define COUNTERS_HPP #include "Persistence.hpp" #include <map> #include <string> /** * @brief Data abstraction for object classification to be persisted */ class Counters { private: std::map <std::string, int> countMap; Persistence persistence; void PersistUpdate(std::string name, i...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> using namespace std; typedef long long LL; const LL mod = 1000000000; int n; LL f[310][310]; bool vis...
#pragma once #include "Analysis.hpp" #include <cmath> #include <complex> #include "Zygelman.hpp" #include "Helper.hpp" using namespace std; typedef std::complex<double> dcomp; class Bispectrum_NLG { public: Bispectrum_NLG(AnalysisInterface *analysis); ~Bispectrum_NLG(); double ca...
#include "global.h" float interpolate_undefined_arrival(float ***at,const int i,const int j,const int k) { int ii,lo,up; ii = i; while ((ii>0) && (at[ii][j][k]<0)) { ii--; } lo = ii; ii = i; while ((ii<nx-1) && (at[ii][j][k]<0)) { ii++; } up = ii; if ((up>i) && (lo<i)) { at[i][j][k] = ((up-i)*at[lo][j]...
#include <iostream> #include <vector> using namespace std; int main() { int ret = 0; vector<int> tasks; for (int i = 0; i < 3; i++) { int x; cin >> x; tasks.push_back(x); } sort(tasks.begin(), tasks.end()); for (int i = 1; i < 3; i++) ret += tasks[i] - tasks[i - 1]; cout...
/* * Copyright (C) 2013 Tom Wong. All rights reserved. */ #ifndef __GT_FT_TEMP_H__ #define __GT_FT_TEMP_H__ #include "gtobject.h" #include <QtCore/QIODevice> GT_BEGIN_NAMESPACE class GtFTTempData; class GtFTTempPrivate; class GT_SVCE_EXPORT GtFTTemp : public QIODevice, public GtObject { Q_OBJECT public: ...
// // Created by manout on 17-3-22. // #include "common_use.h" /* * Find the contiguous sub_array within array(containing at least one number)which has the largest sum * * 分析: * 最大连续子序列的和 * 当我们从头到尾遍历这个数组的时候,对于数组里的一个整数,它只有两种选择 * 1:加入之前的sub_array * 2:自己另起一个sub_array ...
#include <gtkmm/application.h> #include "./HelloWorld.h" int main(int argc, char** argv) { auto app = Gtk::Application::create(argc, argv, "org.brianna.love"); HelloWorld hw; return app->run(hw); }
#include<bits/stdc++.h> using namespace std; #define ll long long ll dp[12][2][2][15],len; char num[12]; ll digitDP(int pos, int isEqual,int allZeroes, int totZero){ if(pos==len) return totZero; ll &ret = dp[pos][isEqual][allZeroes][totZero]; if(ret!=-1) return ret; ret = 0; int d = num[pos]-'0'; int mx = isEqu...
/* Given a generic tree and an integer x, check if x is present in the given tree or not. Return true if x is present, return false otherwise. Input format : The first line of input contains data of the nodes of the tree in level order form. The order is: data for root node, number of children to root node, data of e...
class BookInfo { public: enum Status { ONTHEBOOKSHELF, BORROWED }; std::string author; std::string category; unsigned int pagesno; Status status; BookInfo() { } BookInfo(std::string author, std::string category, unsigned int pagesno, Status status) { this->author = author; this->categor...
// BHNavigator.h: interface for the CBHNavigator class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_BHNAVIGATOR_H__B6B72310_2259_494E_8CBC_A4124F3CF5DF__INCLUDED_) #define AFX_BHNAVIGATOR_H__B6B72310_2259_494E_8CBC_A4124F3CF5DF__INCLUDED_ #if _MSC_VER > 1000 #pra...
// // Created by cirkul on 27.11.2020. // #include "Predator.h" void Predator::eat() { for (auto victim : this->home->animals) { if (!victim->isAlive) continue; if (this->satietyInd == this->maxSatisfaction) return; if (victim->id == predator || victim->escape() || ...
#ifndef type_lists_hpp #define type_lists_hpp #include "../2/convertability.hpp" #include "../2/mappings.hpp" #include "../2/types.hpp" template<class T, class U> struct TypeList { typedef T Head; typedef U Tail; }; typedef TypeList<signed char, TypeList<short int, TypeList<int, Typ...
//: C03:StructArray.cpp // Kod zrodlowy pochodzacy z ksiazki // "Thinking in C++. Edycja polska" // (c) Bruce Eckel 2000 // Informacje o prawie autorskim znajduja sie w pliku Copyright.txt // Tablica struktur typedef struct { int i, j, k; } ThreeDpoint; int main() { ThreeDpoint p[10]; for(int i = 0...
/* * Copyright (c) 2001, Swedish Institute of Computer Science. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *...
#include <iostream> #include <vector> using namespace std; #define max_3base 29527 int main(){ int N; cin >> N; int cnt = 0; for(int i = 1; i <= max_3base; i++) { int flag[3] = {0}; int num = i; vector<int> buf; int ans; while((num - 1) / 3 != 0){ ...
#include "DoggieList.h" DoggieList::DoggieList() { this->current = 0; } void DoggieList::add(const Doggie& dog) { this->doggies.add(dog); } Doggie DoggieList::getCurrentDog() { if (this->current == this->doggies.getSize()) this->current = 0; return this->doggies[this->current]; } void DoggieList::seeDogs() { ...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i++) #define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;} #define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;} typedef long l...
//Phoenix_RK /* https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/ Given a binary tree struct Node { int val; Node *left; Node *right; Node *next; } Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL....
int Solution::lis(const vector<int> &nums) { int maxlen = 0; vector<int> dp(nums.size(), 1); if(nums.size() <= 1) return nums.size(); int i=0,j=0; while(i<nums.size()){ if(i==j){ i++; j=0; } else { if(nums[i]>nums[j]){ ...
#include <unordered_map> #include <list> // list 的remove操作是o(n)的,erase才是o(1) // remove的参数是value,基于该值做遍历比较然后删除 // erase的参数是迭代器,直接删除 class LRUCache { // 第一个是key,第二个是value typedef std::list<std::pair<int,int>> LruList; typedef LruList::iterator list_iterator; typedef std::unordered_map<int, list_iterator>...
// Created on: 1997-04-10 // Created by: Prestataire Mary FABIEN // Copyright (c) 1997-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 o...
//: C06:DefineInitialize.cpp // Kod zrodlowy pochodzacy z ksiazki // "Thinking in C++. Edycja polska" // (c) Bruce Eckel 2000 // Informacje o prawie autorskim znajduja sie w pliku Copyright.txt // Definiowanie zmiennych w dowolnych miejscach #include "../require.h" #include <iostream> #include <string> using n...
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); //设置输入非明文显示 ui->passlineEdit->setEchoMode(QLineEdit::Password); //QObject::connect(ui->calButton, SIGNAL(clicked()), this, SLOT(calSlot()...
#include <Homie.h> #include <OneWire.h> #include <DallasTemperature.h> #define PIN_BUTTON 0 #define PIN_RELAY 12 #define PIN_LED 13 #define DS18B20 14 #define INTERVAL 30 // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs) OneWire oneWire(DS18B20); // Pass our ...
// API_03_WinMenu.cpp : 애플리케이션에 대한 진입점을 정의합니다. // #define _CRT_SECURE_NO_WARNINGS #include "framework.h" #include "API_03_WinMenu.h" #include <commdlg.h> #include <stdio.h> #define MAX_LOADSTRING 100 // 전역 변수: HINSTANCE hInst; // 현재 인스턴스입니다. WCHAR szTitle[MAX_LOADSTRING]; ...
#pragma once namespace Hourglass { // A wrapper class for hardware vertex and index buffers class RenderBuffer { protected: ComPtr<ID3D11Buffer> m_VertexBuffer; ComPtr<ID3D11Buffer> m_IndexBuffer; ID3D11InputLayout* m_InputLayout; UINT m_Stride; UINT m_VertexCount; UINT m_IndexCount; uint1...
#pragma once #include "atlas/tools/Tools.hpp" #include "atlas/utils/Geometry.hpp" #include "atlas/gl/VertexArrayObject.hpp" #include "atlas/gl/Buffer.hpp" #include <vector> #include <stack> namespace assignment3 { class TurtleValue : public atlas::utils::Geometry { using Point = atlas::math::Point; ...
#include <iostream> #include <fstream> #include <cmath> #include <iomanip> #include "finite_diffrence_methods/method/regular/explicit/EuroExplicitMethod.hpp" #include "options/OptionPut.hpp" #include "finite_diffrence_methods/method/regular/implicit/EuroImplicitMethod.hpp" #include "finite_diffrence_methods/method/regu...
// // imcommontests.cpp // AutoCaller // // Created by Micheal Chen on 2017/7/18. // // #include "imcommontests.hpp" IMCommonTests::IMCommonTests() { ADD_TEST_CASE(UserCommonTest); ADD_TEST_CASE(MessageCommonTest); ADD_TEST_CASE(VoiceCommonTest); } void UserCommonTest::onEnter() { TestCase::onEnt...
#include <iostream> #include <cstring> #include <vector> #include <stack> const int MAX = 10000; int n, m, ID[MAX * 2 + 1], ID_cnt, group[MAX * 2 + 1]; bool finish[MAX * 2 + 1]; std::vector<int> link[MAX * 2 + 1]; std::stack<int> stk; std::vector<std::vector<int>> SCC; void link_push(int xi, int xj) { if(xi < 0) ...
//************************************************************************************************************* // // レンダラー処理[renderer.cpp] // Author : Sekine Ikuto // //************************************************************************************************************* //--------------------------------...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-1999 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef DOM_LSEVENTS #define DOM_LSEVENTS #ifdef DOM3_LOAD #...
#pragma once // Taken largely from Robert Penners easing equations #define EASE_PI 3.1415926535897932384626433832795f #define EASE_TWOPI 6.283185307179586476925287f #define EASE_PI_DIV2 1.570796326794896619231322f #include <cmath> #define EASE_MODE_FIRST EASE_LINEAR #define EASE_MODE_LAST EASE_...
#include "Player.h" //------------------------------- //コンストラクタ・デストラクタ Player::Player( Sounder* sounder ){ _position = VGet( 0, 0, ( float )FIRST_DISTANCE ); _direction = VGet( 0, 0, 1 ); for ( int i = 0; i < PRE_POS_MAX_INDEX; i++ ) { _prePos[ i ] = VGet( 0, 0, 0 ); } _prePos[ 0 ] = _position; //最初の座標を_preP...