text
stringlengths
8
6.88M
#pragma once #include "GameNode6.h" struct tagTimeLineInfo { int x; int y; }; enum TIME { TIME_SECOND, TIME_MINUTE, TIME_HOUR, TIME_END }; struct tagTimeNameInfo { int time; int x; int y; }; class MainGame7 : public GameNode6 { private: RECT clock; tagTimeLineInfo timeLineInfo[3]; tagTimeNameInfo time...
#pragma once #include "stdafx.h" #include "TestBase.h" class Station; class CallsignTests : public TestBase { public: CallsignTests(); virtual ~CallsignTests(); virtual bool Setup(); virtual void Teardown(); virtual bool RunAllTests(); bool TestN0H_BAR(); bool TestVE9AA(); bool TestOM2V...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; using ii= pair<ll,ll>; #define all(o) (o).begin(),(o).end() #define F first #define S second #define MP make_pair #define PB push_back //using min_of_3=min({ll a,ll b,ll c}); class prioritize{ public: bool operator() (ii &p1,ii &p2){ ...
#include <bits/stdc++.h> using namespace std; int main() { bool marq[1000005]={0}; int n, tot=0, est=0, pt=0, sitio[1000005]; scanf("%d", &n); for(int i=0;i<n;i++) { scanf("%d", &sitio[i]); tot+=sitio[i]; } while(pt>=0 && pt<n) { if(sitio[pt]%2) { if(m...
extern "C" { #include <libavcodec/avcodec.h> #include <libavutil/opt.h> #include <libavutil/imgutils.h> #include <libswscale/swscale.h> }; class AvEncoder { public: AvEncoder(); ~AvEncoder(); bool init(char* codec_name, int width, int height); void encode(unsigned char* buffer); private: bool rgba_t...
// Created on: 2002-11-13 // Created by: Galina KULIKOVA // Copyright (c) 2002-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 ...
// Copyright 2012 Yandex #ifndef LTR_LEARNERS_DECISION_TREE_DECISION_VERTEX_H_ #define LTR_LEARNERS_DECISION_TREE_DECISION_VERTEX_H_ #include <string> #include "ltr/learners/decision_tree/utility/utility.h" #include "ltr/learners/decision_tree/decision_tree.h" namespace ltr { namespace decision_tree { /** * Decisi...
// Created on: 1995-01-27 // Created by: Marie Jose MARTZ // 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 terms of the G...
#include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <queue> #include <stack> #include <string> #include <bitset> #include <string.h> #include <cstdio> #include <limits> #include <vector> #include <climits> #include <cstring> #include <cstdlib> #include <fstream> #in...
class Category_605 { duplicate = 487; }; class Category_640 { duplicate = 487; };
#pragma once #include "aePrerequisitesCore.h" #include <aePrerequisitesUtil.h> namespace aeEngineSDK { class AE_CORE_EXPORT aeApplication { protected: virtual AE_RESULT Init(); virtual AE_RESULT StatusUptade(); virtual void Render(); virtual void Logic(); virtual void Destroy(); public: aeApplication()...
#include <iberbar/RHI/D3D11/Effect.h> #include <iberbar/RHI/D3D11/ShaderState.h> #include <iberbar/RHI/D3D11/ShaderReflection.h> #include <iberbar/RHI/D3D11/ShaderVariables.h> #include <iberbar/RHI/D3D11/Shader.h> #include <iberbar/RHI/D3D11/Buffer.h> #include <iberbar/RHI/D3D11/Device.h> iberbar::RHI::D3D11::CEf...
#include <SoftwareSerial.h> SoftwareSerial mySerial(1, 0);//Initialize serial communications on pins 1TX, 0RX void setup(){ mySerial.begin(9600) } void loop(){ }
//果然还是得一段一段来,process注释掉竟然没问题了,就是说process部分竟然能影响输入 //我他妈也是佩服自己了 while里面的3个for循环全是++A_index. 不死循环才怪呢 //你他妈的就不能一开始就检查吗 非得调试半天 还调试 我真是日了狗了 //检查出这个改了以后就能在小黑框里面运行样例成功了 //这次算是用了下hash吧 和原来的比了一下 无论速度还是内存都不如原来的 //原来的那个加速版的还不如不加速版的 不过这一次的代码长度减少不少原来(73)这次(55) //看了下大概懂原来是怎么写的了 现在客观评价的话,还是现在的代码好懂一点 简洁一点 //不过依然是 在同一个复...
#include <iostream> #include <utility> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <openssl/rsa.h> #include <openssl/evp.h> #include <openssl/pem.h> #include <openssl/err.h> #include <openssl/rand.h> #include <openssl/conf.h> #include "CryptoFunctions.h" using namespace std; i...
// // OpenGLIncludes.h // Crapenstein // // Created by Bruno Caceiro on 23/05/14. // Copyright (c) 2014 Bruno Caceiro. All rights reserved. // #ifndef Crapenstein_OpenGLIncludes_h #define Crapenstein_OpenGLIncludes_h #ifdef __APPLE__ #include <GLUT/glut.h> #include <OpenGL/gl.h> #else #include <GL/gl.h> #include ...
#ifndef WALI_TESTING_KEYS_HPP #define WALI_TESTING_KEYS_HPP #include "wali/Key.hpp" namespace testing { struct Keys { wali::Key st1, st2, st3, st4, st5; wali::Key a, b; Keys(): st1(wali::getKey("state1")), st2(wali::getKey("state2")), st3(wali::getKey("state3")), st4(wali::getKe...
#include <vector> #include "Panel.h" #define FONT_LINE_HEIGHT 40.0f / 512.0f Panel::Panel(Scene& scene, Font& font, glm::vec4 transform) : GuiElement(scene, font, transform){ background = new Gui; background->color = Color {0.5f, 0.5f, 0.5f, 1.0f}; text = new GuiText(font); text->borderColo...
/* * Copyright (C) 2007,2008 Alex Shulgin * * This file is part of png++ the C++ wrapper for libpng. PNG++ is free * software; the exact copying conditions are as follows: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions a...
/** * @date 04/01/19 * @author SPREEHA DUTTA */ #include <bits/stdc++.h> using namespace std; void calc(string w,int m,int p[]) { int l=0,i=1;p[0]=0; while(i<m) { if(p[i]==p[l]) { l++; p[i]=l; i++; } else { if(l!=0) ...
#include <algorithm> #include "Application.h" #include "EverydayTools/Exception/CallAndRethrow.h" #include "EverydayTools/Exception/ThrowIfFailed.h" #include "Keng/Core/ISystem.h" #include "Keng/Core/SystemEvent.h" #include "WinWrappers/WinWrappers.h" #include "WinWrappers/WinWrappers.h" #include "Keng/Core/ISystem.h"...
#include <iostream> #include <vector> #include<math.h> using namespace std; #define P 1000000 vector<int> primes; char sieve[P+1]; void getPrimes(); int cut(int n, bool right); int main() { getPrimes(); int sum = 0; for (int p = 0; p < primes.size(); p++) { if (primes[p] < 10) { sieve[primes[p]] = 5; co...
#include "StdAfx.h" #include "configTreeMng.h" configTreeMng::configTreeMng(void) { } configTreeMng::~configTreeMng(void) { } void configTreeMng::loadDataFromFile() { }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2002 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 SKIN_SUPPORT #include "modules/ski...
#ifndef CRASHEVENT_H #define CRASHEVENT_H #include "Event.h" class Vector; class Object; class PlayerNeo; class Field::CrashEvent : public Field::Event { public: class CrashResult; public: explicit CrashEvent(PlayerNeo*); void exec(void); private: void execFirstCrash(void); void execSecondCrash(void); bool ...
#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; const int INF = 1 << 28; int a[1010][1010]; int use[1010],dis[1010]; int main() { int n,q; whil...
// Copyright (C) 2014, 2015, 2016 Alexander Golant // // This file is part of csys project. This project 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 version 3 of the License, or // (at your...
#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> using namespace std; int main() { //freopen("test1.in", "r", stdin); //freopen("test1.out", "w", stdout); int T; while (~scanf("%d", &T)) { int dp[T + 5]; int data[T + 5]; data[0] = 0; in...
#include<bits/stdc++.h> using namespace std; #define rep(i,b) for(i=0;i<b;i++) #define rep1(i,b) for(i=1;i<=b;i++) #define plln(n) printf("%lld\n",n) #define s3ll(n1,n2,n3) scanf("%lld%lld%lld",&n1,&n2,&n3) #define s2ll(n1,n2) scanf("%lld%lld",&n1,&n2) #define sll...
#include <iostream> #include <vector> using namespace std; int find2020(vector<int>& numbers){ for(int i = 0; i < numbers.size(); ++i){ for(int j = i + 1; j < numbers.size(); ++j){ for(int k = j + 1; k < numbers.size(); ++k){ if(numbers[i] + numbers[j] + numbers[k] == 2020){ ...
// Copyright (c) 2018 Mozart Alexander Louis. All rights reserved. // Includes #include "intro_scene.hxx" IntroScene::IntroScene(const ValueMap& params, BackgroundLayer*) : BaseScene(params, nullptr) {} IntroScene::~IntroScene() = default; ValueMap IntroScene::generateParams() { // Add default params ValueMap p...
// include the basic windows header file #include <windows.h> #include <windowsx.h> #pragma comment(lib, "d3d11.lib") #pragma comment(lib, "dxgi.lib") #pragma comment(lib, "d3dcompiler.lib") #include <d3d11.h> #include <directxmath.h> #include <d3dcompiler.h> #include <sstream> #include <fstream> #include <tuple> #in...
#include "tabwidget.h" #include "ui_tabwidget.h" #include "cvimagewidget.h" using namespace std; /*----------------------* * * * * * TAB WIDGET * * * * * *----------------------*/ TabWidget::TabWidget(QWidget *parent)...
#include "compiler.hpp" void modulo() { Identifier a = identifierMap.at(expressionArguments[0]); Identifier b = identifierMap.at(expressionArguments[1]); Identifier aI, bI; if (identifierMap.count(argumentsTabIndex[0]) > 0) aI = identifierMap.at(argumentsTabIndex[0]); if (identifierMap.count(argumentsT...
#include <cstdlib> #include <iostream> #include <vector> using namespace std; main() { vector <int> a; a.push_back(8); a.push_back(7); a.push_back(2); a.push_back(5); a.push_back(3); a.insert(a.begin()+3,10); for(int i = 0; i < a.size(); i++) cout << a[i] << " "; ...
#ifndef __SYNAPSE_H__ #define __SYNAPSE_H__ #include "../../qgraph/src/Vertex.h" namespace neurnet { struct Synapse { const graph::Vertex* v; double weight; bool operator<(const Synapse& s) const { return (v < s.v); }; bool operator==(const Synapse& s) const { re...
#include "Application.h" #include "components/MeshComponent.h" #include "components/graphics/Camera.h" #include "components/graphics/CameraController.h" #include "components/PhysicsComponent.h" #include "components/TransformComponent.h" //Todo: this could be cleaned up a little bit. using namespace Game; int main() { ...
/* * @Description: front end 任务管理, 放在类里使代码更清晰 * @Author: Ren Qian * @Date: 2020-02-10 08:31:22 */ #ifndef LIDAR_LOCALIZATION_MAPPING_FRONT_END_FRONT_END_FLOW_HPP_ #define LIDAR_LOCALIZATION_MAPPING_FRONT_END_FRONT_END_FLOW_HPP_ #include <ros/ros.h> #include "lidar_localization/subscriber/cloud_subscriber.hpp" #in...
#pragma once #include <random> #include <string> #include <map> #include "Tetramino.h" class RandomTetraminoGenerator { std::map<int, Tetramino *> tetraminoes; public: static RandomTetraminoGenerator& Instance(); void RegisterTetramino(const int & id, Tetramino * tetramino); Tetramino * Generate() { int ...
#include "dbmanager.h" #include <QSqlQuery> #include <QSqlError> #include <QSqlRecord> #include <QDebug> #include <QCoreApplication> DbManager::DbManager(const QString &file) { m_db = QSqlDatabase::addDatabase("QSQLITE", "ball_state_db"); QString path = QCoreApplication::applicationDirPath() + "/" + file; // ...
/* * File: main.cpp * Author: Daniel * * Created on 21 de agosto de 2014, 07:41 AM */ #include <cstdlib> #include <iostream> using namespace std; /* * */ int sumarVectores(int* arreglo, int pos); int main(int argc, char** argv) { int arr[3] = {3,6,9}; cout<<sumarVectores(arr, 2); return ...
#include <bits/stdc++.h> using namespace std; const int maxn = 110; int n, m, cnt; char a[maxn][maxn]; int ans[maxn][maxn]; int main() { cin >> n >> m; for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) scanf("%c", &a[i][j]); for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) if (a[i][j] =...
// Даны два списка чисел, которые могут содержать до 100000 чисел каждый. // Выведите все числа, которые входят как в первый, так и во второй список в порядке возрастания. // Входные данные // Вводится число N - количество элементов первого списка, а затем N чисел первого списка. // Затем вводится число M - количест...
using namespace std; int * construct_array(int); int error_handle(); void print_array(int *, int); int * copy_array(int *, int); void merge(int * arr, int left_index, int middle, int right_index); void merge_sort(int * arr, int left_index, int right_index);
#include<iostream> #include<map> #include<algorithm> #include<set> #include<vector> using namespace std; struct con{ int onof[9]; int ques; int time[9]; }; typedef struct con Con; Con temp={{},9,{}}; vector<int>details(3); int main() { int n,a,b,c,s=0,k; char d; string input,tmp; cin>>...
/* Просто перечисление всех реализованных классов узлов дерева промежуточного представления */ #pragma once namespace IRTree { // Вспомогательные классы class CExpList; class CStmList; // Подклассы IRTree::IExp class CONST; class NAME; class TEMP; class BINOP; class MEM; class CALL; class ESEQ; // Подкл...
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2010 Gael Guennebaud <gael.guennebaud@inria.fr> // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free...
#include <iostream> #include <math.h> using namespace std; int main() { int res = 13; double number = 600851475143; // cout<<res<<"\n"; cout<<"Number is "<<number<<". Factors as follows: \n"; //Find factor for (double i = 2; i <= number/71; i++){ if(fmod(number,i)==0){ //n...
///////////////////////////////////////////////////////////////////////////// // render.cpp // rendering system implementation // $Id$ // #include "precompiled.h" #include "render/render.h" #include "render/scenegraph.h" namespace render { } using namespace render; SceneGraph::SceneGraph() { tree = new SceneNode(N...
/*============================================================================= /*----------------------------------------------------------------------------- /* [JSONManager.h] JSON管理クラス /* Author:Kousuke,Ohno. /*----------------------------------------------------------------------------- /* 説明:JSON管理クラス ===========...
#include <iostream> #include <vector> #include <map> #include <cmath> #include <queue> #include <algorithm> #include <iomanip> #include <set> using namespace std; /* → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → */ #define int long long #define ld lon...
#ifndef _GetAllUserStatus_H_ #define _GetAllUserStatus_H_ #include "BaseProcess.h" class GetAllUserStatus : public BaseProcess { public: GetAllUserStatus() {}; virtual ~GetAllUserStatus() {}; virtual int doRequest(CDLSocketHandler* CDLSocketHandler, InputPacket* inputPacket, Context* pt); virtual int doResponse(...
/************************************************************************************** * File Name : Camera.cpp * Project Name : Keyboard Warriors * Primary Author : JeongHak Kim * Secondary Author : * Copyright Information : * "All content 2019 DigiPen (USA) Corporation, all rights reserv...
#include <QPainter> #include <QApplication> #include "splashscreen.h" #include "clientversion.h" #include "util.h" SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f) : QSplashScreen(pixmap, f) { // set reference point, paddings int paddingRight = 50; int paddingTop = 50; int titleVersionVSpace = ...
//: C08:ConstInitialization.cpp // Kod zrodlowy pochodzacy z ksiazki // "Thinking in C++. Edycja polska" // (c) Bruce Eckel 2000 // Informacje o prawie autorskim znajduja sie w pliku Copyright.txt // Inicjalizacja stalych w klasach #include <iostream> using namespace std; class Fred { const int size; publ...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- // // Copyright (C) 1995-2008 Opera Software AS. All rights reserved. // // This file is part of the Opera web browser. It may not be distributed // under any circumstances. // #ifndef UNIX_OPAUTOUPDATE_H #define UNIX_OPAUTOUPDATE_H #ifdef A...
#include <iostream> #include <vector> #include <map> #include <string> #include <bitset> #include <queue> #include <algorithm> #include <functional> #include <cmath> #include <cstdio> #include <sstream> using namespace std; #define INF 1000000000 class CountingSeries { public: long long countYnX(long long a,long lo...
#include "gast_node.h" #include "gast_manager.h" #include <utils.h> #include <core/Array.hpp> #include <core/String.hpp> #include <core/NodePath.hpp> #include <core/Rect2.hpp> #include <core/Transform.hpp> #include <gen/Camera.hpp> #include <gen/Input.hpp> #include <gen/InputEventScreenDrag.hpp> #include <gen/InputEve...
const int X_Pin = 0; const int Y_Pin = 1; void setup() { Serial.begin(9600); } int state = 0; void loop() { // put your main code here, to run repeatedly: int x, y; //btnState = digitalRead(btnPin); this is a ok code x = analogRead(X_Pin); y = analogRead(Y_Pin); x = -(((x+128)>>7) - 8); y = (y+128)>>7; ...
/////////////////////////////////////// // // Computer Graphics TSBK03 // Conrad Wahlén - conwa099 // /////////////////////////////////////// #include "Camera.h" #include "GL_utilities.h" #include "gtc/matrix_transform.hpp" #include <iostream> // // // CAMERA // // Camera::Camera() { isPaused = true; needUpdat...
/* * velocity_calc.cpp * 4v_2d_magic_numbers * * Created by Niels Otani on 9/7/06. * Copyright 2006 __MyCompanyName__. All rights reserved. * */ #include "velocity_calc.h" void calc_velocity (double *vx, double *vy, double M[4], double *ax, double *ay, double *wavefront_times, int npoints) { /* Calculate ...
#include <vector> #include <string> #include <iostream> #include <fstream> #include <sstream> #include <list> #include <algorithm> #include <sstream> #include <set> #include <cmath> #include <map> #include <stack> #include <queue> #include <cstdio> #include <cstdlib> #include <cstring> #include <numeric> #include <bits...
/****************************************************************************** * * * Copyright 2018 Jan Henrik Weinstock * * * ...
class Solution { public: bool isAnagram(string s, string t) { if(s.size() != t.size()) return false; vector<int> count(128,0); for(int i=0; i<s.size(); ++i){ count[s[i]]++; } for(int i=0; i<s.size(); ++i){ count[t[i]]--; } for(int i=0; ...
#pragma once namespace BroodWar { namespace Api { namespace Enum { [System::Flags] public enum class Targets { None = 0x0, Air = 0x1, Ground = 0x2, Mechanical = 0x4, Organic = 0x8, NonBuilding = 0x10, NonRobotic = 0x20, Terrain = 0x40, OrgOrMech = 0x80, Own = 0x1...
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// // Пример использования static для генерации уникальных ID // уничтожения временных переменных // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// #include <iostream> using namespace std; int generateID() { static int s_itemID = 0; return ++s_...
//============================================================================ // Name : set_exeriments.cpp // Author : Andrzej Pawlowicz // Version : // Copyright : Your copyright notice // Description : Playing with std::set, hash_set, vector //=======================================================...
#ifndef LISP_CMAP_TEST_HPP #define LISP_CMAP_TEST_HPP #include <gtest/gtest.h> #include <cmap.h> #include <hash.h> #include <permutations.h> #include <ops.h> namespace { /** * Function that "hashes" everything to the same value! * (very useful for testing the behavior of hash collisions in a hash table) ...
// Created by: Kirill GAVRILOV // Copyright (c) 2019 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Sof...
#include <stdio.h> #include <stdlib.h> int main() { int sayi,i=0,dizi[100],a,toplam = 0; printf("bir sayi giriniz"); scanf("%d",&sayi); a = sayi; while(sayi > 0) { dizi[i]= sayi % 10; sayi = sayi / 10; i = i + 1; } for(i=i-1;i>=0;i--) { toplam = toplam + dizi[i]*dizi[i]*dizi[i]; } i...
// Copyright (c) 2011-2012 Thomas Heller // Copyright (c) 2013-2016 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) #pragma once #include <pika/config.hpp>...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2005 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef JAYENTROPYDECODER_H #define JAYENTROPYDECODER_H /** Abst...
#ifndef Empleado_h #define Empleado_h using namespace std; class Empleado{ protected: // protected ya que es la clase base string nombre,apellidos; int nomina; double sueldoBase; public: Empleado(); Empleado(string,string,int,double); void setNombre(string); void setApellido(string); vo...
#include <iostream> #include <cstdlib> #include "instr.h" #include "prog.h" #include "../grammar.h" #include "../interpreter.h" using namespace std; using namespace rep; Call::Call(LTerm* tree) : Expression(tree) { TTerm* t = dynamic_cast<TTerm*>((*tree)[0]); name = t->getValue(); for(int i = 1; i < tree->size(...
#include "Arduino.h" #include "blink.h" blink::blink(int pin_num) { pinMode(pin_num, OUTPUT); pin = pin_num; } void blink::on(int deg) { digitalWrite(pin, HIGH); delay(deg); } void blink::off(int deg) { digitalWrite(pin, LOW); delay(deg); }
#ifndef CPOLYLINE_H #define CPOLYLINE_H // system include #include <vector> // project include #include "CRect.h" // external include #include "xmlParser.h" // forward declarations using namespace std; class CPolyLine : public CShape { public: // interface CPolyLine(); ~CPolyLine(); ...
#include <iostream> #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <ncurses.h> using namespace std; int main() { int a, b; scanf("%d %d", &a, &b); if ( a >= 0 && a<=b && b <= 100) { for (int i = a; i <=b; i++) { if ((i % 2) == 0) { ...
#include<stdio.h> /** * 输出数组 * @param array 待输出的数组 * @param len 待输出数组的长度 * @param state 数组的状态,例如:"排序前"和"排序后" * @return void */ void PrintArray(int array[],int len,char state[]) { int i; printf("%s\n",state); for(i = 0;i < len;i++) { printf("%d ",array[i]); } printf("\n"); } /** * 交换两个整数 * @p...
#pragma once #include "Core/Core.h" #include <yaml-cpp/yaml.h> #include <sstream> namespace Rocket { class ConfigLoader { public: ConfigLoader(const String& path) : m_Path(path) {} ~ConfigLoader() = default; int Initialize() { String config_file; #if defined(PL...
// Created: 2001-05-21 // // Copyright (c) 2001-2013 OPEN CASCADE SAS // // This file is part of commercial software by OPEN CASCADE SAS, // furnished in accordance with the terms and conditions of the contract // and with the inclusion of this copyright notice. // This file or any part thereof may not be provid...
class Solution { public: vector<vector<int>> combinationSum(vector<int>& candidates, int target) { sort(candidates.begin(), candidates.end(), greater<int>()); vector<vector<int>> res; vector<int> ve; helper(0, target, res, ve, candidates); return res; } void helper(in...
/* * main.cpp * * Created on: May 10, 2016 * Author: g33z */ #include <iostream> using namespace std; #include <stdio.h> #include <stdlib.h> #include "Point.h" int main(){ double ax,ay, bx,by, cx,cy; cout << "Punkt a.x:" << endl; cin >> ax; cout << "Punkt a.y:" << endl; cin >> ay; Point newXa...
#include <bits/stdc++.h> #define map guohezu using namespace std; const int maxn = 100; const int mov[16] = {1, 2, 2, 1, -1, 2, 2, -1, 1, -2, -2, 1, -1, -2, -2, -1}; int n, m, x, y, a, b, ans; int map[maxn][maxn]; int main() { cin >> n >> m >> x >> y; for (int i = 0; i < 8; i++) map[x + mov[2 * i]][y + mov[2 * i +...
/* POJ2396 NetFlow with lower_bound , source-terminal. add fake-source and fake-terminal. possible solution algorithm not maxium one. */ #include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<algorithm> using namespace std; #define NEWNODE &data[++datap] const int INF=99999999; const...
#include <QtWidgets/QApplication> #include <QtWidgets/QWidget> #include <QDebug> #include <QtWidgets/QGridLayout> #include "ui/LoginWidget/loginwidget.h" #include "ui/Viewer/Viewer.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); Viewer viewer; viewer.runApp(); return a.exec(); }
#ifndef PIECE_H #define PIECE_H #include <QGraphicsPixmapItem> class Piece : public QGraphicsPixmapItem { public: enum couleurPiece {pieceNeutre=0, pieceRond, pieceCroix}; explicit Piece(); // explicit Piece(couleurPiece couleur, int16_t x, int16_t y); int16_t x; int16_t y; bool estJouable(cou...
/* ==general== This script uses the non-volatile storage of esp32 to store key value pairs. These can be accessed via BLE-connection (read and/or write). ==BLE== BLE part Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleWrite.cpp...
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int getNum(int have, int m) { if(have <= m) { return 1; } else if(have % m) { return have / m + 1; } else { return have / m; } } int main() { int n = 0; int m = 0; string temp; int numY = 0;...
/** * @author shaoDong * @email scut_sd@163.com * @create date 2018-08-27 07:43:16 * @modify date 2018-08-27 07:43:16 * @desc 小红有两个长度为n的排列A和B。每个排列由[1,n]数组成,且里面的数字都是不同的。 现在要找到一个新的序列C,要求这个新序列中任意两个位置(i,j)满足: 如果在A数组中C[i]这个数在C[j]的后面,那么在B数组中需要C[i]这个数在C[j]的前面。 请问C序列的长度最长为多少呢? */ #include <iost...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) Opera Software ASA 2008 * * @author Daniel Spang */ #ifndef ES_BLOCK_H #define ES_BLOCK_H #include "modules/util/simset.h" template <class T> class ES_Block; template <class T> class ES_B...
#include "CImg.h" #include "Info.h" #include <map> #include <bitset> #include <vector> using namespace cimg_library; using std::string; std::map<string, string> parseCMD(int argc, char *argv[]); template<typename T> int getKey(CImg<T>& img) { std::bitset<keySpace> bitKey; for (int i = 0; i < keySpace; i++) { bi...
#include <iostream> #include <algorithm> #include <cstdio> #include <cstdlib> #include <ctime> #include <memory.h> #include <cmath> #include <string> #include <cstring> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional> #include <numeric> #include <ss...
#include <iostream> template<typename T> class Matrix; template<typename T> class Vector { T v[4]; public: template<typename U> friend Vector<U> operator*(Matrix<U> const&, Vector<U> const&); }; template<typename T> class Matrix { Vector<T> v[4]; public: template<typename U> friend Vector<U...
#include "menu.h" #include "ui_menu.h" menu::menu(QWidget *parent) : QMainWindow(parent), ui(new Ui::menu) { ui->setupUi(this); } menu::~menu() { delete ui; } void menu::on_smasuk_clicked() { sm.resize(1366,768); this->close(); if(QGuiApplication::primaryScreen()->geo...
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #include "Stucchi.h" #include "StucchiGameMode.h" #include "StucchiPawn.h" AStucchiGameMode::AStucchiGameMode(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { // set default pawn class to our character class DefaultPawnClass = ASt...
#include <iostream> using namespace std; typedef unsigned long ulong; bool IsBouncy (ulong num); int main() { ulong bouncyNumCnt = 0; ulong n; long double ratio = 0; for (n = 99; 100*bouncyNumCnt < 99*n; n++) { if (IsBouncy (n)) bouncyNumCnt++; } cout << n; return...
class TimeBomb: CA_Magazine { scope = 1; displayName = "$STR_MN_TIME_BOMB"; picture = "\CA\weapons\data\equip\m_satchel_CA.paa"; useAction = 1; useActionTitle = "$STR_ACTION_PUTBOMB"; type = 256; value = 5; ammo = "TimeBomb"; count = 1; initSpeed = 0; maxLeadSpeed = 0; nameSoundWeapon = "satchelcharge"; na...
#include <iostream> #include <iomanip> #include <cmath> using namespace std; long long primes[200000000]; bool isPrime(long long num, int numprimes) { for(int i = 0; i < numprimes; i++) { if (num % primes[i] == 0) { return false; } } return true; } int main() { int numprimes = 1; primes[0] = 2; long l...
#include "ofSSobj.h" #include "ofMesh.h" GLuint vao_; GLuint vbo_; ofSSobj::ofSSobj(void){ GLfloat saqv[8] = {-1.0f,-1.0f,1.0f,-1.0f,-1.0f,1.0f,1.0f,1.0f}; glEnableClientState(GL_VERTEX_ARRAY); glGenVertexArrays(1, &vao_); glBindVertexArray(vao_); glGenBuffers(1, &vbo_); glBindBuffer(GL_ARRAY_BUFFER, vbo_); gl...
#include <iostream> #include <vector> using namespace std; class Solution { private: string s, p; int sLen, pLen; vector< vector<bool> > visited, DP; bool isMatch(int sIndex, int pIndex){ // string finished if(sIndex == sLen){ // pattern also finished if(pIndex == pLen) return true; // if a char witho...