text
stringlengths
8
6.88M
#include "gromacsoptionsgroup.h" #include "ui_gromacsoptionsgroup.h" #include <QMouseEvent> #include <QCheckBox> #include <QLabel> #include <QFontMetrics> #include "gromacsoption.h" #include "gromacsoptionchoose.h" #include "gromacsoptionenter.h" #include "gromacsoptionfile.h" enum ColumnPositions { PosCheckBox = 1, P...
#ifndef corbeilleediteur_cpp #define corbeilleediteur_cpp #include <QDebug> #include<QMessageBox> #include "corbeilleediteur.h" #endif CorbeilleEditeur::CorbeilleEditeur( Corbeille* c, QWidget *) : corbeille(c){ list = new QListWidget(); layout = new QVBoxLayout(); scroller = new QScrollArea(); vid...
#include "queen.h" Queen::Queen(int x, int y, bool pieceColor) : Piece(x, y, 'Q', pieceColor){} bool Queen::Move(int i, int j, Location** board) { int x = mX; int y = mY; // diagonal movements = same as bishop's code if (i > mX) { // down diagonal if (j > mY) { // ¢Ù x++; y++; while ((x <= BOA...
#include "json_reader.h" namespace reader { void JsonReader::parse(istream& input) { json::Document doc = Load(input); nd = move(make_unique<Node>(doc.GetRoot())); push_requests(); push_rendsettings(); } void JsonReader::push_requests() { auto stop_open = [&](cons...
#include <iostream> #include <queue> #include <vector> struct Request { Request(int arrival_time, int process_time): arrival_time(arrival_time), process_time(process_time) {} int arrival_time; int process_time; }; struct Response { Response(bool dropped, int start_time): d...
#include "stdafx.h" #include "Bullet.h" Bullet::Bullet() { } Bullet::~Bullet() { Release(); } HRESULT Bullet::Init(char* imageName, int bulletMax, float range) { _imageName = imageName; _bulletMax = bulletMax; _range = range; return S_OK; } void Bullet::Release() { } void Bullet::Update() { Move(); Anima...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- ** ** Copyright (C) 2009-2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** @author sof */ #include "core/pch.h...
#ifndef ___COLOR_FORMAT_HPP___ #define ___COLOR_FORMAT_HPP___ #include <common\typedef.hpp> #include <common\define.hpp> struct color_format { byte redBits; byte greenBits; byte blueBits; byte alphaBits; uint32 bitsPerPixel; FINLINE color_format() {}; FINLINE ~color_format() {}; FINLINE co...
#include "param.h" #include "../libafqt/qenvironment.h" #define AFOUTPUT #undef AFOUTPUT #include "../include/macrooutput.h" #include "../libafanasy/logger.h" Param::Param(const QString & i_name, const QString & i_label, const QString & i_tip): m_name(i_name), m_label(i_label), m_tip(i_tip) { } Param::~Param() {...
// // PSEyeWrapper.hpp // inf_srv // // Created by Christian Clark on 4/3/16. // // #ifndef PSEyeWrapper_hpp #define PSEyeWrapper_hpp #include <stdio.h> #include "ofMain.h" #include "ofxPS3EyeGrabber.h" #include "ofxGui.h" #include "ofxCv.h" class PSEyeWrapper{ public: PSEyeWrapper(int deviceId, int posX, int...
#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...
#include<bits/stdc++.h> #define sc scanf #define pf printf #define ll long long using namespace std; main() { int i, tast, n, m, ans; sc("%d", &tast); for(i=1; i<=tast; i++) { sc("%d %d", &n, &m); if(n==1 || m==1)pf("Case %d: %d\n", i, n*m); else if(n==2 ||m==2) { ...
#include <iostream> #include <vector> #include <map> #include <set> #include "fileapi.h" #include <chrono> #include <time.h> #include <ctime> #include <ratio> template<typename... Types> class B { }; static BOOL GetVolumeInformationA( LPCSTR lpRootPathName, LPSTR lpVolumeNameBuffer, DWORD nVo...
/* Copyright (c) 2018 Aalto University * * 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 applicable law or agreed ...
/* * Roller.cpp * * Created on: Apr 6, 2015 * Author: eddy */ #include <chrono> #include "Roller.h" void Roller::start_cycle(int size){ sides = size; number = 0; keep_cycling = true; std::thread t {std::bind(&Roller::cycle, this)}; t.detach(); } void Roller::stop_cycle(void){ keep_cycling = false;...
//--------------------------------------------------------- // // Project: dada // Module: gl // File: EBO.cpp // Author: Viacheslav Pryshchepa // //--------------------------------------------------------- #include "dada/gl/EBO.h" #include "dada/gl/GL.h" #include "dada/core/Log.h" namesp...
// // C++ Implementation: SoundSystem // // Description: // // // Author: Jally <jallyx@163.com>, (C) 2009 // // Copyright: See COPYING file that comes with this distribution // // #include "SoundSystem.h" #ifdef HAVE_GST #include "ProgramData.h" #include "output.h" #include "utils.h" extern ProgramData progdt; /** ...
#ifndef WIB_RETURN_CODE_H #define WIB_RETURN_CODE_H #pragma once namespace WhatIBuild { enum ReturnCodeEnum { e_Return_OK = 0, e_Return_FileNotFound, e_Return_ParseError, e_Return_NotSupportedVersion, }; } #endif // WIB_RETURN_CODE_H
// Created on: 1992-09-23 // Created by: Christian CAILLET // Copyright (c) 1992-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the ...
/* -*- 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. * * psmaas - Patricia Aas */ #ifndef OP_HISTORY_MODEL_H #define OP...
#ifndef STRATEGY_H #define STRATEGY_H #include "Graph.h" #include "point.h" #include <vector> #include "z3++.h" class Strategy { public: Strategy(Graph); void computeroute(); Graph GetSolution(); virtual ~Strategy(){} protected: Graph graph,solution; z3::expr bool_to_int(z3::expr a,z3::context& c,bool special)...
#include <iostream> #include <cmath> using namespace std; int weight[] = {3, 4, 1, 2, 3}; int value[] = {2, 3, 2, 3, 6}; int dp[6][11]; int search(int n, int w) { if (w > 10) return -1; if (n >= 5) return 0; if (dp[n][w] >= 0) { return dp[n][w]; } return dp[n][w] = max(search(n + 1, w),...
// Created on: 1997-02-10 // Created by: Alexander BRIVIN // Copyright (c) 1997-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 "Tetris.h" #include "Screen.h" #include "Block.h" #include "Grid.h" #include "Square.h" #include "Rectangle.h" #include "L.h" #include "S.h" #include "T.h" #include "Z.h" #include "ReverseL.h" namespace WinTetris { int Tetris::DIRECT = 0; int Tetris::LEFT = 1; int Tetris::RIGHT = 2; int Te...
#include "stdafx.h" #include "MainGame15.h" MainGame15::MainGame15() { } MainGame15::~MainGame15() { } HRESULT MainGame15::Init() { GameNode::Init(); // 이미지 크기 540 x 566 // 180 x 188 하나 // 인데 init에 넣을 때 크기로 offset이 결정됨 image = new Image; image->Init("images/image.bmp", 300, 300, false, RGB(255,0,255)); //...
#include <iostream> #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <vector> #include <algorithm> #include <math.h> using namespace std; int n; struct st { int val, idx; }; st s[111]; void input(){ scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", ...
#include<bits/stdc++.h> #define rep(i,n) for (int i =0; i <(n); i++) using namespace std; using ll = long long; const double PI = 3.14159265358979323846; const ll MOD = 1000000007; int main(){ int A,B; cin >> A >> B; int Y = (A - B) / 2; int X = A - Y; cout << X << " " << Y << endl...
#include "Delaunay.h" Delaunay::Delaunay(point p1, point p2, point p3, point p4) { m_Pts.resize(4); m_Pts[0] = p1; m_Pts[1] = p2; m_Pts[2] = p3; m_Pts[3] = p4; m_Edges.resize(4); Edge l1 = { 0,1,-1 }; Edge l2 = { 1,2,-1 }; Edge l3 = { 0,3,-1 }; Edge l4 = { 2,3,-1 }; m_Edges[0] = l1; m_Edges[1] = l2; m_Edg...
/* Copyright (c) 2014 Mircea Daniel Ispas This file is part of "Push Game Engine" released under zlib license For conditions of distribution and use, see copyright notice in Push.hpp */ #include "Actions.hpp" #include "Image.hpp" #include "Core/Log.hpp" namespace TexturePacker { void ConvertTextures(const std::ve...
/* * Copyright (c) 2012 Dan Wilcox <danomatika@gmail.com> * * BSD Simplified License. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * * See https://github.com/danomatika/ofxAppUtils for documentation * */ #pragma once...
#include <iostream> #include <stack> #include <string> #include <vector> #include <algorithm> #define MAX 350000 struct node{ std::vector<int> child; std::string word; }; node tree[MAX]; std::string TORIE, KEYWORD; int tree_size, TORIE_size, KEYWORD_size; bool FLAG; int dfs(int parent, int now, int T_idx) { ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2004-2010 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** \author { Anders Oredsson <anderso@opera.com> } */ /* OpSnapts...
#include "World.h" namespace platformer { World::World(int id, int maxX, int maxY, std::vector<std::string *> &map) : id(id), maxX(maxX), maxY(maxY), map(map) {} World::~World() { for (std::string *row : map) { ...
#include "TestGTE.h" #include <iostream> #include <iomanip> int main(int argc, char **argv) { using namespace test; gte device; GTEtestbench tester(&device); tester.constructInstruction(0, NCLIP); tester.storeData(gte::SXY0, 0x0005000A); // sx0 = 10, sy0 = 5 tester.storeData(gte...
#pragma once #include "calc_row_pitch_size.hpp" namespace leaves { namespace pipeline { struct subresource { uint16_t mip_level; uint16_t array_index; uint16_t width; uint16_t height; uint16_t depth; size_t row_pitch; size_t slice_pitch; byte* pointer; }; uint16_t calculate_mipmap_level(uint16...
#include <iostream> #define MAX 1000001 int main() { std::cin.sync_with_stdio(false); std::cin.tie(NULL); int t; std::cin >> t; while(t--) { int n, m, ans = 0; std::cin >> n >> m; for(int i = 1; i <= n; i++) { int t; std::cin >> t; ...
#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...
/* For a given a Binary Tree of type integer, duplicate every node of the tree and attach it to the left of itself. The root will remain the same. So you just need to insert nodes in the given Binary Tree. You can see that every node in the input tree has been duplicated and inserted to the left of itself. Input format...
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <iostream> #include <sstream> #include <vector> #include <string> #include <algorithm> #include <opencv2/core.hpp> #include <opencv2/highgui.hpp> #include <GL/glew.h> #ifdef __linux__ #include <GLFW/glfw3.h> #elif __MINGW32__ #include <GLFW/glfw3.h...
#ifndef LICENCE_H #define LICENCE_H #include <SFML\Graphics.hpp> /// <summary> /// @author Peter Lowe /// @version 1.0 /// @date may 2016 /// /// \brief simple page to display Licence text for fixed period. /// /// </summary> class Licence { public: Licence(); ~Licence(); protected: }; #endif // !LICENCE_H
// Copyright 2020 Fuji-Iot 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 appli...
#include <iostream> #include <ColorConsole.h> int main() { std::cout << red << "Hello, World!" << std::endl; std::cout << lred << "Hello, World!" << std::endl; std::cout << green << "Hello, World!" << std::endl; std::cout << lgreen << "Hello, World!" << std::endl; std::cout << blue << "Hello, Worl...
#include"mapping.h" using namespace std; using namespace TENET; Mapping::Mapping(shared_ptr<ISL_Context> context): _context(context) {} Mapping::Mapping( shared_ptr<ISL_Context> context, const char* space_map_str, const char* time_map_str): _space_map(isl_union_map_read_from_str(context->ctx(), space_map_str)),...
#pragma once #include "exceptions.hpp" #include <vector> #include <type_traits> namespace perseus { /** @brief A coroutine's stack. Most operations use the stack for their parameters and results, function parameters and return values go there as well as return addresses and local variables. @todo Add suppo...
//--------------------------------------------------------------------------- #pragma hdrstop #include "ISourceData.h" //--------------------------------------------------------------------------- #pragma package(smart_init) String IClassMember::GetFullName() { if(GetArrayVar() == "") return GetName(); retu...
/* -*- 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 Manuela Hutter (manuelah) */ #include "core/pch.h" #i...
/** * An adress consists of the following information * * Peronal Name (e.g. "Erik Eriksson") * Mailbox name (e.g. "ee") * Host name (e.g "opera.com") * * This should be generic to work across different protocols * * The personal name usually has no function for others than human * readers, but it c...
#pragma once // Json.h namespace Json { void GetValue(Json::Value& parent, string name, float& vec); void SetValue(Json::Value& parent, string name, float& vec); }
#ifndef PROBLEM_H #define PROBLEM_H #include <vector> #include "operation.h" class Problem { public: Problem(double start, int movs); Problem(double start, double goal, int movs); ~Problem(void); void input(const Operation* op); void reset(void); bool isSolved(void) const; int getCurren...
// Copyright (c) 2014 Erik Schnetter // Copyright (c) 2014 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) #include <pika/future.hpp> #include <pika/init.hp...
/* 此题为单调队列模板题,底下有无注释版 单调队列有两个性质 队列中的元素其对应在原来的列表中的顺序必须是单调递增的。 队列中元素的大小必须是单调递(增/减/甚至是自定义也可以) 单调队列与普通队列不一样的地方 就在于单调队列既可以从队首出队, 也可以从队尾出队。 那么我们应该怎样实现单调队列呢? 就拿样例来谈谈,设以最小的为标准。 8 3 1 3 -1 -3 5 3 6 7 下文中我们用q来表示单调队列,p来表示其所对应的在原列表里的序号。 由于此时队中没有一个元素,我们直接令1进队。此时,q={1},p={1}。 现在3面临着抉择。下面基于这样一个思想:假如把3放进去,...
#include <iostream> using namespace std; int main() { char b; cout << "Think of a number between 1-100 including 1 and 100" << endl << "DON'T ENTER THE NUMBER \nPress Y or y if you have choosen a number in your mind \n"; cin >> b; cout << "\n\n\n\n\n"; if (b == 'Y' || b == 'y') ...
/* * AutoTest.cpp * * Created on: 2021. 9. 28. * Author: dhjeong */ #include <iostream> #include "AutoTest.h" AutoTest::AutoTest() { } AutoTest::~AutoTest() { } //구조체나 공용체, 클래스도 가능함 class Test { public: int a; } tt; //함수포인터나, 함수 자체도 가능함 -> 이러한 함수를 람다 함수라고 함 //함수 포인터 -> 구조체나 클래스의 함수 포인터도 가능 int test2(...
// Created on: 1992-02-03 // Created by: Christian CAILLET // Copyright (c) 1992-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the ...
#include "reactor/net/http/HttpResponse.h" namespace reactor { namespace net { namespace http { void HttpResponse::set_status(int status) { set_status(status, status_text(status)); } void HttpResponse::set_status(int status, const std::string &text) { status_ = status; status_text_ = text; } void HttpResponse::s...
#include <iostream> #include <fstream> #include "TFile.h" #include "TTree.h" using namespace std; int main(int argc, char **argv) { if (argc != 3) { cerr << "Wrong number of arguments! Instead use\n" << "\t/path/to/tree/file /path/to/output/text/file \n\n"; return -1; } // Read in the fil...
#include "../includes/Move.h" Move::Move(){ this->x1 = 0; this->y1 = 0; this->x2 = 0; this->y2 = 0; this->player = 1; } Move::Move(int x1, int y1, int x2, int y2, int player){ this->x1 = x1; this->y1 = y1; this->x2 = x2; this->y2 = y2; this->player = player; } std::string Move::to_string(){ std...
class Solution { public: int sumNumbers(TreeNode *root) { if(root == nullptr) return 0; return sumRec(root, 0); } int sumRec(TreeNode* root, int last){ int sum = last*10 + root->val; if(!root->left && !root->right){ return sum; } int val = 0; ...
#include "timeeditdelegate.h" #include <QModelIndex> #include <QPainter> #include <QDateTime> #include <QStyleOptionViewItemV3> #include <QStyleOptionViewItemV2> void TimeEditDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { QDateTime d...
#pragma once #include "util/AsyncExecutor.h" #include "util/Loggable.h" #include "util/ThreadRecursionProtector.h" namespace BeeeOn { /** * @brief Implementation of AsyncExecutor that executes the tasks directly * in the current thread. Thus, the execution is in fact not asynchronous. * The purpose of the NonAsyn...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 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 (arjanl) */ #ifndef KDE4_PRINTER_INTEGRATION_H #define KD...
#include<iostream> #include<string> using namespace std; void genrate_subset(int n,string s) { int j=0; while(n>0) { if(n&1) cout<<s[j]; j++; n=n>>1;} cout<<endl; } void Filterchar(string s) { int n=s.length(); for(int i=0;i<(1<<n);i++) { genrate_subset(i ,s); } } ...
/*! * \file lineeditdelegate.cpp * \author Simon Coakley * \date 2012 * \copyright Copyright (c) 2012 University of Sheffield * \brief Implementation of text line edit delegate */ #include <QLineEdit> #include "./lineeditdelegate.h" LineEditDelegate::LineEditDelegate(QObject * parent) : QItemDelegate(parent)...
/* Copyright 2021 University of Manchester 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 applicable law or agreed to in writing, s...
#include <bits/stdc++.h> using namespace std; int main() { int n,k=-1; cin>>n; string S[n]; string s; for (int i=0; i<n; i++) cin>>S[i]; for (int i=0; i<n; i++) for (int j=i; j<n; j++) { string s1=S[j],s2=S[i]; if (s1.length() <s2.length()) ...
/*! \file */ //Copyright 2011-2016 Tyler Gilbert; All Rights Reserved #ifndef BASE64_HPP_ #define BASE64_HPP_ namespace calc { /*! \brief Base64 Encode/Decode Class * \details This class includes methods to encode and decode data * using the base64 algorithm. Base64 is useful for representing binary * data using...
#include "archivefenetre.h" ArchiveFenetreEditeur::ArchiveFenetreEditeur(Note* n, QWidget*) : note(n) { question = new QLabel("Voulez-vous supprimer de manière définitive la note "+QString::number(note->getId())+" ?"); layout = new QVBoxLayout; reponses = new QHBoxLayout; oui = new QPushButton("Oui"...
#ifndef POINT2D_H #define POINT2D_H // STD library #include <sstream> template<typename T> class Point2d { public: Point2d(T x, T y) { m_data[0] = x; m_data[1] = y; } Point2d(T data[2]) { m_data[0] = data[0]; m_data[1] = data[1]; } Point2d(const Point2d& o...
/* -*- 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. * * @author Arjan van Leeuwen (arjanl) */ #include "core/pch.h" #...
#include "player.hh" Player::Player() { _playerID=1; _pawnLeft=_totalPawnCount=1; _actionLeft=0; } Player::~Player() { } Player::Player(int playerId, int pawnsPerPlayer) { _playerID=playerId; _pawnLeft=_totalPawnCount=pawnsPerPlayer; } int Player::getPlayerId() const { return _playerID; } ...
// Created on: 1993-09-23 // Created by: Jean Louis FRENKEL // Copyright (c) 1993-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...
#include "ImmediateRenderer2D.hpp" #ifdef _WIN32 #include <Windows.h> #include <gl/GL.h> #else #error Unsupported platform #endif #include <SDL2/SDL_image.h> #include <cassert> #include <algorithm> constexpr static f32 toDegree = 180.0F / mm::pi(); ImmediateRenderer2D::ImmediateRenderer2D(const Window& window, boo...
#include <iostream> using namespace std; #define FOR(i,k,n) for(int i=(k); i<=(n); i++) #define LL long long bool prime( LL x ) { if (x<2) return false; for (LL i=2; i*i<=x; i++) if (x%i==0) return false; return true; } LL n = (LL)(1000000000)*100000; LL ans = 0; void dfs( LL cur, i...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <octomap/octomap_timing.h> #include <octomap/octomap.h> #include <octomap/math/Utils.h> #include "testing.h" using namespace std; using namespace octomap; void printUsage(char* self){ std::cerr << "\nUSAGE: " << self << " inputfile.bt [max_depth]...
#include "Timber.h" Timber::Timber() { this->width = 0; this->length = 0; this->pricePerMeter = 0; this->totalWoodMeters = 0; } Timber::Timber( int width, int length, float pricePerMeter, int totalWoodMeters) { this->width = width; this->length = length; this->pricePerMeter = pricePerMeter; this->totalWoodM...
/***************************************************************** Name :binary_heap Author :srhuang Email :lukyandy3162@gmail.com History : 20191226 decrease-key, delete, find. 20191226 reconstruct 20191225 decrease-key and delete 20191225 return the node when insert 20191218 add merge operat...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2012 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #include "core/pch.h" #ifndef NS4...
#include <iostream> using namespace std; int main(int argc, char** argv) { int a[7] = {2,4,1,3,7,9,5}; int min; //int j; for(int i = 0; i < 7; i++) { //min = a[i]; //int temp = a[i]; min = i; for(int j = i+1; j < 7; j++) { if(a[j] < a[min]) ...
#include "Observer.h" Observer::Observer(Necromancer* necromancer) { this->bookMaster = necromancer; this->listOfVictims = new std::set<Unit*>(); } Observer::~Observer() { std::set<Unit*>::iterator it = this->listOfVictims->begin(); // auto for (; it != this->listOfVictims->end(); it++ ) { (*i...
#include<stdio.h> // This is also possible // void print_arr(int list[4]){ void print_arr(int *list){ for(int i=0; i<4; i++){ list[i] *= 2; } } int main(){ int arr[4] = {1,2,3,4}; print_arr(arr); for(int i=0; i<4; i++){ printf("%d ", arr[i]); } }
#include "snake.h" #include "display.h" #include "input.h" const uint16_t MAX_SNAKE_LENGTH = 512; uint8_t snakeX[MAX_SNAKE_LENGTH]; uint8_t snakeY[MAX_SNAKE_LENGTH]; uint8_t snakeLength = 2; uint8_t appleX; uint8_t appleY; DPad lastInput = DPAD_RIGHT; void initSnake() { snakeX[0] = 2; snakeY[0] = 1; snakeX[1] =...
 // DBTestDlg.h: 헤더 파일 // #pragma once // CDBTestDlg 대화 상자 class CDBTestDlg : public CDialogEx { // 생성입니다. public: CDBTestDlg(CWnd* pParent = nullptr); // 표준 생성자입니다. // 대화 상자 데이터입니다. #ifdef AFX_DESIGN_TIME enum { IDD = IDD_DBTEST_DIALOG }; #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // ...
#include "stdafx.h" #include "MyProp.h" #include "MyPropSheet.h" // CMyPropSheet IMPLEMENT_DYNAMIC(CMyPropSheet, CPropertySheet) CMyPropSheet::CMyPropSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage) :CPropertySheet(nIDCaption, pParentWnd, iSelectPage) { } CMyPropSheet::CMyPropSheet(LPCTSTR pszCaption, ...
#include <iostream> #include <vector> #include <string> #include <ctime> #include <stdlib.h> using namespace std; class Solution { public: int majorityElement(vector<int> &num) { int cnt=0; for(;;){ if(num.size()==1) return num[0]; else { ...
#ifndef RADIALBASISFUNCTION_H #define RADIALBASISFUNCTION_H #include <QVector> #include <QPointF> class RadialBasisFunction { public: RadialBasisFunction(); virtual QVector<double> sample(QVector<double> xs) const = 0; }; #endif // RADIALBASISFUNCTION_H
#include <iostream> using namespace std; int N = 7; void swap(int& a, int& b) { int temp = a; a = b; b = temp; } void maxHeap(int A[], int i) { int largest; int left = 2*i; int right = 2*i + 1; if (left <= N && A[left] > A[i]) largest = left; else largest = i...
#include "Globals.h" #include "Application.h" #include "Module.h" #include "ModuleTextures.h" #include "ModuleInput.h" #include "ModuleParticles.h" #include "ModuleRender.h" #include "ModulePlayer.h" #include "ModulePLayer2.h" #include "ModuleFonts.h" #include <string> #include "ModuleSceneWater.h" #include "ModuleAudi...
#pragma once # include <Siv3D.hpp> # include <rnfs.h> #include"Laser.h" class Mirror :public Task{ private: TaskCall m_Update; //更新設定 TaskReceive m_Receive; //受信設定 TaskSend m_Send; //送信設定 void Update(); Rect mirror1, mirror2, mirror3, mirror4; public: Mirror(); void HitCheck(Laser &particle); }; class...
#pragma once #using <mscorlib.dll> #include "llvm/IR/Attributes.h" namespace LLVM { ref class LLVMContext; ref class AttrBuilder; ref class Attribute; ref class AttributeSet; public ref class Attribute { public: enum class AttrKind { None, Alignment, AlwaysInline, ByVal, InlineHint, InReg, MinSize, ...
// // Created by seadream on 2018/12/16. // void ReorderOddEven(int *pData, unsigned int length) { if (pData == nullptr || length == 0) { return; } int *pBegin = pData; int *pEnd = pData + length - 1; while (true) { // 向后移动 while (pBegin < pEnd && *pBegin & 0x1 != 0) { ...
int numTrees(int n) { vector<int> vec(n+1,0); vec[0]=1; for(int i=1; i<=n; i++) { for(int j=0; j<i; j++) vec[i]+=vec[j]*vec[i-j-1]; } return vec[n]; }
#include <vector> #include <GL/glew.h> #include <GL/gl.h> #include "core/log.h" #include "core/io.h" #include "shadercompiler.h" namespace pb { void showShaderInfoLog(GLuint id, bool success) { int msgLen; glGetShaderiv( id, GL_INFO_LOG_LENGTH, &msgLen ); if ( msgLen > 1 ) { std::vector<char...
#pragma once #include <iostream> // console In/Out Stream #include <fstream> // File In/ Out Stream #include <sstream> // String In/Out Stream #include <iomanip> // In/Out Manipulate //-->stdio.h #include <string> // String Class using namespace std;
#include "GnGamePCH.h" #include "GStartInterfaceLayer.h" #include "GnITabCtrl.h" #include "GnIButton.h" GStartInterfaceLayer::GStartInterfaceLayer() { } GStartInterfaceLayer::~GStartInterfaceLayer() { } GnInterfaceGroup* GStartInterfaceLayer::CreateInterface(gtuint uiIndex , GnBaseSlot2<GnInterf...
// Created on: 1995-12-01 // Created by: EXPRESS->CDL V0.2 Translator // Copyright (c) 1995-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the te...
/** ****************************************************************************** * Copyright (c) 2019 - ~, SCUT-RobotLab Development Team * @file UpperMonitor.c * @author LiangHong Lin(林亮洪) * @brief Code for Upper monitor supported by Mr.Lin in STM32F4. * @date Unkown. * @version 1.0 * @par ...
#pragma once #include "plbase/PluginBase.h" #include "CVector.h" #pragma pack(push, 4) class PLUGIN_API CPanel { public: unsigned short m_nFrameId; unsigned short m_nAxis; float m_fAngleLimit; CVector m_vRotation; CVector m_vPos; }; #pragma pack(pop) VALIDATE_SIZE(CPanel, 0x20);
#include <iostream> #include <cstdio> #include <cstring> #define maxn 1005 #define INF 0x3f3f3f3f #define mem(a) memset(a, 0, sizeof a) int map[maxn][maxn]; int dis[maxn],check[maxn]; using namespace std; int dijkstra(int n, int m) { mem(check);mem(dis); for(int i = 1; i <= n; i++) { dis[i] = map[1][i]; } ...
// // Created by 송지원 on 2020-02-08. // #include <iostream> using namespace std; int gcd1(int a, int b) { if (b == 0) { return a; } else { return gcd1(b, a%b); } } int gcd2(int a, int b) { int r; while (b != 0) { r = b; b = a%b; a = r; } return a...
// ---------------------------------------------------------------------------- // Copyright (C) 2002-2006 Marcin Kalicinski // Copyright (C) 2009 Sebastian Redl // // 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_...