text
stringlengths
8
6.88M
/* Copyright 2017 Istio Authors. All Rights Reserved. * * 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 applicab...
// // SMViewConstValue.cpp // SMFrameWork // // Created by KimSteve on 2016. 11. 3.. // // #include "SMViewConstValue.h" #include <cocos2d.h> /************************************************************************* 공통 Constant *************************************************************************/ cons...
// Copyright 2020 JD.com, Inc. Galileo Authors. All Rights Reserved. // // 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 requ...
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin>>t; while(t--){ int n,q; cin>>n>>q; string s; cin>>s; vector<int>arr(26,0); for(int i=0; i<n; i++){ arr[s[i]-'a']++; } int m=0; for(int i=0; i<26; i++){ m = max(m,arr[i]...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Phone.System.2.h" WINRT_EXPORT namespace winrt { namespace Windows::Phone::System { struct SystemProtection { SystemProtection() = delete; static bool ScreenLocked(...
#pragma once #include "perspective_camera_model.h" #include "sophus/se3.hpp" #include "opencv2/viz.hpp" class Viewer3D { public: Viewer3D(); void addBodyAxes(Sophus::SE3d pose_local_body, int img_num); void addCameraAxes(Sophus::SE3d pose_local_camera, int img_num); void addCameraFrustum(const PerspectiveCam...
#include <cstdlib> #include <climits> #include "SLList.hpp" using namespace std; SLList * const SLList::NIL = new SLList(0, NULL); SLList::SLList(int i, SLList *n) { _first = i; _rest = n; } int SLList::first() { return this -> _first; } SLList *SLList::rest() { return this -> _rest; } void SLList::setFirst(...
/*************************************************** * This is an example for the DFRobot Wido - Wifi Integrated IoT lite sensor and control node * Product Page & More info: http://www.dfrobot.com/index.php?route=product/product&product_id=1159 * Designed specifically to work with the DFRobot Wido products: * * ...
#ifndef __GAME_H_DEFINED__ #define __GAME_H_DEFINED__ #include "Window.h" #include "Board.h" #include "Piece.h" #include "Color.h" class Game { public: Game(Window* window, Board* board); void drawScene(); void createNewPiece(); int pieceX, pieceY, rotation; private: void drawBoard(); void drawPiece(...
#include<stdio.h> #include<unistd.h> int main() { printf("Hello from %d\n",getpid()); printf("Parent id is %d\n",getppid()); }
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "base.h" WINRT_WARNING_PUSH #include "internal/Windows.UI.3.h" WINRT_EXPORT namespace winrt { namespace impl { template <typename D> struct produce<D, Windows::UI::IColorHelper> : ...
#include <iostream> #include <array> int main(void) { using namespace std; array<double, 3> grades; for(int i = 0; i < 3; ++i) { cout << "Your grade: "; cin >> grades[i]; } double avg = (grades[0] + grades[1] + grades[2])/3.0; cout << "Average grade: " << avg ...
#include <string> #include <iostream> #include <stdio.h> #include <unistd.h> #include <errno.h> #include <sys/syscall.h> #include <sys/stat.h> #include <dirent.h> #include <algorithm> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/imgproc...
// // Copyright Jason Rice 2017 // 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) // #ifndef NBDL_TAP_HPP #define NBDL_TAP_HPP #include <nbdl/promise.hpp> #include <utility> namespace nbdl { struct tap_fn { ...
#pragma once #include "Common.h" #include "OpenAssetImportMesh.h" class ALight; class ALightHouse : public COpenAssetImportMesh{ private: ALight *m_pLight; public: ALightHouse(); ~ALightHouse(); void Initialise(); ALight* GetLight(); //set light direction to follow a target void SetLightDirection(glm::mat3 ...
#ifndef __HelloScene_H__ #define __HelloScene_H__ #include "cocos2d.h" #include "SimpleAudioEngine.h" #include "cocos-ext.h" using namespace cocos2d; using namespace cocos2d::extension; class HelloScene : public cocos2d::Layer { public: // 这个是用来初始化函数的 virtual bool init(); // 设置一个静态的场景函数 static...
// // UIHeroDetailLayer.cpp // Boids // // Created by Yanjie Chen on 5/9/15. // // #include "UIHeroDetailLayer.h" #include "../Utils.h" #include "../data/PlayerInfo.h" #include "../manager/ResourceManager.h" #include "../manager/AudioManager.h" #include "../util/CocosUtils.h" using namespace cocos2d; #define HERO...
#include<stdio.h> int binarysearch(int a[],int left,int right,int x); int main() { const int n=10; int a[n]={1,2,3,4,5,8,34,49,90,190};//此处为严格递增序列 //在顺序表中查找6和9 printf("%d %d",binarysearch(a,0,n-1,49),binarysearch(a,0,n-1,9)); return 0; } //二分搜索,传入参数顺序表,左端点,右端点,待查找的元素 int binarysearch(int a[],int left,int righ...
/* 14500. 테트로미노 */ #include <iostream> #include <cstring> using namespace std; int N, M, board[500][500]; int answer = 0; bool visited[500][500]; int dr[4] = {0,0,-1,1}; int dc[4] = {1,-1,0,0}; void find(int i, int j, int cnt, int sum) { if(cnt == 4) { if(answer < sum) answer = sum; ...
/* * Copyright 2016-2017 Flatiron Institute, Simons Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required ...
#include <iostream> #include <cmath> #include "kotsubu_vec.h" #define USE_KOTSUBU_VEC #include "kotsubu_math.h" using namespace std; // kotsubu_mathのテストプログラム int main() { KotsubuMath& math = KotsubuMath::getInstance(); VEC2<double> a(0, 0), b(10, 10); cout << "Distance : " << math.distance(a, b) << end...
#include "../Include/Botton.h" Botton::Botton() : Widget(), isActive(false) { } void Botton::setActive(bool isActive) { this->isActive = isActive; if (isActive) { mLayers[Layer::Buttom]->setColor(Color::Grey2); } else { mLayers[Layer::Buttom]->setColor(Color::Grey); } } bool Botton::isWidgetActive(int x, i...
/* * Copyright (C) 2018-2019 wuuhii. All rights reserved. * * The file is encoding with utf-8 (with BOM). It is a part of QtSwissArmyKnife * project. The project is a open source project, you can get the source from: * https://github.com/wuuhii/QtSwissArmyKnife * https://gitee.com/wuuhii/QtSwissArmyKnife...
#ifndef VISITOR_H #define VISITOR_H #include <QString> class Route; class Visitor { public: virtual QString visit(Route* route) = 0; virtual ~Visitor() = default; }; #endif // VISITOR_H
#pragma once #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> #include <glm/gtx/io.hpp> class Camera { public: virtual void moveFront(float delta) = 0; //permettant d'avancer / reculer la caméra. Lorsque delta est positif la caméra doit avancer, sinon elle doit reculer. virtual void rot...
// // Created by adama on 5/9/2017. // #ifndef SS_COMPILERC_LEXICALANALYZER_H #define SS_COMPILERC_LEXICALANALYZER_H #include <stdlib.h> #include <string> #include <array> using namespace std; typedef enum {nulSymbol = 0, identSymbol, numberSymbol, plusSymbol, minusSymbol, multiplySymbol, slashSymbol, oddSymbol...
#include <moveit/move_group_interface/move_group_interface.h> // Move the Robot. #include <moveit/planning_scene_interface/planning_scene_interface.h> // Modify Robot's world. #include <moveit_visual_tools/moveit_visual_tools.h> const float OPEN_GRIPPER = - 1.00; const float CLOSE_GRIPPER = 0.00;...
#include <iostream> #include <memory> using std::cout; using std::endl; using std::shared_ptr; using std::make_shared; void fonction1(const shared_ptr<int>& a); int main() { shared_ptr<int> a(new int(42)); cout << a.use_count() << endl << endl; shared_ptr<int> b = a; cout << a.use_count() << endl; cout << b.us...
///udppeer_co_basic.h #ifndef UDPPEER_CO_BASIC_H #define UDPPEER_CO_BASIC_H #include "fddef.h" #include "addr.h" #include "udppeer.h" #include "netpeer_co.h" #include "namespdef.h" #include <coroutine> #include <queue> NAMESP_BEGIN namespace net { template<class Socket, class EventQueueT, class MsgWrapper> class Ud...
#ifndef SIMULATION_HEADER #define SIMULATION_HEADER #include <chrono> #include "Common/Timing.h" #include "Units/Unit.h" #include "Units/SystemUnitTypes.h" namespace solar { //Simulates solar system class Simulation { public: Simulation(parser_p parser, simMethod_p simMethod, viewer_p viewer); //Starts simul...
#include "HTMLTagDecorators.h" #include <iostream> int main() { std::unique_ptr<IHTMLElement> strongElement = std::make_unique<StrongTagDecorator>(std::make_unique<BasicHTMLElement>("Lorem ipsum")); strongElement->print(); std::unique_ptr<IHTMLElement> pstrong(std::make_unique<PTagDecorator>(std::move(strongElemen...
#include "counter.h" Counter Counter::operator ++() { ++count_; //unary operator // //Create object, set it and return it // Counter temp; // temp.count_ = count_; // return temp; //one liner return Counter(++count_); //unnamed temp object } Counter Counter::operator...
#include <Servo.h> #include "servo.h" #include "command.h" #include "command_processor.h" // Используемый последовательный порт #define SERIAL Serial1 #define SERVO_EPSILON 3 #define EXTEND_SPEED 50 #ifndef PA0 #define PA0 3 #define PA1 5 #define PA2 6 #define PA3 9 #define PA6 10 #define PA7 11 #undef ...
#pragma once //DO NOT CHANGE THIS PART typedef int TElem; #define NULL_TELEM 0 #include <utility> class Matrix { private: //TODO - Representation typedef struct Node { TElem value; int index;//i*columns+j Node* leftChild; Node* rightChild; }Node; Node* root; int lines, columns; public: //constructor ...
#pragma once #include "string.h" #include <vector> #include "stdio.h" #include "sendchannel.h" using namespace std; class objrepr_t { public: string type; // if basetype string value; // field name vector<pair<string, objrepr_t*> > fields; objrepr_t() { /* type = new char [255]; ...
#include<stdio.h> int main() { int a[5] = { 0,1,2,3,4 }; printf("%d %d\n", a[0], a[1]); printf("%d %d\n", &a[0], &a[1]); printf("a林家=%d a[0]林家=%d\n", a, &a[0]); int* p = a; printf("a林家=%d\n", p); return 0; }
#ifndef CHIFFREMENT_H #define CHIFFREMENT_H #include <gmpxx.h> #include <vector> /** * @brief Module Chiffrement * @file Chiffrement.h * * Cette classe permet de chiffrer un message et une clé AES * * @version 1.0 * @date 2018/04/10 */ class Chiffrement { private: mpz_class t1; /** <Donnée membre: t1 un nombre géné...
/*********************************************************************** * Copyright (C) 2019 Yinheyi. <chinayinheyi@163.com> * * 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 * vers...
#include "header.h" #define TEST_NUM 009 #define TEST(NUM) CONCAT(test, NUM)() #define TEST_NUM_FILE(a, b) STRINGIFY(CONCAT(a,b)) #include TEST_NUM_FILE(TEST_NUM, .hpp) int main() { TEST(TEST_NUM); }
#include <stdio.h> #include <string.h> int push(char str[]){ char keywords[10][10] = {"kuda","kambing","ikan","anjing","kucing","sapi","burung"}; int a, z = 0; for(a = 0; a < 26; a++){ if(strcmp(keywords[a], str) == 0){ z = 1; break; } } ...
#include <stdio.h> #include<stdlib.h> #include "DynaLnkList.h" int main() { // TODO: Place your test code here LinkList ml = NULL; InitList(&ml); ListInsert(ml,1,5); ListInsert(ml,1,3); ListInsert(ml,1,2); ListInsert(ml,1,1); ListInsert(ml,1,4); ListTraverse(ml,visit); inverse(ml); ListTraverse(ml,visit); ...
/******************************************************************************* * include/tools/geometry.h * * Copyright (C) 2016-2017 Sebastian Lamm <lamm@ira.uka.de> * * All rights reserved. Published under the BSD-2 license in the LICENSE file. *****************************************************************...
/******************************************************************************** ** Form generated from reading UI file 'integrityfile.ui' ** ** Created by: Qt User Interface Compiler version 5.13.1 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ************************************...
#ifndef __START_SCENE_H__ #define __START_SCENE_H__ enum ControlType { JOYSTICK, BUTTON }; #include "cocos2d.h" USING_NS_CC; class StartScene : public cocos2d::CCLayer { public: virtual bool init(); static cocos2d::CCScene* scene(); CREATE_FUNC(StartScene); private: void start(CCObject* pSender); void joysti...
/*====================================================================* - Copyright (C) 2001 Leptonica. 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 c...
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. /*=========================================================================== Generated code exported from UnrealHeaderTool. DO NOT modify this manually! Edit the corresponding .h files instead! ==============================================================...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
/** * @file Semaphore.cpp * Implements the Semaphore class under Windows 32/64bit and POSIX enables OSes. * @date Jan 20, 2014 * @author Alper Sinan Akyurek */ #include "Semaphore.h" #if defined( _WIN32 ) || defined( _WIN64 ) Semaphore::Semaphore( const TValue value ) { this->m_handle = ::CreateSemaphore(...
/* Copyright 2017-2018 All Rights Reserved. * Gyeonghwan Hong (redcarrottt@gmail.com) * * [Contact] * Gyeonghwan Hong (redcarrottt@gmail.com) * * Licensed under the Apache License, Version 2.0(the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the Lic...
#include "messenger.hpp" #include <QApplication> int main(int argc, char *argv[]) { QApplication app(argc, argv); QSharedPointer<messenger> start_messenger = QSharedPointer<messenger>::create(); QObject::connect(start_messenger.data(), &messenger::close_all_windows, &app, &QApplication::closeAllWindows);...
#include <iostream> using namespace std; template<class T> class Para { public: Para(T a, T b) : _pierwszy(a), _drugi(b) {} T pierwszy() {return _pierwszy;} T drugi() {return _drugi;} private: T _pierwszy, _drugi; }; int main(){ Para<int> test(1,2); cout << "Pierwszy= " << test.pierwszy() << " Drugi= " <<...
#ifndef PACKET_H #define PACKET_H #include "compress.h" #define PACKET_SIZE (1960) //size of a packets to send #define HEADER_SIZE (13) //number of bytes taken up in the packet by buffer class Packet { public: Packet() { for(int i = 0; i < PACKET_SIZE; i++) { data[i] = 0; } } //creates ...
#include <QTime> #include "RtspTask.h" #include "RtspCommon.h" #include "ffmpeg_server_demux.h" RtspTask::RtspTask(RTSPServer *server, UsageEnvironment *environment) { mRtspServer = server; mEnvironment = environment; } // 开始任务 bool RtspTask::startTask(std::string file) { mFileName = file; ...
#include "word.h" const Word Word::And = Word("&&", Tag::AND); const Word Word::Or = Word("||", Tag::OR); const Word Word::eq = Word("==", Tag::EQ); const Word Word::ne = Word("!=", Tag::NE); const Word Word::le = Word("<=", Tag::LE); const Word Word::ge = Word(">=", ...
#include "InvalidInput.h" InvalidInput::InvalidInput() { //ctor } InvalidInput::~InvalidInput() { //dtor }
#include "Request.h" #include "mpi.h" // MESSAGE TAGS #define TOKENS_TAG 0 #define RELEASE_TAG 1 #define REQUEST_TAG 2 #define PRIORITY_TAG 3 #define CANCEL_REQUEST 4 class MPIManager { public: MPIManager(); inline void RightNode(int rightNode){ this->rightNode = rightNode; } ...
#include <Wire.h> //MEGA--master void setup() { Wire.begin(); Serial.begin(9600); } void loop() { Wire.beginTransmission(0x7F); Wire.write("shit"); Wire.endTransmission(); }
// HASH TABLE LINEAR PROBING #include <stdio.h> #include <string.h> #include <stdlib.h> const int MAX_ELEMENT = 6; const int MAX_LENGTH = 255; char hashtables[MAX_ELEMENT][255]; void view_hashtable() { for (int i = 0; i < MAX_ELEMENT; i++) { printf("%d -> %s\n", i, hashtables[i]); } } // untuk m...
#include "algorithm/module/include/tracker.h" namespace OpticalFlow_SLAM_algorithm_opticalflow_slam { /** * @brief * @author snowden * @date 2021-07-18 * @version 1.0 */ Tracker::Tracker( std::weak_ptr<Map> map, const std::shared_ptr<SystemConfig> sp_slam_config, c...
#pragma once #include "QT_FRONTCheckClass.h" #include "InterCHeck.h" class COutShowCheck :public QObject, public CBaseCheckAlg { Q_OBJECT private: CInterCHeck* SecretBase; public: COutShowCheck(bool b_init); ~COutShowCheck(); public: virtual void Release(); virtual char* GetCameraName(void); virtual char* GetAl...
#include<bits/stdc++.h> using namespace std; const int maxn = 310; const int maxm = 100010; int n, m, u, v, c, ans, ufs[maxn]; int find(int x) { if (ufs[x] != x) return ufs[x] = find(ufs[x]); return ufs[x]; } void unionn(int x, int y) { int fx = find(x), fy = find(y); if (fx != fy) ufs[fx] = fy; } struct Edge ...
 #ifndef __ITEM__ #define __ITEM__ #include "../../FrameWork\Animation.h" #include "../../Objects/BaseObject.h" #include "../../FrameWork/IComponent.h" #include "../../FrameWork/Scene/PlayScene.h" #define ITEM_FORCE GVector2(50.0f, 250.0f) #define ITEM_GRAVITY GVector2(0.0f, -250.0f) class Item : public Bas...
/* * PyPB PBLib::PBConstraint bindings */ #ifndef _PBLIB_PBCONSTRAINT_HPP_ #define _PBLIB_PBCONSTRAINT_HPP_ #include <Python.h> #include <pbconstraint.h> #ifdef __cplusplus extern "C" { #endif // Name used as reference within Python #define PyPBConstraint_NAME "PBConstraint" extern PyTypeObject PyPBConstraint_Ty...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; #define pb push_back #define rsz resize #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() using pi = pair<int, int>; #define f first #define s second #define mp make_pair void setIO(string name = "cardgame") { ...
// Z90ContactCPUTestDlg.cpp : 实现文件 // #include "stdafx.h" #include "Z90ContactCPUTest.h" #include "Z90ContactCPUTestDlg.h" #include "afxdialogex.h" #include "dcic32.h" #pragma comment(lib, "dcic32.lib") #ifdef _DEBUG #define new DEBUG_NEW #endif HANDLE icdev; // 用于应用程序“关于”菜单项的 CAboutDlg 对话框 class CAboutDlg : publ...
// http://www.apache.org/licenses/LICENSE-2.0 // Copyright 2014 Perttu Ahola <celeron55@gmail.com> #pragma once #include "core/types.h" namespace Urho3D { class Context; } namespace client { struct State; } namespace app { struct App { virtual ~App(){} virtual void set_state(sp_<client::State> state) = 0; v...
/* Copyright (c) 2011 Andrew Wall 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, distribute, sub...
// ***************************************************************************** // Module..: Leddar // /// \file LdBitFieldProperty.cpp /// /// \brief Definition of LdBitFieldProperty class. /// This property make easy to manipulates individual bits. /// /// \author Patrick Boulay /// /// \since Janua...
/**************************************************** * Graph Interface for Source Code and Binary * Author : tps * Date : 27Apr 09 ****************************************************/ #ifndef __SB_Graph__ #define __SB_Graph__ class SB_DirectedGraph : public SgIncidenceDirectedGraph { public: }; #endif
#include<bits/stdc++.h> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(...
 #include "enemy.h" // コンストラクタ Enemy::Enemy() : Hp(8) , Mp(1) , Atk(2) , Def(1) { printf( "コンストラクタ\n" ); Name[0] = '\0'; } // デストラクタ Enemy::~Enemy() { printf( "デストラクタ\n" ); } // ステータス初期化 void Enemy::InitStatus(const char* enemyName) { sprintf_s( Name, 32, "%s", enemyName ); Hp = 8; Atk = 2; Def = 1; } /...
#include "SurfaceIntegrator.h" SurfaceIntegrator::SurfaceIntegrator() { mDepth = 0; } int SurfaceIntegrator::GetDepth() { return mDepth; } void SurfaceIntegrator::SetDepth( int depth ) { mDepth = depth; }
#include "Material.hpp" Material::Material() { } Material::Material(const Cvec3f& color) : color(color) { } Material::Material(const char* textureFileName) { setDiffuseTexture(textureFileName); } Material::~Material() { } void Material::setColor(const Cvec3f& color) { this->color = color; } void Material:...
/* * SeqFibonacci.cpp * * Created on: 10 de fev de 2018 * Author: kryptonian * * Desenvolva uma aplicação que gere a Sequencia de Fibonacci a partir de um número inteiro qualquer lido pelo teclado e mostre, no console, os n primeiros elementos da sequencia. * * Ex.: 0 -> 1 -> 1 -> 2 -> 3 -> 5 ->...
#ifndef EXPRESSION_H #define EXPRESSION_H #include <vector> #include <string> #include <iostream> enum AtomType { None, Bool, Symbol, Value }; class Expression{ public: struct Variant { AtomType type; bool bool_value; double double_value; std::string string_value; std::vector<Expression* > Branch; }; Var...
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <locale.h> int main(int argc, char** argv) { char vet[100]; int i, j, k, l, x, y, m, espaco; long int mat[3][3]; for(i=0; i<3; i++){ for(j=0; j<3; j++){ scanf("%i", &mat[i][j]); } } for(i=0; i<3; i++){ printf("|"); for(...
#ifndef MATHTOOLBOX_ACQUISITION_FUNCTIONS_HPP #define MATHTOOLBOX_ACQUISITION_FUNCTIONS_HPP #include <Eigen/Core> #include <functional> namespace mathtoolbox { double GetExpectedImprovement(const Eigen::VectorXd& x, const std::function<double(const E...
// Created by yuanzhongji on 2015/09 #include "ScrollItem.h" #include "GameManager.h" #include "ScrollItemTemplate.h" USING_NS_CC; #define SCROLL_ITEM_SPRITE_TAG 5668 // 可以拖动的精灵tag #define PARTICLE_TAG 3679 // 粒子效果tag bool ScrollItem::init(ScrollLayer *...
// Forward declaration of guess API. // @param num, your guess // @return -1 if my number is lower, 1 if my number is higher, otherwise return 0 int guess(int num); class Solution { public: int guessNumber(int n) { int guessMax = n; int guessMin = 1; while(guessMin <= guessMax) { ...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
#pragma once #include <vector> #include <ostream> namespace ant { class printable_traits { public: virtual std::ostream& Print( std::ostream& stream ) const =0; virtual ~printable_traits() = default; }; inline std::ostream& operator<< (std::ostream& stream, const ant::printable_traits& printable) { return p...
#pragma once #include "Cloneble.h" class Hashable:public Cloneble { public: virtual unsigned int getHash() = 0; };
// Fill out your copyright notice in the Description page of Project Settings. #include "TTT.h" #include "TTTGameMode.h" #include "TTTIronPlayer.h" void ATTTIronPlayer::OnTurn() { GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("Iron Turn")); RunMinMax(PlayerNumber); } float ATTTIronPlayer::RunMinMax(...
#include "graph.h" #include<stdio.h> #include<malloc.h> int LocateMGraphVex(MGraph *G,VertexType v) { /*在邻接矩阵G中,若v是途中的顶点名字, 则返回v在图G中的位置,否则返回-1*/ int i; for(i=0;i<G->vexnum;i++) if(G->vers[i]==v) return i; return -1; } //CreateUDNMGraph 创建无向网的邻接矩阵 int CreateUDNMGraph(MGraph *G) { int i,j,k; ...
#include "mainwindow.h" #include "ui_mainwindow.h" #include "inout.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); ui->textOutput->setReadOnly(true); ui->fileInput->setReadOnly(true); ui->pushOk->setVisible(false); } ...
#include "DirWeightGraph.hh" #include<iostream> EdgeWeightedDigraph::EdgeWeightedDigraph(int v){ V = v; E = 0; adj = new std::deque<DirectedEdge>[v]; } void EdgeWeightedDigraph::addEdge(int v, int w, double weight){ DirectedEdge TempEdge(v,w,weight); adj[v].push_back(TempEdge); ++E; } std::deque<DirectedEdge...
#include "CACLFloat.hpp" //重载除法 CACLFloat CACLFloat::operator/(CACLFloat number) { CACLFloat ans; ans.initialize(); // 利用无符号CACLFloat相除函数 unsignedDivision(&ans, *this, number); // 设置ans的符号 ans.integer.setSymbol(this->integer.getSymbol() != number.integer.getSymbol()); return ans; } CAC...
#include "dummy_map.h" #include <canvas.h> #include <canvas_p.h> #include <style.h> #include <cassert> #include <iostream> #include <memory> #include <osm2go_annotations.h> #include <osm2go_stl.h> #include <osm2go_test.h> namespace { void set_bounds(osm_t::ref o) { bool b = o->bounds.init(pos_area(pos_t(52.26927...
using namespace std; using ll = long long; using vi = vector<int>; #define pb push_back #define all(x) begin(x), end(x) #define rep(i, a, b) for(ll i = a; i < b; ++i) using pi = pair<int, int>; #define f first #define s second void setIO(string name = "cowdance") { ios_base::sync_with_stdio(0); cin.tie(0); ...
/* 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...
/* * SPDX-FileCopyrightText: (C) 2013-2022 Daniel Nicoletti <dantti12@gmail.com> * SPDX-License-Identifier: BSD-3-Clause */ #ifndef CLEARSILVER_H #define CLEARSILVER_H #include <Cutelyst/View> #include <QObject> #include <QStringList> namespace Cutelyst { class ClearSilverPrivate; class CUTELYST_VIEW_CLEARSILVER...
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n, p, ans = 0; cin>>n>>p; long int a[n], dp[n], sum[n], mx = 0; for(int i=0; i<n; i++) cin>>a[i]; sum[0] = a[0]; dp[0] = sum[0]%p; for(int i=1; i<n; i++) { long int a1 = (a[i]+sum[i-1])%p, b = a[i]%p; ...
#ifndef MYSTRING_H #define MYSTRING_H class pointerS // o clasa pentru liste inlantuite { char info; pointerS *next; public: pointerS(); void set_info(char); void set_next(pointerS *); char get_info(); pointerS *get_next(); }; class myString { int sSize; pointerS *start, *now; pub...
#include<bits/stdc++.h> using namespace std; #define ll long long #define fr(i,n) for (ll i=0;i<n;i++) #define fr1(i,n) for(ll i=1;i<=n;i++) #define N 200005 int main() { ll k; cin>>k; while(k--) { ll m,n,i,j,x,y; cin>>n; vector<ll> v(n+1, 0); ll a...
 /// @file ImpListRec.cc /// @brief ImpListRec の実装ファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2005-2012 Yusuke Matsunaga /// All rights reserved. #include "ImpListRec.h" #include "ImpNode.h" BEGIN_NAMESPACE_YM_NETWORKS ////////////////////////////////////////////////////////////////////// // ク...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: main.cpp * Author: agendron * * Created on October 5, 2017, 12:30 PM */ #include <iostream> using namespace std; ...
/* Auteur : Nicolas Cantin */ #include "Tableau.h" Tableau::Tableau(int z) { size = z; // Rempli le vecteur de 2 et de 4 for (int i = 0; i < ratio*10; i++) { if (i % ratio != 0) { two_four.push_back(2); } else { two_four.push_back(4); } } //vecteur pour les case vide vector<int> vec; /...
#include "Expression.h" std::map<std::string, Function> Expression::functionMap; std::map<char, Expression::Operator> Expression::operatorMap; Expression::Expression(std::shared_ptr<Expression> expr) { std::copy(expr->expressions.cbegin(), expr->expressions.cend(), std::back_inserter(expressions))...
/* * InterpolationForStereo.hpp * * Created on: Aug 6, 2018 * Author: yyhu */ #ifndef INCLUDE_INTERPOLATIONFORSTEREO_INTERPOLATIONFORSTEREO_HPP_ #define INCLUDE_INTERPOLATIONFORSTEREO_INTERPOLATIONFORSTEREO_HPP_ #include <vector> #include "opencv2/core.hpp" #include "opencv2/highgui.hpp" #include "opencv2...
#include <iostream> #include <set> #include <iterator> using namespace std; int main() { // empty set container set <int , greater<int> > gquiz1; // insert elements in random order gquiz1.insert(40); gquiz1.insert(30); gquiz1.insert(60); gquiz1.insert(20); gquiz1.insert(50); ...