text
stringlengths
8
6.88M
#include "sdlwrap.h" #include "GameState.h" #include "StopWatch.h" #include "Sound.h" #include <SDL_timer.h> void load_media() { textures("player_pistol").load("gfx/Player/pistol.png"); sounds("pistol_shot").load("sfx/pistol_shot.mp3"); textures("player_shotgun").load("gfx/Player/shotgun.png"); so...
//使用するヘッダーファイル #include "GameL\DrawTexture.h" #include "GameL\HitBoxManager.h" #include "GameHead.h" #include "ObjBubble.h" #include "ObjBlock.h" #include "UtilityModule.h" #include "GameL\Audio.h" //使用するネームスペース using namespace GameL; CObjBubble::CObjBubble(float x, float y) { m_x = x; m_y = y; } //イニシャライズ void C...
////////////////////////////////////////////////////////////////////////////// // // 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. // ////...
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2007 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** @author Lasse Magnussen lasse@opera.com */ #ifndef MODULES_DOM_DOM...
#include "SAT.h" #include "Graph.h" #include "point.h" #include "random.h" #include "test.h" #include <iostream> #include <ctime> using namespace std; int main() { //input parameters deciding the size,pairs and blocks int size,pairs,blocks; cin>>size>>pairs>>blocks; //use random to generate Random random(size,p...
#include <iostream> #include <vector> #include <string> #include <cstring> using namespace std; const int MAX_BUDGET = 2147483647 - 1; // n : 초밥 종류 (1<=n<=20) // m : 예산 (1<=m<=1,000,000,000) // price : 초밥 가격 (<=20000 / 100의 배수) // pref : 초밥 선호도 (1<=pref<=20) int n, m, price[20], pref[20]; //int c...
#ifndef MOREINFOPIONEER_H #define MOREINFOPIONEER_H #include "data_types/pioneer.h" #include "data_types/relation.h" #include "services/pioneerservice.h" #include "services/relationservice.h" #include "ui/mainwindow.h" #include <QDialog> /* ------------------------------------------------------------ * ...
/** * Nana Configuration * Nana C++ Library(http://www.nanapro.org) * Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) * * 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) * * @file _GUI/Config.h * * @br...
// SimpleGraphic Engine // (c) David Gowor, 2014 // // Render Font Header // // ======= // Classes // ======= // Font class r_font_c { public: r_font_c(class r_renderer_c* renderer, char* fontName); ~r_font_c(); int StringWidth(int height, const char* str); int StringCursorIndex(int height, co...
#include "stdafx.h" #include "ball.h" Ball::Ball(int radius, int speed, float direction) : radius(radius) , speed(speed) , direction(direction) , image(sf::CircleShape(radius)) { image.setOrigin(radius, radius); lastCollision = -1; } sf::CircleShape Ball::getImage() { return image; } void Ball::setPosit...
// // environment.h // Total Control // // Created by Parker Lawrence on 1/9/16. // Copyright (c) 2016 Parker Lawrence. All rights reserved. // #ifndef __Total_Control__environment__ #define __Total_Control__environment__ #include <stdio.h> #include "vox.h" #include "render.h" #include "generators.h" #include "gl...
#ifndef tmptools__coretools__selector__hpp #define tmptools__coretools__selector__hpp namespace tmp { template <bool B> struct selector {}; //typedef selector<true> true_type; //typedef selector<false> false_type; } // tmp #endif // tmptools__coretools__selector__hpp
/* ***** BEGIN LICENSE BLOCK ***** * FW4SPL - Copyright (C) IRCAD, 2009-2010. * Distributed under the terms of the GNU Lesser General Public License (LGPL) as * published by the Free Software Foundation. * ****** END LICENSE BLOCK ****** */ #ifndef _IOVTKGDCM_DICOMPATIENTDBWRITERSERVICE_HPP_ #define _IOVTKGDCM_DIC...
struct KeyFrame { //for the animation's convience, we need the datatype cooperates with time float timeStamp; std::map<std::string, JointTransform> transforms; // std::vector<JointTransform> transforms; }; class JointAnim : public OBJproperty { protected: std::vector<KeyFrame> keyframes; public: virtual ~JointA...
/*==================================================================== Copyright(c) 2018 Adam Rankin 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 limitati...
#include "chesslib.h" int King::attack(char* p) { if(deskout(p) > 0) return(0); int x = p[0] - pos[0]; int y = p[1] - pos[1]; if(x < 0) x = -x; if(y < 0) y = -y; if((x <2) && (y<2)) return(1); return(0); }; int Alfil ::attack(char* p) { if(deskout(p) > 0) return(0); int x = p[0] - pos[0]; int y = p[1] ...
#include <iostream> #include <sstream> #include "readf.cpp" using namespace std; int main(int argc, const char *argv[]) { string line; if(line.empty()) cout << "yeah" << endl; getline(cin,line); //line += " "; istringstream in(line); readfile(in); return 0; }
#pragma once #include <memory> namespace detail_uninit { template<typename T> struct alignment_of_impl; template<typename T, std::size_t size_diff> struct helper { static const std::size_t value = size_diff; }; template<typename T> struct helper<T,0> { static const std::size_t value = alignment_of_impl<T>:...
#include "Archiver.h" // Change to your path const path from = "./"; const path to = "./archived/"; // And default images path is "./assets/" , "./archived/assets/" const path imgPath = "assets/"; int main(int argc, const char* argv[]) { cout << "Current Path: " << current_path() << "\n"; if (argc < 2) {...
#ifndef NET_NETADDRESS_HPP #define NET_NETADDRESS_HPP #include <string> #include <vector> #include <cstring> #include <netdb.h> #include <arpa/inet.h> #include <sys/socket.h> #include "../core/Exception.hpp" #include "../core/Stringable.hpp" namespace net { //Union for storing address union u_address {...
#ifndef MACOPAUTOUPDATEPI_H #define MACOPAUTOUPDATEPI_H #ifdef AUTO_UPDATE_SUPPORT #include "adjunct/autoupdate/pi/opautoupdatepi.h" class MacOpAutoUpdatePI : public OpAutoUpdatePI { public: virtual ~MacOpAutoUpdatePI() {} virtual OP_STATUS GetOSName(OpString& os); virtual OP_STATUS GetOSVersion(OpString& versio...
// // Created by dylan on 3-3-2020. // Hpp file containing the function declarations for the picture class // Takes a given picture and turns it into an object that it can draw on the window // #ifndef PICTURE_HPP #define PICTURE_HPP #include "drawable.hpp" class picture : public drawable { public: ...
// // write_float_image.cpp // PlaneMap // // Created by Yimeng Zhang on 5/25/14. // Copyright (c) 2014 Yimeng Zhang. All rights reserved. // #include "write_float_image.h" #include <stdint.h> #include <cstdio> void write_float_image(GLuint fbo, GLsizei width, GLsizei height, const char * imagepath, bool append){...
#include <iostream> int get_fibonacci_last_digit_naive(int n) { if (n <= 1) return n; int previous = 0; int current = 1; for (int i = 0; i < n - 1; ++i) { int tmp_previous = previous; previous = current; current = tmp_previous + current; } return current %...
#include "Utils/GenerateName.h" #include <crossguid/guid.hpp> using namespace xg; using namespace Rocket; String Rocket::GenerateName() { auto id = newGuid(); return id.str(); }
/* Copyright (c) 2019-2022 Xavier Leclercq Released under the MIT License See https://github.com/ishiko-cpp/test-framework/blob/main/LICENSE.txt */ #include "TestResult.hpp" namespace Ishiko { std::string ToString(TestResult result) { std::string str; switch (result) { case TestResult::un...
#include <iostream> #include <queue> #include <deque> #include <algorithm> #include <string> #include <vector> #include <stack> #include <set> #include <map> #include <math.h> #include <string.h> #include <bitset> #include <cmath> using namespace std; vector<int> use; vector<int> temp[102]; vector<queue<int>> will; i...
#ifndef GAME_SETTINGS_H #define GAME_SETTINGS_H // TODO: Add suitable settings // TODO: Load settings from file somewhere namespace Platy { namespace Game { class Settings { public: Settings() = delete; ~Settings() = default; static void Init(); ///////////////// // Setters ///////////////...
#include "StepGenerator.hpp" #include <sys/time.h> #include <cmath> #include <boost/random/uniform_real_distribution.hpp> #define PI 3.14159265359 StepGenerator::StepGenerator() { timeval tv; gettimeofday(&tv, NULL); rng.seed(1000000*tv.tv_sec + tv.tv_usec); } void StepGenerator::generateNext(position& ...
/** ****************************************************************************** * Copyright (c) 2020 - ~, SCUT-RobotLab Development Team * @file motor_AK80.h * @author Mentos Seetoo 1356046979@qq.com * @brief Driver for T-Motor A-Series Dynamic Module(AK80-6, AK80-9), which is * high...
#ifndef COPY_NODE_H_ #define COPY_NODE_H_ #include <SOP/SOP_Node.h> #include "G_Global_IO.h" class GIO_Load:public SOP_Node { public: static OP_Node *myConstructor(OP_Network *,const char*,OP_Operator *); static PRM_Template myTemplateList[]; GIO_Load(OP_Network *,const char*,OP_Operator *); virtual ~GIO_Load()...
// // Created by Masayuki IZUMI on 5/14/16. // #include <iostream> #include <pcl/io/pcd_io.h> #include <pcl/point_types.h> #include <pcl/filters/statistical_outlier_removal.h> #include "pctools/utils.hpp" using namespace pctools; int main (int argc, char** argv) { pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud (ne...
#ifndef AREA_NAVIGATION_ROS_H #define AREA_NAVIGATION_ROS_H #include <string> #include <ros/ros.h> #include <tf/tf.h> #include <actionlib/server/simple_action_server.h> #include <area_navigation/area_navigation.h> #include <area_navigation/structs.h> // ROS messages #include <navigation_sign_msgs/NavigationSigns.h> #...
#include<iostream> using namespace std; int main() { int age; char gender, martialStatus; cout<<"THE DEPARTMENT OF DEFENSE | ELIGIBLITY TEST\n"; cout<<"ENTER YOUR GENDER ('X' for male and 'Y' for female)"<<endl; cin>>gender; cout<<"ENTER YOUR MARTIAL STATUS ('M' for married and 'S' for...
#include <iostream> using namespace std; int main() { int n, cur, init; string s; cin >> n >> s; cur = 0; init = 0; for(char ch : s) { if(ch == '+') cur++; if(ch == '-') { cur--; if(cur < 1) { cur = 0; init++; } } } cout << cur << endl; }
/////////////////////////////////////// // // Computer Graphics TSBK03 // Conrad Wahlén - conwa099 // /////////////////////////////////////// #ifndef _TEST // ==== Includes ==== #include "Program.h" // ==== Main Program ==== int main(int argc, char *argv[]) { Program program; return program.Execute(); } #else #i...
#ifndef LogVol_ShieldingPSDCone_h #define LogVol_ShieldingPSDCone_h 1 /*! @file LogVol_ShieldingPSDCone.hh @brief Defines mandatory user class LogVol_ShieldingPSDCone. @date August, 2015 @author Flechas (D. C. Flechas dcflechasg@unal.edu.co) @version 2.0 In this header file, the 'physical' setup is defin...
#pragma once #include "Core/Core.h" #include "Render/DrawBasic/FrameBuffer.h" #include <vulkan/vulkan.h> typedef struct GLFWwindow GLFWwindow; namespace Rocket { class VulkanFrameBuffer { public: void Connect( VkDevice device, VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkRenderPass rend...
#ifndef _TRACER_H_ #define _TRACER_ #include "Scene.h" #include "init.h" #include <opencv2/opencv.hpp> class Tracer { public: Tracer(); Vector trace(Ray ray,int step); Color check(Color c); void render(); void savepic(const char* file); void init(char* file); void ins(char* file); Scene *scene; Vector viewP...
#ifndef MAT44_H #define MAT44_H #include<cmath> #include<array> #include<cstdio> #define PI 3.14159265 using namespace std; class mat44 { public: mat44(); // Construtor ~mat44(); // Destrutor // Ponteiro público para os elementos da matrix const float *mptr; // Principais ...
#include "stdafx.h" #include "pong.hpp" #include "menu.hpp" #include "ball.h" #include "paddle.h" #include "Wall.h" #include "scoreboard.h" #include <SFML/Audio.hpp> using namespace std; #define MAX_SCORE 10 int end(sf::RenderWindow& window, char* endText) { window.setMouseCursorVisible(true); sf::Text mainText(e...
#include "ClassificationResult.hpp" void ClassificationResult::operator>>(Counters &counters) {} /** * @brief Copies reference to tracked vector */ void ClassificationResult::operator<<(std::shared_ptr<TrackedObject> obj) { this->classified.push_back(obj); } std::vector<std::shared_ptr<TrackedObject>>Class...
#ifndef ROTATION_H #define ROTATION_H #include <algorithm> #include <cmath> #include <limits> ////////////////////////////////////////////////////////////////// // math functions needed for rotation conversion. // dot and cross production template<typename T> inline T DotProduct(const T x[3], const T...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> using namespace std; typedef long long ll; #define INF 10e10 #define rep(i,n) for(int i=0; i<n; i++) #define r...
#include <cstdio> #include <iostream> #include <vector> using namespace std; struct ListNode{ int val; ListNode *next; ListNode():next(NULL){} }; ListNode *merge(ListNode *head1, ListNode *head2){ ListNode *res = NULL; if(head1 == NULL) return head2; if(head2 == NULL) return head1; if(head1->val < head...
// -*- C++ -*- /*! * @file RTWiimote.cpp * @brief WiiリモコンのRTコンポーネント * @date $Date$ * * $Id$ */ #include "RTWiimote.h" // デバッグ情報の表示 //#define DEBUG_SHOW_INPUT_DATA //#define DEBUG_SHOW_OUTPUT_DATA // Module specification // <rtc-template block="module_spec"> static const char* rtwiimote_spec[]...
/***************************************************************** Name :binomial_heap Author :srhuang Email :lukyandy3162@gmail.com History : 20200108 delete 20200107 decrease key and fix minNode bug 20200107 find 20191226 reconstruct 20191218 Initial Version *********************************...
#ifndef WINDOW_CPP #define WINDOW_CPP #include "Window.h" using namespace std; Window::Window(){ id = 0; idle = 0; totalIdle = 0; timeTilOpen = 0; idleForFive = false; } Window::Window(int id){ this->id = id; idle = 0; totalIdle = 0; timeTilOpen = 0; idleForFive = false; } bool operato...
// // Created by LBYPatrick on 2/6/2018. // #include "util.hpp" void util::RemoveLetter(string &original_string, char letter) { string temp_buffer; bool is_in_quote = false; for (char i : original_string) { if (i == '\"') { is_in_quote = !is_in_quote; continue; } el...
#ifndef HIRAGANA_H #define HIRAGANA_H #include "mot.h" class Hiragana : public Mot { public: Hiragana( const string & inHiraKata, const string & inRoumaji ); virtual ~Hiragana(); }; #endif
#include <iostream> #include <limits.h> using namespace std; typedef long long ll; int n, q, l, r, a[100001]; ll subSum(int l, int r) { ll maxTillNow = LONG_MIN, currSum = 0; bool reverse = false; int i = 1; while (i <= n) { if (i == l && reverse == false) { i = r; ...
#ifndef PREFMODEL_H #define PREFMODEL_H #include <QObject> #include <sharedpreferences.h> class PrefModel : public QObject { Q_OBJECT Q_PROPERTY(QStringList model READ model NOTIFY modelChanged) public: explicit PrefModel(QObject *parent = nullptr); QStringList model() const; public slots: void save(const QS...
/* * Copyright (c) 2020, Mohamed Ammar <mamar452@gmail.com> * 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 notice, thi...
#include <glad/glad.h> #include <GLFW/glfw3.h> #include <stb_image.h> #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include "shader.h" #include "camera.h" #include "object.h" #include <iostream> void framebuffer_size_callback(GLFWwindow *window, int width, int height); void mouse_callback(GLFWwin...
// Copyright 2013 (c) Agustin Berge // // 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) // This test case demonstrates the issue described in #878: `future::unwrap` // trigger...
#include<iostream> using namespace std; int main() { typedef int INT32; INT32 n = 20; cout << n << "is"<<sizeof(n)<<endl; }
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
#ifndef OtherUnderscoreEXTRA_HPP #define OtherUnderscoreEXTRA_HPP #include <QObject> class OtherUnderscoreExtraPrivate; class OtherUnderscoreExtra : public QObject { Q_OBJECT public: OtherUnderscoreExtra(); ~OtherUnderscoreExtra(); private: OtherUnderscoreExtraPrivate* const d; }; #endif
#pragma once #include <bits/stdc++.h> #include "hdf5.h" #include "Utils.h" namespace dyablo { struct Attribute { std::string name; std::string type; std::string center; hid_t handle; }; constexpr size_t CoordSize = 3; // Coordinates are stored as 3-float even in 2D /** * Class storing info about dyablo s...
#include <iostream> #include <stack> #include <math.h> using namespace std; struct arr{ long n; long mn; }; int T, n, k, res = 0; int **a; arr *b; stack<int> sr,sl; void nhap(){ int i, j; cin >> T; b = new arr[T]; a = new int*[T]; for(i = 0; i < T; i++){ cin >> b[i].n >> b[i].mn;...
#include <iostream> using namespace std; class Loc { int longitude; int latitude; public: Loc(); Loc(int lg, int lt); Loc(const Loc& loc1); friend ostream& operator <<(ostream& outs, const Loc& loc1); friend istream& operator >>(istream& ins, Loc& loc1); friend Loc operator +(const Loc& loc...
#include "Item.h" Item::Item(int isbn, string title) : _isbn(isbn), _title(title) { } Item::~Item() { } int Item::getIsbn() const { return _isbn; } string Item::getTitle() const { return _title; } bool Item::matches(string keyword) const { return (_title.find(keyword) != string::npos); ...
#include "Wire.h" #include "I2Cdev.h" #include "MPU6050.h" #include "math.h" int l1 = 6, l2 = 7, r1 = 5, r2 = 4;//Motor Pins IN1, IN2, IN3, IN4 from L298N Driver double kp = 20, kd = 0.014, ki = 28; float sampleTime = 0.005, targetAngle = - 0.5; MPU6050 mpu; int in; int16_t accY, accZ, gyroX; volatile int mSpeed, gRate...
#ifndef TUTORIALOBJECT_H #define TUTORIALOBJECT_H #include "Lib.h" #include <vector> namespace gnGame { // チュートリアル用のオブジェクトのクラス class TutorialObject : public Object{ public: ~TutorialObject() = default; virtual void onUpdate() = 0; }; /// <summary> /// 移動のオブジェクト /// </summary> class MoveIntro : public ...
#include <iostream> #include "TreeNode.h" #include "BinarySearchTree.h" using namespace std; template <typename T> bool equal(const TreeNode<T>* tree_a, const TreeNode<T>* tree_b) { if (!tree_a && !tree_b) { return true; } else if (tree_a && tree_b) { return (tree_a->get_value() == tree_b->g...
#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <map> typedef long long LL; typedef unsigned long long ULL; #define PI 3.141592653589...
#ifndef _ROS_SERVICE_mav_ctrl_motors_h #define _ROS_SERVICE_mav_ctrl_motors_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" namespace asctec_hl_comm { static const char MAV_CTRL_MOTORS[] = "asctec_hl_comm/mav_ctrl_motors"; class mav_ctrl_motorsRequest : public ros::Msg { pu...
#include <iostream> #include <fstream> #include <string> #include <vector> #include <conio.h> #include <stack> #include <algorithm> using namespace std; enum brace_type { ORIENTED_OPEN = '<', ORIENTED_CLOSE = '>', REGULAR_OPEN = '{', REGULAR_CLOSE = '}' }; // Типы скобок enum mnogestvo_type { ORIENTED, REGULAR }; // ...
#include<iostream> #include<string.h> using namespace std; class Base{ protected: int id; public: virtual void whogetsinvoked(){ cout<<"In BASE " <<"\n"; } }; class Derived : public Base{ public: void whogetsinvoked(){ cout<<"In Derived"<<"\n"; } }; class Deriv...
// // Created by 史浩 on 2019-12-03. // #include "OffscreenSurface.h" OffscreenSurface::OffscreenSurface(EGLCore *eglCore,int width,int height) : BaseEGLSurface(eglCore) { createOffscreenSurface(width,height); } void OffscreenSurface::release() { releaseEglSurface(); }
// Created on: 2016-10-20 // Created by: Irina KRYLOVA // Copyright (c) 2016 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 publ...
// belt buckle - no idea what this is used for class Helper_Base_EP1; class BeltBuckle_DZE : Helper_Base_EP1 { scope = 2; model = "\z\addons\dayz_epoch\models\skull.p3d"; displayName = "Belt Buckle"; accuracy = 1000; hiddenSelections[] = {"camo1"}; hiddenSelectionsTextures[] = {"#(argb,8,8,3)color(1,0.5,0.5,0.5,c...
#include<bits/stdc++.h> using namespace std; queue<int>Q; queue<int>Q1; main() { int n, m, a, i, index; while(cin>>n>>m) { for(i=1; i<=n; i++) { cin>>a; Q.push(a); Q1.push(i); } while(!Q.empty()) { a= Q.front(); if(a<=m) ...
#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...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * 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. * * @author Arjan van Leeuwen */ #ifndef QUICK_ADDRESS_DROPDOWN_H ...
#include "stdafx.h" #include "SequenceQuestion.h" using namespace qp; using namespace std; using Sequence = CSequenceQuestion::Sequence; CSequenceQuestion::CSequenceQuestion(const string & description, double score, const Sequence & sequence) :CQuestion(description, score) { if (sequence.size() < 3) { ...
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef pair<int, int> pii; #define ll long long #define fi first #define se second #define pb push_back #define ALL(v) v.begin(), v.end() #define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a)) #define FORN(a, b, c) for (int(a) = (b); (a) <= (c);...
#include<iostream> using namespace std; int binCloseSearch(int arr[],int l, int r,int x){ int mid=l+(r-l)/2; if(arr[mid]==x) return mid; else if(arr[mid]>arr[mid+1]){ if(x==arr[mid+1]) return mid+1; else if(x>arr[mid+1]){ binCloseSearch(arr,mid+2,r,x); ...
#include<bits/stdc++.h> using namespace std; main() { int n, s; while(cin>>n>>s) { int i, j=0, sum, array[200], f, t; for(i=1; i<=n; i++) { cin>>f>>t; sum = f+t; array[j] = sum; j++; } int max=0; for(int k=0; k<j...
#ifndef RVSPECTORUS_H #define RVSPECTORUS_H #include "rvtorus.h" class RVSpecTorus : public RVTorus { public: RVSpecTorus(double smallRadius = 1.0, double bigRadius = 4.0); void setTorusTex(QString leftImage, QString rightImage, QString frontImage, QString backImage, ...
#include<iostream> #include<fstream> #include<stdio.h> #include<vector> using namespace std; vector<long> flag_big; long getO(long t) { long result=1; while((t=long(t/10)) != 0) result *=10; return result; } long C(int base) { if(base <2) return 0; else { switch(base) { case 2: return 1; case 3...
#include "collisionEvent.h" collisionEvent::collisionEvent(GameObject a, GameObject b) { this->a = a; this->b = b; } GameObject collisionEvent::getObjA() { return a; } GameObject collisionEvent::getObjB() { return b; } eventType collisionEvent::getType() { return collisionEvent_type; } cha...
#include "bird.h" #include "timerlist.h" #include "dino.h" #include "game.h" #include "gameover.h" #include <QTimer> #include <QObject> #include <QGraphicsScene> #include <QGraphicsPixmapItem> #include <QGraphicsItem> #include <QList> #include <typeinfo> #include <math.h> #include <QDebug> extern Game *game; Bird::...
#include<stdio.h> #include<stdlib.h> #include<conio.h> using namespace std; struct qnode { struct qnode *next,*prev; unsigned pagenumber; }; struct queue { unsigned count; unsigned totalframe; struct qnode *front,*rear; }; struct hash { unsi...
#pragma once #include "Defines.h" #include <string> using namespace std; class BasePeer { public: BasePeer(int input_buffer_size); ~BasePeer(); SOCKET getPeerSocket(); void InitializeSocket(); int GetLastErrorCode(); void Close(SOCKET handle); bool Bind(short port); bool Listen(int...
#ifndef ECLAT_H #define ECLAT_H #include <bitset> #include <unordered_map> #include <vector> const int MAX_ITEM_LEN = 100; const int MAX_INPUT_LINE = 3200; using namespace std; using std::bitset; using std::unordered_map; class Eclat { private: unordered_map<int, bitset<MAX_INPUT_LINE>> inverted_list; vecto...
#include<iostream> #include<vector> #include<algorithm> #include<set> #include<string> using namespace std; class Solution { public: string getHint(string secret, string guess) { //基本思想:第一次遍历用multiset将secret每个出现过的数字保存起来,第二次遍历看guess中数字是否存在于multiset计算countB string res; int countA=0; i...
#include "pch.h" #include "RenderDevice.h" namespace Hourglass { RenderDevice g_RenderDev; ComPtr<ID3D11InputLayout> g_InputLayouts[kVertexDeclCount]; ComPtr <ID3D11BlendState> g_BlendState[kBlendStateCount]; ComPtr<ID3D11SamplerState> g_SamplerState[kSamplerStateCount]; RenderShader g_RenderShaders[k...
// RsaToolbox #include "Vna.h" using namespace RsaToolbox; // Qt #include <QCoreApplication> #include <QDir> void main() { Vna vna(ConnectionType::VisaTcpConnection, "127.0.0.1"); // Start from instrument preset vna.preset(); vna.pause(); // Get Trc1 interface VnaTrace trc1 = vna.trace("T...
#include <memory> int main() { std::unique_ptr<int> u(new int(0)); return *u; }
#include "Berserker.h" Berserker::Berserker(string nom, int force) : Personnage(nom), _force(force) { } Berserker::~Berserker() { } void Berserker::sePresenter() const { Personnage::sePresenter(); cout << "J'ai également " << _force << " points de force" << endl; cout << "Ma devise : l'attaque est la meilleure de...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. ** It may not be distributed under any circumstances. */ #ifndef DOM_EXTENSIONS_EXTENSIONMANAGER_H #define DOM_EXTENSIONS_EX...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "10550" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) int main(int argc, char const *argv[]) { #ifdef DBG freopen("uva" PROBLEM TESTC ".in", "r", stdin); freopen("uva" PROBLEM ".out", "w", stdout); #endif int start,o...
RENDER_PLANET(RenderTrianglePlanet); // Returns size_in_tris int InitTrianglePlanetMesh(DrawItem &draw_item) { const int splits = 5; // configurable const int size_in_tris = 1 << splits; const int size_in_verts = size_in_tris + 1; const int verts_total = size_in_verts * (size_in_verts + 1) / 2...
// // NodoBB.h // Arboles // // Created by Daniel on 20/10/14. // Copyright (c) 2014 Gotomo. All rights reserved. // #ifndef __Arboles__NodoBB__ #define __Arboles__NodoBB__ #include <iostream> template <class T> class NodoB; template <class T> std::ostream & operator <<(std::ostream &, NodoB<T> &); template <cl...
/* Copyright (c) 2022 Xavier Leclercq Released under the MIT License See https://github.com/ishiko-cpp/test-framework/blob/main/LICENSE.txt */ #include "DirectoryComparisonTestCheck.hpp" #include "FileComparisonTestCheck.hpp" #include "Test.hpp" #include <Ishiko/FileSystem.hpp> using namespace Ishiko; Di...
#pragma once #include "XPBDConstraints.h" #include <cuda_runtime.h> #include <nclgl\Vector4.h> #include <vector> struct CudaTextureWrapper { CudaTextureWrapper() : mem(NULL), tex(NULL), surface(NULL) {} cudaArray* mem; cudaTextureObject_t tex; cudaSurfaceObject_t surface; void allocate( cudaChannelFormatDe...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2004 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 _SUPPORT_PROXY_NTLM_AUTH_ #define ...
/* * main.cpp * * Created on: 24/gen/2012 * Author: jetmir */ #include <stdio.h> #include "cv.h" #include "highgui.h" #include "FieldAnalyse.h" using namespace std; using namespace cv; int main(int argc, char * argv[]) { FieldAnalyse field; field.Launch(); sleep(50); return 0; }
#define GLEW_STATIC #include <GL/glew.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> //core glm functionality #include <glm/gtc/matrix_transform.hpp> //glm extension for generating common transformation matrices #include <glm/gtc/matrix_inverse.hpp> //glm extension for computing inverse matrices #include <glm/gtc/t...