text stringlengths 8 6.88M |
|---|
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
ifstream f("date.in");
class text
{
private:
int frecventa;
int lungime;
int index;
public:
text(int frecventa,int lungime,int index) : lungime(lungime),frecventa(frecventa),index(index){};
int Get_lu... |
#ifndef _HS_SFM_FEATURE_MATCH_EPIPOLAR_MATCHES_FILTER_HPP_
#define _HS_SFM_FEATURE_MATCH_EPIPOLAR_MATCHES_FILTER_HPP_
#include "hs_sfm/sfm_utility/match_type.hpp"
#include "hs_sfm/sfm_utility/key_type.hpp"
namespace hs
{
namespace sfm
{
namespace feature_match
{
template <typename _Scalar>
class EpipolarMatchesFilt... |
#include "../headers/operateurdiv.h"
const OperateurDiv& OperateurDiv::evaluate(Pile& pile) const
{
if (pile.taille() >= getArite()) {
try
{
dynamic_cast<Entier&>(pile.top());
}
catch(exception&)
{
throw ComputerException("Erreur : mauvais arguments")... |
Testing github push privileges
Testing resolving a conflict
|
//
// NodeExporter.h
// FbxAwdExporter
//
// Created by Pierre Lepers on 04/11/2014.
//
//
#ifndef __FbxAwdExporter__NodeExporter__
#define __FbxAwdExporter__NodeExporter__
#include <awd/awd.h>
#include <fbxsdk.h>
#include "ExportContext.h"
//This class is a custom writer.
//The writer provide you the ability to ... |
#pragma once
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include "vec3.h"
#include "ray.h"
#include <utility>
// __host__ __device__ inline float ffmin(float a, float b) { return a < b ? a : b; }
// __host__ __device__ inline float ffmax(float a, float b) { return a > b ? a : b; }
class aabb
{... |
#include <cstdio>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iostream>
using namespace std;
int nprime[1009];
vector<int>prime;
void sieve()
{
//p=1;
int x=1000;
int i,j,k,sq;
prime.push_back(1);
prime.push_back(2);
sq=sqrt(x)+1;
for(i=4;i<=x;i+=2)
nprime[i]=1... |
#include<bits/stdc++.h>
using namespace std;
vector<vector<int> >getRes(vector<vector<int> > & intervals)
{
int n = intervals.size();
vector<vector<int> > res;
vector<int> starts,ends;
for(int i = 0; i < n; i++) {
starts.push_back(intervals[i][0]);
ends.push_back(intervals[i][1]);
... |
/*
sleep() fugveny standby-ba rakja a programot,
mivel ez egy vegtelen ciklusban van meghivva,
ezert a program vegig sleep-elni fog,ezert 0%-ban terheli a gepet
*/
#include <unistd.h>
#include <stdio.h>
using namespace std;
int main()
{
for(;;)Sleep(1);
return 0;
}
|
#pragma once
#include <array>
#include <d3d11_2.h>
#include <dxgi1_3.h>
#include <wrl/client.h>
namespace GraphicsEngine
{
/**
* This class was based on the RasterTek tutorial 3: Initializing DirectX 11.
* URL: http://www.rastertek.com/dx11s2tut03.html
*/
class D3DBase
{
public:
explicit D3DBase(HWND out... |
#ifndef MATCHHISTORYWIDGET_H
#define MATCHHISTORYWIDGET_H
#include <QWidget>
#include <QImage>
#include <QPixmap>
#include <QLabel>
#include <QList>
#include "../CommonFiles/GameResultInfo.h"
#include "VerticalScroller.h"
#include "../Labels/ButtonLabel.h"
#include <QEventLoop>
class MatchHistoryWidget : public QWidge... |
/*
// Definition for a Node.
class Node {
public:
int val;
Node* left;
Node* right;
Node* parent;
};
*/
class Solution {
public:
Node* inorderSuccessor(Node* node) {
// inorder successor can be parent, right, or null
// for node, if having right child => leftmost of right-child
... |
// Copyright 2015 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 "media/cdm/external_clear_key_test_helper.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
... |
// Copyright 2019 Apex.AI, Inc.
//
// 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 i... |
/*
* Copyright (c) 2015 RF Digital Corp. All Rights Reserved.
*
* The source code contained in this file and all intellectual property embodied in
* or covering the source code is the property of RF Digital Corp. or its licensors.
* Your right to use this source code and intellectual property is non-transferable,
... |
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
#define MAX 100000
#define type long long
struct node
{
char num[7];
char name[10];
int score;
} a[MAX];
bool cmp1(node a,node b)
{
return strcmp(a.num,b.num)<0;
}
bool cmp2(node a,node b)
{
if(strcm... |
#ifndef _HS_SFM_ESSENTIAL_EMATRIX_5_POINTS_CALCULATOR_HPP_
#define _HS_SFM_ESSENTIAL_EMATRIX_5_POINTS_CALCULATOR_HPP_
#include <utility>
#include <limits>
#include <vector>
#include "hs_math/linear_algebra/eigen_macro.hpp"
#include "hs_math/polynomial/multi_polynomial.hpp"
namespace hs
{
namespace sfm
{... |
#include<cstdio>
#include<iostream>
#include<vector>
using namespace std;
vector<int> findAnagrams(string s, string p) {
int lens = s.size();
int lenp = p.size();
vector<int> str_s(26,0),str_p(26,0);
vector<int> res;
int l = 0,r = 0;
for(int i = 0; i < lenp; i++) {
str_p[p[i]-'a']++;
... |
// includes
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <string.h>
#include <WiFiUdp.h>
#include "WifiHandler.h"
#include "ArduinoCommHandler.h"
#include "Display.h"
// variables
WiFiEventHandler stationDisconnectedHandler;
const unsigned int localUdpPort = 8888;
WiFiUDP Udp;
boolean udpConnected = fal... |
#ifndef FAMILYRUNNER_H
#define FAMILYRUNNER_H
class Person
{
public:
short year;
char lastName[12];
char firstName[12];
char gender;
}; // class Person
class Family
{
public:
Person person;
Person spouse;
Person children[7];
short childCount;
};
class Query
{
public:
Perso... |
#include "CIL/alloc.h"
#include "CIL/string.h"
#include "CIL/util.h"
namespace cil {
char* String::allocate(size_t len) {
size_t totalsize = alignSize(len + 1, (int)sizeof(int));
int* data = (int*)fastMalloc(totalsize + sizeof(int));
data[0] = 1;
cstr_ = (char*)(data + 1);
len_ = len;
cstr_[len] = 0;
re... |
/*Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, … shows the first 11 ugly numbers. By convention, 1 is included. Write a program to find Nth Ugly Number.
*/
#include <bits/stdc++.h>
using namespace std;
bool checkUgly(int num)
{
// cout << num <... |
// SPDX-License-Identifier: LGPL-2.1
/*
* Copyright (C) 2018 VMware Inc, Yordan Karadzhov <ykaradzhov@vmware.com>
*/
/**
* @file KsQuickContextMenu.cpp
* @brief Quick Context Menus for KernelShark.
*/
#include "KsQuickContextMenu.hpp"
#include "KsTraceGraph.hpp"
/**
* @brief Create KsQuickMarkerMenu.
... |
// DP solution
class Solution {
public:
bool canJump(vector<int>& nums) {
if(nums.empty() || nums.size() == 1) return true;
int n = nums.size();
vector<int> dp(n, 0);
dp[0] = nums[0];
for(int i = 1; i < nums.size(); i++)
{
if(dp[i - 1] - 1 < 0)
... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void ipop(){
#ifndef ONLINE_JUDGE
freopen("../input.txt","r",stdin);
freopen("../op.txt","w",stdout);
#endif
}
void solve(){
ll n,k;
cin>>n>>k;
vector<ll>a(n),dp(k+1,0);
for(ll i=0;i<n;i++) cin>>a[i];
for(ll i=1;i<=k;i++){
for(ll j=0;j<... |
class Solution {
public:
struct TrieNode {
TrieNode * child[26];
string str;
TrieNode() : str("") {
for (auto & a : child) a = nullptr;
}
};
struct Trie {
TrieNode * root;
Trie(): root(new TrieNode()) {};
void insert(string word) {... |
/**
* @file robust.h
* @brief Robust estimator functionality.
* @author Michael Kaess
* @version $Id: robust.h 6377 2012-03-30 20:06:44Z kaess $
*
* Copyright (C) 2009-2013 Massachusetts Institute of Technology.
* Michael Kaess, Hordur Johannsson, David Rosen,
* Nicholas Carlevaris-Bianco and John. J. Leonard
... |
//
// DealCardManager.hpp
// demo_ddz
//
// Created by 谢小凡 on 2018/2/16.
//
#ifndef DealCardManager_hpp
#define DealCardManager_hpp
#include "GameManager.hpp"
#include "CardAlignConfig.hpp"
class UICard;
class DealCardManager : public cocos2d::Node
{
public:
enum ShuffType {
RANDOM
};
CREATE_F... |
#pragma once
//#include "Weapons/Weapon.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "StaticFunctionLibrary.generated.h"
UCLASS()
class SPOOL_API UStaticFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
};
|
/**
* 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
*
* ... |
/*************************************************************
* > File Name : P3366.cpp
* > Author : Tony
* > Created Time : 2018年12月21日 星期五 19时56分38秒
**************************************************************/
/* Prim */
#include<bits/stdc++.h>
using namespace std;
int n, m, ans, _map... |
#include "tinyxml.h"
#include <sstream>
#include <iostream>
#include <string>
#include <vector>
//------------- VTK ---------------------
#include <vtkVersion.h>
#include <vtkSmartPointer.h>
#include <vtkImageData.h>
#include <vtkPointData.h>
#include <vtkPolyData.h>
#include <vtkPolyDataNormals.h>
#include <vtkPoly... |
// by thaiph99
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++)
#define FORR(i, a, b) for (ll i = a; i >= (ll)(b); i--)
#define iosb ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
iosb;
}
|
/*
* 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/Singleton>
#include <flux/xml/XmlSyntax>
namespace flux {
namespace xml {
XmlSyntax::XmlSyntax()
{
SYNTAX("xml");
DEFINE_VOID("Gap",
... |
#include "camera.h"
#include "gamewindow.h"
#include "Actor.h"
template <typename T>
void DebugLog(T value) {
std::ostringstream ss;
ss << value;
std::string s(ss.str());
OutputDebugString(s.c_str());
}
// Constructor for camera -- initialise with some default values
CCamera::CCamera()
{
m_position = glm::ve... |
/*************************************************************
* > File Name : SP2713.cpp
* > Author : Tony
* > Created Time : 2019/05/30 12:38:36
* > Algorithm : [DataStructure]SegmentTree
**************************************************************/
#include <bits/stdc++.h>
usin... |
# include <bits/stdc++.h>
# define maxn 2001
using namespace std;
int main()
{
int T,N,K;
int ans=0;
int c=0;
int d=0;
int people[maxn];
memset(people,0,sizeof(people));
scanf("%d",&T);
for(int i=0;i<T;i++)
{
scanf("%d %d",&N,&K);
for(int j=1;j<=N;j... |
#pragma once
#include <Arcane/Graphics/Texture/Texture.h>
namespace Arcane
{
enum ColorAttachmentFormat {
NormalizedSingleChannel8 = GL_RED,
Normalized8 = GL_RGBA8,
Normalized16 = GL_RGBA16,
FloatingPoint16 = GL_RGBA16F,
FloatingPoint32 = GL_RGBA32F
};
enum DepthStencilAttachmentFormat {
NormalizedDep... |
#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;... |
//
// Copyright Jason Rice 2015
// 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 <nbdl/apply_action.hpp>
#include <nbdl/match.hpp>
#include <nbdl/variant.hpp>
#include <boost/hana/tuple.hpp>
#include... |
#ifndef HEADER_RSA_HPP
#define HEADER_RSA_HPP
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/random.hpp>
#include <bits/stdc++.h>
using namespace boost::multiprecision;
using namespace boost::random;
typedef uint32_t primeType;
typedef uint64_t keyType;
typedef uint128_t superType;
#define P_SIZE 64
#de... |
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
/*
Implement a stack having findMiddle operation as well, which returns middle element of stack on O(1) time.
*/
#include<iostream>
using namespace std;
struct node
{
int data;
node *l,*r;
}*start,*mid,*last;
int top=-1;
void push(int a)
{
if(last==NULL)
{
n... |
/*************************************************************
* > File Name : P5023.cpp
* > Author : Tony
* > Created Time : 2019年04月14日 星期日 10时24分55秒
**************************************************************/
#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
typedef... |
#include<string>
#include<map>
typedef map<string, double> Data;
int main(int argc, char* argv[])
{
Data dam_size = { {"H", 30.0},{"L", 20.0}, {"W", 0.0} };
//dam_size["H"] = 30.0;
//dam_size["L"] = 20.0;
//dam_size["W"] = 0.0;
Data::iterator it = dam_size.begin();
for (; it != dam_size.en... |
/*
* Copyright (c) Nuno Alves de Sousa 2019
*
* Use, modification and distribution is subject to 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 LISTENER_H
#define LISTENER_H
#include <memory>
#include <string>
#incl... |
#pragma once
#include "CWETypeDefinition.h"
#include "CWEError.h"
namespace CWE
{
class Input;
//キーコードの列挙
enum KeyCode
{
Key_ESCAPE =DIK_ESCAPE, //「Esc」キー
Key_1 =DIK_1, //「1」キー
Key_2 =DIK_2, //「2」キー
Key_3 =DIK_3, //「3」キー
Key_4 =DIK_4, //「4」キー
Key_5 =DIK_5, //「5」キー
Key_6 =DIK_6, //「6」キー
K... |
#pragma once
#include "../MetaMorpheusEngine.h"
#include <string>
#include <vector>
#include <cmath>
#include <any>
#include <mutex>
//C# TO C++ CONVERTER NOTE: Forward class declarations:
#include "../PeptideSpectralMatch.h"
#include "../CommonParameters.h"
#include "../MetaMorpheusEngineResults.h"
namespace Engine... |
//
// SMWebView.h
// IMKSP
//
// Created by SteveMac on 2017. 11. 3..
//
#ifndef SMWebView_h
#define SMWebView_h
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include "SMView.h"
#include <ui/UIWebView.h>
#include <cocos2d.h>
typedef std::function<void(cocos2d::experimen... |
#ifndef INSTRUCTION_H
# define INSTRUCTION_H
/* Opcode lookup tables:
0 == no modRM byte
1 == no modRM byte, one byte immediate
2 == no modRM byte, four byte immediate
3 == modRM byte
4 == modRM byte + 1 byte immediate
5 == modRM byte + 4 byte immediate
6 == invalid
7 == F6/F7 group (need to c... |
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2010 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
... |
#include <iostream>
using namespace std;
class Test
{
public:
//委托构造,一定要通过初始化列表方式
Test():Test(1, 'a')
{
}
Test(int x): Test(x, 'b')
{
}
Test(char x): Test(11, x)
{
}
int a;
char b;
private:
Test(int x, char y): a(x), b(y)
{
... |
#include <iostream>
using namespace std;
int main()
{
auto integrate = [](auto&& f, double x0, double x1, int n) -> double
{
double sum = 0;
const int step = (x1 - x0) / n;
for (double x = x0; x <= x1; x += step)
{
sum += f(x) * step;
}
return sum;
... |
// github.com/andy489
#include <iostream>
#include <vector>
using namespace std;
typedef vector<int> vi;
typedef vector<double> vd;
#define F(i, k, n) for(int i=k;i<n;i++)
void cs(vi &v) {
int N = v.size();
int min(v[0]), max(v[0]);
F(i, 0, N) {
if (min > v[i]) min = v[i];
if (max < v[i]... |
#include "dialog.h"
#include "ui_dialog.h"
#include<QtCore>
#include<QSerialPort>
#include<QSerialPortInfo>
#include<QDebug>
#include<QMessageBox>
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
ui->temprature_lcd->display("-------");
ui->light_intensity_lc... |
#ifndef SESSION_H
#define SESSION_H
#include <string>
#include <iostream>
#include <regex>
using namespace std;
class Session
{
public:
Session();
int getsessionID();
void setsessionID(int newsessionID);
int getassistantID();
void setassistantID(int newassistantID);
string getsessionType();
... |
// 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.Data.Json.3.h"
#include "Windows.Foundation.h"
#include "Windows.Foundation.Collections.h"
WINRT_EXPORT namespace winrt {
name... |
#include <algorithm>
#include <vector>
using std::sort;
using std::vector;
class Solution {
public:
vector<vector<int>> merge(vector<vector<int>> &intervals) {
sort(intervals.begin(), intervals.end(),
[](const vector<int> &interval1, const vector<int> &interval2) {
return interval1[0] < inte... |
#ifndef UNIT_H
#define UNIT_H
#include "Common.h"
// Unitクラス
class Unit
{
public:
// コンストラクタ
Unit();
// デストラクタ
~Unit();
void InitRandomStatus();
char name[32];
Status status;
};
#endif // #ifndef UNIT_H
|
#include <iostream>
using namespace std;
void param_test (int formal)
{
cout <<"formal is: "<< formal << endl;
formal = 100;
cout <<"formal is: "<< formal << endl;
}
int main (){
int actual = 50;
cout <<"actual is: "<< actual << endl;
param_test(actual);
cout <<"actual is: "<< actual << endl;
return 0;
} |
#include "request.h"
using std::string;
#include "reqcompilemacro.h"
Request::Request(const std::string& name)
:nm(name)
{
// For now, always create ReqCompile
req_compile.reset(new ReqCompileMacro(nm));
}
|
/*
DateSpace.h
DateSpace
copyright Vixac Ltd. All Rights Reserved
*/
#ifndef INCLUDED_DATESPACE
#define INCLUDED_DATESPACE
#include <stdint.h>
namespace vixac
{
namespace inout
{
class DateSpace;
namespace DateResolution
{
enum Type
{
... |
#include "mainwindow.h"
#include "programwindow.h"
#include "ui_mainwindow.h"
#include "scientistservice.h"
#include <QTableWidget>
#include <QDesktopServices>
#include <QtWebKitWidgets/QWebView>
#include <QUrl>
using namespace std;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Ma... |
#include "pokerduel.h" |
/*
* Copyright (C) 2008, 2009, 2010 Richard Membarth <richard.membarth@cs.fau.de>
*
* 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 3 of the License, or
* (at your option) a... |
/**
* \file material.h
* @brief Contains the Material definition.
*
*/
#ifndef MATERIAL_H
#define MATERIAL_H
namespace rt {
/**
* @brief The Material structure.
*/
struct Material
{
Vec3f ambient; //! The ambient coefficient
Vec3f diffuse; //! The diffuse coefficient
Vec3f sp... |
#include "OutputVariable.h"
OutputVariable::OutputVariable(unsigned long space_id, std::string name, std::string description, double range_start, double range_end) {
this->id = NullConverter::NULL_ID;
this->space_id = space_id;
this->name = std::move(name);
this->description = std::move(description);
... |
/* Cpp DEITEL EXERCISE 7.16-7.20
Mix and distribute a 52 card deck with optimized.*/
#include <iostream>
#include <ctime>
#include <cstdlib>
#define SIZE 10
using namespace std;
void shuffle( int [ ][ 13 ] );
void deal( const int [ ][ 13 ], const char *[], const char *[]);
void shuffle_deal( int deck[ ][ 13 ], const ... |
#include <iostream>
using namespace std;
void sillyPrint(const char * str, int n = 0)
{
static int times = 0;
cout << str << endl;
if(n)
for(int i = 0; i < times - 1; i++)
{
cout << str << endl;
}
times += 1;
}
int main()
{
sillyPrint("b0p", 1);
sillyPrint("beep");
sillyPrint("beep");
sillyPrint("be... |
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h> /* _exit, fork */
#include <stdlib.h> /* exit */
#include <errno.h>
#include <iostream>
#include <string>
#include <string.h>
#define MAX_COUNT 200
void ChildProcess(std::string Ident); /* child process prototype */
void ParentPro... |
/***********************************************************************
created: Tue Mar 3 2009
author: Paul D Turner (parts based on original code by Thomas Suter)
*************************************************************************/
/***************************************************************... |
/* Class: Tournament
* Description: The Tournament class represents a round-based tournament
* between two lineups of creatures (creatures are derived from the Creature
* type). The class has two objects of type LineupQueue to hold each player's
* lineup, and object of type LoserStack to hold the creatures who lose... |
#include<windows.h>
#include<fstream>
#include<memory.h>
#include<string.h>
#include "pfmimage.h"
using namespace std;
PFMImage::PFMImage(const PFMImage& pfmImage)
{
this->m_type = pfmImage.m_type;
this->m_width = pfmImage.m_width;
this->m_height = pfmImage.m_height;
if(0 == m_type)
{
m_pPixel = n... |
#ifndef __TYPEN_SPEZ_DATEI__
#define __TYPEN_SPEZ_DATEI__
namespace Common
{
typedef byte byte8;
typedef int16_t int16;
typedef long int32;
typedef long long int64;
typedef float float32;
typedef double float64;
typedef bool bool8;
} // namespace Common
#endif //__TYPEN_SPEZ_DATEI__
|
/*
A program to demonstrate the use of stack in converting arithmetic expression from infix notation to postfix notation
and in evaluating arithmetic postfix expression.
*/
#include <iostream>
using namespace std;
class stack1
{
char a[20];
int top;
public:
stack1()
{
top=-1;
}
void pu... |
#ifndef PATHFINDER_H
#define PATHFINDER_H
#include "dllmacro.h"
#include "shapes.h"
#include <vector>
namespace POICS {
class AStarNode {
public:
int id;
bool closed, opened;
AStarNode* from;
double gvalue;
double hvalue;
Polygon* polygon;
AStarNode(Polygon* _poly);
bool operator==(const AStarNo... |
/*
Represents a client that needs to be pinged to check if still connected.
Copyright (C) 2016 Alex Craig, Michael Wallace, Mario Garcia.
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, eith... |
// -*- 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... |
#ifdef HAS_VTK
#include <irtkImage.h>
#include <irtkTransformation.h>
#include <vtkMath.h>
#include <vtkFloatArray.h>
#include <vtkPointData.h>
#include <vtkPolyData.h>
#include <vtkPolyDataReader.h>
#include <vtkPolyDataWriter.h>
// Default filenames
char *input_name = NULL, *output_name = NULL, *dof_name = NULL... |
#ifndef ARRAY_ACCESS_H
#define ARRAY_ACCESS_H
#include "lexp.h"
#include "aggregates.h"
#include "../type.h"
#include "../visitors/treevisitor.h"
#include "array.h"
#include <iostream>
#include <string>
using namespace std;
/**
* An Array Access represents something syntactically written as
* array[index], where ... |
#include "peertopeer.h"
#include <iostream> //FIXME
#include <memory>
#include <chrono>
#include <QEventLoop>
#include <QTimer>
#include <audiomodule.h>
#include <plog/Log.h>
secure_voice_call::PeerToPeer::PeerToPeer(secure_voice_call::QMLMissedCallsModel *missedCalls,
int p2p... |
#include "dataport.h"
namespace embr {
template <class TDatapump, class TTransportDescriptor, class TSubject>
void DatapumpSubject<TDatapump, TTransportDescriptor, TSubject>::service()
{
// anything queued from transport in? (for application processing)
if(!datapump.dequeue_empty())
{
item_t& item... |
#include "stdafx.h"
#include "Window.h"
#include "resource.h"
#include "App.h"
#define MAX_LOADSTRING 50
WCHAR cn[MAX_LOADSTRING];
WCHAR wndName[MAX_LOADSTRING];
int CALLBACK WinMain(
_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPSTR lpCmdLine,
_In_ int nShowCmd
)
{
UNREFERENCED_PARAMETER(... |
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
using namespace std;
int main(){
fastio;
double N;
cin>>N;
for(double i=0;i<N;i++){
double A;
cin>>A;
cout.precision(4);
cout.setf(ios::fixed);
cout<<sqrt(A)<<"\n";
}
return 0;
}
|
#include <iostream>
#include <fstream>
#include <string>
#include <iterator>
#include <cmath>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/program_options.hpp>
#include <TROOT.h>
#include <TApplication.h>
#include <TCanvas.h>
#include <TH1I.h>
#include <epecur/geometry.hpp>
#include... |
#include<bits/stdc++.h>
using namespace std;
int main(){
srand(time(NULL));
cout << rand()%100 + 1 << endl;
}
|
class Solution {
public:
vector<vector<int>> minimumAbsDifference(vector<int>& arr) {
map<int, vector<vector<int>>> m;
sort(arr.begin(), arr.end());
int n = arr.size();
for (int i = 1; i < n; i++) {
m[arr[i] - arr[i - 1]].push_back({arr[i - 1], arr[i]});
... |
#include "furrierslider.h"
#include "qcustomplot.h"
#include <QApplication>
#include <QWidget>
#include <QList>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QList>
double furrier(double t);
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget* window = new QWidget;... |
#include<bits/stdc++.h>
using namespace std;
#define int64 long long
#define printarr(a,n) for(int i=0;i<n;i++) cout<<a[i]<<" ";
int main()
{
int n,burst,finished[100],waiting[100],cpu_time = 0,p,b;
queue<pair<int,int> >process;
pair<int,int> rp;
cout<<"Enter the number of process: ";
cin>>n;
... |
#include <cassert>
#include <iostream>
#include "Tensor.h"
int main() {
using namespace StaticNet;
static_assert(std::is_same<
TensorUtils::transpose_helper<Tensor<float, 2, 3, 4, 5>, Transpose<1, 2, 3, 0>>::type,
Tensor<float, 3, 4, 5, 2>
>::value, "Transpose test 1 failed");
static_... |
// This file has been generated by Py++.
#ifndef SectionSpecificationVector_hpp__pyplusplus_wrapper
#define SectionSpecificationVector_hpp__pyplusplus_wrapper
void register_SectionSpecificationVector_class();
#endif//SectionSpecificationVector_hpp__pyplusplus_wrapper
|
class Solution {
public:
int maxProfit(vector<int>& prices) {
int L = prices.size();
if(L < 2) return 0;
// profit at day-i
int has1_Sell = 0; // action: have stock and sell it
int has1_doNothing = -prices[0]; // have stock and do nothing
int has0_Buy = -pr... |
#include "inventory.h"
Inventory::Inventory() {
vertexArray.setPrimitiveType(sf::Quads);
this->width = 3;
this->height = 3;
position = sf::Vector2f(300, 300);
drop = false;
}
Inventory::~Inventory() {}
bool Inventory::addItem(Item* item)
{
if (materials.size() + 1 > this->width * this->height) re... |
//
// Created by wangrunji0408 on 2017/6/22.
//
#ifndef INC_2RAYTRACE_RECTLIGHT_H
#define INC_2RAYTRACE_RECTLIGHT_H
#include "LightSource.h"
#include "../../Shapes/2D/Plane.h"
class RectLight: public LightSource {
Plane plane;
public:
int sampleSize = 4;
bool sampleRandom = false;
public:
RectLight(... |
#pragma once
#include<iostream>
#include<sstream>
#include"Error.h"
class Deserializer {
std::istream &in_;
public:
explicit Deserializer(std::istream& in) :in_(in) {}
template <class T>
Error load(T& object)
{
return object.serialize(*this);
}
template <class... ArgsT>
Error operator()(ArgsT&&... args)
{... |
#include <Servo.h> //Die Bibliothek Servo wird ins Programm eingeführt
const int buttonPin = 3; //Die Variable buttonPin wird deklariert und der Wert 2 zugewiesen
int buttonState = 0; //Die Variable buttonState wird deklariert und der Wert 0 zugewiesen
Servo myservo; //Deklaration des Objektes myservo aus der Klas... |
#include"avoidance.h"
#include<iostream>
#include <dg_include/xform.h>
using namespace std;
avoidance::avoidance():
DGConsole("avd", boost::bind(&avoidance::processCmd, this, _1)),
private_nh("~")
{
private_nh.param("stopDist", stopDist, 0.3);
private_nh.param("dangerDist", dangerDist, 0.5);
private_nh... |
#include "matrix.h"
#include <iostream>
using namespace std;
int main()
{
matrix<int> hoa(2,2);
hoa<<1<<2<<3<<4;
matrix<int> he(2,2);
he<<1<<2<<3<<4;
cout<<hoa+he;
cout<<hoa*he;
cout<<hoa(0,1);
return 0;
}
|
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Graphics.Display.1.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Foundation {
#ifndef WINRT_GENERIC_cdb5efb3_5788_509d_9be1_71ccb8a3362a
#define WINRT_GENERIC_c... |
#include<stdio.h>
#include<queue>
#include<string.h>
#include<algorithm>
using namespace std;
#define N 1000002
int vis[7][N];
int a0[10], b0[10], A, B;
struct node
{
int k;///光标所在位置
int num;
int step;
};
void FenNum(int n, int a[])///把n的每位数字存到a数组中;
{
int i=6;
while(i)
{
a[i--]=n%10;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.