text
stringlengths
8
6.88M
class Solution { public: ListNode *swapPairs(ListNode *head) { ListNode *ret = NULL, *cur = head; ListNode **insert = &ret; while (cur != NULL) { ListNode *node = cur; if (node->next != NULL) { cur = (node->next)->next; ...
#include <stdio.h> #include <pthread.h> #include <unistd.h> /* This is our thread function. It is like main(), but for a thread */ void *threadFunc(void *c) { // char *str; int i = 0; // str=(char*)arg; while(i < 10 ) { usleep(1); printf("threadFunc says"); ++i; } return NULL; } int main(void) { pthre...
#include<bits/stdc++.h> #define ll long long int using namespace std; int main() { ll n,b; cin>>n; vector<ll> v; for(ll i=0;i<n;i++) { cin>>b; v.push_back(b); } sort(v.begin(),v.end()); //counting first similar ll firstsm=0; for(ll i=0;i<n;i++) { if...
#include "LightShader.h" #include <glm/ext.hpp> LightShader::LightShader() : Shader() { } LightShader::LightShader(glm::vec3 viewPos, const char *vs, const char *fs, bool isFile) : Shader(vs, fs, isFile) { this->viewPos = viewPos; } LightShader::~LightShader() { } void LightShader::addDirectionalLight(glm::vec...
/* * UAE - The Un*x Amiga Emulator * * Win32 interface * * Copyright 1997 Mathias Ortmann * Copyright 1997-2001 Brian King * Copyright 2000-2002 Bernd Roesch */ #define NATIVBUFFNUM 4 #define RECORDBUFFER 50 //survive 9 sec of blocking at 44100 #include "sysconfig.h" #include "sysdeps.h" #if defined(AHI) #include <...
/************************************************************* * > File Name : UVa11168.cpp * > Author : Tony * > Created Time : 2019/04/25 12:45:01 **************************************************************/ #include <bits/stdc++.h> using namespace std; struct Point { double x, y; ...
#ifndef _TRINITY_WIDGET_OBJECT_H_ #define _TRINITY_WIDGET_OBJECT_H_ #include "trinity_object_id.h" #include "base/nextai_app.h" #include "render_system/render_system.h" typedef unsigned long ObjectId; namespace NextAI { /* 点击结果 */ enum class HitResult { Hit = 0, /* 命中 */ Missed, ...
#include "..\inc.h" class Solution { public: //I & II vector<vector<int> > permute(vector<int> &num) { vector<vector<int> > r; if(num.empty()) return r; sort(num.begin(), num.end()); r.push_back(num); if(num.size() == 1) return r; for(;;){...
#include "camera.hpp" #include <cmath> Camera::Camera(int width, int height) : center(), size(), rotation(0), viewport(0, 0, 1, 1) { reset(FloatRect(0, 0, width, height)); } void Camera::setCenter(float x, float y) { center.x = x; center.y = y; } void Camera::setCenter(const sf::Vector2f& ...
#include<bits/stdc++.h> using namespace std; #define ll long long int main(){ ll n, c; cin >> n >> c; ll h[n]; for(int i = 0; i < n; i++){ cin >> h[i]; } ll dp[n]; for(int i = 0; i < n; i++){ int ans = -1; for(int j = i - 1; j >= 0; j--){ } } return 0...
// // Copyright (c) 2003--2009 // Toon Knapen, Karl Meerbergen, Kresimir Fresl, // Thomas Klimpel and Rutger ter Borg // // 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 FILE IS AUTOMATICALLY GENERATED ...
/* * 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...
//Water Pump Loop stuff void pumpOn(){ // Serial.println("Pump On");//For Debug digitalWrite(WATER_PUMP_PIN, LOW); // lcd.setCursor ( 6, 1 ); // lcd.print("W+"); t.after(600000, pumpOff); } void pumpOff(){ // Serial.println("Pump Off");//For Debug //lcd.setCursor ( 6, 1 ); // lcd.print("W-"); digitalWrite...
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; while( t-- ){ int n; cin >> n; int ans = 0; int d = log10(n) + 1; ans = (d - 1) * 9; for(int j = 1; j <= 9; j++){ int curr = 0; for(int i = 0; i < d ; i++){ ...
#include <iostream> #include <pcl/io/pcd_io.h> #include <pcl/point_types.h> #include <pcl/point_cloud.h> #include <pcl/octree/octree.h> #include <pcl/filters/voxel_grid_covariance.h> #include <pcl/visualization/cloud_viewer.h> float voxel_size = 0.1; int count = 0; int counttarget = 0; void XOR(pcl::PointCloud<pcl::P...
#include "AboutLayer.h" #include "WelcomeLayer.h" AboutLayer::AboutLayer() { } AboutLayer::~AboutLayer() { } bool AboutLayer::init() { bool s=false; do { CC_BREAK_IF(!BasicLayer::init()); SetView(); s=true; } while (0); return s; } void AboutLayer::SetView() { setBackgroundImage("loading.png"); auto l...
// file : liblava/util/file.hpp // copyright : Copyright (c) 2018-present, Lava Block OÜ // license : MIT; see accompanying LICENSE file #pragma once #include <liblava/core/data.hpp> #include <liblava/util/log.hpp> #include <fstream> #include <filesystem> #include <nlohmann/json.hpp> // fwd struct PHYSFS_Fi...
/************************************************************************* > File Name : Crl.cpp > Author : YangShuai > Created Time: 2016年07月29日 星期五 20时43分44秒 > Description : ************************************************************************/ #include"Itsdata.h" #include"data_handle.h" int32...
#include "JavaFunction.h" /* JNIEnv *env; // JVM environment jobject instance; // the Java function instance jmethodID fct; // the Java method jstring jname; // the Java function name jdoubleArray array; // the Java array as argument */ JavaFunction::JavaFunction(JNIEnv* env, jobject instance...
//$Id: USNTwoWayRange.cpp 1398 2011-04-21 20:39:37Z $ //------------------------------------------------------------------------------ // USNTwoWayRange //------------------------------------------------------------------------------ // GMAT: General Mission Analysis Tool // // Copyright (c) 20...
#ifndef __GUICON_H__ #define __GUICON_H__ #include <iostream> #include <fstream> #include <conio.h> #include <stdio.h> void redirectIO(char *filename); void toConsole(); void closeRedirectIO(); void setPath(); #endif
// This file has been generated by Py++. #ifndef PropertyDefinitionSizef_hpp__pyplusplus_wrapper #define PropertyDefinitionSizef_hpp__pyplusplus_wrapper void register_PropertyDefinitionSizef_class(); #endif//PropertyDefinitionSizef_hpp__pyplusplus_wrapper
// Copyright Steinwurf ApS 2011-2013. // Distributed under the "STEINWURF RESEARCH LICENSE 1.0". // See accompanying file LICENSE.rst or // http://www.steinwurf.com/licensing #pragma once #include <cstdint> #include <cassert> #include <kodoc/kodoc.h> #include "field.hpp" #include "codec.hpp" #include "factory.hpp" ...
#include "CollisionAvoidanceScene.h" using namespace std; CollisionAvoidanceScene::CollisionAvoidanceScene() { Agent *agent = new Agent; agent->setPosition(Vector2D(640, 360)); agent->setTarget(Vector2D(640, 360)); agent->loadSpriteTexture("../res/soldier.png", 4); agents.push_back(agent); target = Vector2D(640...
#ifndef RENDERCONTEXT_H_ #define RENDERCONTEXT_H_ #include "SDL.h" #include "Color.h" #include "geo/Rectangle.h" #include <memory> #include "renderer/TextureUnit.h" #include "renderer/ClearState.h" #include "renderer/VertexArray.h" #include "renderer/GraphicsDevice.h" #include "renderer/Framebuffer.h" #include "Primi...
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package #ifndef JACTORIO_INCLUDE_RENDER_OPENGL_MVP_MANAGER_H #define JACTORIO_INCLUDE_RENDER_OPENGL_MVP_MANAGER_H #pragma once #include <glm/glm.hpp> #include "jactorio.h" namespace jactorio::render { class MvpManager ...
#include "stdafx.h" #include "DcmVR.h" MAP_VRPROPERTY CDcmVR::m_VrProperty; bool CDcmVR::m_bInit = CDcmVR::Init(); CDcmVR::CDcmVR(void) { } CDcmVR::~CDcmVR(void) { } bool CDcmVR::Init() { Insert(VR_00,"私有Tag", 0, 4, 1,10,0,4,2,"VR_00"); Insert(VR_SQ,"Sequence of Items", 0, 4, 1,12,0,4,4,"VR_SQ");...
#include <iostream> #include "../../CACLFloat/CACLFloat.hpp" int main(int argc, char **argv) { cacl::CACLFloat test, test1, test2; std::cin >> test1 >> test2; test = test1 / test2; std::cout << test; return 0; }
#include <jni.h> #include <string> #ifndef LEMONWALLETC_STRCONV_H #define LEMONWALLETC_STRCONV_H using namespace std; jstring CStr2Jstring(JNIEnv* env, const char* pat); const char* Jstring2CStr(JNIEnv* env, jstring jstr); jbyteArray CBytes2JByteArray(JNIEnv* env, const char* bytes, size_t size); #endif //LEMONWA...
#include <string> #include <vector> using namespace std; vector<int> solution(vector<int> lottos, vector<int> win_nums) { vector<int> answer; int count = 0; int zero_count = 0; for (auto lotto : lottos) { if (lotto == 0) { zero_count++; continue; } for (auto win : win_nums) if (lotto == win) ...
/* * Time.h - Library for maintaining discrete date and time representation for PrNet nodes. * Created by Dwyane George, November 16, 2015 * Social Computing Group, MIT Media Lab */ #ifndef PrTime_h #define PrTime_h #include "Arduino.h" // Time structure struct t { int month; int date; int year; ...
/* * non_oop.cpp * * Created on: Sep 4, 2015 * Author: ferrazlealrm@ornl.gov * * Non OOP example of URL: * scheme:[//domain[:port]][/]path */ #include <iostream> #include <string> std::string domain = "ornl.gov"; std::string http_port = "80"; std::string https_port = "443"; std::string ftp_port = "20"...
#include<bits/stdc++.h> using namespace std; int main() { int n,p; vector<int> ps; cout<<"Enter the length of the page string.\n"; cin>>n; set<int> s; queue<int> q; cout<<"Enter the page frame size.\n"; int pframe; cin>>pframe; int currsize=0; int phit=0,pfault=0; cout<<"Enter the page string.\n"; for(int ...
#ifndef D3D9INDEXBUFFER_H #define D3D9INDEXBUFFER_H #include "iindexbuffer.h" #include <d3d9.h> #if USE_LONG_INDICES #define D3DINDEXFORMAT D3DFMT_INDEX32 #else #define D3DINDEXFORMAT D3DFMT_INDEX16 #endif class D3D9IndexBuffer : public IIndexBuffer { protected: virtual ~D3D9IndexBuffer(); public: D3D9IndexBuffer...
#include"globalDefine.h" #include"PerspectiveCamera.h" #include"ObjFile.h" #include"DirectionalLight.h" #include<iostream> #include<string> #pragma comment(lib,"legacy_stdio_definitions.lib") #if _MSC_VER>=1900 #include "stdio.h" _ACRTIMP_ALT FILE* __cdecl __acrt_iob_func(unsigned); #ifdef __cplusplus extern "C" #e...
// PaintFindIndexVisitor.h #ifndef _PAINTFINDINDEXVISITOR_H #define _PAINTFINDINDEXVISITOR_H #include "Visitor.h" #include <afxwin.h> class PaintFindIndexVisitor : public Visitor { public: PaintFindIndexVisitor(CDC *dc); PaintFindIndexVisitor(const PaintFindIndexVisitor& source); virtual ~PaintFindIndexVisitor(); ...
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package #ifndef JACTORIO_INCLUDE_RENDER_RENDERER_EXCEPTION_H #define JACTORIO_INCLUDE_RENDER_RENDERER_EXCEPTION_H #pragma once #include <stdexcept> namespace jactorio::render { // These are raised by render classes if an ...
#include "audio\Singularity.Audio.h" namespace Singularity { namespace Audio { IMPLEMENT_OBJECT_TYPE(Singularity.Audio, AudioListener, Component); #pragma region Constructors and Finalizers // Constructor. Takes in a name for the AudioListener. AudioListener::AudioListener(String name) ...
#ifndef REFCOUNT_H #define REFCOUNT_H template <class T> class IRefCount{ template <class U> friend class SharedPointer; protected: virtual void incRefCount() = 0; virtual void decRefCount() = 0; virtual T* getPtr() const = 0; public: virtual int getCounter() const = 0; }; //------------------------------------...
/************************************************************* * > File Name : UVa1396.cpp * > Author : Tony * > Created Time : 2019/05/02 16:55:22 **************************************************************/ #include <bits/stdc++.h> using namespace std; const double eps = 1e-7; struct ...
#ifndef __QINT_H__ #define __QINT_H__ #define _BIT_UINT32_ 32 #define _DEFAULT_SIZE 16 #define _POSITION ((Binary.size() - 1 - i) / (sizeof(_Uint32t) * CHAR_BIT)) #define _SHIFT_OFFSET (((Binary.size() - 1) % (CHAR_BIT * sizeof(_Uint32t))) - (i % (CHAR_BIT * sizeof(_Uint32t)))) #include <string> #include <io...
/**************************************** * * INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE * Copyright (C) 2019 Victor Tran * * 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 Foundati...
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; bool flag = true; for(int i=0;i<s.size();i++){ if(s[i] == 'X'){ cout << i << endl; flag = false; break; } } if(flag) cout << s.size() << endl; }
#include <iostream> #include <queue> #include <climits> using namespace std; class node { public: int data; node* left; node* right; node(int d):data(d),left(NULL),right(NULL){ } }; void Preorder(node* root){ if(root==NULL){ return; } cout<<root->data<<" "; Preorder(root->left); Preorder(root->right); } ...
/* * Callback.h * * Created on: Dec 28, 2013 * Author: Jakub 'kuhar' Kuderski , Dawid Drozd */ #pragma once #include <vector> #include <utility> #include <type_traits> #include <functional> #include "cocos2d.h" #define CALLBACK_ENABLE_ASSERTIONS 1 #if CALLBACK_ENABLE_ASSERTIONS == 1 #include <cassert> #endif ...
#include "Sprites.h" #include "SpriteManager.h" #include "Testing.h" #include "Settings.h" void Sprite::Unvalidate() { if( Valid ) { if( ValidCallback ) { *ValidCallback = false; ValidCallback = nullptr; } Valid = false; if( Paren...
#include "actor.h" Arena::Arena(int width, int height) { w_ = width; h_ = height; } void Arena::add(Actor* a) { auto pos = find(begin(actors_), end(actors_), a); if (pos == actors_.end()) { actors_.push_back(a); } } void Arena::remove(Actor* a) { auto pos = find(begin(actors_), end(ac...
/** * @author Levi Armstrong * @date January 1, 2016 * * @copyright Copyright (c) 2016, Southwest Research Institute * * @license Software License Agreement (Apache License)\n * \n * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Licens...
/* * This program is to illustrate concept of call by reference. * In this swap function is used. */ #include <iostream> using namespace std; void swap(int &a,int &b){ // swap function which have call by reference concept so it will take address as parameter. int temp=a; a=b; b=temp; } int main(){ int a=10,b=2...
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ long n; cin>>n; vector<long>arr(n); vector<long>marr(n); for(long i=0; i<n; i++){ cin>>arr[i]; } marr[0] = arr[0]; for(long i=1;i<n; i++){ marr[i] = min(marr[i-1],arr[i]); } long long count=0; for(long i=...
#include<bits/stdc++.h> using namespace std; string solve(string input) { int li,ri; int max_size = 0; for(int i=0;i<input.size();i++) { // odd length string temp; int left = i; int count = 0; int right = i; while(left>=0 && right <input.size() && input[left]==input[right]) { count = right - left ...
#include <boost/optional.hpp> #include <cmath> #include <ctime> #include <iostream> #include <vector> boost::optional<int> get_even_random_number() { int i = std::rand(); return (i % 2 == 0) ? i : boost::optional<int>{}; } boost::optional<int> get_even_random_number2() { int i = std::rand(); return boost::opt...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.System.Power.2.h" WINRT_EXPORT namespace winrt { namespace Windows::System::Power { struct BackgroundEnergyManager { BackgroundEnergyManager() = delete; static uint...
// // Created by alex on 9/26/19. // #ifndef ALG_LAB1_MAIN_H #define ALG_LAB1_MAIN_H #include <cstdlib> #include <bits/stdc++.h> #define WrongFormatException 11000 #define UnidentifiedOperatorException 12000 #define VariableCountingException 13000 class AtomicList; using namespace std; union Content { AtomicL...
#include <cstdio> #include <climits> #include <cmath> #include <iostream> #include <algorithm> #include <map> #include <set> #include <vector> using namespace std; const int MAX_N = 15; const int MAX_M = 15; const int INF = std::numeric_limits<int>::max(); //2,147,483,647 == 2^31 -1 int dp[2][1 << MAX_M]; //INPUT ...
#ifndef RSIM_Adapter_H #define RSIM_Adapter_H /** Adapters. * * An adapter is an object that can be attached to a simulator to change the simulator's behavior, and then detached to * restore the simulator to its original behavior. * * An example of an adapter is TraceIO, which monitors data transfers on specif...
// antchaos.cpp - verbesserte antchaos-version // (c) 1999 Michael Fink /* Originaler Kommentar von Christian Strobl: Programm, das mittels eines Graphikbeispiels verdeutlicht, wie in v”llig zuf„lligen Strukturen, also Chaos, pl”tzlich regel- m„áige Muster auftauchen k”nnen, also Ordnung. Das Programm fllt zuerst per...
#ifndef CHEQUING_ACCOUNT_H #define CHEQUING_ACCOUNT_H #include "Account.h" // Base class: Account.h class Chequing_Account : public Account { friend std::ostream &operator<<(std::ostream &os, const Chequing_Account &account); private: static constexpr const char *def_name = "Unnamed Chequing Account"; static...
/* * UAE * * mp3 decoder helper class * * Copyright 2010 Toni Wilen * */ #include "sysconfig.h" #include "sysdeps.h" #include <zfile.h> #include <mp3decoder.h> #include <windows.h> #include <mmreg.h> #include <msacm.h> #define MP3_BLOCK_SIZE 522 static int mp3_bitrates[] = { 0, 32, 64, 96, 128, 160, 192, 224...
// 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.Foundation.3.h" #include "internal/Windows.UI.Xaml.Interop.3.h" #include "internal/Windows.UI.Xaml.Media.Animation.3.h" #include...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework\Actor.h" #include "Components\BoxComponent.h" #include "Components\StaticMeshComponent.h" #include "TimerManager.h" #include "DoorKeyStruct.h" #include "DoorKey.h" #include "Gam...
#include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/nonfree/features2d.hpp> #include <opencv2/legacy/legacy.hpp> #include <vector> #include "SiftTest.h" using namespace cv; using namespace std; int siftTest::one_Img_Sift(Mat img) { //...
#include "Pololu37D.h" #include <mutex> using namespace Encoder; Pololu37D::Pololu37D(const Config &config) : m_QEI(config.ChannelA, config.ChannelB, config.Index, config.quadratureEncoding), m_zeroOffsetDeg(config.offsetDeg) {} bool Pololu37D::getAngleDeg(float &angle) { std::scoped_lock<Mutex> lock(m_...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once WINRT_EXPORT namespace winrt { namespace ABI::Windows::Devices::SerialCommunication { struct IErrorReceivedEventArgs; struct IPinChangedEventArgs; struct ISerialDevice; struct ISerialDeviceS...
#include <iostream> #include "list.hpp" #include "putovanje.h" using namespace std; int main() { return 0; }
///udppeer_co.h #ifndef NETPEER_CO_H #define NETPEER_CO_H #include "fddef.h" #include "addr.h" #include "namespdef.h" #include <coroutine> #include <deque> NAMESP_BEGIN namespace net { template<class MsgWrapper> class NetPeer_co { public: NetPeer_co() { } virtual ~NetPeer_co(){ } protected: void cl...
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <cstring> #include <queue> #include <sstream> using namespace std; /* 输入两棵二叉树A,B,判断B是不是A的子结构。(ps:我们约定空树不是任意一个树的子结构) e.g.: {8,8,7,9,2,#,#,#,#,4,7},{8,9,2} 输出true */ /* struct TreeNode { int val; struct TreeNode *left; struct TreeNo...
#include "ovpCBoxAlgorithmSignalMaximum.h" using namespace OpenViBE; using namespace OpenViBE::Kernel; using namespace OpenViBE::Plugins; using namespace OpenViBEPlugins; using namespace OpenViBEPlugins::SignalProcessing; boolean CBoxAlgorithmSignalMaximum::initialize(void) { m_oSignalDecoder.initi...
#include <iostream> using namespace std; int heapsize = 0; int *heap; int n, m,tmp; void heapinsert (int x) { int now = heapsize; while (now > 0 && x<=heap[(now-1)/2]) { heap[now] = heap[(now-1)/2]; now = (now-1)/2; } heap[now] = x; heapsize++; } void adjust (int number)...
#pragma once #include <utility> #include <memory> #include <functional> using tensor_shape = std::pair<size_t, size_t>; using tensor_index = tensor_shape; template <typename Type, size_t Height, size_t Width> using array2d = std::array<std::array<Type, Width>, Height>; template <typename Type> using tensor_data = std:...
#include "SampleRobot.h" SampleRobot::SampleRobot() { sensors = std::tr1::shared_ptr<Sensors>(new Sensors()); } SampleRobot::~SampleRobot() { } void SampleRobot::run() { std::vector<float> anglesServo; //sensors->mBodySensors["RHipPitch"]->setPosition(-90*RAD_OVER_DEG); sensors->getReadyServoByName(JOINT_ST...
/*************************************************************************** dialogocaso.cpp - description ------------------- begin : sep 13 2003 copyright : (C) 2003 by Oscar G. Duarte email : ogduarte@ing.un...
#ifndef MENU_ELPOLLOLOCO_TESTS #define MENU_ELPOLLOLOCO_TESTS #include "gtest/gtest.h" #include "../../composite/menu_component.hpp" #include "../../composite/menu_taco/header/menu_items_elpolloloco.hpp" #include "../../composite/menu_taco/header/menu_elpolloloco.hpp" #include <iostream> using namespace std; TEST(Men...
/* 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...
/* Copyright (c) 2008-2015 Jordi Santiago Provencio 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, publis...
#pragma once #include "stdafx.h" class BackGround { private: int** pMapArr; ege::PIMAGE blockImg; ege::PIMAGE floorImg; void initMap(); public: BackGround(); ~BackGround(); void reDraw(); };
/* * VacuumPump.cpp * * Parent class for all throttle controllers Copyright (c) 2018 Chris Young 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 lim...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
// 快排 // Partition+Qsort // Qsort:W(P+Q+Q),P切分产生两个区间,由于两个区间内的元素的最终位置不会越过该区间,所以递归排序即可 // Partition:选取元素,将其移动到合适的位置,使其左侧元素均小于它,右侧元素均大于等于它 #include <bits/stdc++.h> using namespace std; const int MAXN = 5010; // [two pointers]思想,从两端同时处理 // 该思想具体精髓在哪里还需要刷题 int Partition(int A[], int left, int right) { // 脑海里想象整个数组 ...
/* * Copyright (c) 2009-2012 André Tupinambá (andrelrt@gmail.com) * * 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...
/* vim:tabstop=4:expandtab:shiftwidth=4 * * Idesk -- XImlib2Shadow.cpp * * Copyright (c) 2002, Chris (nikon) (nikon@sc.rr.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: * * ...
#include<stdio.h> #include<string.h> int a[1000000]; int main() { int n, x; scanf("%d%d",&n,&x); for(int i = 0; i < n; i++) { scanf("%d",&a[i]); } if(a[0] >= x) { a[0] > x ? printf("-1 0") : printf("0 0"); return 0; } if(a[n-1] <= x) { a[n-1] < x ?...
#include "window_config.h" LRESULT CALLBACK wndProc(HWND windowHandle, UINT message, WPARAM wParam, LPARAM lParam){ static HDC hardwareContext; static HGLRC graphicContext; int width; int height; if(message == WM_CREATE){ hardwareContext = GetDC(windowHandle); globalHardwareCont...
// MQ5 Gas Sensor int sensor = 7; int gasValue = A0; //D7 void setup() { pinMode(sensor, INPUT); Serial.begin(9600); } void loop() { gasValue = analogRead(sensor); Serial.print("MQ5 Value : "); Serial.print(gasValue); Serial.println(""); delay(1000); }
// // RenderTarget.cpp // 3d technics // // Created by Mike on 1/12/15. // Copyright (c) 2015 Mike. All rights reserved. // #include "RenderTarget.h" FrameBuffer::FrameBuffer(void) : fbo(0) { GL_DEBUG(glGenFramebuffers(1, &fbo)); GL_DEBUG(glBindFramebuffer(GL_FRAMEBUFFER, fbo)); } FrameBuffer::~FrameBuff...
// Copyright 2019 Google LLC // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. // // Auto-generated file. Do not edit! // Specification: test/f32-vsubc.yaml // Generator: tools/generate-vbinary-test.py #include <gtest/gtest.h> #...
/*Sensor de Temperatura y Humedad DHT11<br>Instrucciones: Recuerda descargar la libreria DHT para poder utilizar este sensor Conectaremos el Sensor DHT11 a 5v y el pin de señal a la entrada digital 7 */ #include "DHT.h" #define DHTPIN 7 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(9600);...
#ifndef ExN02PrimaryGeneratorAction_h #define ExN02PrimaryGeneratorAction_h 1 #include "G4VUserPrimaryGeneratorAction.hh" #include "globals.hh" #include "G4ParticleGun.hh"
#include<bits/stdc++.h> using namespace std; #define mod 1000000007 int util(vector<vector<char> > &arr,int i,int j,vector<vector<int> > &dp){ int n=arr.size(); if(i<0 || j<0 || i>=n || j>=n) return 0; if(arr[i][j]=='*') return dp[i][j]=0; if(i==0 && j==0) return dp[i][j]=1; if(dp[i][j]!=-1) return dp[i][j]; retu...
#include<bits/stdc++.h> using namespace std; #define N 100000 int not_prime[101010]; vector<long long int> primes; void crivo(){ memset(not_prime, 0, sizeof(not_prime)); for(int i = 2; i < N ; i++){ if(not_prime[i]) continue; primes.push_back(i); for(int k = i+i; k < N; k+=i){ not_prime[k] = 1;...
/* M. Gries 2016-05-16 */ /* * Design Specification * Based on ArduinoOTA/WebUpdater for OTA Uploads of any *.bin file the target application will be added here too * an OTA uploader functionality still remains * so another target application can be uploaded later on or an update of the following target appl...
#ifndef HTTPENDPOINTJSONSET_H #define HTTPENDPOINTJSONSET_H #include "httpendpoint.h" #include "jsonconverter.h" #include <functional> template <typename T> class HttpEndpointJsonSet : public HttpEndpoint { public: using callback_t = std::function<void(T)>; HttpEndpointJsonSet(const String &endpoint) : HttpEndpoin...
#pragma once #include "../../hlt/map.hpp" #include "point.h" #include "connection.h" #include "../bot.h" class Bot; class IMap { public: virtual void analyze (Bot const &) = 0; virtual Point * get_point (unsigned x, unsigned y) = 0; virtual std::vector<Connection> get_connections (Point const *) = 0; ...
#pragma once #include "Types.hpp" namespace engine { class Path; class Config { public: static Config& GetInstance(); Config() {} ~Config() {} virtual Bool Initialize(const Path& configFile) = 0; virtual Int32 GetInt32Value(const std:...
#include<iostream> #define OJ 98 using namespace std; int main() { #ifndef OJ freopen("201709-1.txt","r",stdin); #endif int n; cin>>n; int num; //单买可以购买多少瓶 num=n/10; int res=0; int temp=0; temp=num/5; res+=temp*5; res+=temp*2; num-=temp*5; temp=num/3; res+= temp; res+=temp*3; num-=temp*3; res+=num; c...
#include <tudocomp/meta/ast/Parser.hpp> namespace tdc { namespace meta { namespace ast { std::vector<Parser::preprocessor_t> Parser::s_preprocessors; }}} //ns
// // AtomFart.cpp // Boids // // Created by chenyanjie on 4/7/15. // // #include "AtomFart.h" #include "../../scene/BattleLayer.h" using namespace cocos2d; AtomFart::AtomFart() { } AtomFart::~AtomFart() { } AtomFart* AtomFart::create( UnitNode* owner, const cocos2d::ValueMap& data, const cocos2d::Val...
#include <stdio.h> #include <iostream> #include <conio.h> using namespace std; main() { string queue[10]; int depan=0; int belakang=0; int pilihan, i; string data; do { menu: cout<<"===================================="<<endl; cout<<"| PROGRAM ARRAY OF QUEUE\t |"<<end...
#ifndef __FLIP_SLIDESHOW__ #define __FLIP_SLIDESHOW__ extern "C"{ #include <libavformat/avformat.h> #include <libavcodec/avcodec.h> } #include <iostream> namespace fliphw{ class SlideshowPimpl; class Slideshow{ public: Slideshow(); ~Slideshow(); /** * Appends the image, provided the specified stream ...
//DEMO //demo