text stringlengths 8 6.88M |
|---|
/* -*- c++ -*- */
/*
* Copyright 2015 <+YOU OR YOUR COMPANY+>.
*
* This 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 3, or (at your option)
* any later version.
*
* This software is d... |
#ifndef IRFUTURE_H
#define IRFUTURE_H
#include "Instrument.h"
//All times are in fractions of a year.
//An IRFuture of rate 96.7 with an expiry of 0.4 and a tenor of 0.25 means that
//the market expects that at time 0.4 the 3M IBOR will be (100-96.7)/100, i.e. 3.3%.
//In other words, (discount factor to 0.4+0.25)/(d... |
#include "SCurve.h"
#include "SCurve.h"
#include <stdexcept>
scurve::SCurve scurve::SCurveGenerator::createCurve(Point from, Point to)
{
SCurve curve(from, to);
double distance = sqrt(pow(to.x - from.x, 2) + pow(to.y - from.y, 2));
double tAcc = maxVel / maxAcc;
if (maxAcc * tAcc * tAcc > distance) {
//no ... |
#ifndef JOYSTICK_BUTTON_HPP
#define JOYSTICK_BUTTON_HPP
#include "element.hpp"
namespace joystick
{
class button : public element
{
public:
button();
#if __APPLE__
button(IOHIDElementRef elem)
{
elem_ = elem;
}
#endif
};
} // namespace joystick
#endif //JOY... |
#pragma once
#include "gprotoc/internal_protocol.pb.h"
#include "gprotoc/external_protocol.pb.h"
#define MAKE_PB(ptype, pname) \
PB::ptype pname; \
pname.set_type(PB::PT_##ptype);
#define PB2STR(pname, sname, err_op) \
std::string sname; \
try \
{ \
pname.SerializeToString(&sname); \
}... |
/*
* 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, publish,
* distribute, sublicense, and... |
/*
* This source file is part of an OSTIS project. For the latest info, see http://ostis.net
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#pragma once
#include <QDialog>
class QVBoxLayout;
class QCheckBox;
class QGroupBox;
class QFormL... |
#include "ShaderVersion.h"
#include "EverydayTools/Exception/CallAndRethrow.h"
#include "Keng/GraphicsCommon/ShaderType.h"
namespace keng::graphics::gpu
{
const char* ShaderTypeToShaderTarget(const ShaderType& shaderType, ShaderVersion shaderVersion) {
return CallAndRethrowM + [&] {
switch (sha... |
#include "SwsScale.h"
CLASS_LOG_IMPLEMENT(CSwsScale, "CSwsScale");
////////////////////////////////////////////////////////////////////////////////
CBuffer *CSwsScale::Scale(uint64_t pts, unsigned char *data)
{
AVPicture avpic;
avpicture_fill(&avpic, data, m_srcFormat, m_srcW, m_srcH );
return Scale( pts, avpic.dat... |
#ifndef WGF_INPUTACTIONBUTTON_H
#define WGF_INPUTACTIONBUTTON_H
#include "InputAction.h"
#include "InputManager.h"
namespace WGF
{
class InputListener;
class InputActionButton : public WGF::InputAction
{
friend class InputManager;
public:
/** Default constructor */
... |
#include "cConnection.h"
#include <vector>
class cConnectionHandler
{
private:
std::vector<cConnection> mConnections;
public:
cConnectionHandler(int aNumConnections) {mConnections.reserve(aNumConnections);}
void AddConnection(int aID1, int aID2) {mConnections[aID1].AddConnection(aID2);} //todo:check!
void CheckL... |
#include <unistd.h>
#include "muduo/base/ThreadPool.h"
#include "muduo/base/Thread.h"
#include "muduo/base/CountDownLatch.h"
using std::placeholders::_1;
void print() {
printf("tid=%d\n", muduo::CurrentThread::tid());
}
void printMsg(const std::string &s) {
printf("str=%s\n", s.c_str());
usleep(100 * 1000);
}
... |
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2012-2013.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#ifndef _GDCMIO_DICOMSURFACEWRITER_HPP_
#define _GDCMIO_DICOMSURFACEWRITER... |
//
// MyEvent.hh for MyEvent in /home/paumar_a/projet/git/AW_like/Event
//
// Made by cedric paumard
// Login <paumar_a@epitech.net>
//
// Started on Wed Jul 30 16:02:01 2014 cedric paumard
// Last update Thu Aug 14 11:31:09 2014 cedric paumard
//
#ifndef MYEVENT_HH_
# define MYEVENT_HH_
/*
** includes
*/
# inc... |
#include "mysse64.h"
#include "su3.h"
namespace qcd {
template<int dir, int sign>
void shrink_to(const wilson_vector& wv, half_wilson_vector& res);
template<int dir, int sign>
void expand_to(const half_wilson_vector& half, wilson_vector &res);
} // qcd namespace
|
// exercise.cpp : 定义控制台应用程序的入口点。
//
#include<iostream>
#include<string>
using namespace std;
//CodeForces - 443A
//题意:统计输入中有多少不同的字母
//int main()
//{
// string s;
// getline(cin, s);
// int len = s.length();
// int i;
// int alpha[26] = { 0 };
// for (i = 1; i < len - 1; i += 3)
// {
// alpha[s[i] - 'a']++;
// }
// ... |
// TextureCustomData.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "assert.h"
#include "stdint.h"
#include "string.h"
#include <PVRTexture.h>
#include <PVRTextureDefines.h>
#include "PVR.h"
#include "JPEG.h"
#include "PNG.h"
#include "Util.h"
#include<filesystem>
/*
pArgv... |
clothes[] = {
{Loot_MAGAZINE, 1, Skin_Bandit1_DZ},
{Loot_MAGAZINE, 1, Skin_Bandit2_DZ},
{Loot_MAGAZINE, 1, Skin_Bandit3_DZ},
{Loot_MAGAZINE, 1, Skin_Bandit4_DZ},
{Loot_MAGAZINE, 1, Skin_Bandit5_DZ},
{Loot_MAGAZINE, 1, Skin_BanditW1_DZ},
{Loot_MAGAZINE, 1, Skin_BanditW2_DZ},
{Loot_MAGAZINE, 1, Skin_SurvivorWcomb... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#ifndef __SSLBASEREC_H
#define __SSLBA... |
#pragma once
#include "geometrical_classes.h"
//#include "helper.h"
#include <stdio.h>
#include <tchar.h>
#include <GL/glew.h>
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#include <vector>
#include <algorithm>
#include <iostream>
#include <OpenMesh\Core\IO\MeshIO.hh>
#include <OpenMesh\Core\Mesh\PolyMesh_ArrayKern... |
#include <iostream>
/*
passing array to function using sizeof operator...
*/
void print_array(int array[], int size)
{
for (int i = 0; i < size; i++)
{
std::cout << array[i] << " \t ";
}
std::cout << std::endl;
}
int main ()
{
int my_array[] = {1,2,3,4,5,6,7};
int size = sizeof(m... |
#ifndef SPRITEDEFINITIONWIDGET_HPP
#define SPRITEDEFINITIONWIDGET_HPP
#include <QWidget>
#include "SpriteDefinitionModel.hpp"
namespace Ui {
class SpriteDefinitionWidget;
}
namespace Maint
{
class LevelManager;
class SpriteDefinitionWidget : public QWidget
{
Q_OBJECT
Ui::SpriteDefiniti... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2002 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 "adjunct/m2_ui/dialogs/DefaultM... |
#include<bits/stdc++.h>
using namespace std;
main()
{
int test, i, j, n, b=0, t=0, a=0, w=0;
char ch;
scanf("%d",&test);
for(j=1; j<=test; j++)
{
scanf("%d",&n);
for(i=0; i<n; i++)
{
cin>>ch;
if(ch=='B')
b++;
else if(ch=='T'... |
// Created on: 1995-06-13
// Created by: Jacques GOUSSARD
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the G... |
#include <iostream>
#include <vector>
using namespace std;
class people;
class student;
class instructor;
class zambeel;
class course;
class people
{
public:
string name;
string password;
string department;
people();
people(string n, string pass, string dept);
void setName(string n);
void setPass(str... |
#include<iostream>
using namespace std;
int stack[10];
int top = -1;
void push();
int isFull();
void pop();
int isEmpty();
int peek();
int main(){
int y=1,c;
do{
cout<<"1. push \n2. pop \n3. peek \n4. IsFull \n5. IsEmpty \n Enter Choice : ";
cin>>c;
switch(c){
case 1: push(... |
#include <iostream>
using namespace std;
void Input(double *&a,int &n)//Doi voi cap phat Ngoai Ham MAIN();
{
do
{
cout<<"\n Nhap vao n:\t";
cin>>n;
if(n<=0)
{
cout<<"\n N khong hop le!";
}
}while(n<=0);
//Cap phat
a=new double[n];
for(int... |
#include "sim_drill_state_subscriber.h"
CSimDrillStateSubscriber::CSimDrillStateSubscriber() :
m_subscriptionMatched(false),
m_pOnDataAvailable(nullptr),
m_pOnDataDisposed(nullptr),
m_pOnLivelinessChanged(nullptr),
m_pOnSubscriptionMatched(nullptr)
{
memset((void *)&m_sampleInfo, 0, sizeof(DDS::SampleInfo)... |
#ifndef ME_OPEN_GL_H
#define ME_OPEN_GL_H
#include <QtOpenGL\qglwidget>
#include <Qt\qtimer.h>
class MeOpenGl : public QGLWidget
{
Q_OBJECT
GLuint torusVertexBufferID;
GLuint torusIndexBufferID;
GLuint sphereVertexBufferID;
GLuint sphereIndexBufferID;
GLuint planeVertexBufferID;
GLuint planeIndexBufferID;
GL... |
class Cxp_Vehicle_Shop_v2_3D {
idd = 2300;
name="Cxp_Vehicle_Shop_v2_3D";
movingEnable = 0;
enableSimulation = 1;
onLoad = "call cxp_fnc_3dPreviewInit; ctrlShow [2330,false];";
onUnLoad = "call cxp_fnc_3dPreviewExit;";
class controlsBackground {
class MainBackground: Cxp_RscText {
... |
//---------------------------------------------------------------------------
#ifndef GetMemberProcH
#define GetMemberProcH
//---------------------------------------------------------------------------
#include "BaseProcess.h"
class GetMemberProc:public BaseProcess
{
virtual int doRequest(CDLSocketHandler* client,... |
// Copyright 2011 Yandex
#ifndef LTR_DATA_UTILITY_PARSERS_PARSER_H_
#define LTR_DATA_UTILITY_PARSERS_PARSER_H_
#include <boost/spirit/include/classic_core.hpp>
#include <map>
#include <vector>
#include <string>
#include <iostream>
using std::vector;
#include "ltr/data/object.h"
#include "ltr/data/data_set.h"
#incl... |
#include "MC.h"
namespace _MC {
MC::MC(AnyOption* opt1) {
opt = opt1;
cout << "In testing phase" << endl;
AM = new HashTreeCube(89041);
outdir = opt->getValue("outdir");
probGraphFile = opt->getValue("probGraphFile");
//eta = strToInt(opt->getValue("eta"));
graphType = DIRECTED;
setModel(opt);
countIt... |
#ifndef MINISERVER_CONFIGURE_H
#define MINISERVER_CONFIGURE_H
#include <iostream>
#include <map>
#include <string>
#include <sstream>
#include <sstream>
#include <stdexcept>
namespace miniserver {
class ConfigureValueType {
public:
ConfigureValueType();
ConfigureValueType(const std::string &conf_value);
~Co... |
#pragma once
#include <stdexcept>
using std::runtime_error;
class MoveOutOfImageRangeException : public runtime_error
{
public:
MoveOutOfImageRangeException::MoveOutOfImageRangeException(): runtime_error( "attempted to reach a pixel out of range" ) {}
};
class MoveConfigFileNotFoundException : p... |
// Created on: 2000-01-26
// Created by: Denis PASCAL
// Copyright (c) 2000-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2002 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 "OpSplitter.h"
#include "OpWorksp... |
#ifndef RPCEfficiencyShiftHisto_H
#define RPCEfficiencyShiftHisto_H
// * *
// * RPCEfficiencyShiftHisto
// * *
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/DQMEDHarves... |
#ifndef _DX11_INPUT_LAYOUT_H_
#define _DX11_INPUT_LAYOUT_H_
#include "InputLayout.h"
#include "DX11Shader.h"
#include "DX11DatatypeHelper.h"
namespace HW{
struct DX11InputDesc{
String Name; // the Variable name
String Semantic; // the semantic
UINT uSemanticIndex; // the index within semantic
DX11... |
// Copyright (c) 2007-2014 Hartmut Kaiser
// Copyright (c) 2011 Bryce 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_1_0.txt)
/// \file startup_function.hpp
#pragma... |
#define CATCH_CONFIG_MAIN
#include "../external/catch2/catch.hpp"
#include "../src/array/filter.hpp"
#include <vector>
template <typename T>
struct TestStruct
{
std::vector<T> val;
std::vector<T> actual;
std::function<bool(const T&)> Fun;
TestStruct(std::vector<T> val, std::vector<T> actual, std::fun... |
#ifndef kinect_proc_node_h
#define kinect_proc_node_h
// Include the ROS library
#include "ros/ros.h"
#include "std_msgs/Float32.h"
// Include opencv2
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
// Include CvBridge, Image Transport, Image msg
#include <image_transport/image_transpor... |
#include "core.hpp"
void create_scene(scene_t *scene,
glm::mat4 projection_matrix,
glm::vec3 camera_location,
glm::vec3 camera_lookat,
glm::vec2 level_size)
{
static unsigned int ids = 0;
assert(scene);
scene->id = ++ids;
scene->p... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#include "core/pch.h"
#ifndef WINDOWS_WINDOWFRAME_H
#define W... |
// Created on: 1996-09-16
// Created by: Jacques GOUSSARD
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the G... |
#include "include/LightSource.hpp"
LightSource::LightSource() {}
LightSource::LightSource(const RT_Vec3& pos, const RT_Vec3& ka, \
const RT_Vec3& kd, const RT_Vec3& ks):
m_Position(pos), m_Ka(ka), m_Kd(kd), m_Ks(ks) {}
void LightSource::setPosition(const RT_Vec3& pos)
{
m_Position=pos;
}
void LightSource::setKa... |
#ifndef __AUDIODECODETHREAD_H__
#define __AUDIODECODETHREAD_H__
#include <list>
#include "codec/MediaDecoder.h"
class CPlayer;
//音频解码线程
///////////////////////////////////////////////////////////////////
class CAudioDecodeThread : public CSemaphore
{
public:
CAudioDecodeThread(CPlayer *pPlayer)
: m_pPlayer(pPlay... |
#include <iostream>
using namespace std;
int main (){
//Lapeiretta, Alex
//CS111 22C Homework 3
//Part A
int finaln,start;
cout << "Please enter a number greater than 0 and less than 20: ";
cin >> finaln;
start = 1;
while (finaln <= 0 || finaln >= 20){
cout << "Invalid number. Please enter a number betw... |
#ifndef BOOST_ASTRONOMY_COORDINATE_ALT_AZ_HPP
#define BOOST_ASTRONOMY_COORDINATE_ALT_AZ_HPP
#include <type_traits>
#include <tuple>
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/algorithms/transform.hpp>
#include <boost/geometry/algorithms/equals.hpp>
#i... |
command=ptz_req&req="+req+"¶m="+param+"&channel="+g_viewStatu[g_clicked].nchannel+"&stream="+g_channelStatu[g_viewStatu[g_clicked].nchannel
# Control commands (reconfig for up):
# Move right:
|
#include "FnContext.h"
#include "LandruActorVM/VMContext.h"
namespace Landru {
RunState FnContext::run(std::vector<Instruction>& instructions)
{
RunState runstate = RunState::Continue;
if (vm->traceEnabled)
for (auto& i : instructions) {
i.second.exec(*this);
if ((runstate = i.first(*this)) != RunSt... |
/*
注意类中vector的初始化方法,递归比较费事费空间,dp比较快。
*/
class Solution {
public:
//int table[40] = {0};
vector<int> table = vector<int>(40, 0);
int Fibonacci(int n) {
if(n <= 0) return table[n];
if(n == 1 || n==2 ) {
table[n] = 1;
return table[n];
}
table[n] = Fibonac... |
//Covert a string to lower case
string str_lower(string str)
{
//Read all the characters
for(int i = 0; i < str.length(); i++)
{
//Convert the character to lower case
str[i] = tolower(str[i]);
}
//Return the string in lower case
return str;
}
//Lower case alias
string str_lower_case(string str)
{
... |
#ifndef SZAMKIJELZO_H
#define SZAMKIJELZO_H
#include "Widget.h"
class Szamkijelzo: public Widget
{
public:
Szamkijelzo(int, int);
virtual ~Szamkijelzo();
int szam();
std::string tostring(int);
virtual void rajzol() override;
virtual void esemeny(genv::event ev);
... |
//==================================================================================================
// Name : OneSuspectLikelihoodSolver.cpp
// Author : Ken Cheng
// Copyright : This work is licensed under the Creative Commons
// Attribution-NonCommercial-ShareAlike 4.0 International License. To view... |
#include "list.hpp"
void validNumber(int& number) {
while (std::cin.fail()) {
std::cout << "Invalid Value: Try again!" << std::endl;
std::cin.clear();
std::cin.ignore(256,'\n');
std::cout << "Please enter the intager number: ";
std::cin >> number;
}
}
void chooseFun... |
/************************************************************************/
/* Size() function recursively calculates the size of a tree.write a function calculate the size of a tree*/
/************************************************************************/
struct Node{
int nVal;
Node *pLeft;
Node *pRight;
Node(i... |
#ifndef __HOT__COMMONS__MULTI_MASK_PARTIAL_KEY_MAPPING___
#define __HOT__COMMONS__MULTI_MASK_PARTIAL_KEY_MAPPING___
#include <immintrin.h>
#include <array>
#include <set>
#include "hot/commons/Algorithms.hpp"
#include "hot/commons/DiscriminativeBit.hpp"
#include "hot/commons/MultiMaskPartialKeyMappingInterface.hpp"
... |
// Copyright 2017 The Ray Authors.
//
// 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 applicable law or agreed to i... |
#include "components/ai/ai.hpp"
#include "views/hud.hpp"
#include "entities/system.hpp"
namespace ai {
bool AI::add_task(AI::script_ptr ais, AI::priority_t prior) {
if (prior <= current_priority())
return false;
current_script()->suspend(this);
{
task_stack t;
... |
#include <iostream>
#include <vector>
using namespace std;
struct SomeStruct {
int x,y,z;
SomeStruct(int x=0, int y=-1, int z=-2) : x{x}, y{y}, z{z} {
std::cout << "ctor running" << std::endl;
}
};
void test0() {
vector<SomeStruct> values(10);
}
int main() {
test0();
return 0;
}
|
//
// main.cpp
// pendulum
// ¼òÌåÖÐÎÄ
// Created by Ran Bao on 9/22/13.
// Copyright (c) 2013 R&B. All rights reserved.
//
#include <iostream>
#include <cmath>
#include <GL/freeglut.h>
#include <string>
#include "FPS.h"
#include "GLColor.h"
#include "TextBox.h"
#define M_PI 3.141592653f
using namespace std;
co... |
/*
Name: �ҳ�ֻ����һ�� ��������
Copyright:
Author: Hill bamboo
Date: 2019/8/18 9:40:17
Description: ��
�ܽ
�����е��������ñ������Ǽ�鲻�����ģ�
һ��Ҫ��д����������ϸϸ�ؼ��һ��
*/
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
long long arr[maxn];
int n = 0;
void getNumber(long long& num1, long lo... |
//
// Created by abel_ on 09-10-2022.
//
#include <unordered_map>
#include <vector>
#include <string>
#include <iostream>
#include <stack>
//bool hasPath(std::unordered_map<std::string, std::vector<std::string>> graph, std::string src, std::string dst) {
// std::stack<std::string> stack;
// stack.push(src);
// ... |
#include <vector>
#include <regex>
#include <cstdlib>
#include <QString>
#include <QDomDocument>
#include <QTextStream>
#include <QXmlStreamWriter>
#include "assertImpl.h"
#include "XmlAudioMarkup.h"
namespace PticaGovorun {
namespace {
static const char* XmlDocName = "audioAnnotation";
static const char* AnnotAud... |
//知识点: 状压DP
/*
By:Luckyblock
发现 n,m <=9,又要求方案数 ,
就知道这必然是个状压了.
分析题意:
一些性质:
1. 对于每一行 的棋子摆放情况,
只会被相邻的两行棋子所影响
2. 对于两行棋子能否相邻 , 处理方式较麻烦
但是n,m<=9 , 状态数较少 ,
可以预处理出所有状态 , 及他们能相邻的其他状态
//=============================================================
算法实现:
先预处理出 单行的合法状态. (即没有左右相邻的国王的状态)
并记录此单行状态 的 国... |
#include <LogManager.h>
#include <ConsoleLogListener.h>
#include <cassert>
#include <gameContext.h>
#include <ConfigManager.h>
using namespace breakout;
LogManager::LogManager()
{
}
LogManager::~LogManager()
{
}
LogManager& LogManager::Get()
{
static LogManager logManager;
return logManager;
}
void LogManage... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "10721"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
int main(int argc, char const *argv[])
{
#ifdef DBG
freopen("uva" PROBLEM TESTC ".in", "r", stdin);
freopen("uva" PROBLEM ".out", "w", stdout);
#endif
int units,b... |
#pragma once
#include "x/x_types.h"
#include "x/x_string.h"
#include "x/x_windowHandler.h"
#include "x/x_devicecontexthandler.h"
namespace x
{
typedef void(*x_OnClose)(void);
typedef void(*x_OnSize)(x_Sint32 x, x_Sint32 y);
class X_API x_Platform
{
public:
x_Platform::x_Platform();
virtual x_Platform::~x_P... |
#include<bits/stdc++.h>
#define rep(i,n) for (int i =0; i <(n); i++)
using namespace std;
using ll = long long;
int main(){
int N;
cin >> N;
vector<int>A(N);
rep(i,N)cin >> A[i];
sort(A.begin(),A.end());
int ans = 0;
rep(i,N){
rep(j,i){
rep(k,j){
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-file-style: "stroustrup" -*-
*
* Copyright (C) 1995-2005 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef XMLUTILS_H
#define XMLUTILS_H
#include "modul... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(0);
std::cout.tie(0);
std::string s;
std::cin >> s;
std::cout << s << "??!\n";
return 0;
} |
#pragma once
#include <string>
#include <vector>
#include <utility>
#include <memory>
using std::string;
using std::vector;
using std::forward;
using std::make_unique;
using std::unique_ptr;
using std::to_string;
|
#ifndef __OPTION_LAYER_H__
#define __OPTION_LAYER_H__
#include <cocos2d.h>
using namespace cocos2d;
//操作层代理:用于实现与其他层数据交互
class OptionDelegate
{
public:
virtual void onTouch() = 0;
};
class OptionLayer : public Layer
{
public:
OptionLayer(){}
~OptionLayer(){}
virtual bool init();
CREATE_FUNC... |
#include <string>
#include <vector>
#include <QtCore>
#include <QtGui>
#include <QtWidgets>
#include "directorydialog.hpp"
#include "mainwindow.hpp"
#include "sfcsv/sfcsv.h"
#include "ui_mainwindow.h"
static QStringList parseCsv(const QString& in) {
QStringList result;
std::vector<std::string> parsed;
con... |
// Created on: 2017-06-27
// Created by: Andrey Betenev
// Copyright (c) 2017 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 pub... |
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
int a,b,tempo,aux;
cin >> a >> b;
if(a >= b){
aux = (b - a)+24;
}
else
aux = (a - b)+24;
cout << "O JOGO DUROU " << aux << " HORA(S)";
return 0;
}
|
#ifndef LIGHTIMAGE_VEC_H
#define LIGHTIMAGE_VEC_H
#include <iostream>
#include "error.hpp"
namespace li {
template<typename _Tp>
class Vect_ {
public:
Vect_();
Vect_(int _dims);
Vect_(int _dims, _Tp value);
Vect_(int _dims, _Tp *_data);
Vect_(Vect_<_Tp> &_v);
... |
/** \file nxtexception.h
\brief
*/
/*
* (C) 2013 Uwe Lippmann
*
* 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 3 of the License, or (at your
* option) any later version.
*... |
#include "stdafx.h"
#include "FileReader.h"
#include <fstream>
FileReader::FileReader()
{
}
FileReader::~FileReader()
{
}
std::vector<char> FileReader::ReadAllBytes(char const* filename)
{
std::ifstream ifs(filename, std::ios::binary | std::ios::ate);
std::ifstream::pos_type pos = ifs.tellg();
std::vector<char... |
#include "gameover.h"
GameOver::GameOver(QWidget *parent) : QWidget(parent)
{
}
int GameOver::getMessage(QString message) {
bool ok = false;
QString text = "";
message += "type Yes/No: ";
while(!ok && checkText(text)==-1) {
QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"),... |
#ifndef TESTWINDOW_H
#define TESTWINDOW_H
#include <QWidget>
#include <dataprocessor.h>
#include <QStandardItemModel>
#include <QMessageBox>
#include <QCloseEvent>
struct TestRecord {
float before,after,ratio;
};
namespace Ui {
class TestWindow;
}
class TestWindow : public QWidget
{
Q_OBJECT
public:
expl... |
#include <iostream>
#include <fstream>
#include <cstdio>
#include <vector>
#include <chrono>
#include <thread>
#include <webcamera.h>
#include <video_encoder.h>
#include <logging.h>
void save_image(const my::Frame &frame, const std::string &filename) {
std::ofstream out;
out.open(filename, std::ios::binary);... |
#include<iostream>
using namespace std;
const int maxn=1e2+4;
char a[maxn][maxn],b[maxn][maxn];
char c[maxn*maxn];
int n,inx;
void f1(){
int x1=0,y1=0,nn=n*n;
inx=0;
while(inx<nn){
if(y1<n-1){
c[inx++]=a[x1][y1++];
while(y1)c[inx++]=a[x1++][y1--];
if(x1<n-1){
... |
#include"application.h"
//shady_engine headers
#include"Debugger.h"
#include"Logger.h"
namespace shady_engine
{
application::application(
const std::string& pName,
int pWindowWidth,
int pWindowHeight,
bool pFullScreen
)
:
mWindowWidth(pWindowWidth),
mWindowHeight(pWindowHeight)
{
if (!glfwIni... |
#pragma once
#include "function.h"
class WorkQue
{
public:
WorkQue()
{
mutex = PTHREAD_MUTEX_INITIALIZER;
}
void insertTask(int fd) //向任务队列中插入新的任务
{
deq.push_back(fd);
}
int size()
{
return deq.size();
}
int getTask() //线程取得新的任务
{
if (deq.empt... |
/******************************************************************************
* *
* Copyright 2018 Jan Henrik Weinstock *
* *
... |
// ´ú Ǭ¹®Á¦
/*
https://www.acmicpc.net/problem/1014
*/
#include <iostream>
using namespace std;
int main(void)
{
int testCase;
cin >> testCase;
int* resArr = new int[testCase] {0, };
int n, m, count = 0;
for (int i = 0; i < testCase; i++)
{
cin >> n >> m;
char** arr = new char*[n];
for (int j = 0; j < n... |
/* -*- 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 "modules/style/src/css_viewport_r... |
#include <ionir/construct/inst/zext.h>
#include <ionir/passes/pass.h>
namespace ionir {
ZextInst::ZextInst(ZextInstOpts opts) :
Inst(opts.parent, InstKind::Zext) {
//
}
void ZextInst::accept(Pass &visitor) {
// TODO: Implement.
// visitor.visitCallInst(this->dynamicCast<Call... |
#ifndef AWS_NODES_ASSIGNMENT_H
#define AWS_NODES_ASSIGNMENT_H
/*
* aws/nodes/assignment.h
* AwesomeScript Assignment
* Author: Dominykas Djacenka
* Email: Chaosteil@gmail.com
*/
#include <string>
#include "expression.h"
#include "statement.h"
namespace AwS{
namespace Nodes{
class Assignment : public Stateme... |
#include <iostream>
#include <bitset>
#include <cstring>
using namespace std;
void updateOnes(int ones[][33], int idx, int val)
{
bitset<32> b(val);
string bitStr = b.to_string();
for (int i = 1; i <= 32; i++)
{
ones[idx][i] = ones[idx - 1][i] + (bitS... |
#include "image_info.h"
ImageInfo::ImageInfo():
width(0),
height(0),
image(VK_NULL_HANDLE),
imageView(VK_NULL_HANDLE),
memory(VK_NULL_HANDLE),
sampler(VK_NULL_HANDLE),
mVkDevice(nullptr)
{
}
ImageInfo::ImageInfo(VkDevice& vkDevice):
width(0),
height(0),
image(VK_NULL_HANDLE),
imageView(VK_NULL_HANDLE),
... |
// RsaToolbox includes
#include "General.h"
#include "VnaReferenceMarker.h"
#include "VnaChannel.h"
#include "Vna.h"
using namespace RsaToolbox;
// Qt includes
// #include <Qt>
/*!
* \class RsaToolbox::VnaReferenceMarker
* \ingroup VnaGroup
* \brief The \c %VnaReferenceMarker class
* controls a reference marker... |
#include<iostream>
using namespace std;
int main() {
int n;
cin>>n;
int arr[n],max=-1;
for(int i=0;i<n;i++)
{
cin>>arr[i];
if(arr[i]>max)
max=arr[i];
}
int count[max+1]={0};
for(int j=0;j<n;j++)
count[arr[j]]++;
for(int i=1;i<=max;i++)
count[i]+=count[i-1];
... |
#include "nextbutton.h"
#include <QDebug>
#define DEFAULT_BG_COLOR 255, 255, 255, int(1.0 * 255)
#define HOVER_BG_COLOR 255, 255, 255, int(0.3 * 255)
#define PRESS_BG_COLOR 255, 255, 255, int(0.1 * 255)
NextButton::NextButton(const QString &text, QWidget *parent)
: DPushButton(parent)
, m_text(text)
... |
#ifndef __IEXECUTABLE_H__
#define __IEXECUTABLE_H__
struct IExecutable {
virtual ~IExecutable() {}
void execute() { execute_impl(); }
private:
virtual void execute_impl() = 0;
};
#endif |
#include "a5_library.hpp"
#include <ostream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
Library::Library() {}
Library::Library(vector<Book> updated_library) :
library(updated_library) {}
bool Library::insert_book(string title, string authors, string date_of_publication)... |
#pragma once
#ifndef ADDTASKWINDOW_H
#define ADDTASKWINDOW_H
#include <QDialog>
#include <QString>
#include <QStandardItemModel>
#include <QJsonDocument>
#include <QJsonArray>
#include <memory>
#include <vector>
#include <utility>
namespace Ui {
class AddTaskWindow;
}
class AddTaskWindow : public QDialog
{
Q_OB... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.