text
stringlengths
8
6.88M
#include "HttpRequest.h" #include "HttpServer.h" #include "HttpStringParser.h" /* * 字符串分割函数 */ static std::vector<std::string> split(std::string str, std::string pattern) { std::string::size_type pos; std::vector<std::string> result; str += pattern;//扩展字符串以方便操作 int size = str.size(); for (int i = 0; i < size; ...
/* value_test.cpp -*- C++ -*- Rémi Attab (remi.attab@gmail.com), 26 Mar 2014 FreeBSD-style copyright and disclaimer apply Tests for the Value function. */ #define BOOST_TEST_MAIN #define BOOST_TEST_DYN_LINK #include "tests.h" #include "reflect.h" #include "test_types.h" #inc...
/* =============================================================================== Name : main.c Author : $(author) Version : Copyright : $(copyright) Description : main definition =============================================================================== */ #if defined (__USE_LPCOPEN) #if...
#ifndef ADMINISTRADOR_H #define ADMINISTRADOR_H #include <QMainWindow> #include <QMap> #include <QString> #include <QMessageBox> #include "resultados.h" #include "principal.h" using namespace std; namespace Ui { class Administrador; } class Administrador : public QMainWindow { Q_OBJECT public: explicit Admin...
/* // Created by: Jacob Cassady // Date Created: 9/3/2016 // Last Updated: 9/9/2016 */ /* Problem statement: Design a class template, OrderedCollection, that stores a collection of Comparables (in an array), along with the current size of the collection. Provide public functions isEmpty, makeEmpty, insert, remove...
#include<cstdio> #include<sstream> #include<cstdlib> #include <iomanip> #include<cctype> #include<cmath> #include<algorithm> #include<set> #include<queue> #include<stack> #include<list> #include<iostream> #include<fstream> #include<numeric> #include<string> #include <unordered_map> #include<vector> #include<cstring> #i...
#include <SPI.h> #include <LedCubeStills.h> #include <LedCubeSequences.h> int clockPin = 13; int dataPin = 11; int latchEnablePin = 8; int outputEnablePin = 10; byte leds[8][8]; // [z],[y],1<<x int activeLayerIndex = 0; void setup() { Serial.begin(9600); // Timer 2 Initialization for 125uS interrupt. cli(...
// Decimal to hexadecimal #include <iostream> using namespace std; //convert decimal to hexadecimal void convert(int num) { char arr[100]; int i = 0; while (num != 0) { int temp = 0; temp = num % 16; if (temp < 10) { arr[i] = temp + 48; i++; ...
// // Observable.hpp // Assignment3 // // Created by mushfiqur anik on 2019-11-17. // Copyright © 2019 mushfiqur anik. All rights reserved. // #pragma once #include <list> using namespace std; class Observer; class Observable { public: virtual ~Observable() {}; virtual void Attach(Observer *) = 0; vi...
class Solution { public: string shortestPalindrome(string s) { int n = s.size(); vector<int> fail(n, -1); for (int i = 1; i < n; ++i) { int j = fail[i - 1]; while (j != -1 && s[j + 1] != s[i]) { j = fail[j]; } if (s[j + 1] == s[...
#ifndef DLLMYSQL_H #define DLLMYSQL_H #include "QSqlTableModel" #include <QObject> #include "dllmysql_global.h" class DLLMYSQLSHARED_EXPORT DLLMySQL: public QObject { Q_OBJECT public: DLLMySQL(); int DLLMYSQLSHARED_EXPORT validateCard(QString cardId); int DLLMYSQLSHARED_EXPORT validateP...
/* * 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 ...
// Node for a binary tree // Created by A. Student // Modified by: Tuan Truong // This hash table is using linked list as a collision resolution method #ifndef _HASH_TABLE_H #define _HASH_TABLE_H #include<string> #include<iostream> #include<iomanip> #include<cmath> #include"SList.hpp" using namespace std; template<cl...
/* MIT License Copyright (c) 2019 Vladislav Gusak 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, publish...
#include "util.h" #include"Poco.h" void D_ADMINSETTING::Jsonize(JsonIO & json) { json ("ID",data.ID ) ("ROOTPATH",data.ROOTPATH) ("STATICPATH",data.STATICPATH) ("IMAGEPATH",data.IMAGEPATH) ("BACKUPPATH",data.BACKUPPATH) ("SERVERPORT",data.SERVERPORT) ("HOSTNAME",data.HOSTNAME) ; } D_ADMINSETTING D_ADMINS...
#pragma once #include "Headers.h" #include <vector> template <class Name, class Weight> class Graph { public: template <class Name> class Vertex { private: Name name; public: Vertex(Name name) { this->name = name; } Name getName() { return this->name; } }; template <class ...
#include <opencv2/opencv.hpp> #include "Contour.hpp" #include "ContourDetector.hpp" #include "HSVImage.hpp" ContourDetector::Params::Params() { filter_by_hue = false; min_hue = 0; max_hue = 255; filter_by_saturation = false; min_saturation = 0; max_saturation = 255; filter_by_value = false; min_value = 0; m...
#include <QString> #include <iostream> namespace { class Main { public: Main() { } ~Main() { } private: }; } int main() { auto msg = QString("Hello, world"); std::cout << msg.toStdString() << std::endl; return 0; }
/* * Particle.h * * Created on: Jun 7, 2015 * Author: colman */ #include "robot.h" #include "Globals.h" #include "pngUtil.h" #ifndef PARTICLE_H_ #define PARTICLE_H_ class Particle { private: double _x; double _y; double _yaw; double _belief; public: Particle(double x, double y, double yaw, double be...
#include<bits/stdc++.h> using namespace std; void reverseArray(char arr[], int start, int end){ while(start < end){ swap(arr[start], arr[end]); start++; end--; } } void printArray(char arr[], int size){ for(int i=0; i<size; i++){ cout<<arr[i]<<" "; } cout<<endl; } bool isAlphabet(char x){ return ( (x >=...
#ifndef NAVMESH_H #define NAVMESH_H #include "dllmacro.h" #include "shapes.h" #include "mapobject.h" #include "pathfinder.h" #include "agentbuilder.h" namespace POICS{ enum class CornerSmoothing {NONE, PORTAL, POLYOFFSET}; /* Hertel-Mehlhorn convex polygon partition based navigation mesh */ class POICS_API HMNav...
/**************************************************************************** ** ** Copyright (C) 2009 Du Hui. ** ****************************************************************************/ #ifndef COMPORTDLG_H #define COMPORTDLG_H #include <QtGui/QDialog> class QSerialComm; namespace Ui { cla...
#include <typeinfo> #include <iostream> using namespace std; template <typename Type> class Node { public: Type data; Node<Type> *next = NULL; }; template <typename Type> class LinkedList { public: // Constructor LinkedList(); // Destructor ~LinkedList(); // Get the value located at index Type Get(const in...
#ifndef QPROMODIALOG_H #define QPROMODIALOG_H #include <QWidget> #include <QLabel> #include <QLineEdit> #include <QVBoxLayout> #include <QPushButton> class QPromoDialog : public QWidget { Q_OBJECT private: std::string cf; QLineEdit* insert_cf; public: explicit QPromoDialog(QWidget *parent = nullptr);...
//========================================================================== // WATCHINSPECTOR.CC - part of // // OMNeT++/OMNEST // Discrete System Simulation in C++ // // Implementation of // inspectors // //========================================================================== ...
#ifndef BONEINFO_H #define BONEINFO_H #include "Bone.h" #include <map> namespace kyrbos { class ENGINE_API BoneInfo { public: // Tiene que ser todo publico, ya que es solo una estructura con data! Bone* m_pkBone; D3DXMATRIX offSetMatrix; std::vector<unsigned int> m_mVIndex; std::vector<float> m_mVWeight...
/* main.cpp Author: Izaak Coleman */ #include <iostream> #include <iomanip> #include <vector> #include <string> #include "boost/program_options.hpp" #include <sys/stat.h> // benchmarking #include <sys/resource.h> #include <chrono> #include "SNVIdentifier.h" #include "GenomeMapper.h" #include "gsa.h" using namespa...
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** 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 Foundation; either ...
#ifdef CQUEUE_H_ #define CQUEUE_H_ #include <iostream> using namespace std; class CQueue { private: }; #endif
#pragma once #include <limits> #include <dtl/dtl.hpp> //===----------------------------------------------------------------------===// // Third party dependency: 'libdivide' by ridiculous_fish // Usable under the terms in either zlib or Boost license. // See 'thirdparty/libdivide/LICENSE.txt' for details. //===-----...
#include <stdlib.h> // standard C library #include <mpi.h> // MPI library #include <time.h> // Time library // KOMPILACJA // mpicxx -o runfile fiverr_mpi.cpp // po użyciu powyższej komendy utworzony zostanie plik runfile, który możemy uruchomić za pomocą: // mpiexec -N 4 runfile // gdzie -N odpowiada za licz...
#include <Siv3D.hpp> int whiteCount = 0; int blueCount = 0; int count = 1; int othelloStone[8][8]; double FILED[8][8]; int white = 1; int blue = 2; Array<Rect> cell; Array<Circle> stone; Array<Rect> WALL; void Wall() { for (int i = 0; i < 8; i++) for (int j = 0; j < 8; j++) { WALL << Rect(220, ...
#include "pch.h" #include "SymbolSet.h" #include <algorithm> SymbolSet::SymbolSet(){ } SymbolSet::~SymbolSet() { } int SymbolSet::in_Tab(string name) { transform(name.begin(), name.end(), name.begin(), ::towlower); if (Tab.getinfo(name)) { ifo = Tab.ret_info(); return 1; } return 0; } int SymbolSet::in_ATab...
#include <iostream> #include <math.h> using namespace std; /* ---------------------------------- */ // QUASI-NEWTON METHOD /* TODO: * translate terms to English * format and style code * add explanations, code too verbose */ /* ---------------------------------- */ double f1_paraboloid(double x, doub...
#include <iostream> #include <fstream> #include <string> #include "Text.h" namespace w3 { Text::Text() { } Text::Text(char* filename) { std::fstream in(filename, std::ios::in); if (in.is_open()) { std::string line; while (getline(in, line)) LineCount++; std::cout << "'" << filename <...
#ifndef GAMEMANAGER_H #define GAMEMANAGER_H #include <iostream> #include <SDL.h> #include <fstream> #include <vector> #include "GameWindow.h" #include "Sprite.h" #include "PlayerCharacter.h" #include "Environment.h" #include "Button.h" #include "MainMenu.h" class GameManager { public: GameManager(int pass...
/* 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...
/************************************************************* * > File Name : c1071_1.cpp * > Author : Tony * > Created Time : 2019/10/04 12:05:00 * > Algorithm : SegmentTree **************************************************************/ #include <bits/stdc++.h> using namespace st...
#include <iostream> //For files #include <fstream> #include <cctype> //For character handling #include <string> #include <chrono> #include <vector> #include <algorithm> #include <iomanip> class User { public: User();//Constructor User(char, char, char, int); //Constructor ~User(); //Deconstructor void checkIfUser...
//Student Name: Bair Suimaliev //Student email: bsuimaliev@myseneca.ca //Student ID: 159350198 //Date: 09.27.2021 //I have done all the coding by myselfand only copied the code //that my professor provided to complete my workshopsand assignments. #pragma once #ifndef _SDDS_STRINGSET_H_ #define _SDDS_STRINGSET...
#ifndef REGISTER_H #define REGISTER_H #include "../visitors/codevisitor.h" #include <string> using namespace std; /** * A register is an abstraction used by three address code to represent * identifiers. */ class Register { public: Register(bool global): isGlobal_(global) { } virtual ~Register() { }...
#include <cstdio> // Min => Max // DATA: indexd | A[i] | unindexed void direct_insert_sort(int arr[], int n) { int i, j, tmp; // tmp as temporary data for(i = 1; i < n; i++) { if(arr[i-1] > arr[i]) { tmp = arr[i]; for(j = i-1; arr[j] > tmp; j--) // move forward to reseve i's postion ar...
#include "RenderingSystem.h" RenderingSystem::RenderingSystem() { height=screenHeight; width=screenWidth; glClearColor(0.0f,0.0f,0.4f,0.0f); glViewport(0.0f, 0.0f, width, height); glEnable(GL_DEPTH_TEST); } RenderingSystem::~RenderingSystem() { } void RenderingSystem::set2D() { glMatrixMode(GL_PROJECTION...
#include "Collision.h" Collision::Collision(sf::Vector2f bird_size, float world_bottom) { this->bird_size = bird_size; this->world_bottom = world_bottom; world_top = 0.0f; } Collision::~Collision() { } bool Collision::isCollision(sf::Vector2f bird_position, int amount_of_columns, std::vector<sf::RectangleShape> ...
#include "RegisterWidget.h" #include <QPalette> #include <QFont> #include <QDebug> #include <QPushButton> #include <QEventLoop> #include "../CommonFiles/Constants.h" #include "MessageBoxWidget.h" #include <QMessageBox> #include <QKeyEvent> #include <QCryptographicHash> RegisterWidget::RegisterWidget(int width, int hei...
//Seth Stoltenow Delivery 2 CSCI 465 UND Fall 2018. Completed in Linux Mint on GCC 5.4.0 //ID: 1119117 //Email: seth.stoltenow@und.edu //To compile entire program: g++ lexer-SethStoltenow.cpp parser-SethStoltenow.cpp -o pascal -std=c++11 //To run: ./pascal input3.pas //Or: g++ -c lexer-SethStoltenow.cpp parser-SethS...
#include <stdbool.h> #include <stdio.h> #include <stdlib.h> typedef struct bst_node_t{ unsigned key,left_fruit; struct bst_node_t *left, *right, *parent; }BSTNode; typedef struct bst_metadata_t{ unsigned _size_node; BSTNode *_head; }BSTree; /* save node count ...
// github.com/andy489 // https://www.hackerrank.com/contests/practice-8-sda/challenges/maze-9 #include <iostream> #include <vector> #include <queue> using namespace std; vector<int> xd{1, 0, -1, 0}, yd{0, -1, 0, 1}; #define DIRECTIONS 4 struct Cell { char ch; int x, y, level; bool visited; Cell(c...
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; struct data{ long long pos; long long val; }a[100010]; long long sum[100010]; long long sum2[100010]; long long n,m; bool cmp(data a,data b){ return a.pos<b.pos; } int main(){ int i,j,k; ...
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
#include <iostream> #include <vector> using namespace std; class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { map<int, int> hash; for (int i = 0; i < nums.size(); ++i) { if (hash.end() == hash.find(target - nums[i])) { hash[nums[i]] = i; } else { return {hash[targ...
/*********************************************************************** created: Fri Mar 02 2012 author: Paul D Turner <paul@cegui.org.uk> *************************************************************************/ /*************************************************************************** * Copyrigh...
/* * Game.c pp * * Created on: 22 Oct 2016 * Author: andrew */ #include "Game.h" #include "mainWindow.h" #include <iostream> #include <string> #ifndef NDEBUG #define DeBug(msg) std::cout << msg << std::endl #else #define DeBug(msg) #endif Game::Game() { bHasStopped = false; bShallStop = false; iPoss...
/** * Date: 2019-11-09 22:18:16 * LastEditors: Aliver * LastEditTime: 2019-11-09 22:53:37 */ #ifndef _TEST6_H #define _TEST6_H #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <unistd.h> #include <fcntl.h> #include <sys/types.h> using namespace std; const char *filename = "./...
#include <bits/stdc++.h> using namespace std; int main() { long int dp[15]; dp[0] = 1; for(int i=1; i<15; i++) dp[i] = 5*dp[i-1]; int t; cin>>t; while(t--) { int n, ans = 0; cin>>n; for(int i=1; i<14; i++) ans += (int)(n/dp[i]); cout<<ans<<endl; } }
/* We have two sorted array. Without using additional memory we need to merge these two arrays such that the initial numbers are in the 1st array and the remaining numbers are in the second array. Put the small sized array as arr1; complexity=n*n+n*m; ( n<m ) */ #include<iostream> using namespa...
#include "BigIntegerAlgorithms.hh" #include <iostream> #include <fstream> #include <stdlib.h> #include <vector> #include <string> using namespace std; void nextPermut(int* permut, bool* used, int m, int n, int pos, BigInteger& k, BigInteger& counter) { for (int i = 0; i < n; ++i) { if (counter >= k) ...
#pragma once #include <list> #include <string> #include <vector> #include <map> #include <iostream> #include "SDL\include\SDL.h" #include "Globals.h" using namespace std; class Application; struct PhysBody3D; class JSON_File; class Module { private: bool enabled; const char * name; public: Module(bool start_en...
// // bfb_algorithm.hpp // BFBDetectGraph // // Created by Tidesun on 25/3/2019. // Copyright © 2019 Oliver. All rights reserved. // #ifndef bfb_algorithm_hpp #define bfb_algorithm_hpp #include <iostream> #include <vector> #include <unordered_map> #include <array> #include "Graph.hpp" using namespace std; class B...
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <unordered_map> #include <utility> #include "hw2_types.h" #include "hw2_file_ops.h" #include "hw2_math_ops.h" std::vector<Camera> cameras; std::vector<Model> models; std::vector<Color> colors; std::vector<Translation> translations; s...
/*************************************************************************** Copyright (c) 2020 Philip Fortier 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 Foundation; either version 2 of the License, or...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.Foundation.Collections.0.h" #include "Windows.Foundation.1.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Foundation::Collections { struct _...
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
#pragma once #include <map> #include <string> using std::map; using std::string; class Asset { public: /*Abstract function, don't call */ virtual bool load( string file ) = 0; /*Abstract function, don't call */ virtual void unload() = 0; }; class Assets { public: /*Load an asse...
#ifndef EXPENSES_H #define EXPENSES_H #include <QWidget> #include <QtSql> #include<QCompleter> #include<QMenuBar> #include<QMenu> #include<QDate> #include<QSqlQuery> #include<QMessageBox> #include<QByteArray> #include<QtNetwork/QNetworkInterface> #include<QBuffer> #include<QFile> #include<QIODevice> #i...
/** * author : Wang Shaotong * email : wangshaotongsydemon@gmail.com * date : 2020-04-27 * * id : hdu 2111 * name : Saving HDU * url : http://acm.hdu.edu.cn/showproblem.php?pid=2111 * level : 1 * tag : 贪心 */ #include <iostream> #include <algorithm> using namespace std; const int MAXN = 120;...
/*============================================================================== Copyright (c) Laboratory for Percutaneous Surgery (PerkLab) Queen's University, Kingston, ON, Canada. All Rights Reserved. See COPYRIGHT.txt or http://www.slicer.org/copyright/copyright.txt for details. Unless required by appl...
#include "mainwindow.h" #include "ui_mainwindow.h" #include <QFile> #include <QTextStream> #include "basic_types.h" #include "messages.h" #include "sdfiles.h" #include <QDebug> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWi...
#include <math.h> #include <conio.h> #include <stdio.h> #include <locale.h> #include <stdlib.h> #include <string.h> void calcula (int *x, int *y, int *z) { *z = *x + *y; printf ("Primeiro número: %d\nSegundo número: %d\nSoma: %d", *x, *y, *z); } int main (void) { setlocale (LC_ALL, "Portuguese"); int Num1 =...
/*************************************************************************** Copyright (c) 2020 Philip Fortier 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 Foundation; either version 2 of the License, or...
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** 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 Foundation; either ...
// Time complexity: O(log(n)) #include <iostream> using namespace std; int main() { int n = 0; cin >> n; int a = 0, i = n; while (i >= 1) { a = a + 1; i /= 2; } return 0; }
#include "board.h" #include "boardchesspiece.h" #include <iostream> using namespace std; board::board() { // set W values for (int h = 0; h <= 1; h++) { for (int w = 0; w <= 7; w++) { cboard[w][h].x = 'W'; } } // set B values for (int h = 6; h <= 7; h++) { for (int w = 0; w <= 7; w++) { cboard[w...
/*************************************************************************** # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of...
#include <stdio.h> #include <omp.h> #include <stdlib.h> #include <ctime> int main() { srand(time(NULL)); int m=500,n=500,p=500; int b=100; int A[m][n]; int B[n][p]; for (int i=0;i<m;i+=1) for (int j=0;j<n;j+=1) { A[i][j]=rand()%b; ...
/* 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 <stdio.h> #include <string.h> int n,m; int can_eat[50][50]; char name[50][11]; int g_select; int min(int a,int b) { if(a<b) return a; else return b; } int find(char *input) { for(int i=0;i<n;i++) if(strcmp(input,name[i]) == 0) return i; return -1; } int func(int pos,int select, int *check) { ...
#ifndef _HS_SFM_BUNDLE_ADJUSTMENT_BA_NAIVE_AUGMENTOR_HPP_ #define _HS_SFM_BUNDLE_ADJUSTMENT_BA_NAIVE_AUGMENTOR_HPP_ #include "hs_sfm/bundle_adjustment/ba_naive_augmented_normal_matrix.hpp" #include "hs_sfm/bundle_adjustment/ba_naive_vector_function.hpp" namespace hs { namespace sfm { namespace ba { tem...
#ifndef DBOPERATOR_H #define DBOPERATOR_H #include <iostream> #include <QtSql> #include <QtDebug> using namespace std; class DbOperator { public: DbOperator(); void addDatabase(); void checkDB(); QSqlDatabase mydb; void open(); void close(); bool isOpen(); }; #endif // DBOPERATOR_H
#ifndef GENERADOR_ESTRUCTURA_NIVELES_H #define GENERADOR_ESTRUCTURA_NIVELES_H #include "proto_sala.h" #include "../definiciones/definiciones.h" #include <vector> #include <stdexcept> namespace App_Generador { class Generador_estructura_niveles { ////////////// //Definiciones public: private: struct SalaNoExis...
#ifndef __LINBOX_matrix_SlicedPolynomialMatrix_SlicedPolynomialVector_H #define __LINBOX_matrix_SlicedPolynomialMatrix_SlicedPolynomialVector_H #include <vector> #include <iostream> #include <fstream> #include <stdlib.h> #include <stdint.h> #include "linbox/vector/blas-vector.h" #include <givaro/modular.h> #include <g...
class Solution { public: int removeDuplicates(vector<int>& nums) { // 数组操作,思路偏脑筋急转弯 int i = 0; for (int num : nums) { // 遍历数组中的元素 if (i < 2 || nums[i - 2] < num) nums[i++] = num; // 因为至多两个元素连续,并且根据题目要求元素大小递增 // 新的nums是在原有的nums下更新的,这个新的nums不会把原来nums全部元素都更新,它会更新前面一部分的内容 ...
#ifndef FASTCG_COLORS_H #define FASTCG_COLORS_H #include <glm/glm.hpp> namespace FastCG { class Colors { public: static const glm::vec4 NONE; static const glm::vec4 WHITE; static const glm::vec4 SILVER; static const glm::vec4 GRAY; static const glm::vec4 BLACK; static const glm::vec4 RED; static cons...
#pragma once #include <vector> #include "typedValue.h" PP_API void InitOptPattern(); void Optimize(CodeThread *ioThread);
// // Created by Alex Shaver on 8/30/17. // #ifndef FACTORYEXAMPLE_ANCHOR_H #define FACTORYEXAMPLE_ANCHOR_H #include "Alpha.h" class Anchor : public Alpha{ public: void print() override; }; #endif //FACTORYEXAMPLE_ANCHOR_H
// // 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) 1999-2003 Apple Computer, Inc. All Rights Reserved. 2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD FileName: RTPSession.cpp Description: Provides a class to manipulate transmission of the media ...
#ifndef CELLO_COMPONENT_FACTORY_H #define CELLO_COMPONENT_FACTORY_H #include <functional> #include <map> #include <string> #include <stdexcept> #include <core/SimulationTypes.h> #include <util/Util.h> using std::function; using std::map; using std::runtime_error; using std::string; namespace cello { class Atlas; cl...
#include <iostream> #include <vector> #include <Eigen/Dense> #include <ros/ros.h> #include <ros_node/kalman.h> #include <opencv/cv.h> #include <opencv/highgui.h> using namespace std; //using namespace cv; const int winWidth = 800; const int winHeight = 600; cv::Point mousePosition = cv::Point(winWidth>>1, winHeight>>1)...
#pragma once #include <string> #include <memory> #include "Logger.hpp" #include "LogSpace.hpp" #include "UserInactivityDetector.hpp" enum class AnswerType { disaccepted, accepted }; class ChatRequest { public: std::string answerForChatRequest(const std::string& senderUsername, const std::string& decision...
#include "pwmwebserver.h" #include "JsonArrayStream.h" #include "gpiopwm.h" PwmWebServer::PwmWebServer(PwmInterface &pwm) : pwm(pwm), testEndpoint("/test"), endpointChannelCount("/ajax/pwm/channelCount"), endpointTest("/ajax/test"), endpointSetBool("/ajax/setBool"), endpointSetInt("/ajax/setInt")...
/*! *@FileName: KaiXinApp_StatusFaceList.h *@Author: GoZone *@Date: *@Log: Author Date Description * *@section Copyright * =======================================================================<br> * Copyright ? 2010-2012 GOZONE <br> * All Rights Reserved.<br> * The file is generated by K...
#include "Shader.h" #include <cstdio> #include <cstdlib> #include <iostream> #include <fstream> #include <sstream> GLuint Shader::currentlyBoundShaderID = 0x0; Shader::Shader() { init = false; } Shader::Shader(const char *vert, const char *frag, bool isFile) { setup(vert, frag, isFile); init = true; } Shader::~...
/** * [Question] * - Insertion Sort のアルゴリズムを実装するにはどうすればよいですか? * * [Solution] * - 前から順に走査 * - 自分より前で昇順になるように適切な位置に挿入 * * [計算量] * - O(N^2) * */ #include <iostream> #include <vector> void straight_insertion_sort(std::vector<int> &v) { // 配列が空 or 長さ1ならソートの必要がない if (v.size() == 0 | v.size() == 1) ...
#include "utils.h" #include "..\Constants.h" namespace input { bool convertMouse2Grid(int* gridX, int* gridY) { ds::vec2 mousePos = ds::getMousePosition(); float fy = (mousePos.y - static_cast<float>(STARTY - HALF_CELL_SIZE)) / static_cast<float>(CELL_SIZE); float fx = (mousePos.x - static_cast<float>(STARTX -...
/* * 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/Stack> #include <flux/rounding> #include <flux/str> namespace flux { String fnum(float64_t x, int precision, int base, int screen) { Ref< Stack<...
#include <bits/stdc++.h> #define ll long long std::map<ll , ll> f ; int T ; ll n , k ; ll solve(ll x) { if (x <= k) return 1 ; if (f.count(x)) return f[x] ; ll res = 1 + solve(x >> 1) + solve(x - (x >> 1)) ; return (f[x] = res) ; } int main() { scanf("%d" , &T) ; for (; T-- ;) { scanf("%lld %lld" , &n , &...
void setup() { // initialize serial communication at 9600 bits per second: Serial.begin(9600); pinMode(2, OUTPUT); digitalWrite(A2, LOW); } // the loop routine runs over and over again forever: void loop() { //determines the levels of dryness unsigned char green=25; unsigned char yellow=50...
#include<bits/stdc++.h> using namespace std; int main(){ string s,s1; cin>>s>>s1; reverse(s.begin(),s.end()); if(s==s1) cout<<"YES"; else cout<<"NO"; return 0; }
#include <iostream> #include <time.h> #include <cstdlib> #include <vector> #include <limits.h> #include <utility> #include <chrono> #include <math.h> using namespace std; const int BOARD_SIDE = 10000; const int SAMPLE_SIZE = 25 * log2(BOARD_SIDE); const int CAP_ZEROS = 2 * log2(BOARD_SIDE); typedef vector<vector<int...