text stringlengths 8 6.88M |
|---|
/* Copyright 2017-2018 All Rights Reserved.
* Gyeonghwan Hong (redcarrottt@gmail.com)
*
* [Contact]
* Gyeonghwan Hong (redcarrottt@gmail.com)
*
* 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 Lic... |
#include "ResolveCMD.h"
#include <regex.h>
#include <stdio.h>
#include <cstring>
#include <iostream>
#include <EZTools.hpp>
using namespace std;
Json::Value RCMD::resolve(EZIO *pRoot, string cmd, string btn, string pwd) {
vector<string> C = EZTools::format(cmd, ' ');
vector<string> L = EZTools::format(pwd + ... |
/*===========/*==============================================================================
Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
Queen's University, Kingston, ON, Canada. All Rights Reserved.
See COPYRIGHT.txt
or http://www.slicer.org/copyright/copyright.txt for details.
Unless req... |
#ifndef __LayerGame_H__
#define __LayerGame_H__
#include "Common.h"
class Item;
class AI;
class TankFriend;
class LayerGame : public CCLayer
{
public:
enum FAILURE_REASON { TIMEOUT, HOMEDESTROY, TANKDIE };
static void gameOver(FAILURE_REASON reason);
static LayerGame* create(unsigned int index);
bool init(unsig... |
#include <cstdio>
#include <cstring>
int main()
{
char str[256];
while (gets(str))
{
for (int i = strlen(str) - 1; i >= 0; i--)
printf("%c", str[i]);
printf("\n");
}
} |
/*
*
* 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 must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions ... |
#include <sstream>
#include <iomanip>
#include "BarCode.h"
BarCode::BarCode() {}
BarCode::operator std::string() const
{
std::stringstream result;
result << std::setw(13) << std::setfill('0') << value_;
return result.str();
}
bool BarCode::operator<(const BarCode other) const
{
return value_ < other.value_... |
#pragma once
#include "MemberTypeLibraries.h"
#include <type_traits>
namespace pumipic {
//Forware declare subsegment
template <typename Type, typename Device>
class SubSegment;
template <typename Type, typename Device>
class Segment {
public:
using Base=typename BaseType<Type>::type;
using Vi... |
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
char a[1005];
void change(int i,int j)
{
char t;
i--;
j--;
while(i < j)
{
t = a[i];
a[i] = a[j];
a[j] = t;
i++;
j--;
}
}
int main()
{
int n,num[101];
while(~scanf("%s",a))
... |
// 这一题,如果用动态规划(LIS)的方法求,会超时,
// 这里使用的是树状数组,
// 因为输入数据允许ai = 0 ,所以要注意0的处理,
// 其实处理0完全可以整体+1
// 从左往右遍历求得序列中在元素左边比该元素小的元素个数,从右往左遍历求得序列中在元素右边比该元素小的元素个数,
// 然后将两个数组相应元素相乘,再进行累加,最终得到的即为满足题目要求的序列的个数。
#include <cstdio>
#include <cstring>
#define lowbit(i) ((i) & -(i))
const int MAXN = 32767 + 10;
int c[MAXN];
int n;
// 因为输入数... |
#include "config.hpp"
#include "kernels/kernel_v2.hpp"
#include "utils/util.hpp"
#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <utility>
#include <vector>
#if defined(OCTORAD_HAVE_VC)
#include <Vc/Vc>
#endif
namespace octotig... |
#include <cstdio>
#include <iostream>
using namespace std;
int main()
{
int x,y,z,t;
float avg,m,n,res;
scanf("%d",&t);
while(t--)
{
scanf("%d %d %d",&x,&y,&z);
avg=(x+y)/3.0;
m=x-avg;
n=y-avg;
if(x<=avg)
{
printf("0\n");
}
... |
#include<bits/stdc++.h>
using namespace std ;
int main()
{
int t ;
cin>>t ;
while(t--)
{
int n ;
cin>>n ;
vector<int> vec ;
int my_int ;
int flag ;
for(int i = 0 ;i<n ;i++)
{
cin>>my_int ;
vec.push_back... |
#include <bits/stdc++.h>
using namespace std;
bool isHappy(int n)
{
while (n / 10 > 0)
{
int sum = 0;
while (n > 0)
{
int rem = n % 10;
sum = rem * rem + sum;
n = n / 10;
}
n = sum;
}
if (n == 1 || n == 7)
return true;... |
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
using namespace std;
struct persona{
char nombre [20];
int edad;
float est;
char sexo;
};
struct elemento{
struct persona arreglo[5], *ptr;
};
int main()
{
struct elemento var, *ptrs;
ptrs=&var;
for(ptrs->ptr=ptrs->arreglo;ptrs->ptr<=&ptrs... |
#pragma once
#include<iostream>
using namespace std;
class myStack
{
int* arr;
int max;
int Csize;
public:
myStack(int = 0);
myStack(const myStack&);
void AddElement(int);
int RemoveElement();
bool IsEmpty();
bool IsFull();
int size();
void sort();
void display();
/*int last();
int* Get... |
#pragma once
#include "Player.h"
#include "stage.h"
#include "camera.h"
class Platform : public stage
{
public:
Platform(float x = 500 , float y = 500 );
~Platform();
bool Collision(character* , int* , sf::Vector2u& ,sf::Vector2u&);
void render(sf::RenderWindow& , Camera&);
void update(int, int, ... |
#pragma once
#if _DEBUG
//#pragma comment(lib, "fbxsdk_mt2008d.lib")
#else
//#pragma comment(lib, "fbxsdk_mt2008.lib")
#endif
namespace Singularity
{
namespace Content
{
class IContentImporter;
class IModelImporter;
class MeshLoader;
//class FbxModelImporter;
class ObjModelImporter;
... |
#include "basic_pipeline.hh"
#include <future>
#include <unistdx/base/log_message>
namespace {
std::promise<int> return_value;
}
void
bsc::graceful_shutdown(int ret) {
try {
return_value.set_value(ret);
} catch (const std::future_error& err) {
sys::log_message(__func__, err.what());
}
}
int
bsc::wait_and... |
class Solution {
public:
int numRabbits(vector<int>& answers) {
if (answers.size() == 0)
return 0;
sort(answers.begin(), answers.end());
int group = answers[0];
int remain = group;
int total = group + 1;
for (int i = 1; i < answers.size(); i++)... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Graphics.Effects.1.h"
WINRT_EXPORT namespace winrt {
namespace Windows::Graphics::Effects {
struct IGraphicsEffect :
Windows::Foundation::IInspectable,
impl::consum... |
// 级数求和
// https://vijos.org/p/1127
#include <bits/stdc++.h>
using namespace std;
int main() {
int n = 1;
int a = 0;
double sum = 0;
cin >> a;
while (sum <= a) {
sum += 1.0 / n;
n++;
}
cout << n - 1 << endl;
return 0;
} |
#include "FileManager.hpp"
#include "File.hpp"
namespace engine
{
ObjectRef<IInputFile> FileManager::OpenFile(const std::string& fileName)
{
//{
// std::lock_guard<std::mutex> guard(m_fileMapMx);
// auto iter = m_fileMap.find(fileName);
// if (iter != m_fileMap.end())... |
//
//
//
#include "MenuHandler.h"
#include "LCDKeys.h"
MenuHandler::MenuHandler (Menu &menu)
: actual(&menu)
{
}
void MenuHandler::begin ()
{
actual->Activate ();
}
void MenuHandler::HandleKeys ()
{
// depending on which button was pushed, we perform an action
switch (LCDKey::Pressed ())
{
// push butto... |
/*!
*@FileName: KaiXinApp_RecentNews.h
*@Author: GoZone
*@Date:
*@Log: Author Date Description
*
*@section Copyright
* =======================================================================<br>
* Copyright ? 2010-2012 GOZONE <br>
* All Rights Reserved.<br>
* The file is generated by Kaixi... |
#include "point.h"
void PointMaterial::apply(unsigned int light_pass)
{
ToonMaterial::apply(light_pass);
prog_->setUniformValue("texture.density", texture.density);
prog_->setUniformValue("texture.radius", texture.radius);
prog_->setUniformValue("texture.circleColor", texture.circleColor);
prog_->setUn... |
#ifndef SIMULATIONFILEPARSER_H
#define SIMULATIONFILEPARSER_H
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <map>
#include <vector>
#include "College.h"
using namespace std;
class SimulationFileParser {
private:
string fileName;
ifstream file;
College* collegePtr;
public:
Sim... |
/* 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... |
/***************************************************************************
* Filename : Renderer.h
* Name : Ori Lazar
* Date : 29/10/2019
* Description : Declares the rendering interface for this engine.
* Contains per-scene parameters, cubemap, camera, lighting calculations, etc....
* ... |
#ifndef __PAR_H
#define __PAR_H
template <typename T1, typename T2>
class par
{
T1 primero;
T2 segundo;
public:
par();
par(const T1 &c1, const T2 &c2);
par(const par<T1,T2> &p);
T1& First();
T2& Second();
bool operator< (const par<T1,T2> & p) const;
par<T1,T2> & operator= (const par<T1,T2>& p)... |
/*********************************************************************************************************************************************************
* *
* ... |
while (true)
{
//Všechna volání funkcí musí být mezi NewFrame a Render
ImGui::NewFrame();
//Umístí levý horní roh okna 100 pixelů od horního levého okraje obrazovky
ImGui::SetNextWindowPos(ImVec2(100.0f, 100.0f);
if (ImGui::Begin("Window"))
{
if (ImGui::Button("Button"))
ImGui::Text("Foo");
else
ImGui:... |
/**
* IIterator.h
* IIterator class (interface of iterator)
**/
#ifndef __I_ITERATOR__
#define __I_ITERATOR__
#include "Person.h"
class IIterator
{
public:
virtual ~IIterator(){}
virtual Person* next() = 0;
};
#endif //__I_ITERATOR__
|
#include "Rifle3.hpp"
//the red rifle
Rifle3::Rifle3(RenderWindow* window, b2World* World, TempObjectHandler* toh, float PositionX, float PositionY, int Ammunition):Weapon(window, World, toh, PositionX, PositionY, Ammunition){
damage=5;
clipsize=12;
clip=clipsize;
ammunition=Ammun... |
#ifndef INCLUDED_HEMELBEXTRACTIONFILE_H
#define INCLUDED_HEMELBEXTRACTIONFILE_H
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <rpc/xdr.h>
#include <argp.h>
#include <vector>
#include <math.h>
#include <string.h>
#include <tr1/unordered_map>
#include <string>
#include <sstream>
#include "HemeLBEx... |
//============================================================================
//befriending class: gdcm::Sorter
//friendly function: gdcm::operator<<
//friendDeclLoc: /Users/mg/WORK/friend/measure/ITK/src/ITK/Modules/ThirdParty/GDCM/src/gdcm/Source/MediaStorageAndFileFormat/gdcmSorter.h:41:24
//defLoc: /Users/mg/WORK/... |
/*
* UAE - The Un*x Amiga Emulator
*
* Save/restore emulator state
*
* (c) 1999-2001 Toni Wilen
*
* see below for ASF-structure
*/
/* Features:
*
* - full CPU state (68000/68010/68020/68030/68040/68060)
* - FPU (68881/68882/68040/68060)
* - full CIA-A and CIA-B state (with all internal registers)
* - saves all custom ... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
string a;
cin>>a;
int n = a.length(), cnt[300][2];
for(int i=0; i<300; i++) cnt[i][0] = cnt[i][1] = 0;
int i = 0, j = n-1;
while(i<(n/2) && j>=int(ceil(float(n)/2)))
{
if(a[i]!=a[j])
{
cnt[a[i]][0]++;
... |
#include"head.h"
#include<time.h>
# ifdef __MergeSort
int main(int argc, char* argv[])
{
int A[] = { 1,2,3,5,7,12, 8,9,22, 11, 42, 32, 35, 21, 25, 0 };
int p = 0, r = 15;
for (int i = 0; i <= 15; i++) printf("%d ", A[i]); printf("\n");
clock_t t_start = clock();
MergeSort(A, p, r);
clock_t t_... |
#ifndef NETWORKVIEW_H
#define NETWORKVIEW_H
/// @file NetworkView.h
/// @brief NetworkView のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2013 Yusuke Matsunaga
/// All rights reserved.
#include "led_nsdef.h"
#include "GateType.h"
namespace nsYm {
namespace nsLed {
class GateMgr;
class GateOb... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,max,i, t;
vector<int> l,r;
int r0 , r1 , l0 , l1;
r0 = r1 = l0 = l1 = 0;
cin >> N;
max = N;
while(max--){
int le,ri;
cin >> le >> ri;
l.push_back(le);
r.push_back(ri);
}
for(i = 0; i < N ; i++)
{
if(r[i] == 1)
{
r1++;
... |
/*
* SPDX-FileCopyrightText: (C) 2017-2022 Matthias Fehring <mf@huessenbergnetz.de>
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef CUTELYSTVALIDATORNOTIN_P_H
#define CUTELYSTVALIDATORNOTIN_P_H
#include "validatornotin.h"
#include "validatorrule_p.h"
namespace Cutelyst {
class ValidatorNotInPrivate : public Va... |
#include "GPIO.h"
void C_GPIO::init_pin(GPIO_TypeDef * port, U16 pin)
{
_pin = (U16)1 << pin;
_port = port;
assert_param(IS_GET_GPIO_PIN(_pin));
_pin_number = pin;
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_Level_3;
GPIO_InitS... |
/*
*
*/
#ifndef __WORLD_H
#define __WORLD_H
#include "object.h"
#include "terrain.h"
#include "camera.h"
#include "player.h"
#include "audio.h"
#include "enemy.h"
#include "gui.h"
#include "h.h"
class World
{
private:
float max_seconds_of_one_game_; // s
float timeElapsed_; // s
bool game... |
#include "SceneGame.h"
#include "Net.h"
#include "canMove.h"
bool SceneGame::init()
{
CCLayer::init();
CreatePlate();
addCtrlPanel();
_selectSprite = CCSprite::create("selected.png");
_selectSprite->setVisible(false);
_selectSprite->setScale(.6f);
addChild(_selectSprite, Z_STONE);
Stone::_d = winSize.height... |
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
void solve(){
int n, m, a, b;
cin >> n >> m >> a >> b;
if( n * a != m * b) {
cout << "NO\n"; return;
}
cout << "YES\n";
vector< string > g(n);
vector <int> col(m,b);
for(int i = 0; i < n; i++){
int r... |
#pragma once
extern "C"
{
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "libswscale/swscale.h"
#include "libavutil/avutil.h"
#include "libavutil/mathematics.h"
#include "libswresample/swresample.h"
#include "libavdevice/avdevice.h"
#include "inttypes.h"
#include "SDL.h"
#include "SDL_thr... |
#pragma once
#ifndef J_MATH_COORDINATEFRAME_H_
#define J_MATH_COORDINATEFRAME_H_
#include <iostream>
#include "vector.h"
#include "point.h"
namespace j {
namespace math {
// A coordinate frame in three-dimensional space. Defined by an origin point (p) and three base vectors (u, v, w).
template<typename valuetype>
st... |
//This is the implementation for the Medusa class.
//Please see the corresponding header file for details about how to use it.
#include "Medusa.hpp"
#include "Die.hpp"
Medusa::Medusa(std::string name)
{
this->name = name;
this->type = "Medusa";
this->armor = 3;
this->maxStrength = 8;
this->strength = 8;
this->d... |
//**********************************************************
// Author: Danielle Lamb and Kirklyn Milgrim
// Date: February 26, 2019
// Purpose: Ask user to enter data, stores data in variables, and prints to user.
//**********************************************************
#include <iostream>
#include <string>
... |
#ifndef Sphere_h
#define Sphere_h
#include "Geometry.hpp"
class Sphere : public Geometry {
public:
Sphere(float radius, float slices, float stacks, bool stereo = false) {
this->radius = radius;
this->slices = slices;
this->stacks = stacks;
this->stereo = stereo;
indicesNu... |
#pragma once
#include <stdexcept>
#include <string>
namespace mylib
{
namespace detail
{
namespace exception
{
// Custom exception class to be used for more practical throwing
class Exception : public std::runtime_error
{
public:
Exception(const std::string & message, const char * file, unsig... |
/***************************************************************************
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... |
/* Copyright 2018 Istio Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... |
#include <iostream>
#include <vector>
using namespace std;
int NumOf1(int num) //统计其中的1的个数
{
int count = 0;
while (num)
{
num = num & (num - 1);
count++;
}
return count;
}
void CalSum(vector<float> &nums, float resleft, float resright, ... |
#define SKP_GET_SINGLE_ELEMENT( \
PyKlass, \
PyKlassType, \
proc, \
_self_ref, \
_target_ref, \
msg ) { \
PyKlass *py_obj = (P... |
#ifndef _HS_SFM_BUNDLE_ADJUSTMENT_CAMERA_SHARED_VECTOR_FUNCTION_HPP_
#define _HS_SFM_BUNDLE_ADJUSTMENT_CAMERA_SHARED_VECTOR_FUNCTION_HPP_
#include <vector>
#include <utility>
#include "hs_math/linear_algebra/eigen_macro.hpp"
#include "hs_sfm/sfm_utility/radial_distortor.hpp"
#include "hs_sfm/sfm_utility/decentering... |
#pragma once
enum MoveType {
Straight,
Arbitrarily,
};
|
#pragma once // Include guard
#include "abstract_solver.h"
class ImplicitSolver : public AbstractSolver {
protected:
/**
* @brief The A matrix from AX=B equation of the Thomas Algorithm
* A is a matrix with 1 it's main diagonal and other values in the diagonal
* above it.
* AX=B coresponding to the linea... |
#ifndef MONHOC_H
#define MONHOC_H
#include <string>
using std::string;
class MonHoc
{
public:
MonHoc();
virtual ~MonHoc();
string maMH() const;
void setMaMH(const string &maMH);
string tenMH() const;
void setTenMH(const string &tenMH);
private:
string m_maMH;
string ... |
#include <cstdlib>
#include <ostream>
#include <sys/stat.h>
#ifndef MYHEAP
#define MYHEAP
class HeapEmpty
{
};
class HeapFull
{
};
class NotFound
{
};
template <class ItemType>
class Heap
{
public:
Heap();
// Constructor
// Pre: None
// Post: Heap is initialized
~Heap();
// Destructor
// Function: Destroys... |
#ifndef TOKEN_H
#define TOKEN_H
enum TokenType
{
TT_KEYWORD,
TT_CBRACKET_OPEN,
TT_CBRACKET_CLOSE,
TT_PASBRACKET_OPEN,
TT_PASBRACKET_CLOSE,
TT_NUMBER,
TT_PREPROC,
TT_COMMENT,
TT_STRING,
TT_SPECIALCHAR,
TT_SYMBOL,
TT_TYPE,
TT_USERTYPE,
TT_CLASSNAME,
TT_FUNCT... |
//---------------------------------------------------------------------------
#ifndef Experiment2_1H
#define Experiment2_1H
//---------------------------------------------------------------------------
#include "Experiment.h"
#include "LinearAlgebra.h"
#include "GLGeometryViewer.h"
//-----------------------------------... |
#include "classification.h"
#include "ui_classification.h"
#include <QApplication>
#include <QTableView>
#include <QObject>
#include <QDate>
#include <QCheckBox>
#include <QSqlQuery>
#include <QTableWidget>
classification::classification(QWidget *parent) :
QWidget(parent),
ui(new Ui::classification)
{
ui->... |
#include "PbConvertor.h"
#include "Test.pb.h"
#include "Test.h"
int main()
{
testNamespace::TestMessage testMessage;
testNamespace::TestChildMessage testChildMessage;
testChildMessage.int32Field = -123;
testChildMessage.stringField = "Hello, Kobe Bryant.";
testChildMessage.testGrandchildMessageFie... |
#ifndef BAKERUI_H
#define BAKERUI_H
#include "../main.h"
#include "PizzaUI.h"
class BakerUI
{
public:
BakerUI();
void startUI();
void bakerui_header();
private:
PizzaUI pizzaui;
};
#endif // BAKERUI_H
|
#include "Queen.h"
Queen::Queen(int color, int row, int col) : ChessPiece(color, row, col)
{
if (color == 0)
{
this->symbol = 'Q';
}
else
{
this->symbol = 'q';
}
this->name = "Queen";
};
// Function to return Piece Name
std::string Queen::getName() const
{
return name;
}
// Function to get Piece symbol t... |
#include<bits/stdc++.h>
using namespace std;
int find_touches(int pos,int mask,vector<string> v,int** dp)
{
if(!(mask&(mask-1))&&mask)
// everything was recongnised successfully when mask contains only one bit set
return 0;
if(pos == -1||mask == 0)
return 100000;
if(dp[pos][mask]!=INT_MAX)
{
retu... |
#include "../../hcomm/include/common.h"
/*
char log_t::fname[255];
bool log_t::opened = 0;
bool log_t::screen = 0;
sem_t log_t::sem;
#define log log_t::log
*/
/*
char *inttostr(int a)
{
char bf[255];
sprintf(bf,"%d", a);
return bf;
}*/
int strtoint(char *a)
{
int b;
sscanf(a, "%d", &b);
return b;
}
bool strs... |
/*
* Copyright (C) 2007-2015 Frank Mertens.
*
* Use of this source is governed by a BSD-style license that can be
* found in the LICENSE file.
*
*/
#include <flux/testing/TestSuite>
#include <flux/stdio>
#include <flux/System>
#include <flux/syntax/SyntaxDebugger>
#include <flux/syntax/SyntaxDefinition>
using n... |
#include "api.hpp"
#include <nlohmann/json.hpp>
#include "translator/Factory.h"
using json = nlohmann::json;
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#else
#define EMSCRIPTEN_KEEPALIVE
#endif
template <class T>
json API(const std::vector<T>& container) {
auto json = json::array();
for (auto& it : container... |
//
// Copyright (c) 2003--2009
// Toon Knapen, Karl Meerbergen, Kresimir Fresl,
// Thomas Klimpel and Rutger ter Borg
//
// 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)
//
// THIS FILE IS AUTOMATICALLY GENERATED
... |
/*
* orange-c-client.h Created on: Jun 12, 2019 Author: NullinV
*/
#ifndef ORANGE_C_CLIENT_H_
#define ORANGE_C_CLIENT_H_
#include <map>
#include <string>
#include <curl/curl.h>
#include <jansson.h>
#include <openssl/evp.h>
struct memory_struct {
char *memory = NULL;
size_t size = 0;
};
void client_init(int a... |
/**
*文件:include/StdAFx.h
*共用库
*/
#ifndef __STD__AFX__H__
#define __STD__AFX__H__
#include <iostream>
#include <string>
#include <cstdlib>
#endif |
#include<stdio.h>
int main()
{
int i,j,k,bin[3][3],move[6],a[6],min1,min,t,count;
while(1)
{
t=0;
count=0;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
if(scanf("%d",&bin[i][j]) == EOF) return 0;
}
}
move[0]=bin[1][... |
// Copyright [2015] <lgb (LiuGuangBao)>
//=====================================================================================
//
// Filename: http.hpp
//
// Description: http 处理
//
// Version: 1.0
// Created: 2015年03月03日 15时10分44秒
// Revision: none
// Compiler: gcc
//
// Au... |
#ifndef __Resource_H__
#define __Resource_H__
#include <memory>
#include "GL/glew.h"
class Resource : public std::enable_shared_from_this<Resource>
{
public:
enum class BindFlags : uint32_t
{
None = 0x0,
Vertex = 0x1,
Index = 0x2,
Con... |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll m,n,t,i,k=0;
string s;
cin>>n>>t>>s;
for(i=0;i<n-1;i++)
{
if(s.substr(0,i+1) ==s.substr(n-i-1)) { k=i+1; }
}
cout<<s;
for(i=1;i<t;i++)
{
cout<<s.substr(k);
}
}
|
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(){
int n,q;
cin>>n>>q;
vector<int>a(n);
for(int i=0;i<n;i++) cin>>a[i];
sort(a.begin(),a.end());
for(int i=0;i<q;i++){
int x;cin>>x;
auto it=lower_bound(a.begin(),a.end(),x);
if(it==a.end()){
if(n%2==0) cout<<"POSITIVE"<... |
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
#include "stdafx.h"
#include "KoningCharacter.h"
#include "Player.h"
std::shared_ptr<Character> KoningCharacter::Create(const std::string name, int order)
{
std::shared_ptr<Character> character(new KoningCharacter(name, order));
return std::move(character);
}
int KoningCharacter::CollectCash()
{
if(ownedBy){
ret... |
//
// Created by ariel.simulevski on 29.04.20.
//
#ifndef TINYGRAPH_CONNECTIONS_H
#define TINYGRAPH_CONNECTIONS_H
namespace tinygraph {
std::shared_ptr<std::map<std::string, std::any>> vertex_link(std::shared_ptr<Vertex> from, std::shared_ptr<Vertex> to, bool undirected);
}
#endif //TINYGRAPH_CONNECTIONS_H
|
// Copyright (c) 2015 University of Szeged.
// Copyright (c) 2015 The Chromium Authors.
// All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SPROCKET_BROWSER_BROWSER_CONTEXT_H_
#define SPROCKET_BROWSER_BROWSER_CONTEXT_H_
#include "base... |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
typedef tuple<ll, ll, ll> tp;
typedef pair<ll, ll> pr;
const ll MOD = 1000000007;
const ll INF = 1e18;
template <typename T> void print(const T &t) {
std::copy(t.cbegin(), t.cend(),
std::ostream_iterator<typename T::value_type>(std::co... |
#ifndef _TNA_VULKAN_BUFFER_H_
#define _TNA_VULKAN_BUFFER_H_
#include "../../common.h"
#include "../buffer.h"
#include <vulkan/vulkan.h>
#include "vkmem_alloc.h"
namespace tna
{
struct VkVertexBuffer
{
VkBuffer m_buffer;
VmaAllocation m_allocation;
uint32_t m_num_vertices;
};
struct VkInde... |
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define fr(i,n) for (ll i=0;i<n;i++)
#define fr1(i,n) for(ll i=1;i<=n;i++)
map<ll , ll> cnt;
int main()
{
ll m,n,i,j=0,res,x,y,p;
cin>>n;
ll a[n];
ll sum=0, ans=0;
fr(i, n)ci... |
#include<iostream>
using namespace std;
#include<vector>
// // 对vector容器的容量和大小操作
// empty() //判空
// capacity() //容量
// size() //大小
//resize() //修改大小,大则填充,小则删除
void prientVector(vector<int> &v)
{
for(vector<int>::iterator it = v.begin();it!=v.end();it++)
{
cout<<*it<<" ";
}
cout<<endl;
}
... |
#if 0
#include <SPI.h>
#include <PN532_SPI.h>
#include "PN532.h"
PN532_SPI pn532spi(SPI, 10);
PN532 nfc(pn532spi);
#elif 0
#include <PN532_HSU.h>
#include <PN532.h>
PN532_HSU pn532hsu(Serial1);
PN532 nfc(pn532hsu);
#else
#include <Wire.h>
#include <PN532_I2C.h>
#include <PN532.h>
... |
#include <iostream>
using namespace std;
void select_sort(char* l,char* r){
for(auto i=l;i!=r;i++){
char mn=*i;
char* mptr=i;
for(auto j=i;j!=r;j++){
if(mn>*j){
mn=*j;
mptr=j;
}
}
char k=*mptr;
*mp... |
#include <iostream>
#include <sys/time.h>
#include <stdint.h>
#include "logger.h"
using namespace std;
int main(int argc, char* argv[])
{
struct timeval tv_begin;
struct timeval tv_end;
gettimeofday(&tv_begin, NULL);
uint64_t i = 0;
for(; i < 1000000L; ++i)
{
LOG_DEBUG("hello, world, %d,... |
//
// RoomAnimationManager.hpp
// demo_ddz
//
// Created by 谢小凡 on 2018/2/16.
//
#ifndef RoomAnimationManager_hpp
#define RoomAnimationManager_hpp
#include "cocos2d.h"
#include "CardTypeDefine.hpp"
class PostedCreator;
class RoomAnimationManager {
using Vec2 = cocos2d::Vec2;
public:
static RoomAnimationMa... |
// - SLAMPROC.CPP -
//
// Implementation of class "CSlamProc".
//
//
#include "stdafx.h"
#include "SlamProc.h"
#include "Localization.h"
#include "SickSafetyLaserScanner.h"
//#include "PfR2000LaserScanner.h"
//#include "HokuyoLaserScanner.h"
#include <fstream>
#include "include/json/json.h... |
#ifndef _CUBOIDAL_TANK_INCLUDED_
#define _CUBOIDAL_TANK_INCLUDED_
class CuboidalTank
{
private:
float length;
float width;
float height;
float liquidHeight;
float tankCapacity;
public:
CuboidalTank();
float getMaxPossibleVolume();
float getCurrentVolume();
float getLiquidHeight();
float getMa... |
#include "parser.h"
#include "executor.h"
#ifndef _rshell_h
#define _rshell_h
class rShell{
public:
void run();
private:
parser shellparse;
executor shellexec;
};
#endif
|
#include "competitive.h"
/*
* BFS runs in O(V+E) with adj list
*/
USESTD;
map<int, VPII> adjList;
int INF = 1000000000;
VI d;
void bfs(map<int, VPII>& adjList, VI& d, int startNode) {
queue<int> q;
q.push(startNode);
while (!q.empty()) {
int u = q.front(); // queue: layer by layer!
q.pop();
cout << "Visi... |
/*
Insert Node in a doubly sorted linked list
After each insertion, the list should be sorted
Node is defined as
struct Node
{
int data;
Node *next;
Node *prev;
}
*/
Node* SortedInsert(Node *head,int data)
{
// Complete this function
// Do not write the main method.
Node... |
#include <iostream>
class Animale {
public:
Animale() { std::cout << "Costruttore Animale" << std::endl; }
Animale(const Animale&) { std::cout << "Copia Animale" << std::endl; }
virtual Animale* clone() const {
std::cout << "Clonazione non specificata" << std::endl;
return new Animale(*this);
}
virtu... |
#include <llvm/IR/BasicBlock.h>
#include <llvm/IR/Function.h>
#include <llvm/Support/raw_ostream.h>
#include <llvm/IR/User.h>
#include <llvm/IR/Instructions.h>
#include <llvm/IR/InstIterator.h>
#include <llvm/Pass.h>
#include <fstream>
#include <llvm/Analysis/CFG.h>
#include <stdio.h>
#include <map>
#include "llvm/Tran... |
/* ToDo
1. Добавить настройку расстояния для срабатывания присутствия через MQTT
2. Добавить регулировку частоты опроса расстояния
*/
#include <Arduino.h>
#include <Ethernet.h>
#include <Wire.h>
#include <avr/wdt.h>
#include "EEPROMAnything.h"
#include <PubSubClient.h> // https://github.com/knolleary/pubsubclient... |
#ifdef HAS_VTK
#include <vtkPointData.h>
#include <vtkPolyData.h>
#include <vtkPolyDataReader.h>
#include <vtkPolyDataWriter.h>
#include <irtkImage.h>
char *input_name = NULL, *output_name = NULL;
char *template_name = NULL;
void usage()
{
cerr << "Usage: matrix2polydata [irtkMatrix] [vtkFileOut] <-template file>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.