text stringlengths 8 6.88M |
|---|
#include<bits/stdc++.h>
using namespace std;
class Solution
{
public:
int firstMissingPositive(vector<int> &nums)
{
const size_t size = nums.size() + 1;
int *array_of_int = new int[size]();
for (const auto num : nums)
{
if (num > (int)size - 1 || num < 1)
... |
#include <iostream>
#include <algorithm> // for copy
#include <iterator> // for ostream_iterator
#include <vector>
using namespace std;
class candidateType {
private:
string candidateName;
int votes;
public:
candidateType(){
candidateName = "";
votes = 0;
}
candidateType(string... |
#pragma once
#include "SCCommon.h"
#include <memory>
namespace SL {
namespace Screen_Capture {
struct CGFrameProcessorImpl;
class CGFrameProcessor {
std::unique_ptr<CGFrameProcessorImpl> _CGFrameProcessorImpl;
public:
CGFrameProcessor();
~CGFrameProcessor... |
#include <iostream>
#include <string>
int main(void)
{
using namespace std;
struct Pizza{
string company;
double diameter;
double weight;
};
Pizza p;
cout << "Enter company name: ";
getline(cin, p.company);
cout << "Enter diameter of pizza: ";
cin >> ... |
#ifndef _OPENCV_FLANN_PRECOMP_HPP_
#define _OPENCV_FLANN_PRECOMP_HPP_
#include <cstdio>
#include <cstdarg>
#include <sstream>
#include "../../opencvlib/flann/miniflann.hpp"
#include "../../opencvlib/flann/dist.h"
#include "../../opencvlib/flann/index_testing.h"
#include "../../opencvlib/flann/params.h"
#include "../.... |
#include "StringOperations.h"
/*
* Responsible for converting "{" and "}" to bitstring 0 and 1 respectively
*
* @param wellFormedString: string consisting of "{" and "}"
* @param return: bistring due to processing wellFormedString
*/
string getBinaryString(string wellFormedString)
{
string bitString = "";
for(int ... |
#include "stdafx.h"
int main(int argc, char* argv[])
{
int a,b,c;
scanf("%d,%d,%d",&a,&b,&c);
if(a>=b)
b=a;
else c>=b;
b=c;
printf("%d\n",b);
return 0;
}
|
class LepszyStos : public Stos
{
pop();
};
|
// Author: Jason Lunt
// Assignment: Program3
// File: stack.h
// Instructor: Dr. Reza Sanati
// Class: CS 2420 Section: 003
// Date: 22 September 2015
// Description: Class to create custom stacks.
//
#ifndef stack_h
#define stack_h
#ifndef FINISHCODE
#define FINISHCODE
enum FinishCode{success, underflow, ... |
#pragma once
#include "Texture.h"
class Texture3D : public Texture
{
public:
Texture3D(void);
~Texture3D(void);
//////////////////////////////////////////////////////////////////////////
// Accessors
ID3D11Texture3D* GetTexture(void) { return m_pTexture; }
/////////////////////////////////////////////... |
#ifndef SAY_H
#define SAY_H
#include <string>
#include <stdexcept>
using std::string;
namespace say {
string in_english(unsigned long long number);
string hundreds(unsigned long long number);
void erase(unsigned long long &number1, unsigned long long number2);
}
#endif SAY_H |
#ifndef __QCLOUD_SIGN_H__
#define __QCLOUD_SIGN_H__
#include <string>
#include "qcloud_sign_const.h"
/*
* @func 服务端签名函数,APP级别,有效期expired内使用
* @param appid 腾讯云APPID
* @param secret_id Qcloud上申请到的密钥id
* @param secret_key Qcloud上申请到的密钥key
* @param expired 过期时间(绝对时间)
* @param u... |
// This file has been generated by Py++.
#include "boost/python.hpp"
#include "generators/include/python_CEGUI.h"
#include "RegexMatchStateEventArgs.pypp.hpp"
namespace bp = boost::python;
void register_RegexMatchStateEventArgs_class(){
{ //::CEGUI::RegexMatchStateEventArgs
typedef bp::class_< CEGUI::Re... |
#include "CommonHeader.h"
ScoreSensor::ScoreSensor(Scene* pScene, std::string name, Vector3 pos, Vector3 rot, Vector3 scale, Mesh* pMesh, ShaderProgram* pShader, GLuint texture, vec2 aUVScale, vec2 aUVOffset,
const char* aCameraName, unsigned int aDrawRenderOrder):
GameObject(pScene,name,pos,rot,scale,pMesh,pShader... |
#pragma once
#pragma comment(lib, "ws2_32")
#include <iostream>
#include <WinSock2.h>
#include <sqlext.h>
#include <DirectXMath.h>
#include <DirectXPackedVector.h>
using namespace DirectX;
using namespace DirectX::PackedVector;
#define UNICODE
void show_error(SQLHANDLE, SQLSMALLINT, RETCODE); |
#include <iostream>
#include <cmath>
using namespace std;
//prototipo da funcao
double areaQuadrado (double l);
int main ()
{
double lado;
cout<<"Digite o valor do lado do quadrado: "<<endl;
cin>>lado;
cout<<"A area do quadrado de lado "<<lado<<" e: "<<areaQuadrado(lado);
return 0;
}
// funcao que calcula... |
// Rate of precipitation input in m3/s
double p= inputExt(precip) * paramNum(fac_precip) / 1000. / delta_t *
paramNum(area_max);
// Rate of evaporation loss in m3/s
double e= lakeEvap_makkink(inputExt(tavg), inputExt(glorad)) *
paramFun(h2a, paramFun(v2h,u[INDEX_v]));
// Estimation of inflow rates at begin and e... |
/**
* Copyright 2016-2017 MICRORISC s.r.o.
*
* 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... |
// Copyright ⓒ 2020 Valentyn Bondarenko. All rights reserved.
#pragma once
#include <File.hpp>
#include <Sound.hpp>
#include <filesystem>
namespace be::sound
{
class Sound2D : public Emyl::Music, public Sound, public File
{
public:
Sound2D(const std::string& file_name)
... |
/*
* Pinky.h
*
* Created on: May 19, 2017
* Author: muhammadhassnain
*/
#ifndef PINKY_H_
#define PINKY_H_
#include "Enemy.h"
#include<iostream>
using namespace std;
class Pinky: public Enemy {
int position_x;
int position_y;
int targetX,targetY;
int enemyNumber;
Point target;
public:
Pinky(int [][17]... |
// This file has been generated by Py++.
#ifndef Scheme_hpp__pyplusplus_wrapper
#define Scheme_hpp__pyplusplus_wrapper
void register_Scheme_class();
#endif//Scheme_hpp__pyplusplus_wrapper
|
#pragma once
#include "Person.h"
#include"Seller.h"
class Visitor :
public Person
{
private:
double cash;
public:
void Info();
Visitor();
Visitor(const std::string& v_name, double v_cash);
void SetCash(double v_n);
double GetCash();
~Visitor();
};
|
#include <dirent.h>
#include <stdlib.h>
#include <stdio.h>
#include "../include/utils.h"
char **
get_all_files_in_directory(const char *path)
{
DIR *d;
struct dirent *dir;
char **ret = NULL;
unsigned int num_files = 0, index = 0;
/* we do a single pass first to get the size
*/
d = opendir(path);
if ... |
#ifndef __CLUCK2SESAME_PLATFORM_ARITHMETICBCD_INC
#define __CLUCK2SESAME_PLATFORM_ARITHMETICBCD_INC
#include "Platform.inc"
#include "GeneralPurposeRegisters.inc"
radix decimal
.module ARITHMETICBCD
extern addBcd
extern bcdToBinary
extern binaryToBcd
#endif
|
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
// #define DEBUG
const int maxn = 100005;
int expectPrice, factoryPrice, factoryAmount, decreaseAmount, saleAmount[maxn];
int main() {
#ifdef DEBUG
freopen("d:\\input.txt", "r", stdin);
freopen("d:\\output.txt", "... |
//----------------------------------------------------------------------------//
// CONTROL THREAD CLASS //
//----------------------------------------------------------------------------//
// Author: Łukasz Korbel, e-mail: korbel85@gmail.com ... |
//
// 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_WEBUI_ROUTE_MAP_HPP
#define NBDL_FWD_WEBUI_ROUTE_MAP_HPP
#include <mpdef/pair.hpp>
#include <mpdef/utility.hpp>... |
#ifndef FASTCG_GRAPHICS_UTILS_H
#define FASTCG_GRAPHICS_UTILS_H
#include <FastCG/Core/Macros.h>
#include <FastCG/Core/Enums.h>
#include <cstdint>
#include <cassert>
namespace FastCG
{
struct BitsPerChannel
{
union
{
uint8_t r;
uint8_t depth;
};
union
... |
// by thaiph99
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for (ll i = a; i <= b; i++)
#define FORR(i, a, b) for (ll i = a; i >= b; i--)
#define iosb \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
const int nax... |
/*
Copyright (c) 2011 Andrew Wall
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, distribute, sub... |
#pragma once
#include <QObject>
#include <QAbstractItemModel>
#include <QHash>
class SshSFtp;
class SshFilesystemNode;
class SshFilesystemModel : public QAbstractItemModel
{
SshSFtp *m_provider;
SshFilesystemNode *m_rootItem;
QModelIndex m_root;
QHash<int, QByteArray> m_roles;
public:
enum Roles... |
/**
* @file graph_tester.cpp
* @brief Implementation for GraphTester methods
*
* @author Gabriel Shelton sheltongabce
* @date 02-18-2019
* @version 0.1
*/
#include <algorithm>
#include "graph_tester.h"
//
// test()
//
void GraphTester::test() {
auto testGraph = GraphFileHandler<int>::readGraph("data.dat")... |
#ifndef CAVE_H
#define CAVE_H
#include <places/outdoor.h>
#include <characters/vampire.h>
#define N_ANIMALS_CAVE 1
#define CAVE_MAX_POPULATION 2
namespace lab3
{
namespace places
{
class Cave : public Outdoor
{
public:
Cave(const std::string &name);
void generateObjects();
void createCharacters();
... |
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <limits>
#define INF 1000000001
using namespace std;
struct Node
{
long startIndex, endIndex, rangeMinimum;
};
void createTree(Node tree[], long arr[], long currentIndex, long startIndex, long endIndex)
{
if (startIndex > endIndex)
{
return;
}
... |
/**
* Checked container for passing return codes.
*/
#ifndef FISHY_STATUS_H
#define FISHY_STATUS_H
#include <CORE/BASE/checks.h>
#include <string>
namespace core {
namespace base {
/**
* Checked error status return value.
*/
class Status {
public:
/**
* Generic error codes.
*/
enum eError {
// T... |
#include "Algorithm.h"
Algorithm::Algorithm()
{
}
void swap(int &a, int &b){
int tmp = a;
a = b;
b = a;
}
void Algorithm::interchangeSort(vector<int> data){
for (int i = 0; i < data.size() - 1; i++){
for (int j = i + 1; j < data.size(); j++)
if (data[i] < data[j]) swap(data[i], data[j]);
}
}
int Algorith... |
#ifndef GAME_SCREEN_H_INCLUDED
#define GAME_SCREEN_H_INCLUDED
#include "screen.h"
#include <vector>
#include "gameobjects/player/player.h"
#include "rectangle.h"
#include "gameobjects/level/level.h"
#include "gameobjects/weapons/weaponbox.h"
#include "gameobjects/weapons/explosion.h"
#include "rendering/camera.h"
str... |
#include "MissionImpossible/mission_impossible_tape.hpp"
#include "MissionImpossible/ad.hpp"
#include "MissionImpossible/derivatives.hpp"
#include <gtest/gtest.h>
using namespace MissionImpossible;
TEST(MissionImpossible_Tape, construction)
{
MissionImpossible_Tape<double> mark;
EXPECT_EQ(mark.size(), 0);
}
TE... |
#include <iostream>
#include <string>
#include "Player.h"
#include "Card.h"
using namespace std;
// Class :: Constructor
Player::Player(string name){
_name = name;
}
Player::~Player(){
}
// В теле ф-ии записываем адрес card в позицию _cardsCount : _cards[_cardsCount] = card; и
// увеличиваем счетчик _cardsCo... |
// lzwdecod.cpp - LZW decoder
// (c) 1996, 2020 Michael Fink
// https://github.com/vividos/OldStuff/
// Original header:
// DECODE.C - An LZW decoder for GIF
// Copyright (C) 1987, by Steven A. Bennett
//
// Permission is given by the author to freely redistribute and include
// this code in any program as long as thi... |
#ifndef SPINPSTRUCTCONTAINER_H
#define SPINPSTRUCTCONTAINER_H
#include <string>
#include <vector>
class SpinPStructContainer
{
public:
// construction phase
SpinPStructContainer(std::string name);
SgClassDeclaration * contructASTNodes();
SgClassDeclaration * getStructSubTree();
void addVariable(SgVariableDeclar... |
#include <stdio.h>
int main() {
int max_cnt = -1;
long long max_value = 0;
int cnt[1000000];
cnt[1] = 1;
for(long long i=2;i<=1000000;i++) {
long long num = i;
int count = 0;
while(1) {
if(num < i) {
count += cnt[num];
if(count > max_cnt) {
max_cnt = count;
max_value = i;
}
c... |
/*
===============================================================================
Name : main.c
Author : $(author)
Version :
Copyright : $(copyright)
Description : main definition
===============================================================================
*/
#if defined (__USE_LPCOPEN)
#if... |
#ifndef __JFLIB_MAIN_HPP__
#define __JFLIB_MAIN_HPP__
#include <jflib/error.hpp>
#include <jflib/obj2str.hpp>
#include <jflib/oper.hpp>
#include <jflib/container.hpp>
#include <jflib/stringutils.hpp>
#endif // __JFLIB_MAIN_HPP__
|
#include <iostream>
#include <slamviewer.h>
#include <vec2.h>
#include <vecn_std.h>
#include <vecn_flexible.h>
#include <slam_sim.h>
#include <vecn_logging.h>
#include <slam.h>
#include <linspline.h>
using namespace Slam;
using namespace Slam::gui;
using Common::submat;
using Common::submatflex;
using Common::vec2d;
u... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QWidget>
#include <QPlainTextEdit>
#include <QLineEdit>
#include <QPushButton>
#include <QLabel>
#include <QString>
#include "TcpServer.h"
class MainWindow : public QWidget
{
Q_OBJECT
private:
QString m_msgStr;
TcpServer* m_tcpServer;
QLineEdit* m_... |
//
// random.hpp
// vulpes
//
// Created by lcl on 2018/7/19.
// Copyright © 2018 lcl. All rights reserved.
//
#ifndef random_hpp
#define random_hpp
#include <random>
using namespace std;
namespace vulpes {
template <typename T>
T random(T min, T max) {
random_device rd;
default_random_e... |
#ifndef SKP_MODEL_HPP
#define SKP_MODEL_HPP
#include "common.hpp"
#include <SketchUpAPI/model/model.h>
#include "entities.hpp"
#include "material.hpp"
#include "component_definition.hpp"
typedef struct {
PyObject_HEAD
SUModelRef _su_model;
PyObject* entities;
} SkpModel;
static void SkpModel_dealloc(SkpModel... |
/* Copyright 2017-2018 All Rights Reserved.
* Gyeonghwan Hong (redcarrottt@gmail.com)
*
* [Contact]
* Gyeonghwan Hong (redcarrottt@gmail.com)
*
* 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 Lic... |
#include<cstdio>
#include<vector>
using namespace std;
const int MAX_V = 1000000;
int V;
vector<int> G[MAX_V]; // adjacent list
vector<int> rG[MAX_V]; // reverse of G
vector<int> vs; // post order
bool used[MAX_V]; // visited?
int cmp[MAX_V]; // topological order of belonging SCC
void add_edge(int from, int to){
... |
#pragma once
#include <string>
#include <unordered_map>
#include <vector>
#include <tuple>
#include "tangible_filesystem.h"
using namespace EngineLayer;
using namespace EngineLayer::FdrAnalysis;
using namespace EngineLayer::Localization;
using namespace MassSpectrometry;
using namespace MzLibUtil;
using... |
#include <iostream>
using namespace std;
void func1(int a, int b)
{
cout << "a = " << a << ", b = " << b << endl;
}
int func2(int a, int b)
{
cout << "a = " << a << ", b = " << b << endl;
return a + b;
}
int main(int argc, char *argv[])
{
bind(func1, 10, 20)();
bind(func2, std::placeholders::_1,... |
//Дан массив размера N, все элементы которого, кроме первого, упорядочены по возрастанию.Сделать массив упорядоченным, переместив первый элемент на новую позицию.
#include <iostream>
#include <locale.h>
using namespace std;
int main()
{
int N, i, t, j;
setlocale(LC_ALL, "Rus");
j = 0;
cout << "введите N>>";
ci... |
#include "SingleFileEventArgs.h"
#include "stringhelper.h"
namespace EngineLayer
{
SingleFileEventArgs::SingleFileEventArgs(const std::string &writtenFile, std::vector<std::string> &nestedIds) : MyRecursiveEventArgs(nestedIds)
{
setWrittenFile(writtenFile);
}
std::string SingleFileEvent... |
/*
* ili9325.cpp
*
* Created: 17.06.2015 9:21:13
* Author: User
*/
#include "ili9325.h"
// default constructor
ili9325::ili9325()
:pinDataLow (Gpio::B) , pinDataHigh (Gpio::D) , pinCommand (Gpio::C)
{
pinDataLow.setDirPort(0xFF);
pinDataHigh.setDirPort(0xFF);
pinCommand.setDirPin(CS);
pinCommand.setDirPin(RS); ... |
#include "GameWorld.h"
#include "Vehicle.h"
#include "constants.h"
#include "Obstacle.h"
#include "2D/geometry.h"
#include "2D/Wall2D.h"
#include "2D/Transformations.h"
#include "SteeringBehaviors.h"
#include "misc/Smoother.h"
#include "ParamLoader.h"
#include "misc/Stream_Utility_Functions.h"
#include <QKeyEvent>
#inc... |
/*
* GeraMega_V1.0.cpp
*
* Created on: 26 de fev de 2018
* Author: kryptonian
*/
#include <iostream>
using namespace std;
int main(){
}
|
#include <iostream>
#include "TRandom3.h"
#include "percettrone.h"
void p_clf::set_weights(){
//inizializza random il vettore dei pesi
TRandom3* gen = new TRandom3();
for(int i = 0; i < dimension+1; i++){
weights.push_back(gen->Uniform(0,1));
}
return;
}
int p_clf::predict(double x, dou... |
#pragma once
#ifndef HASH_H_INCLUDED
#define HASH_H_INCLUDED
#include "StringGenerator.h"
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <iomanip>
#include <chrono>
#include <algorithm>
#include <numeric>
using std::cout;
using std::cin;
using std::endl;
usin... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.Storage.Streams.0.h"
#include "Windows.Foundation.0.h"
#include "Windows.Storage.0.h"
#include "Windows.Foundation.1.h"
WINRT_EXPORT namespace winrt {
n... |
/**
* $Source: /backup/cvsroot/project/pnids/zdk/zls/zlang/ZLangException.hpp,v $
*
* $Date: 2001/11/14 19:03:08 $
*
* $Revision: 1.3 $
*
* $Name: $
*
* $Author: zls $
*
* Copyright(C) since 1998 by Albert Zheng - 郑立松, All Rights Reserved.
*
* lisong.zheng@gmail.com
*
* $State: Exp $
*/
#ifndef _ZLS_... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
pair<int,int>p1={1,2};
cout<<p1.first<<"\n";
cout<<p1.second<<"\n";
pair<int,pair<int,int>>p2={3,{4,5}};
cout<<p2.first<<"\n";
cout<<p2.second.first<<"\n";
cout<<p2.second.second<<"\n";
pair<int,int>arr[]={{... |
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
for(int k = 1; k <= t; k ++){
int n;
cin >> n;
vector<pair<int, int>>timber(n);
for(int i = 0; i < n; i ++){
cin >> timber[i].first >> timber[i].second;
}
map<long long, long... |
#include<bits/stdc++.h>
using namespace std;
vector< pair<int,int> > v;
int d[3000];
int sum = 0;
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
int val,c,f,u;
scanf("%d %d %d %d",&val,&c,&f,&u);
sum += val;
int need = (c+f+u)/2 - c + 1;
if(need<=u) v.push_back({val,max(need,0)});
... |
#ifndef PROCESS_H
#define PROCESS_H
#include <iostream>
#include "visitors/typechecker.h"
#include "visitors/livenesschecker.h"
#include "visitors/constantfolder.h"
#include "visitors/ictranslator.h"
#include "visitors/codegenerator.h"
#include "symboltable.h"
#include "tinyparser.h"
#include "parseargs.h"
using nam... |
#include "FdrCategory.h"
using namespace Proteomics;
using namespace Proteomics::ProteolyticDigestion;
namespace EngineLayer
{
}
|
#pragma once
#include <xtl.h>
class CXBLight
{
private:
float position_x;
float position_y;
float position_z;
float ambient_r;
float ambient_g;
float ambient_b;
float diffuse_r;
float diffuse_g;
float diffuse_b;
float specular_r;
float specular_g;
float specular_b;
float attenuation_0;
float attenua... |
/*
* Copyright (C) 2015 The Android Open Source Project
*
* 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 app... |
/********************************************************************************
Copyright (c) 2012, Francisco Claude.
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 source co... |
#include<iostream>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<string>
/**BINARY TREE (FAMILY TREE) **/
using namespace std;
class family
{
string name;
public:
family *left;
family *right;
string names()
{
return name;
}
family(string names... |
/***********************************************************************
created: Jan 11 2006
author: Tomas Lindquist Olsen
purpose: Implements interface for the WindowRenderer base class
*************************************************************************/
/*********************************... |
/*
* Copyright 2015-2016 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "licen... |
#pragma once
#include <QtCore/QtCore>
#include <QTreeWidget>
#include <QObject>
#include "yaml-cpp/yaml.h"
#if DEBUG
#pragma comment(lib,"yaml-cppd.lib")
#else
#pragma comment(lib,"yaml-cpp.lib")
#endif
#include <QTextEdit>
#include <QTimer>
#include <QSlider>
#include <QLineEdit>
class QMyTextEdit : public QTextEdi... |
/*
* SPDX-FileCopyrightText: (C) 2013-2022 Daniel Nicoletti <dantti12@gmail.com>
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef CUTELYST_ACTION_H
#define CUTELYST_ACTION_H
#include <Cutelyst/component.h>
#include <Cutelyst/context.h>
#include <Cutelyst/cutelyst_global.h>
#include <QtCore/QMetaMethod>
#include ... |
#include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
bool isperfect_number(int n)
{
int sum = 0;
for (int i = 1; i <= n / 2; i++) {
if (n % i == 0) {
sum += i;
}
}
return sum == n;
}
int main()
{
for (int i... |
//
//功能: 求一个byte数字对应的二进制数字中1的最大连续数,例如3的二进制为00000011,最大连续2个1
//
// 输入 : 一个byte型的数字
//
// 输出 : 无
//
// 返回 : 对应的二进制数字中1的最大连续数
#if 0
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int n = 0;
cin >> n;
int maxCount = 0, count = 0;
while (n)
{
if (n & 1)
{
count++;
maxCount = max(ma... |
//Jason Strange
//CS222-01-13W
#include "PrintItem.h"
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
//creates a new PrintItem
PrintItem::PrintItem(int a, int b, int c){
startTime = c;
duration = b;
actualTime = a;
}
//sets the starting time
void PrintItem::setStart(i... |
#include<glad/glad.h>
#include<GLFW/glfw3.h>
#include<iostream>
#include"Shader.h"
#include"Help.h"
#include"Texture.h"
#include"Matirx.h"
#include"Camera.h"
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
{
glViewport(0, 0, width, height);
}
float deltaTime = 0.0f;
float lastFrame = 0.0f;
... |
#include "SettingScene.h"
USING_NS_CC;
USING_NS_CC_EXT;
using namespace ui;
SettingScene::SettingScene()
{
}
SettingScene::~SettingScene()
{
}
CCScene* SettingScene::scene()
{
CCScene* scene = CCScene::create();
SettingScene* layer = SettingScene::create();
scene->addChild(layer);
return scene;
}
bool Settin... |
// Sum of first n natural numbers
#include<iostream>
using namespace std;
int sum(int n){
return (n*(n+1)/2);
}
int main(){
int n;
cin>>n;
cout<<sum(n);
return 0;
}
|
// Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "leveldb/lg_coding.h"
#include "util/coding.h"
namespace leveldb {
const std::string KG_PREFIX = "//LG_ID//";
void PutFixed32LGId(std::string *... |
/*
* File: main.cpp
* Author: Leonardo
*
* Created on 5 de Agosto de 2015, 18:34
*/
#include <cstdlib>
#include <iostream>
#include "Eventos2.h"
#include "Buffer2.h"
#define TAM_PREF 256
typedef bool bit;
using namespace std;
/* MAIN */
int main(int argc, char** argv) {
Buffer2 *t... |
#include <bits/stdc++.h>
#include <cassert>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ok() puts(ok?"Yes":"No");
template<class T> bool chmax(T &a, const T &b) { if(a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if(a > b) { a = b; return true; } return false;... |
#include <iostream>
#include <cstdio>
#include <stack>
#include <cstring>
using namespace std;
char str[205];
// 下面的两个用枚举和二维数组来处理更漂亮
// 把运算符映射成数字入栈
int change(char c)
{
if (c == '+')
return 1;
if (c == '-')
return 2;
if (c == '*')
return 3;
if (c == '/')
return 4;
... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "base.h"
WINRT_WARNING_PUSH
#include "internal/Windows.Phone.ApplicationModel.3.h"
WINRT_EXPORT namespace winrt {
namespace impl {
template <typename D>
struct produce<D, Windows::... |
#include<iostream>
using namespace std;
template<typename T>
struct QueueNode {
T data;
QueueNode<T>* pred;
QueueNode<T>* succ;
QueueNode() {};
QueueNode(T value, QueueNode<T>* p = NULL, QueueNode<T>* s = NULL) {
data = value;
pred = p;
suss = s;
}
};
template<typename T>
struct Queue {
public:
int _size... |
#include <bits/stdc++.h>
using namespace std;
/**
Note: instead of using vector<int> &a to use the same vector<int> in all funciton calls
other way is to define vector<int> a as global variable, then no need to pass it
with function call, since every function knows it.
See 'find the median' solution.
**/
void print... |
#include "avlbst.h"
#include "gtest/gtest.h"
class TreeTest : public testing::Test {
protected:
// You can remove any or all of the following functions if its body is empty.
TreeTest() {
// You can do set-up work for each test here.
}
virtual ~TreeTest() {
// You can do clean-up work that doesn't throw excep... |
#include "mainwindow.h"
#include "screenfactory.h"
#include <QScreen>
#include <QApplication>
#include <QException>
#include <QThread>
#include <QDir>
#include "mediaplayer.h"
#include "client_impl.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent) {
try {
container = new QStackedWidget... |
/*=========================================================================
Program: Visualization Toolkit
Module: vtkLagrangeCurve.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software i... |
#pragma once
#include "Encoder.h"
#include "PwmIn.h"
namespace Encoder {
class MAE3 final : public Encoder {
public:
typedef struct Config {
PinName pwm;
float offsetDeg;
} Config;
MAE3(const Config &config);
MAE3(MAE3 &) = delete;
MAE3(MAE3 &&) = delete;
~MAE3() = default;
bool getAng... |
#include<iostream>
using namespace std;
int remainder (int x) {
return x % 11;
}
int main () {
int x;
cout << "Put a value:";
cin >> x;
cout << remainder(x) << endl;
return 0;
}
|
/*
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... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... |
#pragma once
#include "ofMain.h"
#include <wchar.h>
#include <direct.h>
#include "pxccapture.h"
#include "pxcsensemanager.h"
#include "pxccapturemanager.h"
#include "pxchandcursormodule.h"
#include "pxccursordata.h"
#include "pxchandconfiguration.h"
#include "pxchanddata.h"
#include "pxchandmodule.h"
#include "ofxI... |
#include "common\Singularity.Common.h"
namespace Singularity
{
class Timer
{
private:
#pragma region Variables
double m_dSecondsPerCount;
__int64 m_iStartTime;
__int64 m_iCurrTime;
bool m_bStopped;
#pragma endregion
public:
#pragma region Properties
const float Get_El... |
#pragma once
#include <stdio.h>
#include <iostream>
#include <queue>
#include <thread>
#include <mutex>
#include <opencv2/opencv.hpp>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
using namespace std;
using namespace cv;
class CaptureThrea... |
#include <stdio.h>
#include <stdint.h>
#include <iostream>
#include <math.h>
#include <ros/console.h>
#include <boost/circular_buffer.hpp>
#include <boost/foreach.hpp>
#include "ros/ros.h"
#include "tf/transform_broadcaster.h"
#include "std_msgs/String.h"
#include "std_msgs/UInt8.h"
#include "bilibot_node/MotorState.h"... |
#include "CB_TimeWalk.h"
#include "expconfig/ExpConfig.h"
#include "expconfig/detectors/CB.h"
#include "base/Logger.h"
#include "TObjArray.h"
using namespace std;
using namespace ant;
using namespace ant::analysis::physics;
CB_TimeWalk::CB_TimeWalk(const string& name, OptionsPtr opts) :
Physics(name, opts)
{
... |
/**
* 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
*
* ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.