text stringlengths 8 6.88M |
|---|
// VectorSpace.hpp
#ifndef VectorSpace_HPP
#define VectorSpace_HPP
template<typename Type, int N> class VectorSpace
{
private:
Type arr[N];
public:
// Constructors & destructor
VectorSpace();
VectorSpace(const Type& value); // All elements get this value
VectorSpace(const VectorSpace<Type, ... |
class Solution
{
public:
//Function to find the next greater element for each element of the array.
vector<long long> nextLargerElement(vector<long long> arr, int n){
stack<long long> st;
vector<long long> ans(n,0);
for(int i = n-1;i>=0;i--){
while(st.size()!=0){
... |
#include "drawFrames.h"
#include "cursorSet.h"
#include <stdio.h>
#include <ctime>
#include <conio.h>
#include <windows.h>
#include "time.h"
#include <string>
#include "webClock.h"
#include <iomanip>
#include <iostream>
#include "clockMenus.h"
using namespace std;
void drawFrames::createFrame(int startRow, int sta... |
/********************************************************************************
** Form generated from reading UI file 'editdata.ui'
**
** Created by: Qt User Interface Compiler version 5.15.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
*****************************************... |
//
// Created by 송지원 on 2020/06/30.
//
#include <iostream>
#include <queue>
#include <utility>
using namespace std;
#define X first
#define Y second
int box[1002][1002];
int dis[1002][1002];
int N, M;
char input;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
bool alive = false;
int alive_time = -1;
int main()... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
**
*/
#include "core/pch.h"
#ifdef DATASTREAM_BITARRAY
#include... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
//
// Created by ischelle on 05/05/2021.
//
#include "Dispatcher.hpp"
namespace pandemic
{
Dispatcher::Dispatcher(Board board, City city) : Player(board, city)
{
//nothing
}
} |
#pragma once
#include <iberbar/Utility/Unknown.h>
#include <map>
namespace iberbar
{
template < typename TKey, typename TValue >
class TResourceManager
{
public:
typedef std::map<TKey, TValue*> _Map;
public:
TResourceManager() {}
~TResourceManager();
public:
bool Find( const TKey& key, TValue** ppOut ... |
struct BaseSystem
{
virtual void update() = 0;
void accept(EntityRef e) { entities.emplace(e); }
protected:
std::set<EntityRef> entities;
ComponentManager* components = nullptr;
}; |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
// M - input 1 columns N - input 1 columns/input 2 rows K - input 2 columns
void matMultiplyOnHost(float* A, float* B, float* C, int M, int N, int K)
{
for (int i = 0; i < M; i++)
{
for (int j = 0; j < K; j++)
{
... |
#include "../inc.h"
#include "../linear/matrix.h"
#include "../geometry/affine.h"
#include "../geometry/transform.h"
#include "camera.h"
#include <array>
#include <functional>
#include <vector>
#ifndef CLASS_PLOT
#define CLASS_PLOT
namespace Z_3D_LIB_FOR_EGE {
class _plot;
class _plot {
typedef _plot _Tself;... |
#ifndef PARSER_H_
#define PARSER_H_
#include <string>
#define SHORT_FIELD 24
#define LONG_FIELD 128
using namespace std;
/* symbol_table is a single entry in the symbol table array containing information about
variable declarations, loops, and control statments
these will be the commands found in the sy... |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
int numDecodings(string s) {
//基本思想:动态规划法,dp[i]表示前i个字符的解码方式的总个数
//如果当前字符不等于0,则当前字符可以解码成单个字符,所以dp[i]+=dp[i-1]
//如果当前字符和前一个字符在10-26之间,则两个字符也可以成对解码,所以dp[i]+=dp[i-2]
if (s.size() == 0)
return 0;
int res = 0, ... |
// Created by: Peter KURNEV
// Copyright (c) 2010-2014 OPEN CASCADE SAS
// Copyright (c) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
// Copyright (c) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT,
// EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This file is part of Open CASCADE Techn... |
#ifndef __MODEL_ACTBROWSER_H
#define __MODEL_ACTBROWSER_H
#include "IModelWindow.h"
#include "ModelActTable.h"
namespace wh{
//---------------------------------------------------------------------------
class ModelActBrowserWindow : public IModelWindow
{
public:
using FuncActivateCallback
= std::function<int(cons... |
#ifndef OFXCOMMANDPATTERNTHREADSYNCWINH
#define OFXCOMMANDPATTERNTHREADSYNCWINH
#include <windows.h>
#include <process.h>
class ofxCommandProcessorThreadSyncWin : public ofxCommandProcessorThreadSync{
protected:
HANDLE mutex_handle;
bool acquired;
public:
ofxCommandProcessorThreadSyncWin()
:mutex_handle(NULL)
... |
#include <iostream>
#include <cmath>
using namespace std;
//number of neuron
const auto INPUT_NUM = 2;
const auto FIRST = 3;
const auto SECOND = 2;
const auto OUTPUT = 2;
double sigmoid(double x) {
return 1 / ( 1 + exp(-x));
}
int main(){
int i, j;
double temp;
cout << "first layer output" << endl;... |
/*
* Created by Peng Qixiang on 2018/8/8.
*/
/*
* 最小的k个数
* 输入n个整数,找出其中最小的K个数。
* 例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4,。
*
*/
# include <iostream>
# include <vector>
# include <queue>
using namespace std;
class Solution {
public:
vector<int> GetLeastNumbers_Solution(vector<int> input, int k) {
... |
#include <bits/stdc++.h>
#define isNum(c) ('0'<=c&&c<='9')
using namespace std;
const int maxn = 10000;
const int maxm = 1000;
int n, m, k, t, L, R, ans = -1, res = 0, maxx = -1, x[maxn], y[maxn], l[maxn], r[maxn];
int ret; char ch;
int vis[maxn][maxm];
struct Bird{
int i, h, cnt;
} u, v, q[maxn * 1000];
int read() {
... |
#include "../Headers/edge.h"
Edge::Edge()
{
node_id = 0;
weight = 0;
}
Edge::Edge(int id, int wt)
{
node_id = id;
weight = wt;
}
Edge::~Edge()
{
}
|
#include <iostream>
#include <vector>
#include <string>
void stugum(std::string str) {
for(auto i = 0; i < str.size(); ++i) {
if(str[i] < 'A' || str[i] > 'z' || (str[i] >'Z' && str[i] < 'a')) {
str[i] = '\0';
}
}
std::cout << str << std::endl;
}
int main() {
std::string str... |
#include <iostream>
#include <string>
#include "compiler.hpp"
void Conditions::eq(char* a,char* b, int yylineno) {
controllVariable(a,yylineno);
controllVariable(b,yylineno);
Variable var1 = variables.at(a);
Variable var2 = variables.at(b);
whileLoop.push(commands.size());
long mem2 = getMemory... |
#include "node.h"
Node::Node(QObject* parent)
{
}
|
#include "stivaDouble.h"
bool DStack::isEmpty() {
return first== nullptr;
}
void DStack::push(double val) {
if(first== nullptr)
{
first=new nodeD;
first->val=val;
first->next= nullptr;
}
else
{
nodeD *p=new nodeD;
p->val=val;
p->next=first;
... |
#include <Version.h>
#include <Window.h>
#include <Model.h>
#include <Camera.h>
#include <Lights/LightRenderer.h>
#include <Shaders/Program.h>
class CWindowTest : public CWindow
{
public:
CWindowTest(int width, int height, const std::wstring &title)
: CWindow(width, height, title)
, _camera(glm::v... |
#include "TestFramework.h"
#include "treeface/gl/VertexTemplate.h"
#include <treecore/Array.h>
#include <treecore/ArrayRef.h>
#include <treecore/Variant.h>
using namespace treeface;
using namespace treecore;
void TestFramework::content()
{
TypedTemplate attr1{ "position", 3, TFGL_TYPE_FLOAT };
TypedTemplate... |
#ifndef OBJETO_H
#define OBJETO_H
#include <string>
#include <iostream>
#include <cmath>
#include "Shader.h"
using namespace std;
struct vertex {
float x, y, z;
float r, g, b;
float nx, ny, nz;
};
struct material {
float ka, kd, ks;
float expd, exps;
};
typedef unsigned in... |
#include"Node.h"
#include"LR1Parser.h"
#include"DFA.h"
//################################词法分析器所需要的额外函数 #################################
string s5edgeJudge(string s) {
if (s != "\"" || s == "digit" || s == "letter") {
return "chars1";
}
else {
return s;
}
}
string s7edgeJudge(string s) {
if (s != "'" || s == ... |
#include<iostream>
// Принимаем знак оператора от пользователя
char getMatematicalOperation() {
while (true) {
std::cout << "Enter one of the following: +, -, *, /: ";
char op;
std::cin >> op;
// Переменные типа char могут принимать любые символы из
// пользовательского ввод... |
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define ll long long
#define fi first
#define se second
#define pb push_back
#define ALL(v) v.begin(), v.end()
#define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
#define FORN(a, b, c) for (int(a) = (b); (a) <= (c);... |
#pragma once
namespace KafkaZ {
enum class PollStatus { Message, Error, EndOfPartition, Empty, TimedOut };
}
|
#ifndef SECONDSERVICEIMPL_H_
#define SECONDSERVICEIMPL_H_
#include <iostream>
#include "SecondService.h"
using namespace ::thrift::multiplex::demo;
class SecondServiceHandler : virtual public SecondServiceIf
{
public:
SecondServiceHandler()
{
// Your initialization goes here
}
void blahBlah()
{
// You... |
#ifndef file_io_h
#define file_io_h
#include <exception>
#include <vector>
#include <string>
#include <fstream>
#include <streambuf>
#include "stb/stb_image.h"
namespace avl
{
inline std::vector<uint8_t> read_file_binary(const std::string pathToFile)
{
FILE * f = fopen(pathToFile.c_str(), "rb");
... |
// https://www.codechef.com/problems/GCDQ
/******************************************
* AUTHOR : Abhishek Naidu *
* NICK : abhisheknaiidu *
******************************************/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define all(n) ... |
#include <iostream>
#define ll unsigned long long
using namespace std;
int mod1e10(long long v) {
return (int) (v % 1000000000);
}
struct vertex {
int key;
int height;
ll sLeft, sRight;
vertex *left, *right;
};
vertex *make_v(int value) {
auto *v = new vertex;
v->key = value;
v->left... |
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
//input
char name[10];
scanf("%s",&name);
//output
printf("Hello %s",name);
return 0;
}
|
#include<iostream>
using namespace std;
class Node{
public:
int data;
Node* left = nullptr;
Node* right = nullptr;
};
Node* newNode(int data){
Node* temp = new Node;
temp->data = data;
temp->left = temp->right = nullptr;
return temp;
}
Node* constructTreeutil(int pre[], int* preIndex, in... |
//本题目比较特殊,易超时, 用了dj算法堆优化+邻接表
//但要注意此题,需要枚举每一个点
//并求所有奶牛到达此点的距离总和
//再将求出的和值找出最小值,并输出.
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
const int MAXX=2147483647;//最大值
using namespace std;
struct line
{
int be,af,we;//分存前点 后点 权重
int next;
}l[3000];
struct p
{
int num,diss;
b... |
#include "ListChats.h"
ListChats::ListChats() {}
std::string ListChats::encode() const {
parser->clear();
return parser->getJson();
}
void ListChats::decode(const std::string &jsonStr) {
parser->setJson(jsonStr);
ChatItem chatItem;
for (const auto& item : parser->getArrayJsonStr(KeyWords::c... |
#ifndef vector_h
#define vector_h
#include <iostream>
#include <memory>
#include <string>
#include "vectoBase.h"
template <typename T, typename A = std::allocator<T>>
class vector : private vector_base<T, A>
{
A alloc;
int sz;
T *elem;
int space;
void copy(const vector &arg);
... |
#ifndef VECTOR_H
#define VECTOR_H
#include "global.h"
class Vector
{
public:
Vector();
static vector<float> direction(vector<float> a, vector<float> b);
static vector<float> normal(vector<float> a, vector<float> b);
static float absolute(vector<float> a);
static vector<float> normalize(vector<flo... |
#include<iostream>
using namespace std;
#include<string>
#include"Employee.h"
const int kMaxEmployees=100;
const int kFirstEmployeeNumber=1000;
class Database
{
public:
Database();
~Database();
Employee& addEmployee(string inFirstName,string inLastName);
Employee& getEmployee(int inEmployeeNumber);... |
#include <iostream>
#include <fstream>
using namespace std;
// FIXME: not working
int main() {
// C++代码里,想在某个参数中启用多个选项,基本都是通过位运算的或
// 例如我想设置只读和在末尾打开的模式,就写成ios::in | ios::ate
// 这是因为这些FLAG都是仅有一位是1,从1、2、4、8..往后排列,所以或运算不会互相干扰
// 想判断某个mode是否开启,就用(mode && ios::in) == 1 去判断
// ios::ate: at the end, 表示打开... |
/***************************************************************************
* Vec2.h *
* *
* Vec2 is a trivial encapsulation of 2D floating-point coordinates. *
* It has all... |
#ifndef __CGREEJNIHELPER_H__
#define __CGREEJNIHELPER_H__
#include "jni/JniHelper.h"
#include "GreeExtensionMacros.h"
NS_CC_GREE_EXT_BEGIN
//bool getEnv(JNIEnv **env);
typedef struct JniFieldInfo_
{
JNIEnv *env;
jclass classID;
jfieldID fieldID;
} JniFieldInfo;
class GreeJniHelper
{
public:
static bool getIn... |
#include <sstream>
#include "RootFile.h"
#include <TROOT.h>
#include <TStyle.h>
#include "TMath.h"
RootFile::RootFile(TString fileName, TString pedestalName,
bool isRawPedestalRun, bool isPedestalRun, bool isZSRun, bool clusteringOn,
std::vector<int> xChips, std::vector<int> yChips, int mapping) :
isRawPedestalR... |
#include "Peon.hpp"
#include "Victim.hpp"
#include "Sorcerer.hpp"
#include "Navalny.hpp"
int main()
{
std::cout << "\033[32m Sorcerer creation:\033[0m \n";
Sorcerer volodya("Vladimir", "Bunker");
std::cout << volodya << std::endl;
std::cout << "\033[32m Victim tests:\033[0m \n";
Victim jimss("Jimmy");
std::cout... |
#include "mytcpsocket.h"
MyTcpSocket::MyTcpSocket(QObject *parent) :
QObject(parent)
{
}
void MyTcpSocket::doConnect()
{
socket = new QTcpSocket(this);
connect(socket, SIGNAL(connected()),this, SLOT(connected()));
connect(socket, SIGNAL(disconnected()),this, SLOT(disconnected()));
connect(socket,... |
/*
* @lc app=leetcode id=480 lang=cpp
*
* [480] Sliding Window Median
*
* https://leetcode.com/problems/sliding-window-median/description/
*
* algorithms
* Hard (33.15%)
* Likes: 451
* Dislikes: 48
* Total Accepted: 28.1K
* Total Submissions: 84.9K
* Testcase Example: '[1,3,-1,-3,5,3,6,7]\n3'
*
* ... |
#if !defined(FUTURE_FTDCTRADERAPI_H)
#define FUTURE_FTDCTRADERAPI_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "FutureFtdcUserApiStruct.h"
#if defined(ISLIB) && defined(WIN32)
#ifdef LIB_TRADER_API_EXPORT
#define TRADER_API_EXPORT __declspec(dllexport)
#else
#define TRADER_API_EXPORT __decl... |
// LogOnDlg.cpp: 구현 파일
//
#include "pch.h"
#include "ClientDemo.h"
#include "LogOnDlg.h"
#include "afxdialogex.h"
#include "ClientSocket.h"
#include "ClientDemoDlg.h"
#define WM_CLIENT_LOGON WM_USER + 4
// CLogOnDlg 대화 상자
IMPLEMENT_DYNAMIC(CLogOnDlg, CDialogEx)
CLogOnDlg::CLogOnDlg(CWnd* pParent /*=nullptr*/)
: ... |
#include "_pch.h"
#include "MoveObjView.h"
#include <boost/algorithm/string.hpp>
#include <wx/statline.h>
#include "RecentDstOidPresenter.h"
using namespace wh;
//---------------------------------------------------------------------------
class Node
:public boost::noncopyable
{
public:
Node(const Node* parent, in... |
// Created on: 1995-02-07
// Created by: Jacques GOUSSARD
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the G... |
//本题使用dijkstra算法的堆优化+邻接表,才避免了超时
// 基本思想与普通的dj相同,但在寻找最小的距离值时使用了优先队列
//这样就可以删去一层循环, 变为直接区队首元素.
//为了使用优先队列,定义一个结构体p来存编号与距离最小值
//并按照 距离最小值升序排列
//即可大大降低时间复杂度.
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
const int INF = 2147483647;//最大值
const int MARX = 1e5+10;
using namespace std;
... |
// Created on: 1991-04-03
// Created by: Remi GILET
// Copyright (c) 1991-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Les... |
//STLデバック機能をOFFにする
#define _SECURE_SCL (0)
#define _HAS_ITERATOR_DEBUGGING (0)
//GameLで使用するヘッダー
#include "GameL\SceneObjManager.h"
#include "GameL\DrawFont.h"
#include "GameL\Audio.h"
#include "GameL\DrawTexture.h"
//使用するネームスペース
using namespace GameL;
//使用ヘッダー
#include"SceneRanking.h"
#include "GameHead.h"
//コンストラク... |
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#in... |
#ifndef MULTIPLY_H
#define MULTIPLY_H
#include <QString>
#include "operation.h"
class Multiply : public Operation
{
public:
Multiply(double factor);
~Multiply();
double compute(const double input) const;
QString toQString(void) const;
protected:
double factor;
};
#endif // MULTIPLY_H
|
#include <iostream>
#include <algorithm>
#define MAX_DATA 10000
using namespace std;
struct node {
int priority;
node * left, *right;
int c; //размер дерева (правое + левое + корень)
int data;
bool HaveToAdd;
bool HaveToSet;
int HaveToAddValue;
int HaveToSetValue;
int RMQ;
int RSQ;
node(){
priority = ran... |
// Copyright (c) 2019, Ryo Currency Project
//
// Portions of this file are available under BSD-3 license. Please see ORIGINAL-LICENSE for details
// All rights reserved.
//
// Ryo changes to this code are in public domain. Please note, other licences may apply to the file.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRI... |
//===-- client/fwd.hh - Forward Definitions -----------------------*- C++
//-*-===//
//
// ODB Library
// Author: Steven Lariau
//
//===----------------------------------------------------------------------===//
///
/// \file
/// Forward definitions related to odb_client
///
//===---------------------------------------... |
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <ctime>
#include "pageLib.h"
int main(int argc, char *argv[])
{
if (argc < 3) {
printf("Usage: read_fixed_len_page <page_file> <page_size>\n");
return 0;
}
int csvPageSize = atoi(argv[2]);
Record csvRecord;
Page *csvPage;
FILE *pageF... |
/*
* License:
* License does not expire.
* Can be distributed in infinitely projects
* Can be distributed and / or packaged as a code or binary product (sublicensed)
* Commercial use allowed under the following conditions :
* - Crediting the Author
* Can modify source-code
*/
/*
* File: ErrorH... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
// only gravity will pull me down
// Minimize the sum of product
int t;
cin >> t;
long long n, res;
while (t--) {
cin >> n;
vector<long long> a(n);
vector<long long> b(n);
for(int i=0; i<n; i++) {
... |
#include<bits/stdc++.h>
using namespace std;
struct frac{
int num;
int den;
};
int d = 0;
frac f[11];
int gcd(int a, int b){
while(a*b != 0){
if(a > b)
a = a%b;
else
b = b%a;
}
return a+b;
}
bool comp(frac a, frac b){
return (double)a.num/a.den < (double)b.num/b.den;
}
void fracGene... |
#include "src/Math/Matrix33.h"
#include <memory>
#include "src/Math/Vector2.h"
#include "src/Math/Math.h"
namespace Math {
Matrix33::Matrix33() {}
Matrix33::Matrix33(const Matrix33& a) {
memcpy_s(m, sizeof(m), a.m, sizeof(a.m));
}
Matrix33::~Matrix33() {}
Matrix33& Matrix33::operator=(const Matrix33& a) {
... |
#include <iostream>
#include "DES.h"
using namespace std;
char encrypt( char text , unsigned short int key ){
unsigned char value,subkey1, subkey2;
value = text;
generateSubkeys( key , &subkey1, &subkey2 );
ip( &value );
}
void generateSubkeys( unsigned short int key, unsigned char* subkey1, uns... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2011 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef QUICK_COMPOSITE_H
#define QUICK_COMPOSITE_H
#include "ad... |
/*
Petar 'PetarV' Velickovic
Algorithm: Cycle Detection
*/
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <complex>
#define MAX_N 5001
using ... |
#ifndef __INCLUDE_RTSP_SESSION_H__
#define __INCLUDE_RTSP_SESSION_H__
#include "Def.h"
#include "Thread.h"
#include "TcpSock.h"
#include "Mutex.h"
#include <time.h>
#include <string>
#include "DataSrc.h"
class CRtspSession : CThread
{
public:
CRtspSession();
~CRtspSession();
public:
int Start( int fd, NotifyFun fu... |
// RsaToolbox includes
#include "General.h"
#include "VnaPulseGenerator.h"
#include "VnaChannel.h"
#include "Vna.h"
using namespace RsaToolbox;
// Qt includes
#include <QString>
VnaPulseGenerator::VnaPulseGenerator(QObject *parent) :
QObject(parent)
{
placeholder.reset(new Vna());
_vna = place... |
#pragma once
#include "Bindable.h"
class IndexBuffer : public Bindable
{
public:
IndexBuffer(VeritasEngine& vin, const void* indices, size_t TypeSize, size_t Count)noexcept;
public:
void Bind(VeritasEngine& vin) override;
uint32_t GetCount()const noexcept;
private:
wrl::ComPtr<IVBuffer> pVBuf;
uint32_t indexCount... |
/*
문제 링크 : https://www.acmicpc.net/problem/13458
문제 풀이 : 그리디? 브루트포스?
문제 풀이 참고 블로그 : https://na982.tistory.com/85?category=145346
*/
#include <iostream>
using namespace std;
int nTestPeople[1000001];
int main(void)
{
int N; // 시험장의 개수
int B, C;
long long nResult = 0;
cin >> N;
for (int i = 1; i <= N; i++)... |
#include <iostream>
#include <cmath>
using namespace std;
struct Point3D { double x, y, z; };
struct Line3D { Point3D p, q; };
double distance(Line3D l, Point3D p) {
double x0 = p.x, y0 = p.y, z0 = p.z;
double x1 = l.p.x, y1 = l.p.y, z1 = l.p.z;
double x2 = l.q.x, y2 = l.q.y, z2 = l.q.z;
double a = x2 - x1;
... |
/************************************
未main提供函数接口以及函数声明
Person类以及Manp类
*************************************/
#pragma once
#include<stdio.h>
#include<iostream>
#include<Windows.h>
using namespace std;
const int _exity = 0;
const int _exitx = 4;
struct Pos
{
int x;
int y;
};
class Person
{
public:
struct Pos _rPo... |
#include <AccelStepper.h>
#define EN_PIN 2
#define STEP_PIN 3
#define DIR_PIN 4
#define MS_PIN A5
AccelStepper stepper(AccelStepper::DRIVER, STEP_PIN, DIR_PIN);
bool moveDone = true;
void setup()
{
Serial.begin(9600);
pinMode(MS_PIN, OUTPUT);
digitalWrite(MS_PIN, HIGH);
stepper.setEnablePin(EN_PIN);
ste... |
const int mos=30;
const int mos1=31;
const int mas=32;
const int mas1=33;
const int moso=34;
const int moso1=35;
const int maso=36;
const int maso1=37;
void ileri(){
digitalWrite(mos ,HIGH);
digitalWrite(mos1 ,LOW);
digitalWrite(mas ,HIGH);
digitalWrite(mas1 ,LOW);
digitalWrite(moso ,HIGH);
digitalWrite(moso1 ,LOW);
di... |
#include "BlurEffect.h"
#include "Window.h"
BlurEffect::BlurEffect() {
fbo = new Fbo(window::getWindowSize(), false);
shader.addShader("shaders/gui.vsh", GL_VERTEX_SHADER);
shader.addShader("shaders/blurEffect.fsh", GL_FRAGMENT_SHADER);
shader.start();
shader.bindTextureUnit("textureSampl... |
#include "BitSize.h"
#include <algorithm>
#include <limits>
#include <sstream>
#include <iomanip>
#include <cassert>
#define BITS_IN_BYTE 8.
#define BYTES_IN_KIBIBIT 128.
#define BYTES_IN_MEBIBIT 131072.
#define BYTES_IN_GIBIBIT 134217728.
#define BYTES_IN_TEBIBIT 137438953472.
#define BYTES_IN_PEBIBIT 140737488355328... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2006 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Peter Krefting
*/
#include "core/pch.h"
#if defined PREFS_HA... |
//
// Created by Yujing Shen on 29/05/2017.
//
#ifndef TENSORGRAPH_SRCNODE_H
#define TENSORGRAPH_SRCNODE_H
#include "../SessionNode.h"
namespace sjtu{
class SrcNode: public SessionNode
{
public:
SrcNode(Session *sess, const Shape& shape);
virtual ~SrcNode();
virtual Node forward(... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
**
** Copyright (C) 1995-2000 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
/** @file opelminfo.cpp
*
* Header and implementation of ... |
#ifndef RICERCA_H
#define RICERCA_H
#include "vinolistwidget.h"
#include "mycomboboxtipo.h"
#include <model.h>
#include <QLineEdit>
#include <QCheckBox>
#include <QComboBox>
#include <QPushButton>
#include <QFormLayout>
#include <QRadioButton>
#include <QLabel>
#include <QLCDNumber>
class Ricerca: public QWidget
{
... |
#include <iostream>
#include <vector>
using namespace std;
long mod=1000000007;
long a[100001];
long sumlist[100001];
int ncalc(int N){
long tmp = 1;
while(1){
tmp *= (long)N;
N--;
tmp %= mod;
if (N == 0) break;
}
return tmp;
}
//aのp乗を求めるアルゴリズム
//p=62>31>30>15>14>7>6>3... |
//
// c_board.h
// unblockme_solver
//
// Created by Alexander G Anderson on 12/16/13.
// Copyright (c) 2013 Alexander G Anderson. All rights reserved.
//
/*
CBoard = Compressed Board
Blocks are stored with using the coordinates of their top left entry, and their size.
----> i (first coordinate)
|
|
|
V
... |
/**
* @file test.h
* @author Gerbrand De Laender
* @date 07/04/2021
* @version 1.0
*
* @brief E091103, Master thesis
*
* @section DESCRIPTION
*
* Test bench helper functions. Template parameters are:
* T = Data type excluding AXI4-Stream side channels
*
*/
#pragma once
#include <iostream... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 2000-2008 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef BOOKMARK_INI_STORAGE_H
#defin... |
#include<iostream>
#include <fstream>
#include <cstdlib>
#include <string.h>
using namespace std;
main(){
fstream file("file.txt");
string a;
char b[1];
cout<<"file-s unshij awah\n";
while(file>>a){
cout<<a<<" ";
}
ofstream bichih;
bichih.open("file.txt");
bichih<<"SEAS";
... |
#include "stdafx.h"
#include "butil.h"
using namespace std;
string block_to_string(blockContents b) {
string str;
str += "blockNum:" + to_string(b.blockNum);
str += "parentHash:" + b.parentHash;
str += "txnCount:" + to_string(b.txnCount);
str += "txns:" + seriealize(b.txns);
return str;
}
trans transacitonDump... |
/*
* PlayerMessage.cpp
*
* Created on: Jun 28, 2017
* Author: root
*/
#include "PlayerMessage.h"
#include "MessageStruct/ServerReturn2Int.pb.h"
#include "MessageStruct/ServerReturn3Int.pb.h"
#include "MessageStruct/ServerReturn4Int.pb.h"
#include "MessageStruct/ServerReturn5Int.pb.h"
#include "MessageStruct/... |
#pragma once
#include <iberbar/RHI/OpenGL/Headers.h>
namespace iberbar
{
namespace RHI
{
class IDevice;
}
}
extern "C" __iberbarRHIOpenGLApi__ iberbar::RHI::IDevice* iberbarRhiDeviceCreate(); |
/*
========================================================================
DEVise Data Visualization Software
(c) Copyright 1992-1996
By the DEVise Development Group
Madison, Wisconsin
All Rights Reserved.
========================================================================
Under no circumstances ... |
#include "main-app.h"
#include "main-frame.h"
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
wxFileConfig *pConfig1 = new wxFileConfig(wxT("ec-fc"),wxT("lyqx"),
wxT("ec-fc.ini"),wxT("ec-fc.ini"),
wxCONFIG_USE_GLOBAL_FILE|wxCONFIG_USE_RELATIVE_PATH);
... |
#include <iostream>
#include <string>
#include <algorithm>
#include <cctype>
using namespace std;
int main()
{
string str;
cout << "Enter string to check if anagram or not" << endl;
getline(cin, str);
transform(str.begin(), str.end(), str.begin(), ::toupper);
int fre_even = 0;
int fre_odd = 0;
... |
#include "Server.h"
#include <iostream>
Server::Server(short port, int max_connections, int input_buffer_size)
{
peer_ = new BasePeer(input_buffer_size);
peer_->Bind(port);
max_connections_ = max_connections;
}
Server::~Server()
{
free(peer_);
}
bool Server::Start()
{
return peer_->Listen(max_con... |
#pragma once
#include <vector>
#include "ADetection.hh"
#include "State.hh"
using namespace boost::asio;
class ToSDetection : public ADetection
{
private:
struct ToSVariation
{
ip::address from;
ip::address to;
double variance;
ToSVariation(ip::address f_ip, ip::address t_ip)
: from(f_ip)... |
#ifndef ENDGAME_H
#define ENDGAME_H
#include <QWidget>
#include <QLabel>
#include <QTimer>
namespace Ui {
class EndGame;
}
class EndGame : public QWidget
{
Q_OBJECT
bool gameOver;
public:
EndGame(QWidget *parent = 0, bool gameOver_ = true);
~EndGame();
bool checkHighScore();
QTimer* getBonusTimer()... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-1999 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef DOM_DOMSELECTION_H
#define DOM_DOMSELECTION_H
#includ... |
#ifndef __AUTOPTR_H__
#define __AUTOPTR_H__
// this class is NOT safe for array new's. It will not properly call
// the destructor for each element and you will silently leak memory.
// it does work for classes requiring no destructor however(base types)
template<typename type>
class idAutoPtr
{
public:
explicit id... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.