text stringlengths 8 6.88M |
|---|
// Author: Markus Schordan
// $Id: TreeTraversal.h,v 1.3 2006/04/24 00:21:27 dquinlan Exp $
// WORK IN PROGRESS. DO NOT USE.
#ifndef TREETRAVERSAL_H
#define TREETRAVERSAL_H
#include <vector>
template<typename TreeNode>
class TreeTraversal {
public:
TreeTraversal();
virtual ~TreeTraversal();
virtual void tr... |
#ifndef _NEXTAI_LOG_H_
#define _NEXTAI_LOG_H_
#include "base/nextai_basic_types.h"
#define SPDLOG_WCHAR_TO_UTF8_SUPPORT
#include "spdlog/spdlog.h"
#include "spdlog/fmt/bundled/ostream.h"
#define LOGGER_BUFFER_MAX_LENGTH 512
#define SPRINTF(x,c,...) sprintf(x,##__VA_ARGS__)
#ifdef SYSTEM_LINUX
#define ... |
#ifndef InteractionHandler_H
#define InteractionHandler_H
#include <functional>
#include <iostream>
#include "../External/TippdesDungeon.hpp"
namespace Dungeon {
typedef struct InteractionHandler {
std::string message;
bool shouldLock;
std::function<bool(const InteractionData_t&)> handler... |
#include <iostream>
#include <cassert>
using namespace std;
char nibble_to_hex(uint8_t i){ //пукт 1.1
assert(0x0 <= i && i <= 0xf);
char digits[] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
return digits[i];
}
void print_in_hex(uint8_t byte) {
cout << nibble_to_hex(b... |
#include "colornotifier.h"
#include <iostream>
#include <QtSerialPort/QSerialPort>
#include <thread>
#include <chrono>
ColorNotifier::ColorNotifier(QObject *parent) : QObject(parent),
textColor("black"), backColor("black") {}
void ColorNotifier::setColor(const QColor & color)
{
std::cout << "col: " <<
... |
; the size for this chip
#define EEPROM_SIZE 1024
; the size of each state block
; 1 byte less is available for storage
#define STATE_BLOCK 8
STATE_VARS macro
VARADD STATE_STATE, 2
; position being written to EEPROM
VARADD STATE_PTR, 2
; offset in EEPROM of next state
VARADD EEPROM_OFFSET, 2
VARADD MIRROR_SECON... |
/*
this is the solution of beakjoon #1929
https://www.acmicpc.net/problem/1929
*/
#include <iostream>
using namespace std;
bool is_prime[1000001];
int main(){
int m,n;
cin>>m>>n;
is_prime[0]=true;
is_prime[1]=true;
for(int i=2;i<=n;i++){
if(is_prime[i]==false){
for(int j=2*i;j<=n;j+=i){
is_prime[j]=t... |
/* ============================================================================
* Copyright (c) 2009-2016 BlueQuartz Software, LLC
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QIcon>
#include <QTextEdit>
#include <QTextOption>
#include <Qsci/qscilexerpython.h>
#include <Qsci/qsciscintilla.h>
#include "world.h"
#include <QFileDialog>
#include <QMessageBox>
#include <QTextStream>
MainWindow::MainWindow(QWidget *parent)
: QMai... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.UI.Xaml.Shapes.0.h"
#include "Windows.Foundation.0.h"
#include "Windows.UI.Composition.0.h"
#include "Windows.UI.Xaml.0.h"
#include "Windows.UI.Xaml.Media... |
#include "P012Show.h"
#include "ScrollItem.h"
INIT_SCENE_LOADER_SYNC(P012_show);
// 一共为左侧item个数 + 2 个
static bool P012ShowScrollIsFirstRun[5] = {
true, true, true, true, true
};
P012_show::P012_show()
{
m_ballIndex = 0;
m_changeState = changeState::changeBall;
m_globalZorderMax = 1000;
}
P012_show::~P012_show()... |
/**
* @file kmers_add_strand_information.cpp
* @brief Take the KMC k-mers counts with and without cononization and add to the k-mers
* on which strands there were found
*
* @author Yoav Voichek (YV), yoav.voichek@tuebingen.mpg.de
*
* @internal
* Created 03/10/19
* Compiler gcc... |
#pragma once
#include <cstdio>
#include <iostream>
#include <assert.h>
#define UNDEFINED_TYPE 0x0
#define PAGETYPE_ROW 0x1
#define PAGESTAT_FULL 0x80000000
typedef int PageType;
template <size_t PAGE_SIZE>
class alignas(PAGE_SIZE) PagedDiskFilePage
{
public:
static const char *GetPageTypeStr(PageType t)
{
swit... |
#include <Wire.h>
String inputString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
String commandString = "";
String buttonString="";
char c;
boolean isConnected = false;
void setup()
{
Wire.begin(); // haberleşme master olarak başlatıldı
Ser... |
//
// Created by Peter Eichinger on 20.08.18.
//
#include "ShaderLoader.h"
#include "file-utils/FileHelpers.h"
#include <iostream>
#include <sstream>
#include <tuple>
bool ShaderLoader::m_glslangInitialized;
const TBuiltInResource DefaultTBuiltInResource = {
/* .MaxLights = */ 32,
/* .MaxClipPlanes =... |
#include<stdio.h>
#include<string.h>
int main()
{
char str[]="Hello, World!";
for(int i=0;i<strlen(str);i++)
{
if('A'<=str[i] && str[i]<='Z')
{
str[i]=str[i]-'A'+'a';
}
if('a'<=str[i] && str[i]<='z')
{
str[i]=str[i]-'a'+'A';
}
}
puts(str);
return 0;
}
|
#ifndef MUTEX_H
#define MUTEX_H
#include <Windows.h>
class Mutex
{
public:
Mutex();
~Mutex();
void Create();
void Wait();
void Release();
void Destroy();
private:
HANDLE m_hMutex;
};
#endif // MUTEX_H |
//
// Copyright Jason Rice 2016
// 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_EXAMPLE_CONNECT_HPP
#define NBDL_EXAMPLE_CONNECT_HPP
#include <asio.hpp>
#include <cstdint>
#include <nbdl.hpp>
na... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#include<iostream>
#include<vector>
#include<climits>
using namespace std;
//O(n) and O(n) auxillary space
int solve(vector<int>& arr,int n)
{
int left[n];
int right[n];
for(int i=0;i<n;i++)
{
left[i]=INT_MIN;
right[i]=INT_MIN;
}
left[0]=arr[0];
for(int i=1;i<n;i++)
{
left[i]=max(left[i-1],arr[i]);
}
r... |
// This file has been generated by Py++.
#include "boost/python.hpp"
#include "generators/include/python_CEGUI.h"
#include "PropertyInitialiser.pypp.hpp"
namespace bp = boost::python;
void register_PropertyInitialiser_class(){
{ //::CEGUI::PropertyInitialiser
typedef bp::class_< CEGUI::PropertyInitialis... |
#define size 5
#include<stdio.h>
int queue[size];
int front=-1,rear=-1;
void insert()
{
//if(front==0&&rear==size-1||front==rear+1) or (rear+1)%size==front
if((rear+1)%size==front)
{
printf("\nqueue is full");
return;
}
if(front==-1)
front=rear=0;
else if(rear==size-1) //*
rear=0;
else
rear++;
... |
#ifndef SRC_EASYCOMPUTER_H_
#define SRC_EASYCOMPUTER_H_
#include <ncurses.h>
#include "Player2.h"
class EasyComputer : public Player2{
public:
EasyComputer(int x, int y);
int getX();
int getY();
int getHeight();
void setX(int a);
void setY(int a);
void drawPlayer(int y, int x);
private:
... |
#include "PatternRow.h"
PatternRow::PatternRow()
{
clear();
}
const char *PatternRow::getNoteName(int noteIdx)
{
if (noteIdx == NoNote)
return "--";
static const char *noteNames[] = {
"C-", "C#", "D-", "D#", "E-", "F-", "F#", "G-", "G#", "A-", "A#", "B-"
};
return noteNames[noteIdx];
}
void PatternRow:... |
#include <QCoreApplication>
#include <QSettings>
#include <QDebug>
#include "iodev.h"
#include "RxModbus.h"
#include "logging.h"
#include "IoNetServer.h"
#include "alert.h"
//#include "display.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QCoreApplication::setOrganizationName("Lyno... |
#ifndef C920_CAPTURE_H
#define C920_CAPTURE_H
//Included libraries
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <assert.h>
#include <iostream>
#include <getopt.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include... |
#ifndef TPARAMDIALOG_H
#define TPARAMDIALOG_H
#include <QDialog>
namespace Ui {
class TParamDialog;
}
class IoDev;
class TParamDialog : public QDialog {
Q_OBJECT
public:
TParamDialog(IoDev &src, QWidget *parent = 0);
~TParamDialog();
public slots:
void myAccept(); // реакція на кнопку Ок
prot... |
#ifndef RCFNODE_H
#define RCFNODE_H
/// @file RcfNode.h
/// @brief RcfNode のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2013 Yusuke Matsunaga
/// All rights reserved.
#include "RcfNodeHandle.h"
#include "YmLogic/TvFunc.h"
BEGIN_NAMESPACE_YM
/////////////////////////////////////////////////... |
//------------------------------------------------------------------------------
//
// Copyright 2018-2019 Fetch.AI Limited
//
// 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
//
// ... |
#include "netcam.h"
#include "serinum.h"
//excel相关***********************
extern CRITICAL_SECTION qrcode_CS;
extern CRITICAL_SECTION cout_CS;
extern bool stop_tmp;
extern SeriNum seri;
string qrcode_list[100];
int qrcode_detect[100] = { 0 };
int qrcode_occ[100] = { 0 };
string qrcode_camid[100];
extern string MacAdd;... |
#ifndef _MATRIX_H_INCLUDED
#define _MATRIX_H_INCLUDED
#include "common.h"
#include "config.h"
#define TOP_L 1
#define TOP_R 2
#define BOT_L 3
#define BOT_R 4
using namespace std;
class Matrix
{
public:
Matrix();
~Matrix();
void transCode(int code[]);
int transCode(int anchor, int index);
int transCode(int ... |
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
#include<stack>
using namespace std;
int main()
{
int n;
cin >> n;
while(n--) {
int m, t;
char str[5], ch[5];
scanf("%d %s",&m, str);
if(!strcmp(str, "FIFO")) {
queue<int> ... |
#ifndef __MYTAR__
#define __MYTAR__
/* C++ Library */
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <vector>
/* C Library */
#include <cmath>
#include <cstring>
#include <unistd.h>
using namespace std;
#define PATH_SIZE 1000
#define FILENAME_SIZE 100
#define FILEMODE_SIZE 8
#de... |
//
// Created by 98595 on 2020/4/18.
// 蓝桥杯校赛模拟
//问题描述
// 给定一个单词,请使用凯撒密码将这个单词加密。
// 凯撒密码是一种替换加密的技术,单词中的所有字母都在字母表上向后偏移3位后被替换成密文。即a变为d,b变为e,...,w变为z,x变为a,y变为b,z变为c。
// 例如,lanqiao会变成odqtldr。
//输入格式
// 输入一行,包含一个单词,单词中只包含小写英文字母。
//输出格式
// 输出一行,表示加密后的密文。
//样例输入
// lanqiao
//样例输出
// odqtldr
//评测用例规模与约定
// ... |
#pragma once
#include "CHandler.h"
class CTexture
{
private:
public:
GLuint textureID;
CTexture();
virtual ~CTexture();
void M_LoadBMP(string imagepath);
};
|
/***************************************************************************
Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD
FileName: RTCPTask.cpp
Description: A task object that processes all incoming RTCP pack... |
#include "Furnace.h"
#include "UI.h"
#include "Chat.h"
#include "main.h"
#include "Chunk.h"
#include "Blocks.h"
#include "Player.h"
#include "Interface.h"
#include "Comparators.h"
static const float SMELT_TIME = 10.0f;
struct FurnaceInstance {
float Progress = 0.0f;
float BurnTimeRemaining = 0.0f;
Stack... |
void left_smaller(vector<int> &a,int n,vector<int> &lft)
{
stack<int> stk;
for(int i=n-1;i>=0;i--)
{
while(!stk.empty() and a[stk.top()]>a[i])
{
lft[stk.top()]=i;
stk.pop();
}
stk.push(i);
}
}
void right_smaller(vector<int> &a,int n,vector<int> &... |
#include "nndemo/Data.h"
#include <iostream>
#include <numeric>
#include <utility>
nndemo::Data::Data(std::unique_ptr<std::vector<std::vector<float>>>& features,
std::unique_ptr<std::vector<unsigned long int>>& labels,
unsigned long int datacount)
: features(std::move(fea... |
#pragma once
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <algorithm>
#include <cmath>
#include <tuple>
#include "tangible_filesystem.h"
using namespace EngineLayer;
using namespace EngineLayer::FdrAnalysis;
using namespace MassSpectrometry;
using names... |
// startcompile.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<stdio.h>
#include<string.h>
#include<windows.h>
int main(int argc, char* argv[])
{
char file[200];
if(argc==1){
printf("please input the source file name included the filepath name:\n");
scanf("%s",file);
}... |
/*
https://leetcode.com/problems/longest-substring-without-repeating-characters/
Example 1:
Input: "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
Example 2:
Input: "bbbbb"
Output: 1
Explanation: The answer is "b", with the length of 1.
*/
class Solution {
public:
int lengthOfLong... |
#ifndef Screenshot_h
#define Screenshot_h
class Screenshot {
private:
bool stereo;
public:
public Screenshot():stereo(false) {}
int takeScreenshot(void) {
int width = screenWidth;
int height = screenHeight;
int i,j;
FILE *fptr;
static int counter = 0; /* This sup... |
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <cv_bridge/cv_bridge.h>
#include <sstream>
#include <vector>
#include "ros/ros.h"
#include "geometry_msgs/Point.h"
#include <vector>
using namespace std;
using namespace cv;
Mat img=imread("/home/subham/catkin_ws/src/... |
/**
MIT License
Copyright (c) 2019 mpomaranski at gmail
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, ... |
class Solution
{
public:
int threeSumClosest(vector<int>& nums, int target)
{
int min = INT_MAX, ret = 0;;
sort (nums.begin(), nums.end());
for (int i = 0; i < nums.size(); ++i)
{
for (int j = i+1, k = nums.size()-1; j < k;)
{
int sum = nu... |
/***************************************************************************
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... |
/*
this is the solution of beakjoon #2178
https://www.acmicpc.net/problem/2178
*/
#include <iostream>
#include <queue>
using namespace std;
int A[101][101];
int check[101][101];
int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
int main(){
int n,m;
queue<pair<int,int>> q;
cin>>n>>m;
for(int i=0;i<n;i++){
for(int ... |
#include<iostream>
#include<fstream>
#include<istream>
#include<cmath>
#define PI 3.141592653
//#include"2Dshape.hh"
#include"triangle.hh"
using namespace std;
void Triangle::draw() const{
ofstream fout("triangle.stl");
fout << "solid OpenSCAD_Model" << endl;
fout << " facet normal 0 0 0" << endl;
fout << " ou... |
#include <iostream>
#include <string>
using namespace std;
//int s
bool solve(string input)
{
cout << input << endl;
if(input.size()==0)
{
return true;
}
//12243660
for(int j=input.size()-1;j>=0;j--)
{
int cur = stoi(input.substr(j));
int len = input.size()-j;
int temp = 0;
for(int k=j... |
#include<bits/stdc++.h>
#define M 1000000007
using namespace std;
int solve(string input,int n)
{
if(n==0)
{
return 0;
}
long long total = input[0] -'0';
long long last = input[0] - '0';
for(int i=1;i<n;i++)
{
last = ((last*10) + (input[i]-'0')*(i+1));
last = last%M;
total = (last + total)%M;
}
re... |
#pragma once
namespace SimpleMath
{
inline void sinCos( float a, float& s, float& c )
{
#ifdef WIN32
float localCos, localSin;
float local = a;
_asm fld local
_asm fsincos
_asm fstp localCos
_asm fstp localSin
c = localCos;
s = localSin;
#else
c = cosf(a);
s = sinf(a);
#endif
};
//template<c... |
#pragma once
#include <functional>
#include <memory>
#include <deque>
#include <atomic>
#include <mutex>
#include <algorithm>
#include "ring_buffer.h"
#define DEFINE_SIGNAL(prototype, name) \
public: \
prototype& name() { return name##_; } \
prototype& name() const { return name##_; } \
priva... |
#include "Graphics.h"
#include "application/ResourcePath.h"
#include "graphics/VertexBuffer.h"
#include "graphics/vertices/ColorVertex.h"
#include "graphics/vertices/MeshVertex.h"
#include "graphics/vertices/TextureVertex.h"
#include "graphics/vertices/PositionVertex.h"
#include "graphics/vertices/RigVertex.h"
#inc... |
class Solution {
public:
int mySqrt(int x) {
// // newton iterative method
// if(x == 0) return 0;
// double temp = x;
// // handle overflow
// while(fabs(temp * temp - x) > 0.0001) {
// temp = (temp + x /temp) / 2;
// }
// return temp;
// // binary sear... |
#include "registrationwindow.h"
RegistrationWindow::RegistrationWindow() : QDialog()
{
lbl1 = new QLabel("Придумайте логин");
login = new QLineEdit();
login->setPlaceholderText("Логин");
login->setMaxLength(20);
box1 = new QGroupBox("Ваш возраст");
age = new QSpinBox();
slider_age = new Q... |
// LeetCode Problem 13 :
/*
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
*/
#include "../HeaderFiles/RomantoInteger.hpp"
int RomantoInteger::romanToInt(string s)
{
int ResultValue = 0, i = s.size();
while (i >= 0)
{
i--;
... |
#include "DebugRenderer.h"
DebugRenderer::DebugRenderer()
{
NUM_POINTS[M_CUBE] = 8;
NUM_INDICES[M_CUBE] = 24;
NUM_POINTS[M_PLANE] = 4;
NUM_INDICES[M_PLANE] = 6;
NUM_POINTS[M_SPHERE] = 24;
NUM_INDICES[M_SPHERE] = 24;
NUM_POINTS[M_PATH] = 8;
NUM_INDICES[M_PATH] = 14;
m_indices[M_CUBE] = new U... |
#include "wire.hpp"
#include <string>
/*
* Implementation of Wire
*/
Wire::Wire(std::string NAME) {
name=NAME;
value = 0;
}
Wire::Wire(std::string NAME,bool val) {
name=NAME;
value = val;
}
void Wire::setHigh() {
value = 1;
}
void Wire::setLow() {
value = 0;
}
void Wire::set(bool val) {
this->value ... |
#include "visiondefinitions.h"
#include <stdlib.h>
#include <ostream>
#include <string>
VisionResult::VisionResult(const std::string &vals) :
type(JSVISION_NOTHING),
timestamp(0),
ics_x1(0),
ics_y1(0),
ics_x2(0),
ics_y2(0),
ics_width(0),
ics_height(0),
ics_confidence(0.0f),
rcs... |
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <Eigen/QR>
using namespace Eigen;
using namespace std;
#define dwie3 (2.0/3)
#define minus1_6 (-1.0/6)
#define minus1_3 (-1.0/3)
const double wartosci[4][4]={
{dwie3,minus1_6,minus1_3,minus1_6},
{minus1_6,dwie3,minus1_6,minus1_3},
{minus1_... |
#include "paintwidget.h"
#include <QPixmap>
#include <QTimer>
#include <QPainter>
#include <QColor>
#include <mainwindow.h>
PaintWidget::PaintWidget(QWidget *parent) : QWidget(parent)
{
this->resize(800,800);
pix_=new QPixmap(this->width(),this->height());
pix_->fill(Qt::black);
QTimer *t... |
#ifndef DIRECTOR_H
#define DIRECTOR_H
#include "worker.h"
#include "level1.h"
class director: public worker, public level1 {
private:
static double dir_base_bonus_salary;
static double dir_bonus_bonus_salary; // da aggiungere al bonus di base del contratto full time
static int dir_bonus_vac_day;
public:
... |
/***************************************************************************
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... |
/*
* autoShoot.h
*
* Created on: May 4, 2015
* Author: vandenrobotics
*/
#ifndef SRC_COMMANDS_AUTOSHOOT_H_
#define SRC_COMMANDS_AUTOSHOOT_H_
#include "Commands/CommandGroup.h"
#include "../Robot.h"
class AutoShoot : public CommandGroup
{
public:
AutoShoot();
};
#endif /* SRC_COMMANDS_AUTOSHOOT_H_ */
|
#include <iostream>
int main() {
int lenn;
std::cin >> lenn;
int A[lenn];
for (int i = 0; i < lenn; ++i) {
std::cin >> A[lenn-i-1];
}
if (lenn == 1) {
std::cout << A[0];
return 0;
}
int inc_idx[lenn]; // предыдущий элемент меньше
int inc_len[lenn]; // длина ... |
class Solution
{
public:
int lengthOfLastWord(string s)
{
int count = 0;
for(auto iter = s.rbegin(); iter != s.rend(); ++iter)
{
if (*iter == ' ' && count == 0)
continue;
else if (*iter == ' ')
break;
else
... |
#include <bits/stdc++.h>
#include <string>
typedef unsigned long long int ll;
#define MOD 998244353
using namespace std;
unsigned long long int power(ll a,ll b)
{
if(b==0)return 1;
ll p=power(a,b/2);
p=(p*p)%MOD;
return (b%2==0)?p:(a*p)%MOD;
}
unsigned long long int inverse_mod(ll a,ll b)
{
return p... |
#ifndef PEOPLE_H
#define PEOPLE_H
#include "Date_time.h"
#include "Address.h"
#include "Base.h"
using namespace std;
class Vehicle { //ideias para funcoes para aqui??
Date registration_date;
string type;
string brand;
public:
Vehicle();
~Vehicle();
void setRegistrationDate(Date data);
void setType(string t... |
#include "stdafx.h"
#include "FrameResource.h"
#include "ShaderBufferTypes.h"
#include "NormalRenderItem.h"
using namespace Common;
using namespace GraphicsEngine;
FrameResource::FrameResource(ID3D11Device* device, const std::vector<NormalRenderItem*>& renderItems, SIZE_T materialCount) :
MaterialDataArray(material... |
/*
* Copyright (C) 2016 Open Source Robotics 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 by appl... |
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef complex<double> cd;
const double PI = acos(-1.0);
const int maxn = 10005;
// d[0]存放最低位,高位往后面加
struct bigint {
int... |
#include<bits/stdc++.h>
using namespace std;
int n, a[51], d[51][500001];
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&a[i]);
d[0][0] = 1;
for(int i=1;i<=n;i++){
for(int j=0;j<=500000;j++){
int high = d[i-1][j];
int low = high - j;
if(!high) continue;
d[i][j] = max(d[i][j]... |
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
CyLandBlueprintSupport.cpp: CyLand blueprint functions
=============================================================================*/
#include "CoreMinimal.h"
#include "Engi... |
#include <bits/stdc++.h>
using namespace std;
#define MAX 1000;
#define MILISECOND_CONVERSION 1000000
clock_t t_random, t_sorted, t_reverse;
bool ascending = false, descending = false;
bool array_generated = false;
void insertionSort(int *a, int n)
{
int i, key, j;
for (i = 1; i < n; i++)
{
key =... |
// CSV2PCD.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <pcl/visualization/cloud_viewer.h>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <iostream>
#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h>
#include <math.h>
#includ... |
#include "GenjiboState.h"
GenjiboState::GenjiboState()
{
}
GenjiboState::~GenjiboState()
{
}
|
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define scd(x) scanf("%lf",&x)
#define pfi(x) printf("%d",x)
#define pfl(x) printf("%lld",x)
#define pfd(x) printf("%lf",x)
#define pfc(x) printf("Case %d: ",x++)
#define ... |
#include<iostream>
const int N = 10000001;
using namespace std;
int tree[N];
int sum[N];
int Max;
int findRoot(int p) {
if (tree[p] == p) {
return p;
}
else {
int tmp = findRoot(tree[p]);
tree[p] = tmp;
return tmp;
}
}
void unions(int p, int q) {
int pRoot = findRoot(p);
int qRoot = findRoot(q);
if (pRo... |
#pragma once
class Grid
{
int column;
int row;
char* content;
public:
Grid();
void setColumn(int);
void setRow(int);
void setContent(char*);
Grid(const Grid&);
int getColumn();
int getRow();
const char* getContent();
Grid& operator=(const Grid&);
~Grid();
friend std::ostream& operator<<(std::ostream... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::ApplicationModel::CommunicationBlocking {
struct ICommunicationBlockingAccessManagerStatics;
struct ICommunicationBlockingAppManagerSta... |
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define MAXSTRLEN 255
typedef unsigned char sstring[MAXSTRLEN+1];
/* 字符串赋值,当赋值字符串长度超过被赋值字符串时候截断,未超过时先将长度存入T[0],再逐位赋值 */
Status StrAssign(sstring T, char *chars)
{
int i;
if (strlen(chars) > MAXSTRLEN)
{
for (i = 1; i <= MAXSTRLEN; ++i)
... |
#include <iostream>
using namespace std;
int binarySearch(int arr[],int n,int element){
int start=0;
int end=n-1;
while(start<=end){
int mid=start+(end-start)/2;
if(arr[mid]==element)
return 0; //key is present so smallest difference is 0
else if(element<arr[mid])... |
// Copyright (c) Facebook, Inc. and its affiliates.
// All rights reserved.
//
// Copyright 2019 Google LLC
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
//
// Auto-generated file. Do not edit!
// Specification: test/f16-gemm.yam... |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
double INF = 1e100;
double EPS = 1e-12;
typedef long long int ll;
typedef pair < int,int > PII;
typedef ... |
#include "controller.h"
#include "config.h"
#include <QtDebug>
#define TEST_BOTpas
QQueue<Cell*> Cell::deadList;
char View::keysStatment = Config::INIT_KEYS_STATMENT;
int Settler::ProbMalusCell = Config::PROBABILITY_MALUS_CELL;
int Settler::ProbBonusCell = Config::PROBABILITY_BONUS_CELL;
QSemaphore Cell::sem_deadL... |
//
//
//
//
//
#ifndef PLANET_H
#define PLANET_H
#include <string>
#include "Player.h"
using namespace std;
class Planet
{
public:
Planet();
virtual ~Planet();
// Returns the planets name
string getName() { return planetName; }
// Returns the planets name
int getNum() { return planetNum; }
... |
#include "kernels/kernel_cpu.hpp"
#include "kernels/kernel_v2.hpp"
#if OCTORAD_HAVE_CUDA
#include "kernels/kernel_gpu.hpp"
#endif
#include "utils/fx_case.hpp"
#include "utils/fx_compare.hpp"
#include "utils/util.hpp"
#include <cstdio>
constexpr std::size_t CASE_COUNT = OCTORAD_DUMP_COUNT;
template <typename K>
bool ... |
/*
* SWM11_point_comparator.h
*
* Created on: Feb 4, 2014
* Author: vbonnici
*/
#ifndef SWM11_POINT_COMPARATOR_H_
#define SWM11_POINT_COMPARATOR_H_
#include "SWM11_Point.h"
using namespace dolierlib::SWM11;
namespace dolierlib{
namespace SWM11{
class SWM11_point_comparator{
public:
virtual ~SWM11_poi... |
class Solution {
public:
void moveZeroes(vector<int>& nums) {
for (int i = 0,j=0,n=int(nums.size()); j<n;j++) {
if (nums[j]!=0)
swap(nums[i++],nums[j]);
}
}
}; |
//---------------------------------------------------------------------------
////#include "stdafx.h"
#pragma hdrstop
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <io.h>
#include "..\..\Util\WorkStr.h"
#include "History.h"
//enSite globalSite=SITE_UNDEF;
tpDis TPDIS_UNDEF={ACT_UNDEF,0};
//--... |
// github.com/andy489
// https://www.hackerrank.com/contests/test7-sda-soft-eng/challenges/challenge-1770/problem
#include <iostream>
#include <vector>
#include <unordered_map>
#include <set>
using namespace std;
int main() {
unordered_map<int, int> um;
set<pair<int, int>> setPairs;
int n, i(0), a, c(0... |
#ifndef __MF_NODE_EXPRESSION_MEMORYRESERVATION_H__
#define __MF_NODE_EXPRESSION_MEMORYRESERVATION_H__
#include <cdk/nodes/expressions/UnaryExpression.h>
#include "nodes/expression/Assignment.h"
#include "SemanticProcessor.h"
namespace mayfly {
namespace node {
namespace expression {
/**
* Class fo... |
#include "Song.h"
using namespace std;
Song::Song()
{
title = "Blank";
artist = "Blank";
size = 0;
}
Song::Song(string _artist, string _title, int _size)
{
artist = _artist;
title = _title;
size = _size;
}
ostream& operator << (ostream& out, const Song &s)
{
out << s.g... |
#include <iostream>
using namespace std;
int main() {
cout << "My Homework for intro to programming with c++ 24.Nov.2020" << endl;
//inicializirame 4isloto
int num {0};
//iskame 4islo ot potrebitelya
cout << "\nplease enter a 3 digit number" << endl;
cin >> num;
//proveryavame dali e tricif... |
#include <game/generated/protocol.h>
#include <game/server/gamecontext.h>
#include "landmine.h"
CLandmine::CLandmine(CGameWorld *pGameWorld, vec2 Pos, int Owner)
: CEntity(pGameWorld, CGameWorld::ENTTYPE_PICKUP)
{
m_ProximityRadius = PickupPhysSize;
m_Life = 4000;
m_Pos = Pos;
m_Owner = Owner;
m_Flashing = false... |
/*
* Author : BurningTiles
*/
#include <iostream>
using namespace std;
int main(){
char x[20];
cin >> x;
int n=0,i=0,j;
while(x[n] != '\0') ++n;
while(++i<n){
if(x[i] < x[i-1]){
j = i-1;
do {
--x[j];
}while(x[j] < x[j... |
/*
Problem
: print Hello Wolrd!
Condition
: No specific condition
*/
#include<iostream>
using namespace std;
int main(){
cout<<"Hello World!"<<endl;
}
|
#include "stdafx.h"
#include "mainGame.h"
mainGame::mainGame()
{
}
mainGame::~mainGame()
{
}
//초기화
HRESULT mainGame::init(void)
{
gameNode::init();
_player1.rc = RectMakeCenter(WINSIZEX / 2 - 400, WINSIZEY / 2, 100, 50);
_player2.rc = RectMakeCenter(WINSIZEX / 2 + 400, WINSIZEY / 2, 100, 5... |
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
string readProgramFromFile(string filename);
string readProgramFromFile(string filename)
{
string programText = "";
//input stream for data
ifstream inFile;
//open file
inFile.open(filename);
//error handling in case file does not ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.