text stringlengths 8 6.88M |
|---|
//#pragma once
//#pragma once
//#ifndef prob3_h
//#define prob3_h
//#include <iostream>
//
//int counter = 0, arraycounter = 0;
//int defective[16];
//int y = 0X6a2f, t = 0, i2 = 17;
//unsigned int c = 1 << 15;
//int number = 0;
//int j;
//
//void getZero()
//{
// std::cout << '0';
// defective[arraycounter] = i2 - 1;
... |
#include "Kernel.hpp"
#include "Context.hpp"
#include "Device.hpp"
#include "SException.hpp"
#include <iostream>
using namespace std;
using namespace rustling;
static char* Read_Source_File(const char *filename)
{
long int size = 0, res = 0;
char *src = NULL;
FILE *file = fopen(filename, "rb");
if ... |
/**
*
* @file B3MSC1170A.cpp
* @authors Yasuo Hayashibara
* Naoki Takahashi
*
**/
#include "B3MSC1170A.hpp"
#include <Tools/Byte.hpp>
#include "B3MSC1170AControlTable.hpp"
#include "../../../Communicator/Protocols/KondoB3M.hpp"
namespace IO {
namespace Device {
namespace Actuator {
namespace S... |
#include <bits/stdc++.h>
using namespace std;
long int n(long long int);
int main()
{
int t;
cin>>t;
while(t--)
{
long long int a, b;
cin>>a>>b;
if(a==b)
{
cout<<0<<endl;
continue;
}
if(b==1 && a==0)
{
cout<<1<<endl;
continue;
}
if(b==1 || b==0)
{
cout<<-1<<endl;
continue;
... |
#pragma once
#include "AObject.h"
#include "RAsset.h"
#include "TDataTypes.h"
class RAnimationSequence;
class TBone;
class BThing;
class RAnimationNode: public AObject {
DECLARE_CLASS(RAnimationNode,CLASS_Abstract)
public:
virtual void Tick(float Time) = 0;
virtual void CalcBoneMatrices(TArray<TBo... |
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package
#ifndef JACTORIO_INCLUDE_CORE_COORDINATE_TUPLE_H
#define JACTORIO_INCLUDE_CORE_COORDINATE_TUPLE_H
#pragma once
#include <tuple>
#include "data/cereal/serialize.h"
#include <cereal/types/base_class.hpp>
namespace jac... |
#include <Arduino.h>
#include <ESP8266WebServer.h>
#include <PubSubClient.h>
#include <ESP_MQTTLogger.h>
#include "pixel_peripheral.h"
#define PIXEL_PIN 2
#define PIXEL_COUNT 64
// corresponds to 10fps which is fast enough for static displays
#define FRAME_MILLIS 30
PixelPeripheral::PixelPeripheral() {}
// ESP826... |
#include <bits/stdc++.h>
using namespace std;
void swap(int a[],int b,int c){
int temp=a[b];
a[b]=a[c];
a[c]=temp;
}
void dnfSort(int a[],int low,int mid,int high){
while(mid<=high){
if(a[mid]==0){
swap(a,low,mid);
low++;mid++;
}
else if(a[mid]==1){
mid++;
}
else if(a[mid]==2){
swap(... |
#ifndef _TNA_TASKING_THREAD_POOL_H_
#define _TNA_TASKING_THREAD_POOL_H_
#include "../trace/trace.h"
#include "../types.h"
#include "task.h"
#include <assert.h>
#include <chrono>
namespace tna
{
struct atomic_counter_t;
#define INVALID_THREAD_ID 0xffffffff
#define _TNA_TASKING_MAX_INFO_STRING_LENGTH _TNA_TRACE_MAX... |
#include <iostream>
using namespace std;
// --------------------- Edited on github
// I am in branch test
int fact( int n )
{
if ( n == 0 ) return 1;
return fact(n-1) * n;
}
// This is function main
int main()
{
// Get Input
int n;
cin>>n;
cout<<fact(n);
return 0;
}
|
//
// Recorder - a GPS logger app for Windows Mobile
// Copyright (C) 2006-2019 Michael Fink
//
/// \file WaitEventThread.cpp WaitEvent() thread implementation
//
#include "stdafx.h"
#include "WaitEventThread.hpp"
/// note: called from wait thread
bool CWaitEventThread::WaitComm()
{
// wait handle must not be set
... |
// netbeat.cpp - Netbeat timer display
// https://github.com/vividos/OldStuff/
// (c) 1999, 2021 Michael Fink
#include <dos.h>
#include <stdio.h>
#include <conio.h>
void main()
{
printf("Netbeat:\n");
time t;
unsigned long sekunden, netbeat;
char lastdigit = 10;
do
{
do
{
gettime(&t);
... |
#include "leaderboard.h"
#include "ui_leaderboard.h"
#include "functions.h"
#include <QFile>
#include <QString>
leaderboard::leaderboard(QWidget *parent) :
QWidget(parent),
ui(new Ui::leaderboard)
{
ui->setupUi(this);
}
leaderboard::~leaderboard()
{
delete ui;
}
void leaderboard::on_backButton_clicke... |
#ifndef ANTENNE_H
#define ANTENNE_H
#include <string>
#include "point.h"
class Antenne
{
public:
Antenne();
Antenne(double x, double y, std::string nom, double puissance, double frequence);
Point position();
const std::string nom();
double puissance();
d... |
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
bool validateBinaryTreeNodes(int n, vector<int> &leftChild, vector<int> &rightChild)
{
queue<int> q;
unordered_set<int> s;
if (leftChild.size() == 0)
return true;
for (int i = 0; i < leftChild.si... |
#include <xtl.h>
#include "..\utils.h"
#include "..\main.h"
#include "screenshot.h"
void CXBScreenShot::NextFreeFile()
{
while (FileExists(imagefilename) && imagenumber < 9999) {
_itoa(imagenumber,textnumber,10);
imagenumber++;
strncpy(imagefilename+(17-strlen(textnumber)),textnumber,strlen(textnumber));
}
r... |
#include "Rook.h"
#include <math.h>
Rook::Rook()
{
this->xpos = 0;
this->ypos = 0;
}
Rook::Rook(bool pisWhite)
{
this->xpos = 0;
this->ypos = 0;
this->isWhite = pisWhite;
if (isWhite)
this->character = 'R';
else
this->character = 'r';
}
bool Rook::move(char toxpos, char toypos)
{
if... |
#include "stdafx.h"
#include <time.h>
#include "SimuScanner.h"
#include "ScanPointCloud.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define NOISE_RATIO 0.01f
///////////////////////////////////////////////////////////////////////////////
BOOL CSimuScanne... |
#include <QApplication>
#include <QGraphicsScene>
#include <QGraphicsRectItem>
#include <QGraphicsView>
#include <QDebug>
#include "Joueur.h"
#include "tableauTuile.h"
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
//----------------Paramètre la scène
// cree une Scene
QGraphicsScene* scene = new Q... |
// Copyright (c) 2014-2019 winking324
//
#include "view/main_window.h"
namespace avc {
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent) {
central_widget_ = new CentralWidget(this);
setCentralWidget(central_widget_);
setFixedSize(600, 600);
}
} // namespace avc
|
/*
* 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.
*
*/
#ifndef FLUXMAKE_CONFIGURESTAGE_H
#define FLUXMAKE_CONFIGURESTAGE_H
#include "BuildStage.h"
namespace fluxmake {
class ConfigureStage: public BuildStage
{
public:... |
//--------------------------------------------------------------------------------------
// File: 20200507.cpp
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
#include "DXUT.h"
#include "resource.h"
#include "Direct... |
#ifndef _PROHIBITION_GENERATOR_H_
#define _PROHIBITION_GENERATOR_H_
#include "CAN_interface.h"
#include "proto_def.h"
#include <map>
#include <vector>
struct pt
{
U8 prior;
U32 timer;
pt( U8 inprior, U32 intimer ){ prior = inprior; timer = intimer; }
pt(){}
};
class CProhibitionGenerator
{
public:
CProhibitio... |
#include "graph/table_node.hpp"
#include <cstdlib>
#include <string>
#include <libgccjit.h>
#include "graph/nullary_node.hpp"
#include "graph/query_scope.hpp"
extern "C" {
void my_internal_function(std::int64_t input_arg) {
std::printf("%ld\n", input_arg * 2);
}
}
namespace flow {
TableNode::TableNode(const std... |
#include <Euclide.hpp>
#include "gtest/gtest.h"
TEST(euclide, result_only)
{
}
|
#pragma once
#include <QtGui>
#include <QWidget>
#include <unordered_map>
#include "TrenchCoat.h"
#include <vector>
//#include <QtCharts>
class BarChart: public QWidget
{
Q_OBJECT
public:
BarChart(std::vector<TrenchCoat> coats, QWidget* parent = 0) :QWidget{ parent }, coats{ coats }{}
protected:
std::vect... |
#include <iostream>
using namespace std;
int n=20;
int f[21][6][6];
int main () {
memset (f, 0, sizeof(f));
f[2][1][0]=1;
f[2][0][2]=1;
for (int i=2; i<n; i++)
for (int j=0; j<=5; j++) {
for (int k=0; k<=3; k++)
f[i+1][j][k+1] += f[i][j][k];
... |
/*
==============================================================================
SeaboardComponent.h
Created: 22 Aug 2014 12:00:00pm
Author: Sean Soraghan
==============================================================================
*/
#ifndef MAINCOMPONENT_H_INCLUDED
#define MAINCOMPONENT_H_INCLUDED
#incl... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "ShineCharacter.h"
void AShineCharacter::ChangeMultiSkill( float rate )
{
// TODO: change Lyre Chart
}
|
#include<bits/stdc++.h>
using namespace std;
int main(){
string A,B,C="",trans="0123456789JQK";
cin>>A>>B;
reverse(A.begin(),A.end());
reverse(B.begin(),B.end());
int len=max(A.size(),B.size());//取A、B字符串中最长的长度
for(int i=0;i<len;++i){
int numA=i<A.size()?A[i]-'0':0;//记录相应A字符串位置的数字,如果超过了A的... |
//#include<stdio.h>
//
//int main() {
// int x, y, xy, z;
// int gcd = 0, lcm = 0;
// do {
// x = 0, y = 0;
// printf("두발을 심어주세요 : ");
// scanf("%d %d", &x, &y);
// xy = x * y;
// if (x > 0 && y > 0) {
// while (1) {
// z = x % y;
// if (z == 0) {
// gcd = y;
// lcm = xy / y;
// break;
// }... |
// This file has been generated by Py++.
#ifndef Tree_hpp__pyplusplus_wrapper
#define Tree_hpp__pyplusplus_wrapper
void register_Tree_class();
#endif//Tree_hpp__pyplusplus_wrapper
|
#include "simple-web-server/server_https.hpp"
#include "simple-web-server/client_https.hpp"
#include "simple-web-server/crypto.hpp"
#define BOOST_SPIRIT_THREADSAFE
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <fstream>
#include <boost/filesystem.hpp>
#include <vector... |
#include "_client.h"
SCREENINFO g_Screen;
cSound g_Sound;
cLeis g_Leis;
#define GRENADE_DECOY_STR "decoy"
#define GRENADE_HE_FLASH_STR "he/flash"
#define GRENADE_MOLOTOV_STR "molotov"
#define GRENADE_SENSOR_STR "sensor"
#define GRENADE_SMOKE_STR "smoke"
int GrenadeEspClassID[5] =
{
CC_CDecoyProjectile,
CC_CBas... |
#pragma once
#include <iostream>
using namespace std;
class LinearEquations {
//用来求解方阵Ax=b
private:
int n; //A的维度
double* A;
double* B; //假设为n*1矩阵
double* C;
int* line;//保存换行后行的顺序
double& mA(int i, int j);
public:
LinearEquations(int n, double* A, double* B, double* C=nullptr);
double* solutionB;
double* s... |
/*************************************************
* Publicly released by Rhoban System, August 2015
* www.rhoban.com
*
* Freely usable for non-commercial purposes
*
* Author : Hugo
* Licence Creative Commons *CC BY-NC-SA
* http://creativecommons.org/licenses/by-nc-sa/3.0
**************************... |
#include <vector>
using namespace std;
vector <int> failure(const vector <int> &arr){
int j = 0;
vector <int> pi(arr.size(), 0);
for(int i = 1; i < arr.size(); i++){
while ( j > 0 && arr[i] != arr[j]){
j = pi[j-1];
}
if(str[i] == str[j] ) {
pi[i] = j + 1... |
#pragma once
#include "ofMain.h"
#define NUM 10
class Ball {
public:
ofIcoSpherePrimitive isp;
ofPoint pos, vel;
float z;
// convert sphere to mesh for manipulations
ofMesh* bmesh;
int index;
void draw(void);
void update(float x, float y);
void init(int index);
};
class ofApp : public ofBaseApp{
public:... |
#ifndef STATIC_LINK
#define IMPLEMENT_API
#endif
#if defined(HX_WINDOWS) || defined(HX_MACOS) || defined(HX_LINUX)
#define NEKO_COMPATIBLE
#endif
#include "common.h"
extern "C" {
DEFINE_KIND(k_ui64);
DEFINE_KIND(k_raw_ui64);
DEFINE_KIND(k_ptr);
}
typedef struct {
hx_uint64 value;
} i64_container;
hx_uint64 val_uin... |
//
// main.cpp
// https://open.kattis.com/problems/bookingaroom
//
// Created by Sofian Hadianto on 31/12/18.
// Copyright © 2018 Sofian Hadianto. All rights reserved.
//
#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char * argv[]) {
ios::sync_with_stdio(false);
cin.tie(NULL);
... |
/*
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 "VulkanPipeline.h"
#include "VulkanSwapchain.h"
#include "VulkanDevice.h"
#include "VulkanShaderStage.h"
#include "VulkanRenderPass.h"
#include "VulkanDescriptorSetLayout.h"
#include "VulkanException.h"
#include "Vertex.h"
#include <vulkan\vulkan.h>
VulkanPipeline::VulkanPipeline(VulkanDevice* devic... |
#include "DrawingObject.h"
#include <iostream>
void DrawingObject::setclass( std::string dclass )
{
this->dclass = dclass;
}
void DrawingObject::setid(std::string id )
{
this->id = id;
}
std::string DrawingObject::getid()
{
return id;
}
std::string DrawingObject::getclass()
{
return dclass;
}
|
#include <Book/GameState2.hpp>
#include <Book/MusicPlayer.hpp>
#include <Book/Utility.hpp>
#include <SFML/Graphics/RenderWindow.hpp>
GameState2::GameState2(StateStack& stack, Context context)
: State(stack, context)
, mWorld(*context.window, *context.fonts, *context.sounds)
, mPlayer(*context.player)
, mGame2Text()
{... |
#include "string.hpp"
sf::String String::get_string() const {
return str;
}
void String::set_string(sf::String _str) {
str = _str;
}
String::String() {
str = sf::String();
}
String::String(char ansiChar, const std::locale &locale) {
str = sf::String(ansiChar, locale);
}
String::String (const char *... |
/// @file src/pt/PtUnaryOp.cc
/// @brief PtUnaryOp の実装ファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2011 Yusuke Matsunaga
/// All rights reserved.
#include "PtUnaryOp.h"
BEGIN_NAMESPACE_YM_BB
// @brief コンストラクタ
// @param[in] file_region ファイル上の位置
// @param[in] opr1 オペランド
PtUnaryOp::PtUnaryOp... |
/*
Reverse List in K groups
Difficulty: EASY
Avg. time to solve
15 min
Success Rate
85%
Problem Statement
You are given a linked list of N nodes and an integer K. You have to reverse the given linked list in groups of size K i.e if the list contains x nodes numbered from 1 to x, then you need to reverse each of the gro... |
#include "data.h"
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
std::string &strip(std::string&s, const char c){
s.erase(std::remove(s.begin(), s.end(), c), s.end());
return s;
}
std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::s... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
QPixmap pixmap_sort(":/resources/img/sort.jpg");
QIcon ButtonIcon(pixmap_sort);
ui->incrementShell->setIcon(ButtonIcon);
ui->increme... |
/*
* Lesson18.cpp
*
* Created on: Nov 9, 2018
* Author: Akash Lohani
*/
#include <iostream>
using namespace std; // @suppress("Symbol is not resolved")
int main(){
/*
* for (initialization; condition; inc/dec){
* instruction-to-repeat
*/
for (int i = 0; i < 5; i++){
cout<< i... |
#include "FlyweightFactory.h"
#include <string>
#include <iostream>
int main(int argc, char *argv[])
{
std::string name = "goooogllleee";
std::cout << "Original name: " << name << std::endl;
std::shared_ptr<FlyweightFactory> factory = std::make_shared<FlyweightFactory>();
for (size_t i = 0; i < name... |
//---------------------------------------------------------------------------
#include "stdafx.h"
//---------------------------------------------------------------------------
#include "ExampleExperiment3DGraphics.h"
//---------------------------------------------------------------------------
#include "Properties.h"
#... |
// This file has been generated by Py++.
#ifndef Rectf_hpp__pyplusplus_wrapper
#define Rectf_hpp__pyplusplus_wrapper
void register_Rectf_class();
#endif//Rectf_hpp__pyplusplus_wrapper
|
/*************************************************************
* > File Name : c1090_2.cpp
* > Author : Tony_Wong
* > Created Time : 2019/11/13 20:59:00
* > Algorithm :
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
in... |
/*
* hardwareCall.cpp
*
* Created on: Jul 7, 2015
* Author: shapa
*/
#include "hardwareCall.h"
#include "BoardSupportPackage.h"
#include "stm32f4xx_hal_conf.h"
#include <string.h>
#include <stdlib.h>
extern "C" {
void SysTick_Handler(void);
void UART8_IRQHandler(void);
void DMA1_Stream0_IRQHandler(v... |
#include <iostream>
#include <string>
#include <climits>
#define MAX 999999999
using namespace std;
class Long {
private:
unsigned int first;
unsigned int second;
public:
Long() : first(0), second(0){}
void Init(int, int);
void Read();
string toString();
void Display();
int countOfDi... |
#include <iostream>
#include<cmath>
using namespace std;
string funnynot(string str)
{
unsigned int n=str.length();
for(unsigned int i=1,j=n-1;i<n&&j>0;i++,j--)
{
if((abs(str[i]-str[i-1])^abs(str[j]-str[j-1])))
return "Not Funny";
}
return "Funny";
}
int main() {
// your code goes here
unsigned int tc;
cin... |
#include "Group3D.h"
Group3D::Group3D()
{
}
Group3D::~Group3D()
{
}
void Group3D::translate(const QVector3D& t)
{
translation += t;
QMatrix4x4 localMatrix;
localMatrix.setToIdentity();
localMatrix.translate(translation);
localMatrix.rotate(rotation);
localMatrix.scale(scaling);
localMatrix = globalTransform... |
#ifndef __DUI_SCROLLBAR_H__
#define __DUI_SCROLLBAR_H__
#include "DUIControlBase.h"
DUI_BGN_NAMESPCE
class DUILIB_API IDUIScrollBar: public CDUIControlBase
{
public:
virtual ~IDUIScrollBar() { NULL; }
virtual BOOL SetScrollBarInfo(LPSCROLLINFO pSi) = 0;
virtual VOID GetScrollBarInfo(LPSCROLLINFO pSi) = 0;
vir... |
#include "ZigZag.h"
void ZigZag::Encryption(string& mesaj, const int key)
{
string* satir = new string[key];
int liner = 0;
int positioner = +1;
for (int i = 0; i < mesaj.length(); i++) {
if (liner == key-1) {
positioner=-1;
}
else if (liner == 0) {
positioner=+1;
}
(*(satir+liner)).push_back(mesaj... |
void setup() {
Serial.begin(9600);
pinMode(13,OUTPUT);
}
void loop() {
// 아날로그 데이터 읽기 - 0~1023 사이값을 읽을 수 있다.
// 어두울수록 숫자가 크다. 빛이 얼마나 세냐에 따라서 저항이 달리진다.
// 어두울 때는 값이 커지고, 밝을 때는 값이 작아진다. => 큰값 어둠, 작은값 밝음
// 100k 657 ~ 5 => 652
// 10k 49 ~ 969 => 920 사잇값이 제일 크다. 빛의 세기에 따라 민감하게 반응하다.
// 10k 보다 낮은 저... |
//
// Box.h
// Assignment_5_Project
//
// Created by Mohamad Awab Alkhiami & Ghiyath Alaswad on 21/06/2018.
//
#ifndef Box_h
#define Box_h
#include<algorithm>
class Box {
private:
std::vector<int> triangleIndices;
std::vector<Box> Boxes;
Vec3Df min;
Vec3Df max;
public:
Box() {
... |
#include "SignalHandling.hpp"
#include "SignOut.hpp"
#include "ConversationControl.hpp"
#include "FileHandling.hpp"
#include "GlobalVariables.hpp"
#include "ClasslessLogger.hpp"
#include "ConsoleWindow.hpp"
#include "ChatWindow.hpp"
#include <utility>
#include <cstring>
namespace SignalHandling
{
namespace
{
static b... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QString>
#include <math.h>
double num_first;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui->pushButton0,SIGNAL(clicked()),this,SLOT(digits_numbers()));
connect(ui->... |
//
// PartyVideoDJ - YouTube crossfading app
// Copyright (C) 2008-2017 Michael Fink
//
/// \file ControlBarForm.hpp Form for upper control bar
//
#pragma once
#include <functional>
class ControlBarForm :
public CDialogImpl<ControlBarForm>,
public CDialogResize<ControlBarForm>,
public CWinDataExchange<Contro... |
//
// GA-SDK-CPP
// Copyright 2018 GameAnalytics C++ SDK. All rights reserved.
//
#pragma once
#include <vector>
#include <string>
#include <map>
#include <mutex>
#include <functional>
#include "Foundation/GASingleton.h"
#include <json/json.h>
#include "GameAnalytics.h"
namespace gameanalytics
{
namespace state
... |
#ifndef NOMA_TEST_SCREEN_HPP_
#define NOMA_TEST_SCREEN_HPP_
#include "Screen.hpp"
namespace noma
{
class TestScreen : public Screen
{
public:
TestScreen() {}
virtual ~TestScreen() {}
virtual void initialize() override {}
virtual void update(double dt) override {}
... |
#include"util.h"
using namespace std;
float *Initialize(int size, int seed)
{
default_random_engine e;
uniform_real_distribution<float> distribution(0.0,10000000.0);
e.seed(seed);
float *data = (float*)malloc(sizeof(float) * size);
for (int i = 0; i < size; ++i){
*(data + i) = distribution... |
#ifndef _HS_SFM_SFM_FILE_IO_EXTRINSIC_PARAMS_SET_LOADER_HPP_
#define _HS_SFM_SFM_FILE_IO_EXTRINSIC_PARAMS_SET_LOADER_HPP_
#include <string>
#include <fstream>
#include "hs_sfm/sfm_utility/camera_type.hpp"
namespace hs
{
namespace sfm
{
namespace fileio
{
template <typename _Scalar>
struct ExtrinsicParamsSetLoader
{... |
#include <iostream>
using namespace std;
int main()
{
float N;
cin >> N;
float r = N / (3.14 * 2);
float S = r * r * 3.14;
cout << S;
}
|
#ifndef _AMBIENTE_MOCHILA
#define _AMBIENTE_MOCHILA
#include "Ambiente.h"
#include "Poblacion.h"
#include "CriaturaMochila.h"
#include <fstream>
class AmbienteMochila: public Ambiente {
friend class CriaturaMochila;
private:
ifstream lector;
int cantidadPiedras;
double pesoMochila;
double *vectorPrecio;
dou... |
//**************************************************************************
//**
//** See jlquake.txt for copyright info.
//**
//** 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 ... |
#include <algorithm>
#include <array>
#include <cstdio>
#include <iostream>
#include <iterator>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define ll long long
using namespace std;
typedef tuple<ll, ll, ll> tp;
typedef pair<ll, ll> pr;
const ll MOD = 1000000007;... |
#ifndef CONFIG_H_
#define CONFIG_H_
#include <map>
#include <string>
#include <sstream>
#include <initializer_list>
namespace revel
{
class Config
{
static std::map<std::string, std::string> s_ConfigMap;
private:
static std::map<std::string, std::string> init()
{
std::map<std::string, std::st... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
double S = 0, A = 1;
for (double i = 1; i < 40; i += 2)
{
S += i / A;
A *= 2;
}
printf("%.2lf\n", S);
return 0;
} |
#include <iostream>
#include <timing/chrono.h>
#include "Curve.h"
#include "ticks.h"
using namespace std;
Curve::Curve(string name_, Rhoban::chrono *start_) : name(name_), start(start_), count(0)
{
values = new deque<CurveEntry*>();
}
Curve::~Curve()
{
delete values;
}
void Curve::push(double value)
{
... |
// AUTHOR: Sumit Prajapati
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mk ... |
#include "ClasseB.h"
ClasseB::ClasseB()
{
}
ClasseB::~ClasseB()
{
}
|
/*
* SPDX-FileCopyrightText: (C) 2014 Daniel Nicoletti <dantti12@gmail.com>
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef ROOT_H
#define ROOT_H
#include <Cutelyst/Controller>
using namespace Cutelyst;
class Root : public Controller
{
Q_OBJECT
C_NAMESPACE("")
public:
Root(QObject *app);
~Root(... |
#ifndef _OPTION_H_
#define _OPTION_H_
#include "payoff.h"
#include "marketvariable.h"
#include "derivatives.h"
#include <vector>
enum OptionType { Call = 1, Put = -1 };
/* Barrier feature : In, Out */
enum BarrierFeature { UI, UO, DI, DO };
class Option: public Derivative {
public:
Option() {};
Option(double... |
/*************************************************************************
> File Name : CmePermissions.cpp
> Author : YangShuai
> Created Time: 2016年08月12日 星期五 16时31分35秒
> Description :
************************************************************************/
#include"Primitive.h"
int32 Cme_Permis... |
#include <Adafruit_MotorShield.h>
#include <Wire.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"
#include <Servo.h>
#define PHOTO_GATE 7
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_StepperMotor *foodPodMotor = AFMS.getStepper(200,2);
Servo foodPodServo;
int8_t currentFoodPodPosition = -1;
String... |
/* NO WARRANTY
*
* BECAUSE THE PROGRAM IS IN THE PUBLIC DOMAIN, THERE IS NO
* WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE
* LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE AUTHORS
* AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
* WARRANTY OF ANY KIND, EITHER E... |
#include<stdio.h>
#include "myLog.h"
int main()
{
LOGINIT();
for (int i = 0; i < 1000; i++)
{
LOGE("%f .....%d ", 12563.0 * i, i);
}
LOGEnd();
getchar();
return 0;
}
|
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <vector>
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget* parent = 0);
~MainWindow();
void initializeGraph();
void nextColor();
private slots:
vo... |
/*
* Timer0.cpp
*
* Created: 26.06.2015 10:03:45
* Author: User
*/
#include "Timer0.h"
// default constructor
Timer0::Timer0(prsk p)
{
div=p;
} //Timer0
void Timer0::Start ()
{
TCCR0 &= ~(0x07);
TCCR0 |= div;
}
void Timer0::Stop ()
{
TCCR0 &= ~(0x07);
}
void Timer0::Set_Tcnt (unsigned char val)
{
TCNT0 = va... |
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int, int> temp_map;
vector<int> result;
unordered_map<int, int>::iterator hit;
int index = 0;
int temp = 0;
if(nums.size() < 2) {
return result;
}
... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll n, k, m;
cin >> n >> k;
m = n%(2*k);
ll ans = 0LL;
if(2*k > n){
ans = 10;
}
else {
ans += 5*(((n-m)/(2*k)) + ((n-m)%(2*k) != 0));
n -= ((2*k)-m);
ans += 5;
ans += 5*((n/(2*k)) + ((n%(2*k)) != 0));
... |
/*
* Copyright (c) 2009-2012 André Tupinambá (andrelrt@gmail.com)
*
* 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... |
#pragma once
#include "DataBase.h"
namespace Admin = ECommerce::Admin;
void Admin::Menu(App::DataBase* const& database)
{
std::string user_name{};
std::string password{};
std::cout << "User Name: ";
getline(std::cin, user_name);
std::cout << "Password: ";
getline(std::cin, password);
bool is_here ... |
#include "stringutil.h"
#include <CORE/BASE/checks.h>
#include <algorithm>
/**
* Identifiers for {@link core::util::prettySize}
*/
static const char *g_sizePostfix[] = {" B",
" KiB",
" MiB",
" GiB",
... |
#pragma once
#include <landstalker-lib/patches/game_patch.hpp>
#include <landstalker-lib/constants/offsets.hpp>
#include <landstalker-lib/constants/item_codes.hpp>
#include "../../logic_model/hint_source.hpp"
#include "../../logic_model/randomizer_world.hpp"
class PatchSpellBookTeleportOnUse : public GamePatch
{
pri... |
#include <cstdio>
#include <iostream>
#include <set>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <map>
#include "llvm/IR/Function.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/LLVMContext... |
#pragma once
#include <ctime>
#include <iostream>
#include <string>
#include <boost/array.hpp>
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/asio.hpp>
//#include
// logging set
#include <boost/log/core.hpp>
#include <boost/log/trivial.hpp>
#include <boost/log/expressions.hpp>
... |
#include <iostream>
#include<stdlib.h>
#include<stdio.h>
#include<cstdlib>
#include<time.h>
using namespace std;
struct node
{
int data;
node * next;
node * prior;
} node;
typedef struct node * nodeLink;
//双向循环链表的创建
nodeLink create()
{
int n;
printf("请输入要创建的链表的个数\t");
scanf("%d",&n);
... |
#include <SPI.h>
#include <FreeStack.h>
#include <SdFat.h>
#include <vs1053_SdFat.h>
/*
// Below is not needed if interrupt driven. Safe to remove if not using.
#if defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_Timer1
#include <TimerOne.h>
#elif defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEAN... |
// CSV2PCD.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
using namespace std;
#define FILE_PATH "pts_camera_frame.csv"
void tokenize(const string& str... |
#define MAX_RF 5
#define MAX_AF 10
#define MAX_USER 10001
#define MAX_FCNT 500001
struct USER {
int userID;
struct USER* prev;
};
USER* GetNewFriend(int id) {
USER* newFriend = new USER;
newFriend->userID = id;
newFriend->prev = nullptr;
return newFriend;
}
USER* userList... |
#include<iostream>
#include<string.h>
using namespace std;
struct node
{
char data;
node *l,*r;
};
node* newNode (int data)
{
node *temp = new node;
temp->data = data;
temp->l = NULL;
temp->r = NULL;
return temp;
}
node *insert(int *i,char *str)
{
int index = *i; // st... |
#include <bits/stdc++.h>
using namespace std;
int solve(vector<int> rating)
{
int ans = 0;
for (int i = 0; i < rating.size(); i++)
{
for (int j = i + 1; j < rating.size(); j++)
{
for (int k = j + 1; k < rating.size(); k++)
{
if (rating[i] < rating[j] <... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.