text stringlengths 8 6.88M |
|---|
#include "stdafx.h"
#include "stdio.h"
#include "math.h"
#include "Gz.h"
#include "rend.h"
#include<vector>
#include<algorithm>
/***********************************************/
/* HW1 methods: copy here the methods from HW1 */
GzRender::GzRender(int xRes, int yRes)
{
/* HW1.1 create a framebuffer for M... |
#pragma once
#include "Preamble.h"
/**
*@file
*
* MyPdf.h defines class MyPdf and creates references for all memberfunctions.
*
* The class MyPdf creates the probability density function for the Monte Carlo Simulation.
* This follows an exponential disgtribution multiplied by a sinusoid.
*
*/
class MyPdf
{... |
#include "stdafx.h"
#include "debugInfo.h"
debugInfo::debugInfo()
{
}
debugInfo::~debugInfo()
{
}
void debugInfo::reload()
{
pair[0] ++;
int idx = s_voxelObj->m_hashTable.getSymmetricBox(pair[0]);
pair[1] = idx;
}
void debugInfo::reloadData()
{
FILE * f = fopen("../test/debugInfo.txt", "r");
ASSERT(f);
dat... |
#include "stdafx.h"
#include "Sparkler.h"
#include "Components.h"
Sparkler::Sparkler(DirectX::XMFLOAT3 position, DirectX::XMFLOAT4 color, float lifeTime, std::wstring assetFile, float size, float speed, UINT amount) :
m_ElapsedTime(0.f),
m_LifeTime(lifeTime),
m_Size(size),
m_Speed(speed),
m_Position(pos... |
#include <DIET_data.h>
#define EST_CPUIDLE (EST_USERDEFINED+1)
#define EST_CONSO (EST_USERDEFINED+2)
#define EST_NODEFLOPS (EST_USERDEFINED+3)
#define EST_COREFLOPS (EST_USERDEFINED+4)
#define EST_NUMCORES (EST_USERDEFINED+5)
#define EST_CURRENTJOBS (EST_USERDEFINED+6)
#define EST_CONSOJOB (EST_USERDEFINED+7)
|
#include <stdio.h>
#include <conio.h>
#include <dos.h>
void main () {
clrscr();
int A[2][2]={2,3,3,5};
int r,c;
// SYMMETRIC MATRIX
printf("\n\n\tSYMMETRIC MATRIX");
printf("\n\n A Square Matrix is said to be Symmetric,\n\n\t\tIf A(transpose) = A.");
printf("\n\n\n\tLet A be any Matrix\n\n");
... |
#pragma once
#include <QObject>
#include <QStringList>
#include "PhoneticService.h"
#include "ComponentsInfrastructure.h"
#include "SpeechAnnotation.h"
#include "SpeechDataValidation.h"
namespace PticaGovorun
{
class PhoneticDictionaryViewModel : public QObject
{
Q_OBJECT
std::shared_ptr<SpeechData> speechData_;... |
// Copyright (c) 2006, Giovanni P. Deretta
// Copyright (c) 2012 Hartmut Kaiser
// Copyright (c) 2011-2014 Bryce Adelstein-Lelbach
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_... |
#include "Widget/timelinewidget.h"
#include "ui_timelinewidget.h"
#include <QStyle>
TimeLineWidget::TimeLineWidget(QWidget *parent) :
QFrame(parent),
ui(new Ui::TimeLineWidget)
{
ui->setupUi(this);
ui->playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay));
ui->pauseButton->setIcon(style(... |
#include<bits/stdc++.h>
using namespace std;
class Node{
public:
int key;
Node* left;
Node* right;
};
class BST{
public:
Node* search(Node* root, int key){
if(root==NULL||root->key==key){
cout<<"search node: "<<root->key<<endl;
retur... |
#include <cstdio>
int main(){
//1
/*int numero;
int dias;
int minutos;
int horas;
int resto;
printf("Introduzca minutos");
scanf("%d", &numero);
dias = numero / 1440;
resto = numero % 1440;
horas = resto / 60;
minutos = resto % 60;
printf(" %d Dias, %d horas, %d... |
/*
* Copyright (c) 2015-2017 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_DETAIL_ANY_ALL_H_
#define CPPSORT_DETAIL_ANY_ALL_H_
namespace cppsort
{
namespace detail
{
constexpr auto any(bool head)
-> bool
{
return head;
}
template<typename... Bools>
constexpr auto any... |
#include <iostream>
using namespace std;
int main()
{
int num = 0;
cout << "How many numbers would you like to have? ";
cin >> num;
for ( int a = 1; a <= num; ++a) {
if ( a % 3 == 0 and a % 7 == 0 ) {
cout << "zip boing" << endl;
} else if ( a % 3 == 0 ) {
cout ... |
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
using namespace std;
const int maxn = 2000 + 10;
const int INF = 1 << 30;
struct edge{
int from,to,dist;
edge(int from,int to,int dist):from(from),to(to),dist(dist) {}
bool operator < (const edge& rhs) const {
return dist < rhs.dist;
... |
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode(int x) : val(x), next(NULL) {}
};
void Init_ListNode(ListNode* head, vector<int> vec)
{
if (vec.size() == 0)
{
head = NULL;
return;
}
ListNode* p;
p = head;
p->val = vec[0];
for... |
#include "connector.hpp"
#include "log.hpp"
#include "utils/assert.hpp"
#include <cppconn/prepared_statement.h>
#include <istream>
#include <sstream>
#include <boost/asio.hpp>
using namespace std;
namespace ba = boost::asio;
namespace nora {
namespace db {
inline string build_procedure_string... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 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"
#include "adjunct/quick_toolkit/bindings/R... |
#include <iostream>
#include <vector>
#include <string.h>
#include "scene.h"
using namespace std;
Scene::Scene()
{
texTotal_ = 0;
}
Scene::Scene(const char * sceneFile)
{
texTotal_ = 0;
loadScene(sceneFile);
}
Scene::~Scene()
{
}
void Scene::loadScene(const char * sceneFile)
{
FILE* data;
char token[100], buf[... |
#include<bits/stdc++.h>
using namespace std;
const double pi=acos(-1.0);
const double eps=1e-8;
int cmp(double x){
if(fabs(x)<eps) return 0;
if(x>0) return 1;
return -1;
}
inline double sqr(double x){
return x*x;
}
struct point{
double x,y;
point(){}
point(double a,double b)... |
/*****************************************************************************
* *
* OpenNI 2.x Alpha *
* Copyright (C) 2012 PrimeSense Ltd. *
* ... |
#include "stdafx.h"
#include "CppUnitTest.h"
#include <iostream>
#include <utility> // for pair
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace UnitTestSample
{
TEST_CLASS(UnitTest1)
{
public:
TEST_METHOD(TestMethod1)
{
std::pair<int, int> p1 = std::make_pair(10, 20);
std::... |
#include<iostream>
using namespace std;
int main(){
int marks = 46;
string result = (marks >= 40) ? "Passed" : "Failed"; Code to cheak pass or fail
cout<<result<<endl;
return 0;
} |
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <bitset>
#include <queue>
#include <algorithm>
#include <functional>
#include <cmath>
using namespace std;
class SpaceWarDiv2 {
struct Enemy {
int strength,count;
};
static
bool compS(const Enemy &lhs,const Enemy &rhs)
{
return l... |
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int hours,mins,seconds,x;
cout<<"Enter hours=";
cin>>hours;
cout<<"\nEnter minutes=";
cin>>mins;
cout<<"\nEnter seconds=";
cin>>seconds;
if(hours > 24)
{
cout<<... |
#pragma once
// Здесь представленно описание класса "Участник" и прототипы всех необходимых методов.
#include <string>
class Member
{
public:
Member(); // Конструктор по умолчанию
Member(const char*, const char*); // Параметрический конструктор
~Member(); // Де... |
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
#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); ++(a))
#define FORD(a, b, c... |
#include <ionir/syntax/ast_printer.h>
#include <ionir/misc/bootstrap.h>
#include "pch.h"
using namespace ionir;
TEST(AstPrinter, GetString) {
Ast ast = Bootstrap::functionAst();
AstPrinter astPrinter = AstPrinter(ast);
std::optional<std::string> astString = astPrinter.make();
if (astString.has_value(... |
#include "hashtable.hpp"
#include <iostream>
#include <fstream>
int main()
{
// Even, odd, prime
const std::vector<int> TABLE_SIZES = {100, 101, 99};
std::ofstream output;
output.open("kmt_oa.txt");
// Key mod tablesize and open-addressing
for (const int TABLE_SIZE : TABLE_SIZES)
... |
#ifndef UI_ACTION_ADAPTOR_CONTROLADAPTOR_H_
#define UI_ACTION_ADAPTOR_CONTROLADAPTOR_H_
#pragma once
namespace ui
{
class UILIB_API ControlAdaptor
{
public:
ControlAdaptor(Control* ctrl);
void RunAction(Action* action);
private:
Control* ctrl_;
};
}
#endif |
#include <iostream>
#include <set>
#include <cstdlib>
#include <string>
#include <time.h>
#include "tensor.h"
#define NUM_TENSORS 40
//we should not have tensorflow namespace here!!
void random_initialization_test(){
//this test creats a number of tensors and initializes them with new allocated buffers, or share b... |
#include "../headers/Transaction.h"
Transaction::Transaction(string from, string to, double amount) : from(from), to(to), amount(amount) {
timeT = time(nullptr);
} |
// Created on: 1995-12-01
// Created by: EXPRESS->CDL V0.2 Translator
// 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 te... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2006 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_CSS_TRANSFORM_VALUE_H
#define DOM_CSS_TRANSFORM_VA... |
#include <iostream>
using namespace std;
int Stock(int s)
{
int res = s-1;
int i=2;
while (res>=i)
res-=i++;
return (i-3)*(i-2)/2+res+1;
}
int main()
{
int n;
while (cin>>n)
cout<<Stock(n)<<endl;
return 0;
}
|
#include <bits/stdc++.h>
#define INF 1<<30
using namespace std;
char MA[505][505];
int custo[505][505];
struct POS
{
int ii, jj, w;
POS(int a, int b, int c)
{
ii = a; jj = b; w = c;
}
};
struct comp
{
bool operator()(POS a, POS b)
{
return a.w>b.w;
}
};
int dijkstra(pair<int,... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#define rep(i,n) f... |
//知识点 :图论
/*
By:Luckyblock
分析题意:
题意中指出: 路径上的所有点的出边 ,
所指向的点都直接或间接与终点联通
所以要将不直接或间接与终点联通的点 ,
即不合法点都在图中删除.
直接寻找与终点不直接间接联通的点 比较麻烦
但是可以进行转换,
先寻找 直接间接与终点相连的点.
算法实现:
要寻找直接间接与终点相连的点,
可以通过从终点反向BFS来实现.
先将 与终点直接连通的点加入队列,
之后 再将与队列中的点相连接的点 加入队列
给队列中的点打标记,表明暂时合法.
在暂时合法的 点中,还存在一些 与不合法的点直接相连的点
它们也是不合法... |
#include "common.hpp"
namespace po=boost::program_options;
void add_eod_option(boost::program_options::options_description& desc, std::string* eodmarker) {
desc.add_options()
("eodmarker",po::value<std::string>(eodmarker)->value_name("<string>")->default_value("eeeoddd"),"end of document marker");
}
void add_con... |
// Copyright (c) 2013 Nick Porcino, All rights reserved.
// License is MIT: http://opensource.org/licenses/MIT
#include "LandruCompiler/Tokens.h"
namespace Landru
{
#ifdef TOKEN_DECL
# undef TOKEN_DECL
#endif
#define TOKEN_DECL(a, b) case kToken##a: return b;
char const* tokenName(TokenId t)
{
switch (t)
... |
#define max_msgs 16
dimension2d<s32> charSize = dimension2d<s32>(16, 15);
SColor chatBG = SColor(128,0,0,0);
int lineHeight = -18, letterSpacing = -3;
#define chatPos position2d<s32>(32,SS.Height-64);
ITexture* font;
std::string chat[max_msgs];
clock_t lastChat = clock();
void writeChat(std::string msg) {
range... |
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#define pb push_back
using namespace std;
int bd, kt, ck;
void input() {
scanf("%d %d", &bd, &kt);
}
int tinhChuky(int n) {
int demCk = 1;
... |
#ifndef BOOKWRITER_H
#define BOOKWRITER_H
#include "book.h"
#include <QMetaObject>
#include <QMetaProperty>
class BookWriter
{
public:
BookWriter();
BookWriter(QString fn);
bool saveBook(QObject &b);
private:
QString fileName;
};
#endif // BOOKWRITER_H
|
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <fmt/format.h>
#include <folly/chrono/Conv.h>
#include <folly/io/Cursor.h>
#include <folly/io/SocketOptionMap.h>
#includ... |
#ifndef __GENERATOR__
#define __GENERATOR__
#include <string>
#include <vector>
//-------------------------------------------------------------------------------------------------
// Абстрактный генератор кода на всякий случай
// Возможно придется связывать динамически разные генераторы в общий список или массив
// С... |
#include "MyMeshObject.h"
MyMeshObject::MyMeshObject(MyMesh& mesh)
{
_mesh = mesh;
populatePolygons();
calculateBoundingSphere();
}
MyMeshObject::~MyMeshObject()
{
if (_boundingSphere)
{
delete(_boundingSphere);
}
}
int MyMeshObject::intersect(Ray& ray, double tMax, double& t, Point3d& P,
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef MODULES_HARDCORE_MH_MH_H
#define MODULES_HARDCORE_MH_MH_... |
#pragma once
#include "vfs/vfs.h"
#include "script/jsfunctioncall.h"
#include "script/jsfunction.h"
#include "script/wrappedhelpers.hpp"
namespace script
{
class ScriptEngine;
class GlobalObject : public ScriptedObject
{
friend class ScriptEngine;
public:
static ScriptClass m_scriptClass;
protected:
void... |
#include<iostream>
#include<vector>
#include<memory>
using namespace std;
class Konto;
class Bank{
vector<shared_ptr<Person>> kunden;
string bankname;
public:
Bank();
Bank(string);
ostream& print(ostream&) const;
void neuerKunde(string, char);
vector<shared_ptr<Person>> getKunden() const;
void kuendigen();
};... |
#include "Vulkan/VulkanSwapChain.h"
#include "Vulkan/VulkanFunction.h"
#include <GLFW/glfw3.h>
using namespace Rocket;
void VulkanSwapChain::Connect(VkInstance instance, VkPhysicalDevice physicalDevice, VkDevice device, VkSurfaceKHR surface)
{
this->instance = instance;
this->physicalDevice = physicalDevice;
this... |
/*
* vegetation.cpp
*
*
* Places vegetation objects on the terrain
* Created on: 30 Mar 2012
* Author: sash
*/
#include "terrain_generator.hpp"
#include <vector>
extern int crop_height;
extern int crop_width;
extern int** tmap;
extern int snow_level;
extern int sea_level;
extern int n_rivers;
extern ... |
#include "mainwindow.hh"
#include "ui_mainwindow.h"
Mainwindow::Mainwindow(QWidget *parent) :QWidget(parent), ui(new Ui::Mainwindow){
ui->setupUi(this);
connect(ui->clear, SIGNAL(clicked()), this, SLOT(clear_clicked()));
connect(ui->km, SIGNAL(valueChanged(int)), this, SLOT(km_changed()));
}
Mainwindow::~... |
//算法:模拟
//将A-B=C转化为A-C=B
//这样可以在输入时顺便减去C,获得B
//最后统计B在原序列中 的出现次数即可
#include<cstdio>
#include<map>
using namespace std;
int n,c;
long long ans;
long long a[2000010];
map <long long,int> s;//map存出现次数
int main()
{
scanf("%d%d",&n,&c);
for(int i=1;i<=n;i++)
{
scanf("%lld",&a[i]);
s[a[i]]++;/... |
//
// Leaf.h
// GetFish
//
// Created by zhusu on 15/3/11.
//
//
#ifndef __GetFish__Leaf__
#define __GetFish__Leaf__
#include "cocos2d.h"
#include "Actor.h"
USING_NS_CC;
class Leaf : public Actor
{
public:
const static int DIR_LEFT = 0;
const static int DIR_RIGHT =1 ;
static Leaf* create(... |
#include "Move.h"
Move::Move(Character* character, Node* move_node)
{
this->character = character;
vector<Node*> frame_nodes = move_node->getNodeByName("Frames")->getNodesByName("Frame");
for(int i=0;i<(int)frame_nodes.size();i++)
{
Frame* frame = new Frame(character, this, frame_nodes[i]);
... |
/**********************************************************
//
// Wih (Wireless Interface Hockey)
//
// main.cpp (ウィンドウメッセージの制御)
//
// Copyright (C) 2007,
// Masayuki Morita, Kazuki Hamada, Tatsuya Mori,
// All Rights Reserved.
**********************************************************/
#include <str... |
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
bool dont_have_seven (int x , int divisor){
while(x != 0){
if(x % divisor == 7)return false;
x /= divisor;
}
return true;
}
int main(){
int N;
... |
#pragma once
#include "level.hpp"
#include "music.hpp"
#include "utility.hpp"
class Lagunita {
public:
void init();
void loop();
private:
void update();
void render();
bool canSave();
bool canLoad();
void save();
void load();
private:
enum class Menus : uint8_t { main, game, credits, help, lo... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* Copyright (C) Opera Software ASA 2012
*
* @author Andreas Farre
*/
#ifndef ES_ALLOCATION_CONTEXT_H
#define ES_ALLOCATION_CONTEXT_H
#include "modules/ecmascript/carakan/src/vm/es_context.h"
class ES_Allo... |
/*
* mysql_head.h
* Copyright: 2018 Shanghai Yikun Electrical Engineering Co,Ltd
*/
#ifndef MYSQL_HEAD_H
#define MYSQL_HEAD_H
#include <iostream>
#include <ros/ros.h>
#include <mysql/mysql.h>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <map>
#include <time.h>
#include <ctime>
#... |
#ifndef WALI_UTIL_BASE64_INCULDE
#define WALI_UTIL_BASE64_INCULDE
#include <string>
namespace wali {
namespace util {
std::string base64_encode(unsigned char const* , size_t len);
std::string base64_decode(std::string const& s);
}
}
#endif
|
#ifndef _HEXAPI_H
#define _HEXAPI_H
#include "ros/ros.h"
#include <tf2/LinearMath/Vector3.h>
/**
* This class represents the high level concept of the functions Hexapi and perform,
* such as movement, surveillance. (All in the LH Frame with Z pointing up and X pointing forward)
* Supports:
* 1. Initial boot up (s... |
//https://www.patest.cn/contests/gplt/L2-017
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
using namespace std;
int main(){
//input
int n;
cin>>n;
vector<int> input;
for(int i=0;i<n;++i){
int temp;
... |
// -*- LSST-C++ -*-
/*
* LSST Data Management System
* Copyright 2014-2015 AURA/LSST.
*
* This product includes software developed by the
* LSST Project (http://www.lsst.org/).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#include "modules/search_engine/log/Log.h"
... |
/*
cin 通过 blank,\t,\n来确定字符串结束位置
*/
/*
cin.getline(arrname, N):最多读取N-1个字符到arrname中
cin.getline()读取整行,通过回车键输入的换行符确定输入结尾
RK: getline会将缓冲区的换行符直接读入结束输入!getline会读取换行符,但是会把它替换为空
试一下如果超出N-1输入
*/
/*
cin.get(arrname, N):类似getline,但是换行符将留在输入缓冲区!
cin.get(无参数):读取下一个字符,哪怕是换行符
留换行符的办法使得我们可以通过检查队列里第一个字符来确定cin是得到N-1个字符停止还是得到一行而停止
*/
#i... |
#include <bits/stdc++.h>
using namespace std;
struct UnionFind {
vector<int> par;
UnionFind(int n) : par(n, -1) {}
void init(int n) {par.assign(n, -1);}
int root(int x){
if(par[x] < 0) return x;
else return par[x] = root(par[x]);
}
bool same(int x, int y){
... |
//fibanocci series using recursion
#include<iostream>
using namespace std;
void fibanocci(int n)
{
static int n1=0, n2=1,sum;
if(n>0)
{
sum=n1+n2;
cout<<sum<<" ";
n1=n2;
n2=sum;
fibanocci(n-1);
}
}
int main(){
int n;
cout<<"Enter no.of elements: ";
cin>>n;
cout<<"0 "<<"1 ";
fibanocci(n-2);
}
|
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n, m, r, c;
cin >> n >> m >> r >> c; --r; --c;
vector<vector<int>> mat(n, vector<int>(m));
for (auto& row: mat)
for (auto &i: row) cin >> i;
for (int i = 0; i < n; ++i) {
if (i == r) continue;
for (int j = 0; j... |
//
// 155. Min Stack.cpp
// leetcode
//
// Created by Xujian CHEN on 5/24/20.
// Copyright © 2020 Xujian CHEN. All rights reserved.
//
/*
155. Min Stack
Easy
3156
304
Add to List
Share
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
push(x) -- Push ele... |
#ifndef SERVO_SUPPLY_H
#define SERVO_SUPPLY_H
#include "bluetooth.h"
class supply : public Bluetooth {
public:
void supplySetup(); //inizializza i pin ultilizzati per l'alimentazione
float getVoltage(); //funzione che legge e restituisce la tensione di una sola... |
#pragma once
#include "PhysicsInclude.h"
#include "Physics.h"
void Physics::GetClosestTwoSegments(const Vector3 &segmentPointA0, const Vector3 &segmentPointA1,
const Vector3 &segmentPointB0, const Vector3 &segmentPointB1,
Vector3 &closestPointA, Vector3 &closestPointB)
{
Vector3 v1 = segmentPointA1 - segmentPointA0... |
#include "XDemux.h"
#include <iostream>
using namespace std;
extern "C"
{
#include "libavcodec/avcodec.h"
#include "libavutil/avutil.h"
#include "libavformat/avformat.h"
}
#pragma comment(lib, "avformat.lib")
#pragma comment(lib, "avcodec.lib")
#pragma comment(lib, "avutil.lib")
static double r2d(AVRational r)
{
retu... |
/*
2016年5月1日14:27:17
#1141 : 二分·归并排序之逆序对
时间限制:10000ms
单点时限:1000ms
内存限制:256MB
描述
在上一回、上上回以及上上上回里我们知道Nettle在玩《艦これ》。经过了一番苦战之后,Nettle又获得了的很多很多的船。
这一天Nettle在检查自己的舰队列表:
我们可以看到,船默认排序是以等级为参数。但实际上一个船的火力值和等级的关系并不大,所以会存在A船比B船等级高,但是A船火力却低于B船这样的情况。比如上图中77级的飞龙改二火力就小于55级的夕立改二。
现在Nettle将按照等级高低的顺序给出所有船的火力值,请你计算出一共有多少对船满足上面... |
#include <bits/stdc++.h>
#define loop(i,s,e) for(int i = s;i<=e;i++) //including end point
#define pb(a) push_back(a)
#define sqr(x) ((x)*(x))
#define CIN ios_base::sync_with_stdio(0); cin.tie(0);
#define ll long long
#define ull unsigned long long
#define SZ(a) int(a.size())
#define read() freopen("input.txt"... |
#include "Survey.h"
#include "NonGamingStudent.h"
// Constructor
Survey::Survey(int participants) {
numOfStudents = participants;
this->participants = new Person*[numOfStudents];
// This sets all of the values to 0 so they can be incremented properly
numOfGamers = 0;
averageAgeGamer = 0;
averageHoursGaming =... |
#pragma once
#include "CoreMinimal.h"
#include "Engine/DataTable.h"
#include "Enum/CharacterClassType.h"
#include "CharacterClassInfo.generated.h"
USTRUCT(BlueprintType)
struct ARPG_API FCharacterClassInfo :
public FTableRowBase
{
GENERATED_USTRUCT_BODY()
public:
// 캐릭터 클래스를 나타냅니다.
UPROPERTY(EditAnywhere, Blue... |
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include "octonav/OctoGraph.hpp"
#include "octonav/visualize.hpp"
using namespace std;
using namespace octomap;
TEST_CASE("Tunnel neighbors", "[graph]")
{
OcTree tree(1);
OctoGraphSparse graph(tree);
for (int x = 0; x < 3; x++)
{
tree.upda... |
/**************************************************************************************
* File Name : DataReader.hpp
* Project Name : Keyboard Warriors
* Primary Author : JeongHak Kim
* Secondary Author :
* Copyright Information :
* "All content 2019 DigiPen (USA) Corporation, all rights re... |
#pragma once
#include "mapper.hpp"
class Mapper4 : public Mapper
{
uint8_t reg8000;
uint8_t regs[8];
bool horizMirroring;
uint8_t irqPeriod;
uint8_t irqCounter;
bool irqEnabled;
void apply();
public:
Mapper4(uint8_t* rom) : Mapper(rom)
{
for (int i =... |
// 0913_4.cpp : 定义控制台应用程序的入口点。
//先输入一个整数,再输入整数个数的数据,输出和
#include <iostream>
using namespace std;
/*
int main()
{
int N,i;
while (cin >> N)
{
if (N == 0)
break;
else
{
for (i = 1; i <= N; i++)
cout << i << ' ';
cout << endl<<N*(1 + N) / 2;
}
}
return 0;
}
*/
int main()
{
int N, i;
while (cin >> N)
{
if (N == 0)
... |
#include <Wire.h>
#include "defines.h"
#include "helpers.h"
enum class EngineState
{
Idle,
Work
};
EngineState g_CurrentEngineState = EngineState::Idle;
bool g_IsAutoRPM = false;
uint16_t g_WorkRPM = 1500;
uint16_t g_IdleRPM = 600;
uint16_t g_CurrentRPM = 0;
float g_LastFrameTime = 0.f;
float g_TargetTimeToIdle ... |
#ifndef CONFIG_H
#define CONFIG_H
#include "MonsterTypes.h"
class CGame;
class CSkill;
class TiXmlElement;
class CMonster;
class CConfig
{
public:
static void init(CGame* pGame);
private:
static CSkill* createSkill(std::wstring& sName, TiXmlElement* pSkillNode);
static void initFeatures(TiXmlElement* pNode, co... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2002-2011 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"
#include "modules/pr... |
#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>
#include <Wire.h>
// Connect the GPS Power pin to 5V
// Connect the GPS Ground pin to ground
// Connect the GPS TX (transmit) pin to Digital 8
// Connect the GPS RX (receive) pin to Digital 7
SoftwareSerial mySerial(8, 7);
Adafruit_GPS GPS(&mySerial);
const byt... |
// Created on: 1995-05-12
// Created by: Christian CAILLET
// 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 ... |
/*
replay
Software Library
Copyright (c) 2010-2019 Marius Elvert
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, ... |
#include "stdafx.h"
#include "QuizSession.h"
#include "QuestionStates.h"
namespace qp
{
using namespace std;
CQuizSession::CQuizSession(CConstQuizPtr const& quiz, const CQuestionStates & questionStates)
:m_questionStates(questionStates)
,m_currentQuestionIndex(0)
{
quiz;
questionStates;
}
CQuiz... |
// gestionVehicules.h : fichier Include pour les fichiers Include système standard,
// ou les fichiers Include spécifiques aux projets.
#pragma once
#include <iostream>
#include <string>
#include <vector>
#include "Vehicule.h"
// TODO: Référencez ici les en-têtes supplémentaires nécessaires à votre programme.
|
#include "NewProjectPop.h"
#include "Common.h"
using namespace studio;
static ImVec2 itemWidthxxx = ImVec2(0.0f, 0.0f);
void NewProjectPop::draw()
{
ImGui::OpenPopup(u8"新建项目");
if (ImGui::BeginPopupModal(u8"新建项目", &Datas::ShowNewProjectPop, /*ImGuiWindowFlags_NoResize |*/ ImGuiWindowFlags_NoSavedSettings | ImGuiWi... |
// Created on: 2015-07-13
// Created by: Irina KRYLOVA
// Copyright (c) 2015 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 Lesser General Public License version 2.1 as publ... |
#ifndef PGTOOLS_SEPARATEDPSEUDOGENOME_H
#define PGTOOLS_SEPARATEDPSEUDOGENOME_H
#include "readslist/SeparatedExtendedReadsList.h"
#include "SeparatedPseudoGenomeBase.h"
namespace PgTools {
const string PGTYPE_SEPARATED = "SEPARATED_PGEN";
class SeparatedPseudoGenome: public SeparatedPseudoGenomeBase {
... |
#ifndef CavesApp_HPP
#define CavesApp_HPP
#include "OgreFramework.h"
#include "BasicApp.h"
#include "PerlinNoiseGenerator.h"
#include "CaveRegion.h"
#include "DensityCubeBrush.h"
#include "SquareDensityBrush.h"
#include "StandardCubeSmoother.h"
#include "CubeWalker.h"
class CavesApp : public BasicApp
{
private:
... |
//
// EnemyTypes.h
// Dev
//
// Created by Wahid Chowdhury on 5/28/13.
// Copyright (c) 2013 Wahid Chowdhury. All rights reserved.
//
#ifndef __Dev__EnemyTypes__
#define __Dev__EnemyTypes__
#include <iostream>
#include "OBJLoader/OBJObject.h"
#include "OBJLoader/TexturedOBJObject.h"
#define NUM_ENEMY_TYPES 3
//... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2012 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef NET_STATUS_POLLER_H_
#define NET_STATUS_POLLER_H_
... |
#include "sculptor.h"
#include <iostream>
#include <fstream>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <string>
Sculptor::Sculptor(int _nx, int _ny, int _nz){
nx = _nx;
ny = _ny;
nz = _nz;
if(nx <= 0 || ny <= 0 || nz <= 0){
nx = 0;
ny = 0;
n... |
//Expedi SPOJ
//its wrong,but i dont know what is wrong
#include<iostream>
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#define ll long long
vector<pair<ll,ll>>vec;
bool comp(pair<ll,ll>p1,pair<ll,ll>p2)
{
return p1.first<p2.first;
}
int main()
{
ll t;
cin>>t;
while(t--)
{
ll n,d;
cin>>n;
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
* psmaas - Patricia Aas
*/
#include "core/pch.h"
#ifdef HISTORY_SU... |
// M32/M203 grenades
class 1Rnd_HE_M203: CA_Magazine
{
scope = 2;
type = 16;
displayName = "$STR_DN_HE_M203";
model = "\z\addons\dayz_epoch_w\magazine\dze_m203_he.p3d";
picture = "\Ca\weapons\Data\Equip\m_40mmHP_CA.paa";
ammo = "G_40mm_HE";
initSpeed = 80;
count = 1;
nameSound = "grenadelauncher";
descri... |
#include <iostream>
int convers(int num, int system) {
int result = 0;
int i = 1;
while (0 != num) {
result = result + (num % system) * i;
num = num / system;
i = i * 10;
}
return result;
}
void convers1(int num, int system) {
std::string result1;
int i = 0;
while(0 != num) {
int balance = num % syste... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.