text stringlengths 8 6.88M |
|---|
/*
* TestClass.hpp
*
* Created on: Apr 30, 2017
* Author: Patryk
*/
#ifndef INCLUDE_TESTCLASS_HPP_
#define INCLUDE_TESTCLASS_HPP_
#include <Templates.hpp>
#include <Window.hpp>
#include <iostream>
#include <InputManager.hpp>
class TestClass : public IInput
{
public:
TestClass() = default;
void key_input... |
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#inc... |
/*
* MIT License
*
* Copyright (c) 2017 by J. Daly at Michigan State University
*
* 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 ... |
#include <string.h>
#include <vector>
#include <iostream>
#include <stdio.h>
#include <map> |
#include <iostream>
using namespace std;
int main() {
double n, m;
char op;
cout << "Enter operation: ";
cin >> op;
if (op != '+' && op != '-' && op != '*' && op != '/') {
cout << "Invalid operation\n";
return -1;
}
cout << "Enter arg1: ";
cin >> n;
cout << "Enter... |
#include <iostream>
#include <cmath>
#include "point.h"
#include "integrate.h"
#include "Double.h"
int main()
{
const unsigned int k = 2;
Double u[k][k][k];
Double phi[k][k];
Double omega[k];
for (unsigned int j=0; j<k; ++j)
{
double x = 1.*j/(k-1);
omega[j].value = 1./k;
phi[0][j].value ... |
#ifndef QXTMETAOBJECT_H
/****************************************************************************
** Copyright (c) 2006 - 2011, the LibQxt project.
** See the Qxt AUTHORS file for a list of authors and copyright holders.
** All rights reserved.
**
** Redistribution and use in source and binary forms, with or ... |
class Mother
{
public:
Mother();
void sayHi();
int getSomeVar();
~Mother();
private:
int var;
protected:
int someVar;
};
class Daughter:public Mother
{
public:
Daughter();
~Daughter();
}; |
#pragma once
#include <wrl/client.h>
#include <memory>
#include <string>
class Shader
{
Microsoft::WRL::ComPtr<struct ID3D11VertexShader> m_pVsh;
Microsoft::WRL::ComPtr<struct ID3D11PixelShader> m_pPsh;
Microsoft::WRL::ComPtr<struct ID3D11InputLayout> m_pInputLayout;
std::shared_ptr<class InputAssemblerS... |
#pragma once
#include <boost/scoped_ptr.hpp>
#include <boost/scoped_array.hpp>
#include <unistd.h>
#include "Dynamixel.hpp"
#include "Motor.h"
#define maxDynamixel 12
#define numServo 2
class CActuator
{
public:
unsigned int baudRate;
boost::asio::io_service io;
boost::scoped_ptr<boost::thread> serialThreadAr... |
#pragma once
#include "LayerNode.hpp"
#include "Utils/NotNull.hpp"
#include <algorithm>
#include <cmath>
template<class Type>
struct ReLULayerNode : LayerNode<Type> // add passthrough LayerNode that doesn't need numOutputs because it should get them from parent
{
ReLULayerNode(NotNull<ComputationNode<Type>> inpu... |
#include "ExCoefficients.h"
ExCoefficients::ExCoefficients(const Eigen::MatrixXd &f1_mat, const Eigen::MatrixXd &f2_mat) : m_mat_f1(f1_mat), m_mat_f2(f2_mat)
{
m_mat_f1x = diff_about_x(m_mat_f1);
m_mat_f1y = diff_about_y(m_mat_f1);
m_mat_f2x = diff_about_x(m_mat_f2);
m_mat_f2y = diff_about_y(m_mat_f2);... |
#include "treeface/scene/guts/Geometry_guts.h"
#include <treecore/ArrayRef.h>
using namespace treecore;
namespace treeface
{
Geometry::Guts::Guts( const VertexTemplate& vtx_temp, GLPrimitive primitive, bool is_dynamic )
: vtx_temp( vtx_temp )
, primitive( primitive )
, dynamic( is_dynamic )
, buf_vt... |
#include "GamePch.h"
#include "AI_ChargeUp.h"
void AI_ChargeUp::LoadFromXML( tinyxml2::XMLElement* data )
{
const char* anim = data->Attribute( "anim" );
m_Anim = WSID(anim);
m_Duration = 2.0f;
data->QueryFloatAttribute( "duration", &m_Duration );
}
void AI_ChargeUp::Init( Hourglass::Entity* entity )
{
m_Timer... |
/*
-----------------------------------------------------------------------------------------
Laboratory : POO2 - Laboratoire 14
File : test.cpp
Author : Thomas Benjamin, Gobet Alain
Date : 22.03.2018
Class : POO - A
Goal : Definition of a class Test to test all the features of the clas... |
//
// Created by roy on 12/18/18.
//
#ifndef PROJECTPART1_LINEPARSER_H
#define PROJECTPART1_LINEPARSER_H
#include <vector>
#include <string>
#include <iostream>
#include "CommandMap.h"
#include "SmallLexer.h"
#include "BigLexer.h"
#include "SymbolTable.h"
#include "Utilities.h"
#include "ConnectCommand.h"
#include "O... |
//
// main.cpp
// BYU Box
//
// Created by Jesse Millar on 9/16/13.
// Copyright (c) 2013 Jesse Millar. All rights reserved.
//
#include <iostream>
using namespace std;
int main()
{
cout << "BYU\n\nBYU\n\nBYU";
} |
#include <iostream>
#include <fstream>
#include <set>
#include <string>
#include <algorithm>
#include <boost/regex.hpp>
#include "Configfile.h"
#include "Helpers.h"
#include "CLArguments.h"
std::string GetFileContent(const std::string& filename)
{
std::string content;
std::ifstream in(filename.c_str());
if... |
// Created on: 1995-05-29
// Created by: Xavier BENVENISTE
// 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 ... |
#pragma once
#include "naive_async_dictionary.hpp"
#include "naive_dictionary.hpp"
#include "scenario.hpp"
#include "tools.hpp"
#include "trie.hpp"
#include "trie_async.hpp"
#include "trie_async_global.hpp"
#include <functional>
#include <gtest/gtest.h>
#include <thread>
|
#include "AAObject.h"
#include "AAWorld.h"
AAObject::AAObject(const char *name)
{
this->name = name;
glm::mat4 modelTransformationMatrix;
glm::mat4 projectionMatrix;
this->objectTransformationMatrix = glm::translate(glm::mat4(1.f), glm::vec3(0.0f, 0.0f, 0.0f));
this->objectScaleMatrix = glm::scale(glm::mat4(1.f),... |
#pragma once
#include<string>
class Evenement{
private:
public:
virtual std:: string method() const = 0; // J'ai mis cette méthode ici juste pour que ce soit une classe abstraite pour le moment
};
|
#include<bits/stdc++.h>
#define rep(i,n) for (int i =0; i <(n); i++)
using namespace std;
using ll = long long;
const double PI = 3.14159265358979323846;
const ll MOD = 998244353;
int main(){
ll A,B,C;
cin >> A >> B >> C;
ll a = A*(A+1) / 2;
a %= MOD;
ll b = B*(B+1) / 2;
b %= MOD;
... |
#ifndef TRAJECTORY_H
#define TRAJECTORY_H
#include "point.h"
#include <QList>
#include "node.h"
#include "CGLA/Mat4x4f.h"
#include "CGLA/Mat1x4f.h"
#include "CGLA/Mat3x4f.h"
#include "CGLA/Mat1x3f.h"
#include "CGLA/ArithMat.h"
#include "qmath.h"
#include "matrix.h"
#include "vertex.h"
#include "rocketship.h"
#include "... |
#include "LCDNumber.h"
#include <QDebug>
#include <QApplication>
#if defined(Q_OS_UNIX)
#include <QLibrary>
#include <QtX11Extras/QX11Info>
#include <X11/Xutil.h>
#elif defined(Q_OS_WIN)
#include <windows.h>
#endif // Q_OS_MACRO
LCDNumber::LCDNumber(QWidget *parent)
: QLCDNumber(parent)
{
timer = new QTimer(... |
#include <bits/stdc++.h>
using namespace std;
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 100000
#define INF 0x3f3f3f3f
#define DEVIATION 0.00000005
typedef long long LL;
vector <string> table;
void build(string str){
if( str.size() > 5 ) return;
table.push_back(str);
for(char i =... |
#include <iostream>
#include <queue>
using namespace std;
typedef int Dado;
enum Posicao
{
DIR,
ESQ
};
class Noh
{
friend class ABB;
public:
Noh(Dado d);
bool FilhoDaDireita();
Dado MenorRecursivo();
bool Sucessor(Dado *ptResultado);
private:
Dado valor;
Noh *esq;
Noh *dir;... |
#pragma once
#include <BWAPI.h>
#include <map>
#include <vector>
#include <set>
enum class UnitOrder
{
COLLECT_MINERALS,
COLLECT_GAS,
SCOUT_CONFUSION_MICRO,
BUILD,
CAMP,
CAMP_MOVE,
SCOUT,
RALLY
};
class UnitManager
{
// <unit id, UnitOrders>
std::map<int, UnitOrder> m_unitOrders;
std::set<int> ... |
/**********************************************
** Description: Header file of Player
*********************************************/
#ifndef PLAYER_HPP // PLAYER.hpp is the Player class specification file.
#define PLAYER_HPP
#include<string>
class Player
{
private: //This is member variables.
std::strin... |
#include<iostream>
#include<cstring>
using namespace std;
long long f[100010];
int main()
{int t;
freopen("test.in","r",stdin);
scanf("%d",&t);
while (t--)
{int n;
long long ans = 0;
scanf("%d",&n);
memset(f,0,sizeof(f));
for (int i = 0;i < (n+1)/2; i++)
{f[i+1]=f[i]+n-2*i;
f[n-i]=f[i+... |
#include "engine/net/ServerNet.hpp"
ServerNet::ServerNet(){
pthread_mutex_init( &mutex, NULL);
pthread_mutex_init( &mutex1, NULL);
pthread_cond_init( &connectionSignal, NULL);
ServerNet::Init();
}
int ServerNet::Init(){
if (enet_initialize () != 0)
{
fprintf (stderr, "An error occ... |
/*
Copyright (c) 2005-2022 Xavier Leclercq
Released under the MIT License
See https://github.com/ishiko-cpp/test-framework/blob/main/LICENSE.txt
*/
#ifndef _ISHIKO_CPP_TESTFRAMEWORK_CORE_TESTAPPLICATIONERRORCODES_HPP_
#define _ISHIKO_CPP_TESTFRAMEWORK_CORE_TESTAPPLICATIONERRORCODES_HPP_
namespace Ishiko
{... |
#ifndef __residlerParameterFormat__
#define __residlerParameterFormat__
#include "pluginterfaces/base/ftypes.h"
#include <vector>
namespace Steinberg {
namespace Vst {
namespace residler {
using namespace std;
//-----------------------------------------------------------------------------
class residlerParameterFor... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* @author Arjan van Leeuwen (arjanl)
*/
#include "core/pch.h"
... |
#include "TransitionGenerator.h"
#include "Situation.h"
#include "Transition.h"
#include <iostream>
using std::unique_ptr;
using std::make_unique;
using std::shared_ptr;
TransitionGenerator::TransitionGenerator() {
}
TransitionGenerator::~TransitionGenerator() {
}
unique_ptr<Transition> TransitionGenerator::generat... |
// Toboggan_Trajectory.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <vector>
#include <string>
int main()
{
std::vector<std::string> trees;
std::string tmp;
while (std::cin >> tmp)
{
trees.push_back(tmp);
... |
#include <assert.h>
#include <math.h>
#include <algorithm>
#include <climits>
#include <functional>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
using namespace std;
const int mod = 1e9 + 7;
int n, k... |
/*====================================================================
Copyright(c) 2018 Adam Rankin
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 limitati... |
#ifndef _METADATA_H_
#define _METADATA_H_
#include "mcprotocol_base.h"
#include "slotdata.h"
namespace MC
{
namespace Protocol
{
namespace Msg
{
class Metadata : public BaseMessage
{
public:
Metadata();
Metadata(int8_t _item);
size_t serialize(Buffer& _dst, size_t _offset);
size_t deserialize(const Buffer& _src... |
/****************************************************************************
** Copyright (C) 2017 Olaf Japp
**
** This file is part of FlatSiteBuilder.
**
** FlatSiteBuilder 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 S... |
#include"matrix03.h"
#include<vector>
#include<gtest/gtest.h>
TEST(MulTest, meaningful) {
std::vector<std::vector<int>> left = {
{11, 12, 13, 14},
{21, 22, 23, 24},
{31, 32, 33, 34}
};
std::vector<std::vector<int>> right;
right.resize(4, std::vector<int>(3, 1.));
std::vector<std::vector<int>> exp... |
#include <Arduino.h>
#include <EEPROM.h>
#define EEPROM_SIZE 1
#define btn 15
unsigned char ledStatus = LOW;
bool changeLedStatus = false;
volatile bool interruptState = false;
int totalInterruptCounter = 0;
portMUX_TYPE gpioIntMux = portMUX_INITIALIZER_UNLOCKED;
void IRAM_ATTR gpioISR()
{
portENTER_CRITICAL(&gpi... |
/*
* types.hpp
*
* Created on: Sep 24, 2019
* Author: jacoboffersen
*/
#ifndef TYPES_HPP_
#define TYPES_HPP_
typedef unsigned short int u8;
#endif /* TYPES_HPP_ */
|
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
const int maxn = 1e... |
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int t{}, n{};
int max_speed{}, speed{};
cin >> t;
for(int i = 1; i <= t; ++i){
cin >> n;
max_speed = 0;
for(int j = 0; j < n; ++j){
cin >> speed;
max_speed = max(max_speed, sp... |
#ifndef UNIVERSE_H
#define UNIVERSE_H
#include "solarsystem.h"
#include "SimConstants.h"
#include "custom_sim_exceptions.h"
namespace Simulation
{
class Universe {
public:
// Members
Universe(int world_count);
~Universe(void);
void Init();
void Update(float dt);
void Add... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QMap>
#include <QWindow>
#include <QMutex>
#include <xcb/xcb.h>
#include <xcb/xcb_ewmh.h>
#include <QtX11Extras/QX11Info>
#include <QCloseEvent>
class QSystemTrayIcon;
class QThread;
struct strucWindow {
int wid = 0;
QString name = ... |
#include "connexion.h"
using namespace std;
int connexion(u_short port, SOCKET &sock, SOCKADDR_IN &sin)
{
WSADATA WSAData;
WSAStartup(MAKEWORD(2, 0), &WSAData);
sock = socket(AF_INET, SOCK_STREAM, 0);
sin.sin_addr.s_addr = INADDR_ANY;
sin.sin_family = AF_INET;
sin.sin_port = htons(port);
bind(sock, (SOCKADDR *... |
#include "Director.h"
#include"Builder.h"
Director::Director(Builder * bld):_bld(bld) {
}
Director::~Director() {
//if(_bld)
// delete _bld;
//_bld = nullptr;
}
void Director::Construct() {
_bld->BuildPartA("one");
_bld->BuildPartB("one");
_bld->BuildPartC("one");
}
|
#include "SvrConfig_.h"
#include <vector>
#include "tinyxml.h"
#include "Logger.h"
using namespace std;
static std::string GetAttribute(TiXmlElement * element,std::string name,std::string defaultValue)
{
const char * attribute = element->Attribute( name.c_str() ) ;
if(attribute==NULL || std::string(attribu... |
// 全排列.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
#include<string>
using namespace std;
#include<vector>
#include<algorithm>
vector<string> res;
void quanpai(string& a, int low, int high) {
if (low >= high) res.push_back(a);
for (int i = low; i < high; i++) {
swap(a[low], a[i]);
quanpai(a, low ... |
#include <iostream>
#include <string>
class HashMap {
private:
struct Node {
std::string name;
int key;
struct Node* next;
};
int hash(int key) {
return key % 5;
}
Node** arr = new No... |
#include "interface.h"
#include "machine.h"
#include "util.h"
#include <ncurses.h>
#include <menu.h>
#include <sstream>
#include <fstream>
#include <cmath>
#include <vector>
#include <json/json.h>
#include <menu.h>
#include <dirent.h>
const int HEADER_MENU_LENGTH=4; //not really the best way to do things
menu_option... |
#include<iostream>
using namespace std;
class shape
{
protected :
float d1,d2,a;
public :
shape (float k,float l)
{ d1=k; d2=l;}
virtual float calc_area ()=0;
};
class rectangle : public shape
{ public :
rectangle (float k,float l) : shape (k,l) {}
float calc_area ()
{ a=d1*d2;
return a;}
};
c... |
#pragma once
#include "utils/ptts.hpp"
#include "proto/config_league.pb.h"
using namespace std;
namespace pc = proto::config;
namespace nora {
namespace config {
using league_ptts = ptts<pc::league>;
league_ptts& league_ptts_instance();
void league_ptts_set_fu... |
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <map>
bool isEven(int number) {
bool isEven = false;
if (number % 2 == 0) {
isEven = true;
}
return isEven;
}
int main() {
int anumber = 0;
std::cin >> anumber;
std::string oddevenWord[] = {"ODD... |
#include "citygen.hpp"
#include "city.hpp"
#include "components/room.hpp"
#include "entities/citizen.hpp"
#include "entities/workroom.hpp"
#include "entities/entity.hpp"
#include "entities/filestorage.hpp"
#include "hydroponics/hydroponics.hpp"
#include "hydroponics/hydroponics_table.hpp"
#include "storage/storageroom.... |
// Copyright 2012 Yandex
#ifndef LTR_INTERFACES_PRINTABLE_H_
#define LTR_INTERFACES_PRINTABLE_H_
#include <ostream>
#include <string>
using std::string;
namespace ltr {
class Printable {
public:
virtual string toString() const = 0;
virtual ~Printable() {}
};
std::ostream& operator<<(std::ostream& stream, cons... |
/*********************************************************\
* Copyright (c) 2012-2018 The Unrimp Team
*
* 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 wit... |
#ifndef LIBLAS_CHIPPER_H
#define LIBLAS_CHIPPER_H
#include <liblas/liblas.hpp>
#include <liblas/export.hpp>
#include <liblas/detail/opt_allocator.hpp>
#include <vector>
namespace liblas
{
namespace chipper
{
enum Direction
{
DIR_X,
DIR_Y,
DIR_NONE
};
class LAS_DLL PtRef
{
public:
double m_pos;
... |
#include <iostream>
#include <string>
#include <memory>
#include <algorithm>
#include <vector>
#include <functional>
#include "stdafx.h"
#include "..\Dependencies\jni.h"
#include "ConfigReader.h"
using namespace std;
#pragma region "Interop class"
namespace JNIBridge {
namespace Core {
class JNIBRIDGE_API Interop ... |
#include <iostream>
#include <fstream>
using namespace std;
int WriteToText() {
ofstream myfile ("example.txt");
if (myfile.is_open())
{
myfile << "This is a line.\n";
myfile << "This is another line.\n";
myfile.close();
}
else cout << "Unable to open file";
return 0;
}
int ReadFromText() {
str... |
//
// Created by Alan de Freitas on 12/04/2018.
//
#include "parameter_control_EA.h"
template<typename problem, typename solution>
std::default_random_engine parameter_control_EA<problem, solution>::_generator = std::default_random_engine(
std::chrono::system_clock::now().time_since_epoch().count());
templat... |
#include<iostream>
//time complexity for array rotation using temp O(n)
//auxillary space O(d)
using namespace std;
int main(){
int n,arr[100],temp[100],d;
cout<<"Enter the size of the array"<<endl;
cin>>n;
cout<<"Enter the array elements"<<endl;
for(int i=0;i<n;i++){
cin>>arr[i];
}
... |
/****************************************************************
File Name: contree.C
Author: Tian Zhang, CS Dept., Univ. of Wisconsin-Madison, 1995
Copyright(c) 1995 by Tian Zhang
All Rights Reserved
Permission to use, copy and modify this software must be granted
by the author ... |
//realwindow.cpp
//Handles real windows - creation, etc.
//Created by Lewis Hosie
//14-07-07
//Dependencies: SDL.
#include "realwindow.hpp"
#include "entry.hpp"
#include "inputpasser.hpp"
void realwindow::takesdlevents(inputpasser &theinputpasser){
SDL_Event event;
while ( SDL_PollEvent( &event ) ){
switch( event... |
#ifndef CONDITION_H_MYIDENTIFY_1985
#define CONDITION_H_MYIDENTIFY_1985
#include <pthread.h>
#include "lock.hpp"
namespace core { namespace common
{
class condition
{
private:
pthread_cond_t cond;
public:
condition()
{
pthread_cond_init(&cond,NULL);
}
... |
#pragma once
#include "GamePiece.h"
#include "Coin.h"
#include "Race.h"
#include "PowerBadge.h"
using namespace std;
class GameDeck {
private:
vector<PowerBadge*>* powers;
vector<Race*>* races;
vector<OneCoin*> oneCoins;
vector<ThreeCoin*> threeCoins;
vector<FiveCoin*> fiveCoin;
vector<TenCoin*> tenCoin;... |
#include <stdio.h>
int main(){
int N;
int a[80];
scanf("%d",&N);
int count;
while(1){
count=0;
int i;
for(int i=0;i<N;i++)
scanf("%d",&a[i]);
for(i=0;i<N-1;i++){
if((a[i]%2==1 && a[++i]%2==0) || (a[i]%2==0 && a[++i]%2==1)){
count++;
}
}
printf("... |
// Calvin Costa
// 7/8/19
// Lab 10 Task A
// The first function should return the number of minutes from 0:00AM until time. The second function should receive two Time arguments earlier and later and report how many minutes separate the two moments. For example, when passing 10:30AM and 1:40PM:
#include <iostream>
u... |
#include <iostream>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <map>;
#define limit 10000
using namespace std;
typedef long long number;
typedef pair<int, int> coord;
ifstream fin("input.txt");
number s[limit], p[limit], i, base;
vector<vector<char>> camera;
map<coord, b... |
/*
* File: main.cpp
* Author: Elijah De Vera
* Created on January 21, 2021
* Purpose: MPG problem
*/
//System Libraries
#include <iostream> //Input/Output Library
#include <iomanip>
using namespace std;
//User Libraries
//Global Constants, no Global Variables are allowed
const float CVLITE... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <stack>
using namespace std;
int findMax(int ar[], int n){
stack <int> s;
int top,max_area=-1,area = 0;
// s.push(0);
top = 0;
int i;
for(i =0;i<n;)
{
if(s.e... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2012 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"
#if defined ENCODINGS_HAVE_TABLE_DRIVEN &&... |
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <memory.h>
#include <math.h>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <map>
typedef long long LL;
typedef unsigned long long ULL;
#define PI 3.141592653589... |
// This example code is in the public domain.
// I2C slave Nano
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#define I2C_ADDR 4
#define SPEED 1000000
#define SPEED 3200000
#define SD_CS 4
#define BUFSIZE 8
byte buffer[BUFSIZE];
int idx = 0;
File dataFile;
void setup()
{
Wire.begin(I2C_ADDR);
Wire.setCl... |
#include "Sort.h"
bool compareStrings(const std::string &s1, const std::string &s2) {
int maxLen = (s1.length() > s2.length()) ? (int)s2.length() : (int)s1.length();
for (int i = 0; i < maxLen; i++) {
if (s1[i] != s2[i]) return (s1[i] < s2[i]);
}
return s1.length() < s2.length();
}
std::string Sort::execute(std... |
/* ***** 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_DICOMPATIENTDBWRITERMANAGER_HPP_
#define _GDCMIO_DICOMPATI... |
#include <GL/glfw.h>
#include <iostream>
#include <cmath>
#include <cassert>
using namespace std;
//feel free to mess with these constants.
const GLfloat BALL_RADIUS = 0.07f;
const GLfloat MAJOR_AXIS = 0.07f;
const GLfloat MINOR_AXIS = 0.36f;
const GLuint THING_COLORS[] = { 0xFFFFFFFF, 0x550000FF, 0x55FF0000 };
stru... |
#pragma once
#include "afxcmn.h"
#include "afxwin.h"
// CModallessDlg 对话框
class CModallessDlg : public CDialog
{
DECLARE_DYNAMIC(CModallessDlg)
public:
CModallessDlg(CWnd* pParent = NULL); // 标准构造函数
virtual ~CModallessDlg();
// 对话框数据
enum { IDD = IDD_MODALLESS_DIALOG };
protected:
virtual void DoDataExchan... |
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <Game/GameUtil.h>
#include "Table.h"
#include "Logger.h"
#include "IProcess.h"
#include "Configure.h"
#include "AllocSvrConnect.h"
#include "CoinConf.h"
#include "HallManager.h"
#include "Util.h"
#include "Protocol.h"
#include "GameApp.h"
#include "St... |
// Grading Students
// https://www.hackerrank.com/challenges/grading/problem
#include<bits/stdc++.h>
using namespace std;
int last(stack<int> stk) {
}
int main()
{
stack<int> stk;
cout<<stk.top();
cout<<endl;
return 0;
} |
#pragma once
namespace u_interface_classes
{
void classes_interface();
} |
#include "cointoss.h"
#include "ui_cointoss.h"
#include <stdlib.h>
/****************
* Do not modify
****************/
coinToss::coinToss(QWidget *parent) :
QDialog(parent, Qt::CustomizeWindowHint | Qt::WindowTitleHint ),
Minigame(),
ui(new Ui::coinToss)
{
ui->setupUi(this);
ui->start_jackpot->s... |
#include <iostream>
#include <boost/thread.hpp>
#include <boost/asio.hpp>
void handler1(const boost::system::error_code &ec)
{
std::cout << "5 s. " << std::endl;
}
void handler2(const boost::system::error_code &ec)
{
std::cout << " 10 s " << std::endl;
}
boost::asio::io_service io_service;
void run()
{
io_ser... |
/*
* Copyright 2016 Freeman Zhang <zhanggyb@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 License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... |
#include<iostream>
#include<math.h>
//declaram 2 variabile pentru numar si pentru radacina
int main(){//start main
int nr, i;
int sq;
printf("\nIntroduce-ti un numar: ");
scanf("%d",&nr);
//verificam daca fiecare numar de la 0 pana la nr ridicat la patrat este egal cu numarul introdus
for(i=0;i<=nr;i++){
... |
#ifndef UNITSTATE_H
#define UNITSTATE_H
#include <iostream>
#include <string>
class UnitState {
private:
std::string name;
int maxHp;
int dmg;
protected:
int hp;
public:
UnitState(const std::string& name, int health, int maxHealth, int damage, bool isUndead = fals... |
#include <numeric>
#include <afxdao.h>
#include "city_forecast.h"
#include "analy-day.h"
//取消DAO数据库操作警告
#pragma warning( disable : 4995 )
//将实况插入数据库
bool insertDB(const char *dbname,const char * table, COleDateTime datet,std::vector<double> &vals)
{
using namespace std;
CDaoDatabase daoDb;
C... |
#include "FlacUtils.h"
#include <boost/format.hpp>
#include <QString>
#ifdef PG_HAS_FLAC
#include "FLAC++/decoder.h"
namespace PticaGovorun
{
namespace details
{
static bool write_little_endian_uint16(FILE *f, FLAC__uint16 x)
{
return fputc(x, f) != EOF && fputc(x >> 8, f) != EOF;
}
class OurDecoder : p... |
#pragma once
#include <string.h>
namespace Application {
static const unsigned int WIDTH = 900;
static const unsigned int HEIGHT = 600;
static const unsigned int NUM_PIXELS_ELEMNTS = WIDTH * HEIGHT * 4;
static unsigned char* data;
static unsigned int time;
void Init();
void Update();
void Close();
} |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
/*
Copyright © 2006, Drollic
All rights reserved.
http://www.drollic.com
Redistribution of this software in source or binary forms, with or
without modification, is expressly prohibited. You may not reverse-assemble,
reverse-compile, or otherwise reverse-engineer this software in any way.
THIS SOFTWARE ("S... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
typedef long long L... |
#include <iostream>
#include <vector>
#include <stdlib.h>
#include <algorithm>
#define min(x, y) (x > y ? y : x)
using namespace std;
int main(){
int N;
int T, A;
int H[1000];
int TEMP[1000];
cin >> N;
cin >> T >> A;
for(int i = 0; i < N; i++)
{
int tmp;
cin >> tmp;... |
( English:'Swedish';
Native:'Svenska';
LangFile:'swedish.lang';
DicFile:'svenska.dic';
FlagID:'se';
Letters:'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,Ä,Å,Æ,Ö,Ü';
LetterCount:'8,2,1,5,7,2,3,2,5,1,3,5,3,6,5,2,0,8,8,8,3,2,0,1,1,1,2,2,0,2,0';
LetterValue:'1,4,8,1,1,3,2,2,1,7,2,1,2,1,2,4,0,1,1,1,4,3... |
// Fri Apr 29 11:54:22 EDT 2016
// Evan S Weinberg
// C++ file for preconditioned CG inverter.
// To do:
// 1. Template to support float, double.
#include <iostream>
#include <cmath>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include "generic_vector.h"
#include "generic_cg_flex_prec... |
//
// Created by Nikita Kruk on 25.11.17.
//
#ifndef SPRAPPROXIMATEBAYESIANCOMPUTATION_PERIODICBOUNDARYCONDITIONSCONFIGURATION_HPP
#define SPRAPPROXIMATEBAYESIANCOMPUTATION_PERIODICBOUNDARYCONDITIONSCONFIGURATION_HPP
#include "../Definitions.hpp"
#include "BoundaryConditionsConfiguration.hpp"
#include "Vector2D.hpp"
... |
#pragma once
#include <opencv2/core/mat.hpp>
#include <iberbar/Poster/MathTypes.h>
namespace iberbar
{
namespace Poster
{
// 安全绘制Mat,检查边界,不抛出异常
void SafeDrawMat( cv::Mat matSrc, cv::Mat matDest, const CRect2i& rcDest, const CColor4B* color = nullptr );
// 安全绘制Mat,检查边界,不抛出异常
void SafeDrawMat( cv::Mat matSrc... |
// O(NF^2) = O(n^3) dp where n <= 500
#include <iostream>
using namespace std;
int factory, layer, layers[600];
long long dist[600][600], recycle[600][600], produce[600][600];
long long dp_recycle[600][600], dp_produce[600][600]; // dp[layer][ball at which factory]
int main(){
cin >> factory >> layer;
for(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.