text
stringlengths
8
6.88M
#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...
#include "../inc/SEMath.h" template <class T> const SEVec3<T> SEMathUtil<T>::UNIT_X_3 = SEVec3<T>(1,0,0); template <class T> const SEVec3<T> SEMathUtil<T>::UNIT_Y_3 = SEVec3<T>(0,1,0); template <class T> const SEVec3<T> SEMathUtil<T>::UNIT_Z_3 = SEVec3<T>(0,0,1); template <class T> co...
// KC Text Adventure Framework - (c) Rachel J. Morris, 2012 - 2013. zlib license. Moosader.com #ifndef _GAMEOUTPUT #define _GAMEOUTPUT #include <iostream> // Gameplay output will use these functions so I can do any necessary // formatting or other things later. namespace Go // "Game Output" { void Out( std::str...
#pragma once #include "../MsgClient/MsgClient.h" class TestExecutive { public: TestExecutive() {} };
#ifndef ARRAY_HEAD_FILE #define ARRAY_HEAD_FILE ////////////////////////////////////////////////////////////////////////////////// //数组模板类 template <class TYPE, class ARG_TYPE=const TYPE &> class CWHArray { //变量定义 protected: TYPE * m_pData; //数组指针 int64_t m_nMaxCount; //缓冲数目 int64_t ...
#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; int a[1010]; int main() { int t,n; scanf("%d",&t); while (t--) { ...
#pragma once #include "IO.h" #include "IDT.h" #include "typedefs.h" class Task{ //friend class private: uint8_t stack[4096]; cpustate* }
#ifndef TOMATO_TIME_H #define TOMATO_TIME_H #include <QObject> class QTimer; class TomatoTimer : public QObject { Q_OBJECT public: TomatoTimer( void ); ~TomatoTimer( void ); void setTime( int workTime, int restTime ); signals: void finishWork(); void finishRest(); void displayTime( int time ); public slots: ...
#include "GnMeshPCH.h" #include "GnGamePCH.h" #include "GMainGameInterfaceLayer.h" #include "GnIButton.h" #include "GEnergyBar.h" #include "GnIProgressBar.h" #include "GGameDefine.h" #include "GItemInfo.h" #include "GPlayingDataManager.h" #include "GUserHaveItem.h" GMainGameInterfaceLayer::GMainGameInterfac...
/* -*- coding: utf-8 -*- !@time: 2020-03-04 03:23 !@author: superMC @email: 18758266469@163.com !@fileName: 0044_reverse_words.cpp */ #include <environment.h> #include <utility> class Solution { public: string ReverseSentence(string str) { if (str.empty()) return str; vector<str...
// // Created by giofnk on 15/02/20. // #include "FormuleTest.h" void FormuleTest::SetUp(){ table=new Table(10,10); formulaSum=new FormulaSum; formulaMax=new FormulaMax; formulaMin=new FormulaMin; formulaMean=new FormulaMean; table->setCellValue(10.5,0,0); table->setCellValue(20.5,0,1); ...
/* 2016Äê2ÔÂ5ÈÕ10:52:34 */ #include <stdio.h> #include <iostream> #include <string.h> using std::cout; using std::cin; using std::endl; int need[510] = { 0 }; int value[510] = { 0 }; int dp[510][100010] = { 0 };//10^5/500 int main() { freopen("../test.txt", "r", stdin); int N, M; int i, j, k; cin >> N >> M...
#include "UniversalForce.h" #include "Object.h" #include "Define.h" #include <iostream> UniversalForce::UniversalForce(Object* obj) : Force::Force(Vector(0, 0, 0)) { this->object = obj; } UniversalForce::UniversalForce(const UniversalForce& uniForce) : Force::Force(dynamic_cast<const Force&>(uniForce)) { this->obje...
/** * @file mp_map_util.h * @brief motion planning map util */ #include <motion_primitive_library/planner/env_map.h> #include <motion_primitive_library/planner/mp_base_util.h> using linkedHashMap = std::unordered_map<int, std::vector<std::pair<MPL::Key, int>>>; /** * @brief Motion primitive planner in voxel map *...
#include <iostream> using namespace std; int N, r, c; int cnt = 0; void devide(int num, int row, int col); int main() { cin >> N >> r >> c; devide(N, r, c); cout << cnt; } void devide(int num, int row, int col) { int num1 = 1; for (int i = 0; i < num; i++) { num1 *= 2; } int start2 = num1 / 2; if (nu...
#ifndef SRC_Qt_messageBox_h #define SRC_Qt_messageBox_h //#ifndef _WIN32 //#pragma once #include <iostream> #include <QtWidgets/qmessagebox.h> #include <QtWidgets/qapplication.h> #include <QtWidgets/qpushbutton.h> #include <QtWidgets/qstylefactory.h> #include <QtWidgets/qlayoutitem.h> #include <QtWidgets/...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * 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. */ #include "core/pch.h" #include "modu...
#include <algorithm> #include <cassert> #include <iostream> #include <string> #include <vector> template <typename T> class Matrix { public: Matrix(T n, T m) : n(n), m(m), mat(n, std::vector<T>(m)) { // Do nothing. } Matrix(const Matrix<T>& matrix) : n(matrix.n), m(matrix.m), mat(matrix.mat) ...
#pragma once #include <math.h> #include "STDUNC.h" struct mat4 { mat4 (); mat4 (float a, float b, float c, float d, float e, float f, float g, float h, float i, float j, float k, float l, float mm, float n, float o, float p);/* vec4 operator* (const vec4& rhs);*/ mat4 operator* (const mat4& rhs); /*ma...
#pragma once #include "TreeNode.h" #include <iostream> #include <stack> #include <vector> using namespace std; class BinarySearchTree { friend class TransferWindowManager; private: TreeNode * m_root; vector<SoccerPlayerData> v; public: BinarySearchTree() { m_root = NULL; } ~BinarySearchTree() { deleteTree(m_ro...
#include "treeface/scene/Scene.h" #include "treeface/scene/guts/Scene_guts.h" #include "treeface/scene/Geometry.h" #include "treeface/scene/GeometryManager.h" #include "treeface/scene/SceneNode.h" #include "treeface/scene/SceneNodeManager.h" #include "treeface/misc/Errors.h" #include "treeface/misc/PropertyValidator....
# include<iostream> #include <vector> using namespace std; int gcd (int a, int b) { if (a==b) return (a); if (a>b) return (gcd(a-b,b)); return (gcd(b-a,a)); } void swap( int *a, int *b) { int temp = *a; *a = *b; *b = temp; } void print_array(vector<int> &a) { for (int i = 0; i < a.size(...
#include<stdio.h> int main(){ int n,sum=1; scanf("%d",&n); for(int i=1;i<=n;i++) sum=sum*i; printf("%d\n",sum); }
/**************************************************************************/ /* */ /* Copyright (c) 2013-2022 Orbbec 3D Technology, Inc */ /* */ /* PROPRIETA...
#include <type_traits> int main(int argc, char** argv) { // make sure we have c++11 enabled using returnv = std::integral_constant<int, 0>; return returnv::value; }
// Copyright (c) 2007-2013 Hartmut Kaiser // Copyright (c) 2016 Thomas Heller // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // The algorithm was taken from http://lo...
#include <iostream> #include <vector> #include <queue> #define MAX 1001 #define INF 1000000000 using namespace std; int n, m; class Com{ public: int idx, dist, post; vector<pair<int, int>> next; Com(int i = 0, int d = INF, int p = -1) :idx(i), dist(d), post(p) {} bool operator < (const Com &c) cons...
#include <bits/stdc++.h> using namespace std; #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) #define MAXN 100 #define INF 0x3f3f3f3f #define DEVIATION 0.00000005 typedef long long LL; int main(int argc, char const *argv[]) { int kase; scanf("%d",&kase); double A,B; double pi = acos(-1.0); while...
#include<iostream> #include<vector> #include<algorithm> # using namespace std; long n; long checkPossible(vector<long> machines,long goal,long days) { for(int a:machines) { goal=goal-(days/a); } return goal; } // Complete the minTime function below. long minTime(vector<long> machines, long ...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4; -*- * * Copyright (C) 2011 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ group "hardcore.component.syncmessenger"; language c++; require MESSAGELOOP_RUNSLICE_SUPP...
#include "stdafx.h" #include "tilemap.h" #include "level_properties.h" #include "level_style.h" #include "rom_file.h" #include "tile.h" int RareDecompress(Buffer& dst, const Buffer& src); TileParts::TileParts() { tile_count_ = 0; } TileParts::~TileParts() { } bool TileParts::Load(CartFile& c...
#include<bits/stdc++.h> using namespace std; int main(){ int n,k; scanf("%d%d",&n,&k); if(n==1&&k==1){ printf("a"); } else if(k==1){ printf("-1"); } else if(k>n){ printf("-1"); } else if(k==n){ for(int i=0;i<n;i++){ printf...
class FirstNotRepeatingCharSolver { public: int FirstNotRepeatingChar(string str) { if (str == "") return -1; map<char, int> memo; for (auto& i : str) { if (memo.count(i) == 0) memo[i] = 1; else memo[i]++; } for (int i = 0; i < str.size(); ++i) { if (memo[str[i]] == 1) { return i; } ...
void setup() { } void loop() { int delaytime=1000; int z=0; int y=0; volatile unsigned char cube[4][4]; for (z=0;z<4;z++) { for (y=0;y<4;y++) { cube[z][y]=0x01; delay(delaytime); cube[z][y]=0x03; delay(delaytime); cube[z][y]=0x07; delay(delaytime); cube[z][y]=0x0f; delay(delaytime)...
#include "util/Occasionally.h" using namespace std; using namespace Poco; using namespace BeeeOn; Occasionally::Occasionally(unsigned int max, const Timestamp::TimeDiff delayMax): m_count(0), m_max(max), m_delayMax(delayMax) { } void Occasionally::execute(const function<void ()> &func) { FastMutex::ScopedLock...
/** * @file AudioListener.cpp * @brief Source file for Engine::AudioListener * * @author Gemuele (Gem) Aludino * @date 09 Dec 2019 */ /** * Copyright © 2019 Gemuele Aludino * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and assoc...
#include <iostream> using namespace std; struct Monkey { int num; //猴子的编号 struct Monkey *next; //下一只猴子 }; int main() { int m,n,i,j,king; Monkey *head, *p1,*p2; cin>>m>>n; if(n==1) { king=m; } else { //建立猴子围成的圆圈 p1=p2=new Monkey; ...
// // Room.cpp // Crapenstein // // Created by Bruno Caceiro on 24/06/14. // Copyright (c) 2014 Bruno Caceiro. All rights reserved. // #include "Room.h" #include "Wall.h" //Constructor Room::Room(GLfloat roomPosX, GLfloat roomPosY, GLfloat roomPosZ, GLfloat leftWallWidth, GLfloat roomHeight, GLfloat backWallWidth...
#include<bits/stdc++.h> using namespace std; using ll=long long; ll n,k; vector<ll> v; int main(){ ios::sync_with_stdio(false); cin.tie(0); cin>>n>>k; for(ll i=1;i*i<=n;i++){ if(n%i==0){ v.push_back(i); if(n/i!=i){ v.push_back(n/i); ...
/** \file sonarRight.hpp \author UnBeatables \date LARC2018 \name sonarRight */ #pragma once /* * sonarRight inherited from BehaviorBase. */ #include <BehaviorBase.hpp> /** \brief This class is responsable for robot`s behavior when sonar detects presence in the right. */ class sonarRight : p...
#include<iostream> using namespace std; int talbai(int c, int d){ int l; l=c*d; return l; } main(){ int a,b,s; cin>>a; cin>>b; s=talbai(a,b); cout<<s; }
#include "Simulacion.h" #include <ctime> #include <iomanip> #include <vector> #include <iostream> #include "carga.h" void Simulacion::generar_cargas() { std::vector<carga> vector_cargas; srand(time(0)); for(int i=0;i<=2;i++){ // genera 3 cargas en posiciones random //printf("random value: %d \n", ...
#include "Orange.h" Orange::Orange() { points = ORANGE_DATA::POINTS; } void Orange::Update() { } void Orange::Draw() { } Orange::~Orange() { }
float const aVCC = 3.346; // Az AVCC pin-en mért feszültség. Az Arduino az 3.3 V-os tápfeszültséget használja referenciának a mérések során. (Névleges érték = 3,3 V, Valódi érték 3,292 V) ...
// Created on: 2005-04-10 // Created by: Andrey BETENEV // Copyright (c) 2005-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 a...
#include <stdio.h> #include <iostream> #include <string.h> #include <sys/socket.h> #include <thread> #include <chrono> #include "TCPServer.h" #define MAX_PACKET_LEN 1024 #define SERVER_PORT 6400 void handle_connection(const int client_sock, const char* client_ip, const int client_port) { char buffer[MAX_PACKET_LEN];...
#ifndef __HiroCat__GMobController__ #define __HiroCat__GMobController__ class GEnemyController : public GActorController { private: GnMemberSlot1<GEnemyController, Gn2DActor::TimeEvent*> mCallbackActorEventSlot; public: static GEnemyController* Create(const gchar* pcID, guint32 uiLevel); protected: ...
#include <iostream> #include <bs/ewma.hpp> #include <bs/frame_range.hpp> #include <bs/utils.hpp> #include <bs/temporal_median.hpp> #include <boost/make_shared.hpp> #include <boost/program_options.hpp> namespace po = boost::program_options; #include <range/v3/front.hpp> #include <range/v3/action/take.hpp> #include <r...
#pragma once class LockGuard { public: LockGuard() { InitializeCriticalSection(&m_lock); } ~LockGuard() { DeleteCriticalSection(&m_lock); } void Lock() { EnterCriticalSection(&m_lock); } void Unlock() { LeaveCriticalSection(&m_lock); } private: CRITICAL_SECTION m_lock; }; class Au...
#include <stdio.h> #include <iostream> #include <math.h> #include <glut.h> #include <string.h> #include "Hud.h" using namespace std; Hud::Hud(void) { } Hud::~Hud(void) { } void Hud::drawHud(Camera &cam, int width, int height) { float x, z, y; w = width; h = height; glPushMatrix(); glLoadIdentity(); setOrth...
#include "AvatarLogicCalculator.h" AvatarLogicCalculator::AvatarLogicCalculator() { } AvatarLogicCalculator::~AvatarLogicCalculator() { } void AvatarLogicCalculator::correctStepsDueToWallCollisions() { //in case of collision we stop the movement in that direction float stepX,stepY; m_avatarModel->getStep(&stepX...
#include <cstdlib> #include <iostream> #include <stack> using namespace std; int main(){ stack <int> a; int i; for(i=1; i < 5; i++){ a.push(i); } while( a.empty() ) { cout<<"Esta vacia"; break; } cout << "El ultimo elemento es: "<<a.top() ; ...
// Created by: Peter KURNEV // 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 Softwa...
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int i=1; i <= n; i++) { for (int j=1; j <= n-i ; j++) cout << "~"; for (int j=1; j <= 2*i-1 ; j++) cout << "*"; cout << endl; } for (int i=n-1; i >=1 ; i--) { for (int j=n-i; j >= 1 ; j--) cout << "~"; for (i...
// Created on: 1992-03-26 // Created by: Laurent BUCHARD // 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 GN...
#ifndef LINEPIECE_H #define LINEPIECE_H #include "abstracttetrispiece.h" class LinePiece : public AbstractTetrisPiece<LinePiece> { public: LinePiece( const TetrisCoordinate& centerCoordinate, int orientation = 0); virtual TetrisConstants::TetrisCellColor color() const override; v...
// Created on: 2000-06-15 // Created by: Edward AGAPOV // Copyright (c) 2000-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...
/******************************************************* 5!=5*4*3*2*1 = 120,包含1个0,请问对于100!包含多少个0? ********************************************************/ #include <vector> #include <string> #include <deque> using namespace std; class Solution{ public: int CalZeroNumber(){ string data("1"); for(int i = 2; i <= ...
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) Triad National Security, LLC. This file is part of the // Tusas code (LA-CC-17-001) and is subject to the revised BSD license terms // in the LICENSE file found in the top-level directory of this distribution. // ////...
/**************************************************************************** ** Copyright (c) 2006 - 2011, the LibQxt project. ** See the Qxt AUTHORS file for a list of authors and copyright holders. ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without ** modificatio...
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: bool isPalindrome(ListNode* head) { /* O(n) time O(n) space vector<int> vec; while(head) { ...
void setup() { P1DIR |= BIT6; // P1.6 to output CCR0 = 65536-1; // PWM Period CCTL1 = OUTMOD_7; // CCR1 reset/set CCR1 = 100; // CCR1 PWM duty cycle TACTL = TASSEL_2 + MC_1 + ID_3; // SMCLK, up mode, divide clock by 8 CCT...
#include <gtest/gtest.h> #include "Nodes/MultipleInputLayerNodes/PassThroughMultipleInputLayerNode.hpp" struct PassThroughMultipleInputLayerNodeTest : testing::Test { }; struct CustomComputationNode : ComputationNode<float> { CustomComputationNode(float v) : output(v) {} ArrayView<float const> ge...
#pragma once #include <EventType.h> #include <string> namespace breakout { enum struct EGameState { IDLE, MAIN_MENU, GAME, PAUSE, CLOSE_APP, GAME_OVER, GAME_WIN, }; class GameStateChangeEvent : public BaseEvent { public: EGameState mPrevState; EGameState mNewState; GameStateChangeEvent(EE...
#pragma once #include <stdint.h> /* specify the precalcuated tables */ #define TABLES_320 #define SCREEN_WIDTH (uint16_t) 320 #define SCREEN_HEIGHT (uint16_t) 256 #define SCREEN_SCALE 2 #define FOV (double) (M_PI / 2) #define INV_FACTOR (float) (SCREEN_WIDTH * 95.0f / 320.0f) #define LOOKUP_TBL #define LOOKUP8(tbl, ...
#include "colormodel2d.h" #include "render/mesh.h" void ColorModel2D::addData(const AbstractMesh &mesh) { auto colorMesh = dynamic_cast<const ColorMesh &>(mesh); genVAO(); addVBO(2, colorMesh.vertexPositions); addVBO(4, colorMesh.vertexColors); addEBO(colorMesh.indices); }
#include <assert.h> #include "Cell.h" namespace Minesweeper { bool Cell::isVisible() const { return this->_isVisible; } bool Cell::hasMine() const { return this->_hasMine; } bool Cell::isMarked() const { return this->_isMarked; } int Cell::numOfMinesAround() const { return this->_numOfMin...
#include <lwr4p_bhand_test/utils.h> double err_thres = 1e-2; void PRINT_INFO_MSG(const std::string &msg) { std::cerr << "\033[1m\033[34m" << "[INFO]: " << msg << "\033[0m\n"; } void PRINT_ERR_MSG(const std::string &msg) { std::cerr << "\033[1m\033[31m" << "[ERROR]: " << msg << "\033[0m\n"; } void lwrRobotRun(Lw...
#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...
#include <iostream> #include <string> #include <vector> #include <map> #include "Checker.h" using namespace std; Checker :: Checker(){} Checker :: Checker(map<string, int> Dic){ Dictionary = Dic; } void Checker :: setDictionary(map<string, int> Dic){ Dictionary = Dic; } void Checker::functionAlteration(string...
// Created on: 1992-04-06 // Created by: Christian CAILLET // 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 ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2007 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 "adjunct/quick_toolkit/widgets/Op...
#include "treeface/graphics/VectorGraphicsMaterial.h" using namespace treecore; #define UNI_NAME_LINE_WIDTH "line_width" #define UNI_NAME_SKLT_MIN "skeleton_min" #define UNI_NAME_SKLT_MAX "skeleton_max" namespace treeface { const Identifier VectorGraphicsMaterial::UNIFORM_LINE_WIDTH( UNI_NAME_LINE_WIDTH ); cons...
// // Created by Nikita Kruk on 08.08.18. // #ifndef SPRAPPROXIMATEBAYESIANCOMPUTATION_BOUNDARYCONDITIONSCONFIGURATION_HPP #define SPRAPPROXIMATEBAYESIANCOMPUTATION_BOUNDARYCONDITIONSCONFIGURATION_HPP #include "../Definitions.hpp" #include "Vector2D.hpp" #include <vector> class BoundaryConditionsConfiguration { pu...
#include "Interface.h" #include "RealImplementation.h" Interface::Interface(const std::string& text, float value):m_Pimpl(std::make_unique<RealImplementation>(text, value)) { } Interface::~Interface() { } Interface::Interface(Interface&& interface):m_Pimpl(std::move(interface.m_Pimpl)) { } Interface& Interface::ope...
/* * Copyright 2019 LogMeIn * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in w...
#include <iostream> #include <cstdio> using namespace std; int main(){ float x, y; scanf("%f", &x); if( x <= 15) y = 4 * x / 3; else y = 2.5 * x - 17.5; printf("%.2f", y); return 0; }
/* * Author: Elijah De Vera * Created on January 23, 2021 * Purpose: Factorial Problem */ //System Libraries #include <iostream> using namespace std; //User Libraries //Global Constants - Math/Physics Constants, Conversions, // 2-D Array Dimensions //Function Prototypes int f...
#include <benchmark/benchmark.h> #include "matrix.hpp" #include "task_4_lib.cpp" static void Block_striped_decomposition(benchmark::State &state) { int size = 800; for (auto _: state) { state.PauseTiming(); Matrix<uint64_t> A(size); randomizeMatrix(A); Matrix<uint64_t> B(size); randomizeMatri...
#pragma once #include "bricks/core/types.h" #define BRICKS_SFINAE_TRUE(x) (sizeof(x) == sizeof(Bricks::SFINAE::True)) #define BRICKS_SFINAE_FALSE(x) (sizeof(x) == sizeof(Bricks::SFINAE::False)) namespace Bricks { namespace SFINAE { class IncompleteType; typedef struct { u8 value[3]; } True; typedef struct { u...
// Copyright (c) 2015 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 ...
#include <iostream> #include <iomanip> #include <vector> #include <cctype> #include "freqan.hpp" // FrequencyAnalyzer class public methods // method parses text buffer void FrequencyAnalyzer::readBuffer(const std::string& buf) { text_buffer = ""; // clear text buffer - it's nice to be able to reuse methods! int...
#include <iostream> using namespace std; long long arr[101][10] = { 0 }; int main() { int N; cin >> N; for (int i = 1; i <= 9; i++) arr[1][i] = 1; for (int i = 2; i <= N; i++) { for (int j = 0; j <= 9; j++) { if (j - 1 >= 0) arr[i][j] += arr[i - 1][j - 1]; if (j + 1 <= 9) arr[i][j] += ar...
// Fill out your copyright notice in the Description page of Project Settings. #include "NotePlayerController.h" #include <cmath> ANotePlayerController::ANotePlayerController() { noteAudioComponent = CreateDefaultSubobject<UAudioComponent>(TEXT("Note Audio Component")); noteAudioComponent->bAutoActivate = false; ...
/** * Definition for an interval. * struct Interval { * int start; * int end; * Interval() : start(0), end(0) {} * Interval(int s, int e) : start(s), end(e) {} * }; */ class Solution { public: vector<Interval> merge(vector<Interval>& intervals) { vector<Interval> ret; if(inte...
#pragma once #include "ofMain.h" #include <kinect.h> #include <Kinect.Face.h> #include <Windows.h> #include "ofxOpenCv.h" #include <iostream> #include <vector> template<class Interface> inline void SafeRelease( Interface *& pInterfaceToRelease ) { if( pInterfaceToRelease != NULL ){ pInterfaceToReleas...
#include "configwindow.h" #include "ui_configwindow.h" ConfigWindow::ConfigWindow(QWidget *parent) : QWidget(parent), ui(new Ui::ConfigWindow) { ui->setupUi(this); } ConfigWindow::~ConfigWindow() { delete ui; }
#include <iostream> #include <vector> #include <algorithm> using namespace std; int n, m, ans1, ans2, ans3; vector<pair<int, int>> v; bool compSet(const pair<int, int> &pa, const pair<int, int> &pb){ return pa.first < pb.first; } bool compOne(const pair<int, int> &pa, const pair<int, int> &pb){ return pa.se...
/*************************************************************************** * Sketch Name: Xively Publish * Description: This sketch illustrates how Arduino Yun can publish data to Xively channels * Created On: March 01, 2016 * Author: Adeel Javed * Book: Building Arduino Projects for...
#pragma once #include "GameLogic.h" class GameLogic; class BallPhysics { GameLogic* gameLogic; Ogre::Vector3 position; Ogre::Vector3 speed; Ogre::Vector3 spin; Ogre::Vector3 gravity; bool out; public: BallPhysics(GameLogic* gameLogic); ~BallPhysics(); void update(float deltaT); vo...
#include <iostream> #include <iomanip> #include <NTL/GF2X.h> #include <stdint.h> #include "xsadd.h" #include "xsadd.c" // to check static functions using namespace NTL; using namespace std; static void uztostring16(char * str, uz * x) { int p = 0; int first = 1; for (int i = UZ_ARRAY_SIZE - 1; i >= 0; i--...
#include "droute.h" #include <fstream> #include <iostream> #include "DataStructure.h" #define INF 9999 extern struct city graph; extern struct route line1[10]; extern struct route line2[10]; extern struct route temp; extern struct passenger passer; extern struct order *command,*end; extern int ll; int _...
/* * Copyright (C) 2018 David C. Harrison. All right reserved. * * You may not use, distribute, publish, or modify this code without * the express written permission of the copyright holder. https://classes.soe.ucsc.edu/cmps109/Spring18/SECURE/12.Distributed2.pdf https://classes.soe.ucsc.edu/cmps109/Spring18/SEC...
#include <iostream> using namespace std; /* (3 p) 3. Fie lista simplu inlantuita C. Sa se distribuie elementele din C in doua liste simplu inlatuite A si B, astfel: A contine elementele de pe pozitiile impare din C, iar B contine elementele din C de pe pozitiile pare. Nu se va folosi memorie suplimentara. */ struct El...
#ifndef EDITORAPPLICATION_HPP #define EDITORAPPLICATION_HPP #include <QApplication> #include "LevelManager.hpp" #include "TextureManager.hpp" namespace Maint { class MainWindow; class EditorApplication : public QApplication { Q_OBJECT /** * @brief The application's main window. ...
#include "graphics.hpp" std::map<std::string, shader_t> GFX_SHADERS; std::map<std::string, model_t> GFX_MODELS; std::map<std::string, texture_t> GFX_TEXTURES; void use_shader(shader_t *shader) { static shader_t *current_shader = NULL; assert(shader); if ( shader != current_shader ) { glUseProgra...
#if !defined(_PSP_VER) #include "Vector2.h" Vector2& Vector2::operator =(const Vector2 &rhs) { _vec = rhs._vec; return *this; } Vector2 Vector2::operator +(const Vector2& rhs) const { Vector2 ret; D3DXVec2Add( &ret._vec, &_vec, &rhs._vec ); return ret; } Vector2 Vector2::operator- (const Vector2& rhs) const { ...
#include<bits/stdc++.h> #define rep(i,n) for (int i =0; i <(n); i++) using namespace std; using ll = long long; int main(){ int a,b; cin >> a >> b; char a1,b1; a1 = a + '0'; b1 = b + '0'; string x; rep(i,b)x.push_back(a1); string y; rep(i,a)y.push_back(b1); ...
#include <iostream> #include <cstring> #include <string> #include <vector> #include <algorithm> #define MAX 53 #define MAXLINE 2503 int n, m, X[MAX][MAX], Y[MAX][MAX], d[MAXLINE]; char map[MAX][MAX]; std::vector<int> adj[MAXLINE]; bool check[MAXLINE]; bool dfs(int i) { if(check[i]) { return false; ...
#include "../head/load_data.h" #include <opencv2/opencv.hpp> //包含头文件 #include <iostream> #include"../head/QRCodeDrawer.h" #include"../head/Video.h" void usage(); int main(int argc, char* argv[]) { if (argc != 4) { usage(); return 1; } load_data load_data; QRCodeDrawer Drawer; string input_file = argv[1]; str...