text
stringlengths
8
6.88M
#ifndef SOUND_H_INCLUDED #define SOUND_H_INCLUDED #include <string> struct FailedToLoadSoundException {}; struct FailedToLoadMusicException {}; /* forward declarations begin */ struct Mix_Chunk; struct _Mix_Music; /* forward declarations end */ class Sound { public: Sound(); Sound(char const* path); ~So...
#include "textreader.h" #include <fstream> namespace cppag { Textreader::Textreader(std::string loc) { mLocation = cppag::CLArguments::matchPath (loc); } bool Textreader::read () { //alten Inhalt löschen mContent.clear(); //filestream für Datei std::ifstre...
#include "PushCardProc.h" #include "Logger.h" #include "Room.h" #include "GameCmd.h" #include "ProcessManager.h" PushCardProc::PushCardProc() { this->name = "PushCardProc"; } PushCardProc::~PushCardProc() { } static void replyPhp(CDLSocketHandler * clientHandler, int cmd, short retcode) { OutputPacket response; ...
// Fill out your copyright notice in the Description page of Project Settings. #include "CSAttributeSet.h" #include "Components/CSHealthComponent.h" #include "GameplayEffectExtension.h" #include "AbilitySystemComponent.h" #include "Net/UnrealNetwork.h" UCSAttributeSet::UCSAttributeSet() { const float DefaultMaxH...
#include "Chaine.hpp" #include <cstdio> using namespace std; using namespace enseirb; void annexe(Chaine s){} int main(){ Chaine C1; //Allocation statique Chaine *C2; //juste un pointeur Chaine *C3 = new Chaine(); //alloc dyn Chaine C4("Hello World"); annexe(C1); std::printf("C1: %d\n",...
/* ============================ @Author: shaoDong @Version: 1.0 @DateTime: 2018-03-31 21:34:27 @Description: vector demo ============================ */ #include <iostream> #include <vector> #include <string> #include <cmath> #include <map> #include <list> #include <algorithm> using namespace std; typedef...
#pragma once #include "../Config.hpp" #include "../SecureWiper.hpp" #include "../Array.hpp" #include "../Intrinsic.hpp" #include <memory.h> namespace accel::Crypto { namespace Internal { template<size_t __WordBits> class RC6_CONSTANT; template<> class RC6_CONSTANT<16> { p...
#ifndef BooleanVoxel_HPP #define BooleanVoxel_HPP #include "OgreFramework.h" typedef struct { Ogre::Vector3 p[3]; } RawTriangle; class BooleanVoxel { private: Ogre::Vector3 _voxelPosition; bool _vertex0; bool _vertex1; bool _vertex2; bool _vertex3; bool _vertex4; bool _vertex5; bool _vertex6; bool ...
//---------------------------------------------------------------- // CTF.cpp // // Copyright 2002-2004 Raven Software //---------------------------------------------------------------- #include "../../idlib/precompiled.h" #pragma hdrstop #include "CTF.h" /* ==========================================================...
// Fill out your copyright notice in the Description page of Project Settings. #include "Cogliati.h" #include "CogliatiPawn.h" #include "ShipAIController.h" AShipAIController::AShipAIController(const FObjectInitializer & OI) : Super(OI) { PrimaryActorTick.bCanEverTick = true; mPossessedPawn = nullptr; } void AShip...
/**************************************************************** * TianGong RenderLab * * Copyright (c) Gaiyitp9. All rights reserved. * * This code is licensed under the MIT License (MIT). * *****************************************************************/ #include "Window/PopupWindow.hpp" #include ...
#ifndef ENGINE_H_ #define ENGINE_H_ #include <random> #include <iostream> #include <fstream> #include <cuda_runtime_api.h> #include <cuda.h> #include <curand.h> #include <curand_kernel.h> class Engine { public: Engine(int duration, int size, float acceleration); ~Engine(); void reset(); void start(); void start...
#include <cstring> using namespace std; const int maxn=1100000; int prime[maxn],primesize,phi[maxn]; bool isprime[maxn]; void getlist(int listsize) { memset(isprime,1,sizeof(isprime)); isprime[1]=false; for(int i=2;i<=listsize;i++) { if(isprime[i])prime[++primesize]=i; f...
#include<iostream> #include<vector> #include<fstream> #include "omp.h" #include<cmath> #include<sys/time.h> #include <algorithm> using namespace std; struct Edge { public: int source; int destination; int weight; }; bool present_in_working_set(vector< vector<Edge> > working_set,Edge edge, int j){ fo...
//========================================================== // // Title: Financial Projection // Course: CSC 1101 // Author: Patrick Ducusin // Date: <03/04/2021> // Description: // We will be making a program that will calculate and project // the finances for a four-unit rental company. ...
#include<iostream> using namespace std; class base{ public: base(){ cout<<"Base class\n"; } }; class derived:public base{ public: derived():base(){ cout<<"Derived class\n"; } }; int main(){ derived d1; return 0; }
/************************************************************************************** * File Name : Tutorial.cpp * Project Name : Keyboard Warriors * Primary Author : Wonju Cho * Secondary Author : * Copyright Information : * "All content 2019 DigiPen (USA) Corporation, all rights reserved...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "686" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) int prime[33000]; void Prime(){ int check,tmp,i,j; memset(prime,0,sizeof(prime)); for(i=2;i<33000;i=i+1){ check=0; tmp=int(sqrt(i)); for(j=2;j<=tmp;j=j+1){ ...
// // tree.h // Tree // // Created by Юрий Маслов on 15.09.16. // Copyright © 2016 Home. All rights reserved. // #ifndef TREE_H #define TREE_H #include <iostream> using namespace std; template <typename T> class Tree { struct Node { T item; Node *son; Node *brother; ...
/** * @file   OgreWidget.h  * @brief  用于定义OgreWidget类的头文件 */ #ifndef OGREWIDGET_H #define OGREWIDGET_H #include <OgreCamera.h> #include <OgreFrameListener.h> #include <OgreRenderWindow.h> #include <OgreSceneManager.h> #include <OgreRoot.h> #include <QPaintEvent> #include <QTimer> #include <QWidget> /**    *  @cla...
#ifndef SHOETCPSOCKET_H #define SHOETCPSOCKET_H #include <QTcpSocket> #include <QByteArray> #include <QDataStream> #include "ShoeManagerTcpPacket.hpp" class ShoeTcpSocket : public QTcpSocket { Q_OBJECT public: ShoeTcpSocket(QObject *parent=NULL); public: void setSocketID(const int nDesc...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * Espen Sand */ #ifndef __PRINT_DIALOG_H__ #define __PRINT_DIALOG_H__ #include "adju...
// Created on: 1992-03-04 // 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...
// This is an example not a library /*************************************************************************** * Copyright (C) 2009 by Dario Freddi * * drf@kde.org * * ...
#ifndef STUDENTQUEUE_H #define STUDENTQUEUE_H #include "Queue.h" #include "Student.h" using namespace std; class StudentQueue { public: static StudentQueue* getInstance(); Student removeStudent(); void addStudent(Student s); int returnSize(); Student peekFront(); void incrementStuWait(); ...
#pragma once #include <stdint.h> // Constants. constexpr int MEM_BUFFER = 32768; constexpr int N_REGISTERS = 8; constexpr int REGISTER_MIN_VALUE = 32768; constexpr int MATH_MODULO = 32768; // Signals. constexpr int SIG_OKAY = 0x00; constexpr int SIG_ABORT = 0x01; constexpr int SIG_ERROR = 0x02; constexpr int SIG_...
#include "HumanB.hpp" HumanB::HumanB(const std::string &name, const Weapon &weapon) : name_(name), weapon_(&weapon) { } HumanB::HumanB(const std::string &name) : name_(name), weapon_(NULL) { } HumanB::HumanB() : name_("default_name") { } HumanB::~HumanB() { } void HumanB::setWeapon(const Weapon &new_weapon) { wea...
#include <iostream> class ival_slider { public: virtual ~ival_slider() {} }; class bbslider {}; class bbdial {}; class bb_ival_slider : public ival_slider, protected bbslider {}; class bb_ival_dial : public ival_slider, protected bbdial {}; void test(bb_ival_slider *p) { ival_slider *p1 = p; ival_slider ...
// // Created by Lee on 2019-04-22. // #include "JsonParser.h" #include <QJsonArray> #include <QCoreApplication> #include <QDebug> Photo JsonParser::jsonToPhoto(QJsonObject json) { long id = (long)(json.value("id")).toDouble(); long groupId = (long)(json.value("photoGroupId")).toDouble(); QString name = ...
// This file was generated based on /usr/local/share/uno/Packages/Fuse.Common/1.3.1/Easing.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.Object.h> namespace g{namespace Fuse{namespace Animations{struct Easing;}}} namespace g{ namespace Fuse{ namespace Animations{ /...
#pragma once #include "IFile.h" class DiskFile : public IFile { public: DiskFile(const char* name, OpenMode mode); virtual ~DiskFile(void); offset_type Read(void* buffer, offset_type size); offset_type Write(const void* buffer, offset_type size); offset_type Seek(offset_type pos, enum SeekMode ...
#include <iostream> #include <string> using namespace std; void mylog(string command) { cout << "[+] " << command << endl; } int main(int argc, char** argv) { mylog(__FUNCTION__); int n =0; n = sizeof(char); cout << "char\t" << n << "\t" << n*8 << endl; n = sizeof(short); cout << "short\t" << n << "\t" ...
#include "PacketManager.h" // Check if the Manager has any packets ready to go bool PacketManager::packetsReady() { std::lock_guard<std::mutex> dolock(m_packetLock); return (!m_packets.empty()); } // Adds a packet to the packet queue void PacketManager::add(std::shared_ptr<Packet> p) { std::lock_guard<std::mutex...
#include <iostream> #include <fstream> #include <cmath> //#include <rand> using namespace std; int main() { ofstream out; out.open("noisySineData.txt", ios::out); srand(time(NULL)); float t[5001]; float f[5001]; float g[5001]; for(int i = 0; i < (sizeof(t)/(sizeof(t[0]))); i++) { t[i] = i*0.01; f[i] = ...
// binary search int binarySearchValue(vector<int> &nums, int target) { int begin = 0, end = nums.size() - 1; while (begin <= end) { int mid = (begin + end) / 2; if (nums[mid] < target) { begin = mid + 1; } else if (nums[mid] > target) { end = mid - 1; } else { return mid; } } return ...
//############################################################################### // INTRODUCCION: Quaternion.cpp //------------------------------------------------------------------------------ // Implementación de las operaciones con cuaterniones. Necesario para poder // trabajar con rotaciones: // - evita gimbal l...
#pragma once #include <GL/glew.h> #include "ModelLoader.h" #include "FogEffect.h" #include "BlackWhiteEffect.h" #include "GlowEffect.h" #include "BlurEffect.h" #include "Fbo.h" class PostProcesser { public: PostProcesser(); virtual ~PostProcesser(); void enable(); void disable(); void render(std:...
#include "CCDirector.h" #include "GreeJniHelper.h" #include <android/log.h> using namespace std; #define LOG_TAG "GreeJniHelper" #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__) #define JAVAVM cocos2d::JniHelper::getJavaVM() extern "C" { bool getEnv(JNIEnv **env) { ...
//知识点:二分图匹配/匈牙利算法 /* 二分图匹配模板 使用匈牙利算法 详见注释 */ #include<cstdio> #include<cstring> #include<ctype.h> using namespace std; //=================================================== const int MARX = 1e3+10; int n,m,e,ans; bool road[MARX][MARX] , vis[MARX]; int hus[MARX];//hus为int,误写成bool //==================...
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*- * * Copyright (C) 1995-2002 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #include "core/pch.h" #ifdef XSLT_HANDLER_SUPPORT # include "modules/xsl...
#include "anklemanager.h" #include <GL/gl.h> #include <algorithm> #include <boost/numeric/ublas/io.hpp> /** * @brief AnkleManager::AnkleManager * Note that there are 8 dimensions to this model - they are as follows: * q(0): stance leg angle with vertical * q(1): hip angle with vertical (=q(2) at heel strike) * q(2...
#ifndef MDIALOG_H #define MDIALOG_H #include <QDialog> namespace Ui { class MDialog; } class MDialog : public QDialog { Q_OBJECT public: explicit MDialog(QWidget *parent = 0); ~MDialog(); private: Ui::MDialog *ui; }; #endif // MDIALOG_H
#include <core/types.h> #include <core/maths.h> #include <core/platform.h> #include <core/shader.h> #include <iostream> using namespace std; typedef float real; typedef XVector2<real> Vec2r; typedef XVector3<real> Vec3r; const uint32_t kHeight = 600; const uint32_t kWidth = 600; const real kWorldSize = 4.0f; const ...
#define BLANK -1 #define LIGHT 2 #define MED 1 #define DARK 0 byte nums_syms[] = {B11111100, B01100000, B11011010, B11110010, B01100110, B10110110, B10111110, B11100000, B11111110, B11110110, B11101110, B00111110, B10011100, B01111010, B10011110, B10001110}; int TEXT[6] = {1,2,3,4,5,6}; int DISP = 1000; byte B...
#ifndef UP_VARIABLEN_H #define UP_VARIABLEN_H #include <math.h> #include <Eigen/Eigen> using namespace Eigen; //Flächenberechnung/Bearbeitung des Querschnitts extern int P_Anz; //geometrische Größen extern double pi; extern double D; //[mm]; KR - Nenndurchmesser extern double s; //[mm]; Spalthöhe extern...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2009 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" #ifdef SCOPE_ECMASCRIPT_DEBUGGER #include...
// Handout #1: Source code of a C++ Program, which // converts distance in miles to kilometers. #include <iostream> //inclusion of support for doing input & output #include <vector> //inclusion of support for doing input & output #include <ctime> #include <time.h> #include <algorithm> #include <fstream> using n...
#pragma once #include "../../UI/Dependencies/IncludeImGui.h" #include "../../Maths/Curve/Curve.h" namespace ae { namespace priv { namespace ui { static Bool IsCurveEditorOpen = false; inline Bool CurveEditor( Curve& _Curve ) { Bool UpdateMesh = False; if( IsCurveEditorOpen ) { ImGui:...
/* -*- 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 "modules/logdoc/helistelm.h" #incl...
// This file was generated based on /usr/local/share/uno/Packages/Fuse.Controls.Native/1.3.1/iOS/Focus.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.h> namespace g{namespace Fuse{namespace Controls{namespace Native{namespace iOS{struct FocusHelpers;}}}}} namespace g{...
// Copyright (c) 2011-2017 The Cryptonote developers // Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs // Copyright (c) 2018-2023 Conceal Network & Conceal Devs // // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php....
#pragma once #include "openvr.h" #include "glm.hpp" class VRSystem; class Controller; class ShaderProgram; enum class VRToolType { Unknown, Move, PointLight, Pointer }; class VRTool { public: ~VRTool(); virtual bool init() = 0; virtual void shutdown() = 0; virtual void activate() = 0; virtual void deactivate(...
// Copyright 2012 Yandex #include "ltr/utility/indices.h" #include <boost/algorithm/string.hpp> #include <boost/lexical_cast.hpp> #include <algorithm> #include "ltr/utility/random_number_generator.h" using std::logic_error; using std::random_shuffle; using boost::erase_all; using ltr::utility::randomizer; names...
#pragma once #ifndef _INPUT_MANAGER_H #define _INPUT_MANAGER_H #include "KeyBoardState.h" #include "MouseState.h" #include "../maths/MathCore.h" class input_manager { private: KeyBoardState m_curKeyBoardState; KeyBoardState m_prevKeyBoardState; MouseState m_currentMouseState; MouseState m_prevMouseState; Vector2 ...
#pragma once class TestBase; class TestRunner { public: TestRunner(); ~TestRunner(); // Run all the tests in the registered test objects in parallel using OPENMP bool RunTestSuite(); private: list<TestBase*> m_tests; };
/************************************************************************/ /* 给定字符串,以及一个字典,判断字符串能否拆分为字典张红的单词,例如: * 字典为:{hello, world}, 字符串为hellohelloworld,则可以拆分为hello, hello, world*/ /************************************************************************/ #include <string> #include <set> #include <map> using namespa...
#include <bits/stdc++.h> using namespace std; void missNum(int arr[], int n) { for(int i=0; i<n; i++){ if(arr[i]>0){ cout<<i+1<<" "; } } return; } void repNum(int arr[], int n) { for(int i=0; i<n; i++){ if(arr[abs(arr[i])-1] > 0){ arr[abs(arr[i])-1] = -arr[abs(arr[i])-1]; ...
// // Created by seafood on 2020-09-28 // #ifndef _STATE_SEARCHING_TARGET_H_ #define _STATE_SEARCHING_TARGET_H_ #include "ArmorBox.h" class StateSearchingTarget { public: armorBoxes armor_boxes; //目标的装甲板 bool run(cv::Mat &srcImage,cv::Mat &processImage); //运行函数 private: lightBlobs light_blobs; ...
#include <bits/stdc++.h> using namespace std; #define foi(i, a, n) for (i = (a); i < (n); ++i) struct trienode { // struct trienode *children[26]; unordered_map<char, struct trienode *> child; bool wordend; }; typedef struct trienode trienode; trienode *getNode() { trienode *newnode = new trienode; newnod...
//线性筛法求素数 模板 //详见注释 #include<cstdio> using namespace std; int n,m,num; int p[100000010];//存质数 bool vis[100000010]={1,1};//存是否为质数 void prime(int n) { for(int i=2;i<=n;i++)//枚举数 { if(!vis[i]) p[++num]=i;//为质数 for(int j=1;j<=num;j++)//打标记 { if(i*p[j]>n) break; vis[i*p[j...
class Land_A_FuelStation_Feed: Strategic { model = "\ca\structures\House\A_FuelStation\A_FuelStation_Feed"; transportFuel = 0; //50000; nameSound = "fuelstation"; }; class Land_Ind_FuelStation_Feed_EP1: Strategic { model = "\ca\Structures_E\Ind\Ind_FuelStation\Ind_FuelStation_Feed_ep1.p3d"; transportFuel = 0; na...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> #include <map> using namespace std; typedef long long ll; #define INF 10e10 #define rep(i,n) for(int i=0; i<n;...
/* SPDX-FileCopyrightText: 2008 Chusslove Illich <caslav.ilic@gmx.net> SPDX-License-Identifier: LGPL-2.0-or-later */ #include "fonthelpers_p.h" #include <QCoreApplication> #ifdef NEVERDEFINE // never true // Font names up for translation, listed for extraction. //: Generic sans serif font presented in font...
#ifndef CBT_BEHAVIOR_T_HPP #define CBT_BEHAVIOR_T_HPP #include <memory> #include "cbt/behavior/status.hpp" #include "cbt/behavior/continuation.hpp" #include "cbt/behavior/continues.hpp" namespace cbt { struct behavior::concept_t { virtual ~concept_t() noexcept = default; virtual auto start(continuation) noexcept -> ...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 2004-2007 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef UNIXGADGETUNINSTALLER_H #define UNIXGADGETUNINSTALLER_H #ifdef WIDGET_RUNTIME_...
#include "Parser.h" #include "Lexer.h" #include "StringBuilder.h" #include "common.h" #include <setjmp.h> #include <stdio.h> __thread jmp_buf jumpBuf; static const char *errorMes[32] = { #define _(x) #x #include "error.inc" #undef _ }; const char *tokenToString(char *buf, int size, int token) { const char *tail ...
/* * SfMUpdateListener.cpp * SfMToyExample * * Created by Roy Shilkrot on 10/7/12. * Copyright 2012 MIT. All rights reserved. * */ #include "SfMUpdateListener.h"
/* * @lc app=leetcode.cn id=367 lang=cpp * * [367] 有效的完全平方数 */ // @lc code=start class Solution { public: bool isPerfectSquare(int num) { if(num<2)return true; long long left = 2; long long right = num/2; long long x, guessSquqred; while (left<=right) { ...
#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; const double inf = 1e16 + 7; const double eps = 1e-8; struct point { double x...
// updateW_diffpen.cpp // // rcpp script for conditional update of W // created following the update rules provided in the paper (Appendix) // this is as according to the rcpp file // updateW_faster_reference.cpp // i let lasso and glasso be specified per component #include <RcppArmadillo.h> #include <RcppArmadilloE...
#include "TriangleMesh2DGenerator.h" TriangleMesh2DGenerator::TriangleMesh2DGenerator() { extent.resize(4); divisions.resize(2); } TriangleMesh2DGenerator::~TriangleMesh2DGenerator() { } void TriangleMesh2DGenerator::setExtent(float xmin, float xmax, float ymin, float ...
// Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 #include <RcppArmadillo.h> #include <Rcpp.h> using namespace Rcpp; // MCMC_full List MCMC_full(const int n_iter, const int n_save, arma::mat theta_t, arma::mat y_t, arma::mat ind_zero, arma...
#include <iostream> using namespace std; #ifndef _METODOS_H_ #define _METODOS_H_ class Direccion{} ; class Persona : Direccion{} ; #endif // fin _METODOS_H_
#include<cstdio> #include<iostream> #define Max 15005 using namespace std; int x[Max],y[Max],hash[Max],n,a[33000]; int main(){ int i,j,s; while(scanf("%d",&n)!=EOF){ for(i=0;i<n;i++){ scanf("%d%d",&x[i],&y[i]); s=0; for(j=0;j<=x[i];j++) s...
/* XMRig * Copyright 2010 Jeff Garzik <jgarzik@pobox.com> * Copyright 2012-2014 pooler <pooler@litecoinpool.org> * Copyright 2014 Lucas Jones <https://github.com/lucasjones> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2016 Jay D Dee <jayddee246@gmail.com> * C...
// // main.cpp // 2.猴子数大王 // // Created by 赵志诚 on 2020/12/21. // Copyright © 2020年 赵志诚. All rights reserved. // #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) { k...
#include<stdio.h> int main(int argc, char const *argv[]) { int M,K; scanf("%d%d",&M,&K); printf("%d\n",M%K); return 0; }
/* kamalsam */ #include<iostream> #include<string> using namespace std; int count=0; int a[16][16],n; void func(int i,int j) { if(i<n&&j<n) { if(i==n-1&&j==n-1) count++; else { if(a[i][j]!=0) { func(i+a[i][j],j); func(i,j+a[i][j]); ...
// g2o - General Graph Optimization // Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard // 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 cod...
#include "WordCount.h" #include "tddFuncs.h" #include <iostream> int main() { WordCount wc; wc.incrWordCount("ApPles"); wc.incrWordCount("'appl-e123's'"); wc.incrWordCount("ApPles123"); wc.incrWordCount("Banana"); wc.incrWordCount("Cat"); wc.incrWordCount("Ca-t''"); assertEquals("monke...
#include "CDView.hpp" CDController * CDView::makeController(Model *m) { return new CDController(m, this); } CDView::CDView(QWidget *parent) : View(parent), fl(new QFormLayout(this)) { setAttribute(Qt::WA_DeleteOnClose); setFixedSize(250, 350); id = new QLineEdit(); fl->addRow(QStringLiteral("ID"), id); ...
// Created on: 1995-12-01 // Created by: EXPRESS->CDL V0.2 Translator // Copyright (c) 1995-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 te...
#ifndef PRIMS_HPP #define PRIMS_HPP #include "defs.hpp" class VM; class Process; void init_primitives(VM*); #endif
#include <iostream> #include <vector> #include <map> #include <cmath> #include <queue> #include <algorithm> #include <iomanip> #include <set> using namespace std; /*ϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕ*/ #define int long long int #define ld long double #define F first #define S second #define P p...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2009 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 "de...
#include <iostream> using namespace std; class A { public: void display( ) { cout<<"Base class A content."; } }; class B { public: void display() { cout<<"Base class B"; } }; class C :public A, public B { public: void display() { cout<<"deriv c class"; } }; int main(...
// Created on: 2003-06-04 // Created by: Galina KULIKOVA // Copyright (c) 2003-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 ...
#pragma once #include <queue> #include <condition_variable> #include "TrantorNonCopyable.h" namespace trantor { template <class T> class TrantorBlockQueue : TrantorNonCopyable { public: explicit TrantorBlockQueue(uint32_t max_queue_size) : max_queue_size_(max_queue_size), mtx_(){} ~TrantorBlockQueue(); ...
#include<iostream> using namespace std; int commonFac(int x, int y) { if(x==0) { return y; } else { return commonFac(y%x,x); } } int main() { int a, b; cout<<"Enter a number, A="; cin>>a; cout<<"Enter another number, B="; cin>>b; cout<<"GCF="<<commonFac...
//Using binary search. Time-0.520s #include <bits/stdc++.h> using namespace std; #define ll long long #define vll vector<ll> ll countDivisors(ll n) { ll cnt = 0; for (int i = 1; i <= sqrt(n); i++) { if (n % i == 0) { if (n / i == i) cnt++; else ...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define show(x) for(auto i: x){cout << i << " ";} typedef long long ll; int main() { int n, m; cin >> n >> m; if ( n == m){ cout << "Yes" << endl; } else { cout << "...
#include <stdio.h> int item_cnt = 0; int money = 100; void buy_item(int cost, int cnt){ item_cnt += cnt; money -= cost; printf("You have got an item.\n"); printf("Number of items: %d\n", item_cnt); printf("Balance: %d\n", money); } int main(){ buy_item(30, 5); buy_item(20, 7); }
#include "ScoreScreen.h" #include <fstream> #include <iostream> #include <algorithm> using namespace std; void ScoreScreen::start(SDL_Renderer* renderer) { font = TTF_OpenFont("font/arial.ttf", 36); title = new Texture(Util::loadTextureFromText("Melhores Scores", renderer, font, SDL_Color{255, 0, 0,255}), 240, 70,...
#pragma once #include "a_star.hpp" #include <octomap/octomap.h> #include <octomap/OcTree.h> octomap::OcTreeKey &makeKeyUnique(octomap::OcTreeKey &key, unsigned int depth); /** * @brief The data structure that describe the nodes of a OctoGraph. * */ class OctoNode : public Node { public: OctoNode() : Node(), k...
../1032/D.cpp
string Solution::convertToTitle(int A) { string ans; while (A) { //or A--, A % 26 + 'A' ans = char ((A - 1) % 26 + 'A') + ans; A = (A - 1) / 26; } return ans; }
// Created on: 1996-12-11 // Created by: Robert COUBLANC // Copyright (c) 1996-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...
/* Designed for a basic test of MCP4921. * Use an LED on the DAC output pin (pin 8), just to see things working. * Hookup is as per sketch_jun13b * dac_write() takes about 8.4us, for a max freq of 119kHz * */ #include <SPI.h> auto& ser = Serial1; #define DAC_CS PB12 SPIClass dacspi(2); // CS=PB12, SCK=PB13, M...
#include <iostream> using namespace std; void answer(int x) { cout << "! " << x << endl; } // (x, y)でクエリを投げ、xならtrueを返す bool query(int x, int y) { cout << "? " << x << " " << y << endl; char res; cin >> res; return res == 'x'; } void solve() { // 前半 int k; for (k = 0; k < 30; ++k) { ...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<algorithm> #include<cmath> using namespace std; int gcd(int a,int b) { while (b) { int t = a;a = b;b = t%b; } return a; } int a[10010]; int...