text stringlengths 8 6.88M |
|---|
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <iostream>
using namespace std;
int k;
string array[15];
string save[1<<16];
string merge(string a,string b)
{
int sa = a.size();
int sb = b.size();
int check;
int check2=1;
for(int i=0;i<sa;i++)
{
if(a[i]==b[0])
{
check=0;
int j;
fo... |
/*!
*@FileName: KaiXinApp_UserInfoDetail.h
*@Author: pengzhixiong@GoZone
*@Date: 2010-10-7
*@Log: Author Date Description
*
*@section Copyright
* =======================================================================<br>
* Copyright ? 2010-2012 GOZONE <br>
* All Rights Reserved.<br>
* The... |
// =============================================================================
// Copyright 2012.
// Scott Alexander Holm.
// All Rights Reserved.
// =============================================================================
#ifndef PLAY_H
#define PLAY_H
#include "player.h"
#include "card.h"
#include ... |
#include <queue>
#include "log.h"
#include "statemachine.h"
#include "utils.h"
using namespace std;
pthread_mutex_t CStateMachine::sm_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t CStateMachine::event_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t CStateMachine::event_mutex_cond = PTHREAD_COND_INITIALIZER;
/... |
/* blah_test.cpp -*- C++ -*-
Rémi Attab (remi.attab@gmail.com), 30 Mar 2014
FreeBSD-style copyright and disclaimer apply
Blah
*/
#define REFLECT_USE_EXCEPTIONS 1
#include "reflect.h"
#include "dsl/all.h"
#include "types/primitives.h"
#include "types/std/string.h"
#include <i... |
/*
* Copyright 2017 Roman Katuntsev <sbkarr@stappler.org>
*
* 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 ap... |
#include<bits/stdc++.h>
using namespace std;
int n;
long long aux,lst;
set<long long>s;
int main(){
cin >> n;
for(int i=0;i<n;i++){
cin >> aux;
s.insert(aux);
}
while(1){
set<long long>::iterator it=s.end();
it--;
aux=*it;
if(aux==1) break;
lst=aux/2;
while(s.find(lst)!=s.end()&&lst>1) lst/=2;
if(... |
class Solution {
public:
void moveZeroes(vector<int>& nums) {
int numbersOfZeros = 0;
int tmpIndex = 0;
int n = nums.size();
int i = 0;
for(; i < n; i++)
{
if(nums[i] == 0)
{
numbersOfZeros++;
continue;
... |
#pragma once
#include "Mesh.h"
class Model {
public:
std::vector<Mesh> meshes;
Model(std::vector<Mesh> meshes);
}; |
/*
* 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/Format>
#include <flux/meta/YasonWriter>
namespace flux {
namespace meta {
Ref<YasonWriter> YasonWriter::create(Format format, String indent) { retu... |
#pragma once
#include <cstdint>
#include <landstalker-lib/tools/json.hpp>
class ItemDistribution
{
private:
uint16_t _quantity = 0;
public:
ItemDistribution() = default;
explicit ItemDistribution(uint16_t quantity) : _quantity (quantity) {}
[[nodiscard]] uint16_t quantity() const { return _quantity... |
//#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <time.h>
#include "tools.h"
#include "gauss.h"
int main(int argc, char** argv){
double* a;
double* b;
int initID = 0;
int n=0;
int m=0;
int res;
char* name;
clock_t t;
double time=0.;
FILE* input;
if (argc==3){
if ( !(n ... |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
/*concept1 문제랑은 다르게 고려해야 할 요소가 4개나 있으니
단순히 pair나 map을 이용해서 풀기 힘들다. 그럴 경우
class를 이용하여 안의 속성들을 정렬하는 방식으로 푼다.*/
class Student {
public:
string name;
int kor, eng, math;
Student(string name, int kor, int eng, int math){
... |
#include <iostream>
#include "logging.hpp"
INITIALIZE_EASYLOGGINGPP
// Program entry point.
int main(int argc, char** argv) {
START_EASYLOGGINGPP(argc, argv);
CXL_LOG(INFO) << "Hello, useful utils =)";
return 0;
}
|
//
// https://open.kattis.com/problems/r2
//
// Created by Sofian Hadianto on 23/12/18.
// Copyright © 2018 Sofian Hadianto. All rights reserved.
//
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(int argc, const char * argv[]) {
ios::sync_with_stdio(false);
cin.tie(NULL);
... |
#ifndef __ZU_STACK_ALLOCATOR_H__
#define __ZU_STACK_ALLOCATOR_H__
#include <string>
#include <iostream>
#include <cdk/symbol_table.h>
#include <cdk/ast/basic_node.h>
#include "targets/symbol.h"
#include "targets/basic_ast_visitor.h"
namespace zu {
class stack_allocator: public basic_ast_visitor {
cdk::symbol_table... |
#include <iostream>
using namespace std;
int main(){
int outputs;
int outputf = 0;
int remainder;
int n;
int s;
cin>>n;
cin>>s;
remainder = s;
for (int i = n ; i>0 ; --i){
if (i<=remainder){
outputs = remainder/i;
outputf += outputs;
remainder -= i*outputs;
}
else{}
}
cou... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int N;
while (cin >> N, N)
{
priority_queue<int, vector<int>, greater<int>> fila;
for (int i = 0; i < N; ++i)
{
int a;
cin >> a;
fila.push(a);
}
int cost = 0;
while (fila.size() > 1)
{
int a = fila.top();
fila.pop();
int b... |
#include<stdio.h>
#include<stdlib.h>
void countSort(int arr[],int size,int max)
{
int count[max+1],output[size],i;
for(i=0;i<=max;i++)
count[i]=0;
for(i=0;i<size;i++) //frequency of elements
count[arr[i]]++;
for(i=1;i<=max;i++) //giving index in sorted array... |
#include <cstdio>
#include <iostream>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <cstring>
#include <set>
#include <iterator>
using namespace std;
vector<string>node;
map<string,int>seen;
map<string,int>indegree;
vector<string>result;
map<string,vector<string> >v;
i... |
#ifndef STMT_INFO_COLLECT_H
#define STMT_INFO_COLLECT_H
#include "AstInterface.h"
#include "SinglyLinkedList.h"
#include "ProcessAstTree.h"
#include "AnalysisInterface.h"
#include "union_find.h"
#include <map>
#include <sstream>
class StmtInfoCollect : public ProcessAstTreeBase
{
protected:
struct ModRecord{
... |
/*
Author: Градобоева Елизавета
Group: СБС-001-о-01
Task#: 1.11
*/
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
cout << "The program calculates the square root of a complex number." << endl;
const double PI = 3.1416;
double x, y, z, iph, X1, Y1, X, Y;
cout << "E... |
/***********************************************************************
created: Sun Jan 11 2009
author: Paul D Turner
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2009 Pa... |
#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
int num[100];
int n;
class treenode {
public:
int data;
treenode *lch;
treenode *rch;
treenode(int s)
{ data=s;
lch=NULL;
rch=NULL;
}
};
void destroy(treenode *node)
{
if... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=0; i<=n; i++)
{
for(int j=0; j<n-i; j++) cout<<" ";
for(int j=0; j<2*i; j++)
{
if(j<=i) cout<<j<<" ";
else cout<<2*i-j<<" ";
}
cout<<0<<endl;
}
for(int i=n-1; i>=0; i--)
{
for(int j=0; j<n-i; j++) cout<<" ";... |
#ifndef TempPeripheral_h
#define TempPeripheral_h
#include <Arduino.h>
#include <ESP8266WebServer.h>
#include <PubSubClient.h>
#include <ESP_MQTTLogger.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include "peripherals.h"
class TempPeripheral : public Peripheral {
public:
TempPeripheral();
... |
#include "stdafx.h"
#include "ErrorLogger.h"
void ErrorLogger::Log(string message)
{
string error_message = "Error: " + message;
MessageBoxA(NULL, error_message.c_str(), "Error", MB_ICONERROR);
}
void ErrorLogger::Log(HRESULT hr, string message)
{
_com_error error(hr);
wstring error_message = L"Error: " + StringC... |
#include<Windows.h>
#include"CView.h"
extern CView app;
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam,
LPARAM lParam) {
int i = 0;
while (CView::messageMap[i].iMsg != 0) {
if (iMsg == CView::messageMap[i].iMsg) {
fpCViewGlobal = CView::messageMap[i].fp;
(app.*fpCViewGlobal)(wParam,lParam);
... |
#include "../include/mathGL_graphics.h"
#include <cmath>
#include <list>
#include <string>
/**
*
* Example of plotting two arguments function f(x,t) = cos(x) - t,
* using syntax parser
*
*/
int main()
{
MathGLGraphics gr;
TwoArgumentsFunction_Surf_SyntaxParser obj("cos(x) - y");
gr.parametres()->set... |
#include<algorithm>
#include<bitset>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<deque>
#include<functional>
#include<iostream>
#include<limits>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>
#include<numeric>
#include<ext/numeric> // iot... |
#include "StdAfx.h"
#include "QueryProcessConnect.h"
#include "CommonFunc.h"
CQueryProcessConnect::CQueryProcessConnect(void)
{
}
CQueryProcessConnect::~CQueryProcessConnect(void)
{
}
long CQueryProcessConnect::Init()
{
long long_ret = 0;
QuerySYSResult = NULL;
QuerySYSTypeCount = NULL;
QuerySYSTypeCountParam=... |
#pragma once
#include <opencv2/core.hpp>
class CurveCompare
{
public:
static void curveCompareNormalizedArea(cv::Mat &input, cv::Mat &teacher, double &area, double &completeness)
{
int numPixels = 0;
int nt = 0;
int ni = 0;
for (int i = 0; i < teacher.cols; ++i)
{
for (int j = 0; j < teacher.rows; +... |
#include<iostream>
#include<set>
#include<algorithm>
using namespace std;
const int MAX_NUM=100000;
set<long long>s;
int tmpArray[MAX_NUM
int n,k;
int process()
{
int ans=0;
int start,end;
cin >>n>>k;
s.clear();
for(int i=0;i<n;i++)
{
long long tmpI;
cin >>tmpI;
s.insert(tmpI);
}
start=0;end=s.size()... |
#ifndef _CAMERA_H_
#define _CAMERA_H_
#include <stdio.h>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#include "CGFcamera.h"
#include "CGFscene.h"
using namespace std;
class Camera: public CGFcamera {
protected:
bool enabled;
string camera_id;
float near;
float far;
public:
Camera(... |
/**********************************************************************
Filename : LobbyDataProvider.h
Content : The Lobby application controller
Created : 7/31/2009
Authors : Prasad Silva
Copyright : (c) 2009 Scaleform Corp. All Rights Reserved.
This file is provided AS IS with NO ... |
template <typename T>
class DataTypeFor
{
public:
static H5::DataType value;
};
template <typename T>
typename std::enable_if<is_tt<std::complex, T>::value, void>::type get_hdf5(T * l, H5::H5File * file, char * name) {
H5::DataSet dataset = H5::DataSet(file->openDataSet(name));
H5::CompType complex_data_typ... |
/***************************************************************************
propiedades.h - description
-------------------
begin : jue abr 24 2003
copyright : (C) 2003 by Oscar G. Duarte V.
email : ogduarte@i... |
#include "expressions/subtraction_expression.hpp"
#include "expressions/expression.hpp"
#include "expressions/binary_expression.hpp"
#include "expressions/operator.hpp"
#include "expressions/scope.hpp"
namespace flow {
SubtractionExpression::SubtractionExpression(ExpressionPtr left,
... |
#ifndef __MODULE_RENDER_3D_H__
#define __MODULE_RENDER_3D_H__
#include "Module.h"
#include "Globals.h"
#include "glmath.h"
#include "Light.h"
#include "RenderTexture.h"
#define MAX_LIGHTS 8
struct SDL_Window;
struct ImVec2;
class ModuleRenderer3D : public Module
{
private:
bool depth_test = false;
bool cull_face ... |
#include <iostream>
#include "simulation.h"
#include "TCanvas.h"
#include "TGraph.h"
#include <vector>
#include <cmath>
#include <gsl/gsl_math.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_sf_airy.h>
#include <gsl/gsl_sf_elementary.h>
#include <gsl/gsl_sf_exp.h>
#include <gsl/gsl_sf_gamma.h>
#include <gsl/gsl_sf_trig... |
#include "naive.h"
//naive alogrithms
// 遇到不匹配时,i ,j都回溯;j回溯至0,i回溯至 i-j+1
int NaiveMatch(const string &s, const string &t)
{
int i(0),j(0);//字符下标均从0开始
while( i<s.length() && j<t.length())
{
if(s[i]==t[j])//两字符相等则继续匹配
{
i++;
j++;
}
else
{ // 若... |
/*
* Helloworld.cpp
*
* Created on: Nov 8, 2018
* Author: Akash Lohani
*/
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}
|
#include<bits/stdc++.h>
using namespace std;
int sqrtN;
struct Query{
int s,e,idx;
bool operator<(const Query& o) const {
if(s/sqrtN == o.s/sqrtN) return e < o.e;
return s/sqrtN < o.s/sqrtN;
}
};
int st[100010];
int n,k,a[100010];
long long ans=0;
int get(int x){
int ret = 0;
while(x > 0){... |
//
// TextureSheet.cpp
// cheetah
//
// Copyright (c) 2013 cafaxo. All rights reserved.
//
#include "BufferManager.h"
#include "TextureSheet.h"
TextureSheet::TextureSheet(BufferManager &bufferManager, const std::string &fileName, const std::string &indexFileName) : Texture(bufferManager, fileName) {
std::strin... |
//! @file ai.h
//! @brief AIcontrolクラスの宣言
/**
* LynxOPS
*
* Copyright (c) 2015 Nilpaca
*
* Licensed under the MIT License.
* https://github.com/Nilpaca/LynxOPS/blob/master/LICENSE
*/
//--------------------------------------------------------------------------------
//
// OpenXOPS
// Copyright (c) 2014-2015, O... |
/*
* Copyright (C) 2015 The Android Open Source Project
*
* 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 app... |
#include<bits/stdc++.h>
using namespace std;
int solve1(int* arr,int n,int k)
{
if(k==0)
{
return 0;
}
if(k < 0)
{
return -1;
}
int max_ = INT_MIN;
for(int i=0;i<n;i++)
{
int temp = solve1(arr,n,k-arr[i]);
if(temp==-1)
{
continue;
}
max_ = max(max_,temp+1);
}
return max_;
}
// iterative o(... |
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package
#ifndef JACTORIO_INCLUDE_GAME_WORLD_CHUNK_H
#define JACTORIO_INCLUDE_GAME_WORLD_CHUNK_H
#pragma once
#include <array>
#include <limits>
#include <vector>
#include "jactorio.h"
#include "data/cereal/serialize.h"
#incl... |
#include "flipLogic.h"
#include <iostream>
#include <string>
#include <cassert>
#include <climits>
void test_basic1();
void test_basic2();
void test_basic3();
void test_cannot_flip();
using namespace std;
int main() {
test_basic1();
test_basic2();
test_basic3();
test_cannot_flip();
}
static void test... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Perception.Spatial.1.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Foundation {
#ifndef WINRT_GENERIC_cdb5efb3_5788_509d_9be1_71ccb8a3362a
#define WINRT_GENERIC... |
#include "Player.h"
Player::Player(const LoaderParams* pParams) : SDLGameObject(pParams) {}
void Player::draw()
{
m_currentFrame = 0;
//m_currentFrame = int(((SDL_GetTicks() / 100) % 5));
if (m_velocity.getX() < 0)
{
TextureManager::Instance()->drawFrame(m_textureID, (Uint32)m_position.getX(), (Uint32)m_positio... |
#include "SDLSoundAPI.h"
#include <string>
#include <iostream>
SDLSoundAPI::SDLSoundAPI()
{
Mix_Init(0);
if (Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 4096))
{
std::cout << Mix_GetError();
}
loadMap();
}
SDLSoundAPI::~SDLSoundAPI()
{
stopMusic();
Mix_Quit();
}
void SDLSoundAPI::loadMap()
{
soundMap.inse... |
#include <iostream>
#include <omp.h>
#include <Eigen/Dense>
#include <H5Cpp.h>
#include <H5Group.h>
#include <chrono>
#include "general.hpp"
#include "kpm_vector.hpp"
#include "aux.hpp"
#include "hamiltonian.hpp"
#include "cheb.hpp"
#include "ComplexTraits.hpp"
#include "myHDF5.hpp"
#define NUM_MOMENTS 2000
int main... |
// github.com/andy489
#include<bits/stdc++.h>
using namespace std;
stack <int> s;
stack <string> history;
int main(){
int n, query, k;
string elem, S;
cin >> n;
while(n--){
cin >> query;
if (query == 1){
// append string w to S
cin >> elem;
history.... |
#ifndef LSIMBDD3_H
#define LSIMBDD3_H
/// @file LsimBdd3.h
/// @brief LsimBdd3 のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2011 Yusuke Matsunaga
/// All rights reserved.
#include "Lsim.h"
#include "YmLogic/Bdd.h"
#include "YmLogic/BddMgr.h"
BEGIN_NAMESPACE_YM
////////////////////////... |
#include <stdio.h> // used for printf
#include <unistd.h> // used for fork(), usleep;
#include <stdlib.h> // used for exit();
#include <sys/wait.h> // used for wait(); WEXITSTATUS
int main()
{
pid_t childpid; // variable to store the child’s pid
childpid = fork();
int status;
if (childpid == 0)
... |
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
string str ="narendiran";
for(int i=0;i<str.length();i++){
if(str[i]>='a' && str[i]<='z')
str[i]-=32;
}
cout<<str<<endl;
for(int i=0;i<str.length();i++){
if(str[i]>='A' && str[i]<='Z')
... |
#include "WblsDaqEvent.h"
#include <TFile.h>
#include <TTree.h>
#include <TChain.h>
#include <iostream>
using namespace std;
void WblsDaq::set_branch_address(TTree* tree, WblsDaq::Event* obj)
{
tree->SetBranchAddress("EventNumber",&obj->count);
tree->SetBranchAddress("TriggerTimeFromRunStart",&obj->time);
... |
/*
*
* @APPLE_LICENSE_HEADER_START@
*
* Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file... |
#include <iostream>
#include <cmath>
using namespace std;
/**
* Escreva um programa que imprima o quadrado dos numeros inteiros,
* no intervalo fechado de 1 a 20.
*/
int main ()
{
// imprime o quadrado dos numeros inteiros de 1 a 20
for (int i=1; i<=20; i++)
cout<<pow (i,2)<<" ";
cout<<endl;
return 0;
}... |
#include <typeinfo> // For std::bad_cast
#include <iostream> // For std::cout, std::err, std::endl etc.
class A {
public:
// Since RTTI is included in the virtual method table there should be at least one virtual function.
virtual ~A() { };
void methodSpecificToA() { std::cout << "Method specific for A was invoked"... |
/*
* 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... |
//TabKey.cpp
#include "TabKey.h"
#include "OtherNoteForm.h"
TabKey::TabKey(Form *form)
:KeyAction(form) {
}
TabKey::TabKey(const TabKey& source)
: KeyAction(source) {
}
TabKey::~TabKey() {
}
TabKey& TabKey::operator=(const TabKey& source) {
KeyAction::operator=(source);
return *this;
}
#include "MemoForm.... |
#include "object.hpp"
Object::Object(int c, sf::String file_name, sf::String name) {
this->cost_ = c;
this->image_file_name_ = file_name;
this->name_ = name;
image_.loadFromFile(PATH_TO_PICTURES + image_file_name_ + PICTURES_FORMAT);
texture_.loadFromImage(image_);
sprite_.setTexture(texture_);... |
#ifndef _GLX_MATH_VEC4_H_
#define _GLX_MATH_VEC4_H_
namespace glx
{
template<class T>
class vec4
{
public:
T x, y, z, w;
public:
vec4() {};
vec4(const T*);
vec4(const vec3<T>& xyz, T w);
vec4(T x, T y, T z, T w);
// casting
operator float* ();
operator const float* () const;
// assignment ope... |
#include "poly.h"
bool Poly::is_neighbor(int idx) const
{
for(int i = 0; i < neighbors.size(); ++i)
{
if(idx == neighbors[i])
{
return true;
}
}
return false;
}
void Poly::clear()
{
center = QPointF(0, 0);
points.clear();
indices.clear();
neighbors.c... |
#include "schokoprod.h"
/********************************************************
*********** DEFINITION DER HILFSFUNKTIONEN **************
*********************************************************/
// Fordert Nutzer auf Enter zu drücken
void press_enter() {
cout << "\nEnter drücken um fortzufahren.";
cin.ignore();... |
//
// Time.cpp
// ReserveSystem
//
// Created by HeeCheol Kim on 27/11/2018.
// Copyright © 2018 HeeCheol Kim. All rights reserved.
//
#include "Time.h"
char* Time::getCurrentTimeYYMMDD() {
time(&(this->rawtime));
this->timeInfo = localtime(&(this->rawtime));
strftime(this->buffer, 80, "%Y%m%d", this-... |
#include "iter.h"
ContOctree::Iter::Iter(ContOctree& oc) :
mem(oc.mem), at_node(true), top_level(oc.top_level), level(oc.top_level),
null_leaf(oc.null_leaf), null_leaf_len(oc.null_leaf_len) {
pos() = 0;
length() = mem.length();
FORI(3)
loc[i] = 0;
}
|
#ifndef CLAP_TRAP_H
# define CLAP_TRAP_H
# include <iostream>
class ClapTrap {
protected:
int _hitPoints;
int _maxHitPoints;
int _energyPoints;
int _maxEnergyPoints;
int _level;
std::string _name;
int _meleeDa... |
// slinked_list.h
// implements a templated singly linked list
// based on Professor Morrison's singly linked list from class
#ifndef SLINKED_H
#define SLINKED_H
#include <cstddef>
template<class T>
class slinked_list
{
private:
// list node data and pointer to next node
// plus constructors and operators
... |
#include "Run_time_Framework.h"
GLvoid CRun_time_Framework::background(float r, float g, float b) {
glClearColor(r, g, b, 1.0f); // 바탕색을 'blue' 로 지정
glClear(GL_COLOR_BUFFER_BIT); // 설정된 색으로 전체를 칠하기
}
GLvoid CRun_time_Framework::Draw_Ball()
{
GLfloat a[] = { 0.2,0.2,0.2,1.0 };
GLfloat d[] = { 0.8,0.8,0.8,1.0 };
... |
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <QObject>
#include <QGraphicsScene>
#include <QTimer>
#include <QGraphicsRectItem>
#include "Zombie.h"
#include "Score.h"
#include "Sun.h"
#include "GroundRect.h"
#include "Nut.h"
#include "ShooterIcon.h"
#include "NutIcon.h"
#include "SunFlower.h"
#include "SunFlower... |
#include "Global.h"
#include "IpmtConfiguration.h"
/*
* Configuração para a função getopt_long.
* Adaptado de
* http://www.gnu.org/software/libc/manual/html_node/Getopt-Long-Option-Example.html
*/
IpmtConfiguration config;
#define COMPRESSION 1
#define INDEXTYPE 2
#define LZ77_BUFFER 3
#define LZ77_LOOKA 4
#define ... |
#include "protein_translation.h"
namespace protein_translation {
std::vector<std::string> proteins(std::string code) {
std::vector<std::string> result;
int codNum = code.size() / 3;
for (int i = 0; i < codNum; ++i) {
std::string subCode = code.substr(i * 3, 3);
if (subCode == "AUG")
result.push_ba... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Devices.Bluetooth.GenericAttributeProfile.1.h"
#include "Windows.Foundation.1.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Foundation {
#ifndef WINRT_GENERIC_e... |
#ifndef STRPAIRARR_H
#define STRPAIRARR_H
#include "pair.h"
template <typename Key, typename Value>
class StrPairArr
{
public:
StrPairArr();
private:
};
#endif // STRPAIRARR_H
|
/***************************************************************************
dialogonumeromostrar.cpp - description
-------------------
begin : jue abr 8 2004
copyright : (C) 2004 by Oscar G. Duarte
email : ogd... |
/*
* Copyright 2021 Stylianos Piperakis, Foundation for Research and Technology Hellas (FORTH)
* License: BSD
*
* 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 t... |
#include "stdafx.h"
#include<sstream>
#include<fstream>
#include<iostream>
#include<algorithm>
#include<string>
#include<list>
#include<map>
using namespace std;
typedef map<char, int> CharMap;
void insertDuCharHelper(CharMap charmap, string prefix, int remaining, list<string> &allStrings){
//Ba... |
#ifndef _escenaH_
#define _escenaH_
#include "PLY2.h"
#include "cuadro.h"
//Esta clase va a servir para dibujar las distintas escenas requeridas en la práctica 4
using namespace std;
class escena{
GLuint ID_text;
PLY lata_tapa;
PLY lata_tronco;
PLY lata_culo;
PLY peon1;
PLY peon2;
PLY peon3;
PLY bet1;
... |
/*
* Copyright 2016-2017 Flatiron Institute, Simons Foundation
*
* 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 ... |
#ifndef CONTROLS_H
#define CONTROLS_H
#include <FastCG/World/Behaviour.h>
using namespace FastCG;
class Controls : public Behaviour
{
FASTCG_DECLARE_COMPONENT(Controls, Behaviour);
protected:
void OnUpdate(float time, float deltaTime) override;
private:
uint8_t mPressedKeyMask{0};
};
#endif |
// github.com/andy489
// https://www.hackerrank.com/contests/practice-4-sda/challenges/truck-ordering/
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
typedef vector<int> vi;
#define F(i, k, n) for(int i=k;i<n;++i)
bool fmiTrucks() {
int n, truck, cnt(1);
cin >> n;
stack<int... |
#include <cassert>
#include <iostream>
using namespace std;
#include "cpp_algs.hpp"
int main() {
ds::SinglyLinkedList<int> sing = ds::SinglyLinkedList<int>();
sing.insertNode(10);
sing.insertNode(20);
sing.print();
ds::SinglyLinkedList<string> s = ds::SinglyLinkedList<string>();
s.insertNode... |
//
// Copyright Jason Rice 2017
// 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)
//
#ifndef NBDL_BINDER_HASH_HPP
#define NBDL_BINDER_HASH_HPP
#include <nbdl/bind_map.hpp>
#include <nbdl/bind_sequence.hpp>
#includ... |
#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define il inline
#define ls rt << 1
#define rs rt << 1 | 1
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define X first
#define Y second
#define pcc pair<char, char>
#define vi vector<int>
#define vl vector<ll>
#define... |
//
// MockEntityModel.h
// MyGame
//
// Created by Ariant Uka on 2015-03-03.
//
//
#ifndef __MyGame__MockEntityModel__
#define __MyGame__MockEntityModel__
#include "IEntityModel.h"
class MockEntityModel: public IEntityModel {
public:
MockEntityModel();
std::shared_ptr<Entity> findEntityById(int enti... |
#ifndef MENUSYSTEM_H
#define MENUSYSTEM_H
enum menuID{
MAIN=1,
WEAKLY,
CARD,
CONNECT
};
class MenuSystem
{
private:
public:
MenuSystem();
void mainMenu();
void weaklyMenu();
void menuCard();
void connections();
};
#endif // MENUSYSTEM_H
|
#include "audio\Singularity.Audio.h"
/*
* AdaptiveMusicManager.h
*
* Handles all adaptive music. Loads in a given file and plays music based upon the information given by the AdaptiveMusicUpdater(s).
*
* Author: Sela Davis
*
* Created: March 15, 2010 (03/15/10)
* Last modified: March 15, 2010 (03/15/10)
*/
... |
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include "header.h"
using namespace std;
int main() {
ifstream stream;
string fileName;
cout << "Please enter a file name." << endl;
cin >> fileName;
while(stream.fail()) { //if stream fails ask for appropriate name
... |
#ifndef OBJECT_H
#define OBJECT_H
#include <QOpenGLShaderProgram>
#include <vector>
#include <array>
#include "objectmodel.h"
struct Vertex
{
std::array<GLfloat , 3> vertex;
std::array<GLfloat , 3> normal;
std::array<GLfloat , 2> texCoord;
};
class Object
{
public:
Object();
... |
//
// Created by mattia on 25/06/19.
//
#ifndef GCC_INSTRUMENTATION_TEST_TEST_CLASS_H
#define GCC_INSTRUMENTATION_TEST_TEST_CLASS_H
#include <time.h>
class falco_engine{
private:
struct timespec ts;
public:
explicit falco_engine(long nsec);
void process_sinsp_event();
~falco_engine() = default;
};
#... |
#ifndef IMPLISTREC2_H
#define IMPLISTREC2_H
/// @file ImpListRec2.h
/// @brief ImpListRec2 のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2012 Yusuke Matsunaga
/// All rights reserved.
#include "ImpRec.h"
#include "ImpVal.h"
BEGIN_NAMESPACE_YM_NETWORKS
//////////////////////////////////... |
#include "GamingLayer.h"
#include "ScoreLayer.h"
#include "TimeLayer.h"
#include "PauseLayer.h"
GamingLayer::GamingLayer()
{
}
GamingLayer::~GamingLayer()
{
}
bool GamingLayer::init()
{
bool s=false;
do
{
CC_BREAK_IF(!BasicLayer::init());
SetView();
s=true;
} while (0);
return s;
}
void GamingLayer::Set... |
#ifndef GAME_HPP
#define GAME_HPP
#include <SFML/Graphics.hpp>
#include "Constants.hpp"
#include "World.hpp"
/**
* Contains all in game components needed to
* run the game.
*/
class Game
{
public:
Game();
void run();
void handleEvents();
private:
sf::RenderWindow m_window;
sf::Event m_event;
sf:... |
#include "fuzzy.h"
Fuzzy::Fuzzy()
: MD_WIN_WIDTH(100),
MD_WIN_HEIGHT(100),
MD_THRESHOLD_PERCENT(10),
MD_HISTORY_SIZE(30),
MD_OFFSET(382), //FIXME base on config limits
TAG_HISTORY_SIZE(6),
TAG_LENGTH(12),
OLD_TAG(40),
VERY_OLD_TAG(80),
VALID_TAG_REPEATS(3),
TAG_ACTIVE_FOR(10)
{
assert(TAG_HIS... |
//**************************************************************************
//**
//** 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 "frame.h"
// Initialize a superwindow
frame::frame(int nr_rows, int nr_cols, int row_0, int col_0)
{
_has_super = FALSE;
_super = NULL;
_w = newwin(nr_rows, nr_cols, row_0, col_0);
_height = nr_rows;
_width = nr_cols;
_row = row_0;
_col = col_0;
}
// Initialize a subwindow with a ... |
#pragma once
#include <SFML/Graphics.hpp>
#include "MASimQt.h"
#include "qwidget.h"
#include "QTimer"
class QMASim : public QWidget, public MASimQt
{
public :
QMASim(QWidget* Parent, const QPoint& Position, const QSize& Size, unsigned int FrameTime = 0);
virtual ~QMASim();
private :
virtual void OnInit();
vir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.