text
stringlengths
8
6.88M
// implementation of filer class #include "filer.h" #include <stdio.h> #include <string.h> #include <stdlib.h> unsigned char* ppmRead(char* filename, int* width, int* height); //<<<<<<<<<<<<<<<<<<<<<<<<<< implementation >>>>>>>>>>>>>>>>>>>>>> unsigned char* Filer:: ppmRead(char* filename, int* width, int* height) {...
#include<iostream> #include"ezwin.h" #include"bitmap.h" #include"assert.h" #include<cstdio> Position pw=Position(1,1); SimpleWindow sizewindow("Input Height & Width ",15.0,25.0,pw); BitMap header(sizewindow); BitMap htbutton(sizewindow); BitMap stdb(sizewindow); BitMap pro(sizewindow); BitM...
#pragma once #include <string> #include "Common/TextFileWriter.h" #include <corprof.h> #include "ProfilerApi.h" #include <unordered_map> #include "TextWriterAdapter.h" namespace CppEssentials { class BinaryWriter; } class Stack; class CallGraphExporter { public: // Takes ownership CallGraphExporter(IProfil...
{dede:noteinfo notename="植牙案例" channelid="1" macthtype="string" refurl="http://" sourcelang="utf-8" cosort="asc" isref="no" exptime="10" usemore="0" /} {dede:listrule sourcetype="hand" rssurl="http://" regxurl="http://" startid="1" endid="" addv="1" urlrule="area" musthas="zzal" nothas="" listpic="1" usemore="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 ...
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <math.h> using namespace std; /* 程序逻辑分为两个部分: 第一部分模拟除法运算, 每进行一步除法运算, 都需要将当前得到的商和余数, 分别保存在数组中, 并且交给第二部分进行循环检测; 第二部分将传递进来的商和余数, 和保存在数组中的历史商和余数依次比较, 若不相等,告知第一部分继续进行除法运算, 若相等,则记录当前商所在下标,该下标为循环节起始位置, 直到数组结束为循环节结束。​ @公众号:一航代码 */ int pos = ...
#include <iostream> using namespace std; int solve(string input,int k) { cout << "hello" << endl; int n = input.size(); if(k > n) { return -1; } if(n==1 && k==1) { if(input[0]=='0') { return 0; } else { return 1; } } int** dp = new int*[n]; for(int i=...
/* Cell.cpp Contains funcitonality for the cell class Fouad Al-Rijleh, Rachel Rudolph */ #include "Cell.h" void Cell::setLocation(int i, int j) { location = { i, j }; } void Cell::setLocation(vector<int> newLocation) { location = newLocation; } vector<int> Cell::getLocation() { return location; } void Cell::se...
#ifndef SHADERCOMPILER_H #define SHADERCOMPILER_H #include "scene/RenderKey.h" #include <string> void compileVertexShader(const std::string &name); void compilePixelShader(const std::string &name); std::string pixelShaderName(const std::string &name, RenderKey::Features features); void compilePixelShaderSet(const ...
#include <iostream> #include <cstdlib> #include <ctime> #include <windows.h> #include <xmmintrin.h> #include <immintrin.h> #include <emmintrin.h> #include <thread> using namespace std; int a[1000000],b[1000000],c[1000000]; void add(int a); //This is the function that the thread called. int main() { ...
/*----------------------------------------------------------------------------* * 파일명 : haPremiumItemItem.h * 하는일 : 프리미엄 아이템 서비스관련 * 작성일 : 최종업데이트 2005년 9월 * 적성자 : 하대용 *-----------------------------------------------------------------------------*/ #pragma once /*------------------------------------------------...
// // Created by sxg on 2019/9/21. // #include <iostream> using namespace std; struct Node { int data; Node* next; explicit Node(int x) { data = x; next = nullptr; } }; class Queue { private: Node* front; Node* rear; public: Queue() { front = rear = nullptr; }...
#ifndef IMAGE_FORMAT_CONVERT_H #define IMAGE_FORMAT_CONVERT_H #include <list> #include <opencv/cv.h> #include <opencv2/opencv.hpp> class QImage; using std::list; QImage* IplImageToQImage( const IplImage* iplImage ); void getBinMask( cv::Mat& comMask, cv::Mat& binMask ); cv::Mat grabCutSeg( cv::Mat im, cv::Mat& mas...
#ifndef SSPEDITOR_LEVELHANDLER_LEVELHANDLER_H #define SSPEDITOR_LEVELHANDLER_LEVELHANDLER_H #include <fstream> #include "LevelHeaders.h" #include "Level.h" #include <qfiledialog.h> #include <DataHandler.h> class LevelHandler { enum Operation { LOAD, SAVE }; private: Level m_currentLevel; QString filePath = "//...
#ifndef __INIT_DEVICES #define __INIT_DEVICES void init_devices(); #endif // __INIT_DEVICES
// // Copyright Jason Rice 2017 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #ifndef NBDL_FWD_WEBSOCKET_SERVER_ENDPOINT_HPP #define NBDL_FWD_WEBSOCKET_SERVER_ENDPOINT_HPP #include <nbdl/websocket/detail/en...
#include <iostream> #include <fstream> #include <string> std::string find_lcs(const std::string &s1, const std::string &s2) { std::string best = ""; for (size_t i = 0; i < s1.size(); i++) { std::string s; std::string s2s = s2; size_t n = s2s.find_first_of(s1[i]); if (n != std::s...
#ifndef _GUN_ #define _GUN_ #include <string> using namespace std; class Gun{ private: string name; string gunImage; string gunImage_fired; string shotgun[3]; int damage; //how many hits to kill monster int fireRate; //when gun can fire again in seconds. int clipSize; //bullets in one clip public: Gun(); ~Gun...
/* * 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...
#include "Camera.h" #include "Sky.h" #include "Highway.h" #include "EndScreen.h" #include "Digit.h" #include "Earth.h" #include <vector> #include <iostream> #include <time.h> /** \mainpage Ball Run * Moldoveanu Florin & Maria Negrea & Bogdan Musat & Ferencz Timea & Catalin Ionescu * 05 / 09 / 2014 -> 10/ 09/ 2014 *...
#include "tableManager.h" TableManager& TableManager::getInstance() { static TableManager instance; return instance; } TableManager::~TableManager() { for (SymbolTable* table : tables) { if (table != nullptr) delete table; } } void TableManager::pushScope() { if (tables.size() >= stackLim...
#include "span/io/streams/Fd.hh" #include <sys/fcntl.h> #include <sys/stat.h> #include <sys/uio.h> #include <algorithm> #include <limits> #include <vector> #include "span/Common.hh" #include "span/io/IOManager.hh" #include "span/io/streams/Buffer.hh" #include "span/exceptions/Assert.hh" #include "glog/logging.h" n...
/** Driver for the doubly linked list. User specifies target filename for processing. ** This program displays the functionality of a doubly linked list including many of the most common features. * @author Erik Mellum * @created 4/2/13 * @modified 4/19/13 * @version 1.0 * @sources: foobt.net */ #include <cstdl...
/* * SPDX-FileCopyrightText: (C) 2014 Daniel Nicoletti <dantti12@gmail.com> * SPDX-License-Identifier: BSD-3-Clause */ #include "root.h" #include <Cutelyst/Context> Root::Root(QObject *app) : Controller(app) { } Root::~Root() { } void Root::index(Context *c) { // In order to easy the logic on the gui cla...
#pragma once #include "pathfinding.h" #include "../utility/entity.h" #include "../utility/timer.h" #include "PrintData.h" static int mapSizeX = 10; static int mapSizeY = 10; enum SearchFlags { SEARCH_NONE = 0, SEARCH_ALL = 1, SEARCH_ASTAR = 2, SEARCH_ASTARMOD = 4, SEARCH_HUMAN = 8, SEARCH_ASTAREXP = 16 }; voi...
#ifndef COMMANDES_H #define COMMANDES_H #include <QString> #include <QSqlQuery> #include <QSqlQueryModel> class Commandes {public: Commandes(); Commandes(QString,int,int); int get_idfourn(); int get_idcom(); QString get_catprod(); bool ajouter(); QSqlQueryModel * afficher(); bool suppri...
#include "inventorycommand.h" #include "rentablestorage.h" InventoryCommand::~InventoryCommand() { } InventoryCommand::InventoryCommand() { //nothing? } bool InventoryCommand::processCommand() { RentableStorage& rentables = getRentableStorage(); rentables.printInventory(); return true; }
#include "solution1018.h" #include <iostream> #include <bitset> BG1018::OUTPUT BG1018::solution_1(BG1018::INPUT input) { // SetTestCase(input); BG1018::OUTPUT output{}; // 정답 판 제작 BG1018::CheckArea answerCase1, answerCase2; bool start1 = B; bool start2 = W; for (int i = 0; i < SIZE * SIZE; i++) { if (i %...
/////////////////////////////////////////////////////////////////////////////////////// void motor_forward(void){ //1,2=> H+H=idle; L+L=idle; H+L=Back; L+H=Forward digitalWrite(MOTOR_R_1, LOW); // digitalWrite(MOTOR_R_2, HIGH); // digitalWrite(MOTOR_L_1, LOW); // digitalWrite(MOTOR_L_2, HIGH)...
/**************************************************************************** ** Resource object code ** ** Created by: The Resource Compiler for Qt version 5.12.0 ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ static const unsi...
#include <mex.h> #include <stdio.h> #include <string.h> #include <algorithm> #include <time.h> #include "types.h" #include "linscan.h" // INPUTS -------------------- #define mxnlabels prhs[0] // number of class labels #define mxcodes prhs[1] // db binary codes #define mxlabels prhs[2] // class label...
#ifndef _BNE_H_ #define _BNE_H_ #pragma once //Header for the Babonator-Engine #include <iostream> #include <string> #include <sstream> #include <math.h> #endif
#include <System/TrueCandidates.h> extern const QSet<QString> trueCandidates = { QStringLiteral("1"), QStringLiteral("true"), QStringLiteral("yes") };
#include <iostream> using namespace std; int rev(int a) { int ans=0,flag=0; while(a>0) { if(a != 0 || flag==1) { ans =ans*10 +(a); flag= 1; } a=a/10; } return ans; } int main() { int t; cin>>t; while(t--) { int a,b; ...
#include <iostream> using std::cout; int main() { int* ptr_num = new int(5); // declare and acquire new memory in heap cout << &ptr_num << "\n";// address where ptr_num is stored cout << ptr_num << "\n"; // address where 5 is strored cout << *ptr_num; delete ptr_num; ptr_num = nullptr; return 0; }
#include "Stages.h" Stages::Stages (int size, int rate) : size_ (size), rate_ (rate) { cur_ = 0; } Arrival::Arrival (int size, int rate) : Stages (size, rate) { cur_ = 1; } int Arrival::next () { cur_++; if (cur_ > size_) cur_ = 1; return cur_; } Service::Service (int si...
#include <iostream> #include <vector> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <string> #include <queue> #include <stack> #include <sstream> #include <cmath> #include <numeric> using namespace std; class Solution { public: int findKthLargest(vector<int>& nums, int k)...
/* * Copyright 2016-2017 Flatiron Institute, Simons Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required ...
#include "Jugador.h" Jugador::Jugador(){ piezas = 0; nombre = "Sin definir"; puntaje = 0; primero = actual = NULL; } Jugador::~Jugador(){ while (primero != NULL ){ actual = primero; primero = primero->getSigNodo(); delete actual; } piezas = 0; } int Jugador::getPiezas(){ return piezas; //retorna la can...
/* * Copyright (C) 2007-2015 Frank Mertens. * * Use of this source is governed by a BSD-style license that can be * found in the LICENSE file. * */ #include <flux/testing/TestSuite> #include <flux/stdio> #include <flux/crypto/Md5> using namespace flux; using namespace flux::testing; using namespace flux::crypto...
/* 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...
set_output(qx_avg)= inputExt(qi_avg);
/* * File: symbol.cpp * * Description: Constructor and accessors for Symbol class. * * */ # include <cstdlib> # include <iostream> # include "scope.h" Symbol::Symbol(std::string name, Type t) :_name(name),_type(t) { } std::string Symbol::getName() { return _name; } Type Symbol::getType() { return _typ...
#include <iostream> using namespace std; int main() { cout << "print statement" << endl; double arr[4] = {14.5, 4.0, 10.7, 78.5}; double *p1 = &arr[0]; double *p2 = p1 + 3; cout << *p2 << " " << p2 - p1; return 0; } // Testing whether it has changed or not
#pragma once #ifndef INTERPRETER_H #define INTERPRETER_H #include <string> #include <iostream> #include <vector> #include "Database.h" #include "parser.h" #include "Relation.h" #include "DependencyGraph.h" using namespace std; //Process schemes into relations class Interpreter { public: Interpr...
#ifndef BSCHEDULER_PPL_BASIC_FACTORY_HH #define BSCHEDULER_PPL_BASIC_FACTORY_HH #if !defined(BSCHEDULER_DAEMON) && \ !defined(BSCHEDULER_APPLICATION) && \ !defined(BSCHEDULER_SUBMIT) #define BSCHEDULER_APPLICATION #endif #include <iosfwd> #include <bscheduler/config.hh> #include <bscheduler/ppl/basic_pipelin...
#include <pthread.h> #include <unistd.h> #include <sys/syscall.h> // #include "Thread.h" #include "ThisThread.h" USE_NAMESPACE __thread int ThisThread::t_cachedTid = 0; __thread char ThisThread::t_tidString[32]; __thread size_t ThisThread::t_tidStringSize; __thread const char* ThisThread::t_threadName; void ThisTh...
#include "Board.h" /** *getInt(): Reads a postive interger from the user. Only an interger is acceptable. No strings and no characters. *return: A postive interger *@param: None */ int getInt() { std::string str; int colNum = 0; while (true) { try { std::getline(std::cin, str); colNum ...
#ifndef CCMTEST_H #define CCMTEST_H #include <QDockWidget> #include "ui_ccmtest.h" #include <QLabel> #include <QVBoxLayout> #include <QTextEdit> #include <QDateTime> #include <QThread> #include <QDialog> #include <QComboBox> #include <QPushButton> #include "global_default.h" class CCMLogBar : public QDockWidget { Q...
#include <iostream> using namespace std; // butuh array, angka cari, ujung kiri, ujung kanan. void binary(int data[], int cari, int kiri, int kanan) { int tengah = (kiri + kanan) /2; if (data[tengah] == cari) { cout << "Data ditemukan di array ke- " << tengah; } else if (data[tengah] < cari) { // ...
#include<stdio.h> #include<string.h> #define maxn 1010 int next[maxn]; char s[maxn],t[maxn]; int m,n,sum; int kmp_index(int x) { int i,j=0; for(i=x;i<m;i++) { while(j!=-1&&s[i]!=t[j]) j=next[j]; j++; if(j==n) { sum++; break; } } ...
#include "ros/ros.h" #include "sensor_msgs/Imu.h" #include "imu_3dm_gx4/FilterOutput.h" #include "geometry_msgs/Accel.h" #include "geometry_msgs/Vector3.h" #include "riptide_msgs/ThrustStamped.h" #include "tf/transform_listener.h" #include <math.h> #include <vector> #include "ceres/ceres.h" #include "glog/l...
//CtrlXKey.cpp #include "CtrlXKey.h" #include "KeyActionCreator.h" #include "MemoForm.h" #include "Memo.h" #include "Line.h" #include "SelectedBuffer.h" #include "CtrlCKey.h" #include "DeleteKey.h" CtrlXKey::CtrlXKey(Form *form) :KeyAction(form) { } CtrlXKey::CtrlXKey(const CtrlXKey& source) : KeyAction(source) {...
#include <map> #include <string> #include <iostream> #include <stdio.h> #include <algorithm> using namespace std; struct Edge { int u, v; double dis; }; // cmp类型写成&更佳 bool cmp(Edge a, Edge b) { return a.dis < b.dis; } const int MAXN = 100010; const int MAXM = 100010; int n, m; Edge edges[MAXM]; int fathe...
#include <fstream> #include <gtest/gtest.h> #include <cereal/archives/portable_binary.hpp> #include "hs_test_utility/test_toolkit/test_serialization.hpp" #include "hs_sfm/sfm_utility/camera_type.hpp" #include "hs_sfm/sfm_utility/key_type.hpp" namespace { TEST(TestCameraType, SimpleTest) { typed...
#include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include <stdio.h> int main(int argc, char const *argv[]) { int fd ; char * myfifo = "~/myfifo"; char buf[1000] ; mkfifo(myfifo,0666); fd = open(myfifo, O_RDONLY); read(fd,buf , sizeof(buf)); printf("REcieved :%s\n",buf ...
class rectangleNode:public Node { private: int l; int b; public: rectangleNode(); ~rectangleNode(); int area(); void display(); }; rectangleNode::rectangleNode() { printf("Making a rectangle node\n"); l = 8; b = 5; } rectangleNode::~rectangleNode() { printf("Destroying the rect...
#include "GameManager.h" #include "LevelManager.h" #include <SFML\Graphics.hpp> #include <cmath> Position GameManager::convGridPos(Position pos) { GridBool obs = *levelManager->getLevel(0); return Position(pos.x * (Config::gridDisplaySize / obs.getWidth()), pos.y * (Config::gridDisplaySize / obs.getHeight())); } Po...
#ifndef UTILS_TREE_H #define UTILS_TREE_H #include <string> #include "utils_linked.h" #include "utils_vector.h" template <class T = int> class utils_tree { public: utils_tree(std::string& str); void clean(); void insert(T data); void remove(T data); bool search(T key); bool is_bst(); bool i...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Devices.Gpio.1.h" #include "Windows.Foundation.1.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Foundation::Collections { #ifndef WINRT_GENERIC_7fc72a82_2c57_5c0...
#include "mainwindow.h" #include "ui_mainwindow.h" #include "model.h" static model md; //Модель int numbGraph = 0; MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); this->setWindowTitle("LabWork"); //Выбор схемы ui->usageBox->a...
// Copyright (c) 2018-2019 Daniel Krawisz // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef COSMOS_EVALUATION_INTERPRETER #define COSMOS_EVALUATION_INTERPRETER #include <cosmos/workspace.hpp> #include "operators.hpp" nam...
class Solution { public: vector<vector<string>> res; vector<vector<string>> partition(string s) { if(s.length()==0) return res; vector<string> temp; helper(temp,s,0); return res; } void helper(vector<string>& temp,string& s,int start){ // start表示开始字符的index if(s.l...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "remoting/host/session_event_executor_win.h" #include <string> #include "base/bind.h" #include "base/command_line.h" #include "base/compile...
#include<stdio.h> #include<algorithm> #define SIZE 10 using namespace std; long a[1000]; int r=0; void ShiftUp(int x) { if(x==1) return; int par,large; par=x/2; large=par; if (a[x] > a[large]) large = x; if (large == par) return; else { swap(a[large], a[p...
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { int isBalanced(TreeNode *root, bool &result) { if (root == nullptr) return 0; ...
#include <cstdio> #include <cstring> int main() { char dict[10][8] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight","nine"}; char tmp[10000]; int sum, len; int sumarr[1000]; len = 0; fgets(tmp, sizeof(tmp), stdin); tmp[strlen(tmp)-1] = '\0'; for(int i = 0; tmp[i] != '\0';i++) ...
#include "Player.h" #include <iostream> Player::Player(Ip remote, sf::UdpSocket *socket, sf::FloatRect shape, int layer, sf::Texture fond, int num, float speed, float poids, float vie) : Collision(shape, layer, fond), Sync(remote, socket), m_num(num), m_speed(speed), m_poids(poids), m_vie(vie), m_enVie(true),...
#pragma once #include <vector> #include <list> class MonoBehavior { public : static std::list<MonoBehavior*> all; public : bool toDestroy; virtual void Update() = 0; MonoBehavior(); ~MonoBehavior(); virtual void Destroy(); static std::list<MonoBehavior*> GetAllMonobehaviors(); };
#pragma once #include "ofMain.h" /* In his 1999 paper “Steering Behaviors for Autonomous Characters,” Reynolds uses the word “vehicle” to describe his autonomous agents, so we will follow suit. */ class Vehicle { public: // METHODS Vehicle(); void seek(ofVec2f target); void applyForce(ofVec2f force); void update()...
#include<bits/stdc++.h> using namespace std; int main(){ int n, x, mod = 1e9 + 7; cin >> n >> x; vector<int>coins(n); for(int i = 0; i < n; i ++){ cin >> coins[i]; } vector<vector<int> >dp(n + 1, vector<int>(x+1, 0)); dp[0][0] = 1; for(int i = 1; i <= n; i ++){ for(int j ...
#include "foreach.h" #include "resource.h" #include <algorithm> #include <crtdbg.h> #include <fstream> #include <iomanip> #include <sstream> #include <string> #include <shlwapi.h> #include <tchar.h> #include <vector> #include <windows.h> #include <Wininet.h> using namespace std; typedef basic_string<TCH...
/* * SPDX-FileCopyrightText: (C) 2015-2022 Daniel Nicoletti <dantti12@gmail.com> * SPDX-License-Identifier: BSD-3-Clause */ #include "viewemail_p.h" #include <Cutelyst/application.h> #include <Cutelyst/context.h> #include <Cutelyst/response.h> #include <SimpleMail/emailaddress.h> #include <SimpleMail/mimemessage.h>...
#include "stdafx.h" #include "InnGold.h" InnGold::InnGold() { } InnGold::~InnGold() { }
#include "WordUnit.h" WordUnit::WordUnit(string newWord){ setWord(newWord); setCounter(); } void WordUnit::setWord(string newWord){ word = newWord; } string WordUnit::getWord(void) const{ return word; } void WordUnit::setCounter(void){ //When a word is create, make sure the counter is started at 1 counter = 1...
#pragma once #ifndef PARALLAX_BACKGROUND_HPP #define PARALLAX_BACKGROUND_HPP #include <array> #include <SFML/Graphics/RenderWindow.hpp> #include <SFML/Graphics/Sprite.hpp> #include "inc/texture_manager.hpp" #include "inc/utility.hpp" namespace astroblaster { class ParallaxBackground { public: ParallaxBackground...
/** * Copyright (C) 2017 Alibaba Group Holding Limited. 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 * * ...
// // main.cpp // https://open.kattis.com/problems/guess // // Created by Sofian Hadianto on 28/12/18. // Copyright © 2018 Sofian Hadianto. All rights reserved. // #include <bits/stdc++.h> using namespace std; int main(int argc, const char * argv[]) { ios::sync_with_stdio(false); cin.tie(NULL); in...
// compile (for debugging): g++ -Wall -Wextra -fsanitize=undefined,address -D_GLIBCXX_DEBUG -g <file> // compile (as on judge): g++ -x c++ -Wall -O2 -static -pipe <file> // Output file will be a.out in both cases #include <bits/stdc++.h> #include <vector> #include <string> #include <algorithm> #include <queue> #includ...
#include "DistorsionZone.h" #include "Transform.h" #include "Application.h" #include "ModuleAudio.h" #include "ModuleRenderer3D.h" #include "ModuleImGui.h" DistorsionZone::DistorsionZone(GameObject * own) : Component(own) { Setname("Distorsion Zone"); SetType(DIST_ZONE); zone.SetNegativeInfinity(); App->audio->Add...
/* 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...
/* ID: zrh331 PROG: numtri LANG: C++ */ #include <fstream> #include <iostream> #include <vector> #include <string.h> #include <stdio.h> using namespace std; int a[1001][1001], f[1001][1001], n, ans=0; int main () { ifstream cin ("numtri.in"); ofstream cout ("numtri.out"); cin >> n; ...
 #include "SoundManager.h" SoundManager* SoundManager::_instance; SoundManager* SoundManager::getInstance() { if (_instance == nullptr) { _instance = new SoundManager(); } return _instance; } void SoundManager::loadSound(HWND hWnd) { // Khởi tạo CSoundManager. DirectSound_Init(hWnd); CSound* sound = null...
#include "ConvexShape3D.h" namespace urchin { //explicit template template class ConvexShape3D<float>; template class ConvexShape3D<double>; }
#pragma once template <typename StructType> struct COsStructQueue { public: typedef COsStructManager<StructType> StructManager; COsStructQueue(StructManager& items, uint32* headIdPtr) : m_items(items) , m_headIdPtr(headIdPtr) { } void PushFront(uint32 id) { uint32 nextId = (*m_headIdPtr); (*m_headIdPt...
#ifndef TRIANGLE2D_H #define TRIANGLE2D_H #include "vector2.h" #include "box2d.h" class Triangle2D { public: Triangle2D(); Triangle2D( const Vector2& Vec1, const Vector2& Vec2, const Vector2& Vec3 ); Box2D GetBound() const; Vector2 m_Vec1; Vector2 m_Vec2; Vector2 m_Vec3; }; #endif // TRIANGLE2D_H
#include "../HeaderFiles/StringtoInteger.hpp" unsigned int CharToValue(char c) { if (c >='0' && c <= '9') { return c - '0';} return -1; } int StringtoInteger::myAtoi(string str) { int ResultInt = 0; int SignBit = 0; bool GetValue = false; for (int i=0; i<str.size(); i++) {...
#include <string> #include <vector> #include <algorithm> using namespace std; int solution(string s) { vector<int> answer; int length = s.length(); string old, news, temp; int counting; /*주어진 문자열 길이가 1이면 답은 1*/ if(length == 1) return 1; /*문자열 전체 길이의 절반을 넘는 단위로 자를 순 없으니 1 부터 le...
#include "FoundationPch.h" #include "Foundation/Reflect/Registry.h" #include "Foundation/Log.h" #include "Foundation/Container/Insert.h" #include "Foundation/Reflect/Enumeration.h" #include "Foundation/Reflect/Data/DataDeduction.h" #include "Foundation/Reflect/Version.h" #include "Foundation/Reflect/DOM.h" #include "...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Storage.AccessCache.1.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Foundation { #ifndef WINRT_GENERIC_5e52f8ce_aced_5a42_95b4_f674dd84885e #define WINRT_GENERI...
class Solution { void reverseVowels(string &s, int left, int right) { string vowels = "AEIOUaeiou"; while(left < right) { while(left < right && vowels.find(s[left]) == string::npos) { left++; } while(left < right && vowels.fin...
#ifndef EXAMPLE_CHESS_GAME_H #define EXAMPLE_CHESS_GAME_H #include <cstddef> #include <cstdint> #include <array> #include <vector> #include <map> #include "opengl/model.h" #include "opengl/renderer.h" #include "engine/input.h" #include "engine/event.h" #include "engine/camera.h" #include "engine/text.h" #include "pre...
/* * @file hcomms.cpp * @author Artur Gilmutdinov <arturg000@gmail.com> */ #include "../include/hcomms.h" // thread client serve void *hcomms_thread_fnc(void *a) { hcomm_srv_t *b = (hcomm_srv_t*)a; try { b->get_sock()->server<hcomm_srv_t>(b, b-...
// Driver.cpp // CSCE 463-500 // Luke Grammer // 11/21/19 #include "pch.h" #pragma comment(lib, "ws2_32.lib") using namespace std; int main(INT argc, CHAR** argv) { #define _CRTDBG_MAP_ALLOC #include <stdlib.h> #include <crtdbg.h> // libraries to check for memory leaks // debug flag to check for memory leak...
//找到起点 //对起点之前置空 起点后指向null的指向头 //star 为0或者为链表长度特殊处理 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* rotateRight(ListNode* head, int k) { int count=1; ...
/* * SpaceDefinition.h * * Created on: Dec 15, 2014 * Author: coppergate */ #ifndef SPACEDEFINITION_H_ #define SPACEDEFINITION_H_ #include <ostream> #include <sstream> using std::ostream; using std::endl; using std::string; using std::stringstream; #include "Definitions.h" namespace Utilities { class S...
#ifndef SPAN_SRC_SPAN_FIBERS_FIBERSYNCHRONIZATION_HH_ #define SPAN_SRC_SPAN_FIBERS_FIBERSYNCHRONIZATION_HH_ #include <list> #include <memory> #include <utility> #include "absl/synchronization/mutex.h" namespace span { namespace fibers { class Fiber; class Scheduler; /** * Wraps an absl::Mutex sp...
/* 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...
#include <iostream> #include <string> #include <vector> /* Simple program that represents a guest list. User inputs names that are to be added on a guest list. Then the programs tells the user how many people are in the guest list and prints the names of each person. */ int main() { // declares a vector (similair t...
//----------------------------------------------------------------------------- // Perimeter Map Compiler // Copyright (c) 2005, Don Reba // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met:...