text stringlengths 8 6.88M |
|---|
#include <bits/stdc++.h>
using namespace std;
struct node
{
node* next;
int data;
};
void print_list(node** head)
{
node *temp=*head;
while(temp!=NULL)
{
cout<<temp->data<<" ";
temp=temp->next;
}
cout<<"\n";
}
void insert_element(node** new_node,int index,node** head,node** tail,int n)
{
if(index==1)
... |
/**
* @file Vec3f.h
* @author matthewpoletin
*/
#pragma once
#include <iostream>
namespace liman {
namespace maths {
struct Vec3f {
float x, y, z;
Vec3f();
Vec3f(const float &x, const float &y, const float &z);
Vec3f &add(const Vec3f &other);
Vec3f &subtract(const Vec3f &other);
Vec3f &... |
#ifndef IF_I_H
#define IF_I_H
#include "label.h"
#include "gotoi.h"
#include "varregister.h"
#include "../operators/operator.h"
#include "../visitors/codevisitor.h"
#include <string>
using namespace std;
/**
* An instruction representing a conditional jump where relop is the
* relational operator for the conditio... |
#include "Customer.h"
Customer::Customer(){
init();
}
Customer::~Customer(){
}
void Customer::init(){
customerID = 0;
enqueueTime = 0;
dequeueTime = 0;
serviceTime = 0;
}
void Customer::set(int i, int e, int d, int s){
setID(i);
setEnqueue(e);
setDequeue(d);
setService(s);
}
void Customer::print(){
cout... |
/*
다시풀기
14503. 로봇청소기
20분
시뮬레이션
*/
#include <iostream>
#define MAX 51
using namespace std;
int N, M, R, C, D, Cnt;
int MAP[MAX][MAX];
int Dr[4] = {-1, 0 ,1, 0};
int Dc[4] = {0, -1, 0, 1};
void Input()
{
cin >> N >> M >> R >> C >> D;
R++; C++;
if(D == 1) D = 3;
else if(D == 3) D = 1;
... |
/*
Sort a linked list in O(n log n) time using constant space complexity.
*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
#include <iostream>
using namespace std;
struct ListNode{
int val;
ListNode *next;... |
#pragma once
#include "base/ast.hpp"
namespace z {
struct Generator {
virtual void run() = 0;
struct Impl {
inline Impl(const z::Ast::Project& project) : _project(project), _gendir(".") {init();}
private:
void init();
protected:
const z::Ast::Proj... |
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
==============================================================... |
/*
写一个函数,求两个整数之和,要求在函数体内不得使用 + 、 - 、 * 、 / 四则运算符号。
思路:
1. 两个数异或:相当于每一位相加,而不考虑进位;
2. 两个数相与,并左移一位:相当于求得进位;
3. 将上述两步的结果相加
循环处理,直到没有进位
1 + 2
0001 0001 ^ 0010 = 0011 == 2
0010 0001 & 0010 = 0
1 + 3
0001 0001 ^ 0011 = 0010 0010 0010 ^ 0010 = 0 0000
0011 0001 & 0011 = 0001 表示有进位 << 1 = 0010 0010 & 0010 = 0010 << 1 = 0100
0000... |
// ------------------------------------------------------------------------------------------------
#include "Common.hpp"
// ------------------------------------------------------------------------------------------------
#include <cstdio>
#include <cstdlib>
// --------------------------------------------------------... |
/*
File Name: BinaryTree.h
Author: Geun-Hyung Kim
Description:
링크드리스트를 활용한 이진트리 생성
*/
// Tree Node
#ifndef _BINARY_TREE_H_
#define _BINARY_TREE_H_
#include <iostream>
#include <queue>
#include <stack>
using namespace std;
template <typename T>
class Node {
T data; // 데이터 저장을 위한 변수
Node<T>* left; //... |
//12541 - Birthdates
//#include<iostream>
#include<bits/stdc++.h>
#define SZ 200009
using namespace std;
class person{
public:
char name[16];
int dd, mm, yyyy;
person(){}
person(int dd, int mm, int yyyy){
this->dd = dd;
this->mm = mm;
this->yyyy = yyyy;
}
};
bool comparator(person p1, person p2){
if(p1.yyy... |
#include <pybind11/pybind11.h>
#include <pybind11/functional.h>
#include <pybind11/iostream.h>
#include <pybind11/chrono.h>
#include <pybind11/eigen.h>
#include <pybind11/stl.h>
#include <memory>
#include "rmf_traffic_ros2/Time.hpp"
#include "rmf_fleet_adapter/agv/Adapter.hpp"
#include "rmf_fleet_adapter/agv/test/Moc... |
// TheFourthGenerator.cpp
// ICS46 Winter 2021 Project 1
// Name: Keyu Zhang
// ID: 19898090
// UCINetID: keyuz4
// Generate a perfect maze with a recursive algorithm
#include <ics46/factory/DynamicFactory.hpp>
#include <random>
#include <utility>
#include <vector>
#include "Direction.hpp"
#include "Maze.hpp"
#incl... |
#include <josm_elemstyles.h>
#include <josm_elemstyles_p.h>
#include <appdata.h>
#include <gps_state.h>
#include <icon.h>
#include <iconbar.h>
#include <josm_presets.h>
#include <map.h>
#include <project.h>
#include <style.h>
#include <uicontrol.h>
#include <osm2go_annotations.h>
#include <osm2go_cpp.h>
#include <osm... |
#include<bits/stdc++.h>
#define REP(i,n) for (int i = 1; i <= n; i++)
#define mod 998244353
#define pb push_back
#define ff first
#define ss second
#define ii pair<int,int>
#define vi vector<lli>
#define vii vector<ii>
#define lli long long int
#define INF 1000000000
#define endl '\n'
const double PI = 3.14159265358979... |
#include <iostream>
#include "Identifiable.h"
int Identifiable::exemplar = 100500;
Identifiable::Identifiable() {
this->id = Identifiable::exemplar;
Identifiable::exemplar += 1;
}
Identifiable::~Identifiable() {
Identifiable::exemplar -= 1;
}
int Identifiable::getExemplar() {
return e... |
/*////////////////////////////////////////////////////
ParticleArrayクラス 実装部
Particle構造体を粒子の個数分確保し,粒子全体の
オペレーションを行うクラス.このクラスを介して
Particle構造体に含まれている情報にアクセスする.
////////////////////////////////////////////////////*/
#include "particle.h"
ParticleArray::ParticleArray():PI(3.14159265358979323846264338328),EPS(1.... |
#include <iostream>
#include <set>
#include <gtest/gtest.h>
#include "hs_math/random/normal_random_var.hpp"
#include "hs_math/random/uniform_random_var.hpp"
#include "hs_sfm/synthetic/flight_generator.hpp"
#include "hs_sfm/synthetic/multiple_camera_keyset_generator.hpp"
#include "hs_sfm/essential/ematrix... |
#include "physics/world.h"
#include <stdio.h>
namespace physics {
World::World() {
// Generate entities
int columns = 10;
int entities_per_column = MAX_ENTITIES / columns;
for (int i = 0; i < columns; i++) {
for (int j = 0; j < entities_per_column; j++) {
... |
#include "PCSSApplication.h"
#include "Controls.h"
#include <FastCG/World/FlyController.h>
#include <FastCG/Rendering/StandardGeometries.h>
#include <FastCG/Rendering/Renderable.h>
#include <FastCG/Rendering/ModelLoader.h>
#include <FastCG/Rendering/MaterialDefinitionRegistry.h>
#include <FastCG/Rendering/DirectionalL... |
#include<iostream>
#include"Person.h"
#include"Visitor.h"
#include"Menu.h"
#include"Cook.h"
#include"Worker.h"
#include"Seller.h"
#include"Coffee.h"
#include"Tea.h"
#include"Donut.h"
#include"Dish.h"
int main()
{
std::vector<Dish*> dishes;
Menu menu(dishes);
menu.PrintMenu();
/*menu.DishIndex(dishes... |
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
int trap(vector<int>& height)
{
int L = 0;
int R = height.size() - 1;
int level = 0;
int water = 0;
while (L<R)
{
int lower = height[height[L]<height[R]?L++:R--];
level = max(lower,level);
wate... |
#include "Digit.h"
#include "Textures.h"
Digit::Digit(int digit,int position, GLfloat* score)
:digit(digit),position(position),score(score)
{
}
Digit::~Digit(void)
{
}
void Digit::DrawObject()
{
int digitPlus = digit+1;
glBindTexture(GL_TEXTURE_2D, Textures::GetInstance()->GetTextures()[9]);
glBegin(GL_QUADS);
... |
// program to demostrate dynamic array.
#include<iostream>
#include<stdlib.h>
using namespace std;
int main()
{
int ptr;
cout<<"please enter size of new array\n";
int n;
cin>>n;
ptr=new int[n];
int ar[]={1,20,34,55,65};
for(int i=0;i<n;i++)
{
ptr[i]=&ar[i];
}
cout<<"elements are\n";
for(int i=0; i<n;i++)
... |
#include <map>
#include <list>
#include <vector>
#include <iostream>
using namespace std;
int main() {
vector<int> x;
for (int i = 0; i < 10; ++i) {
x.push_back(i); // add element;
}
// x.pop_back(); // pop 元素
// x.insert(pos, e) // 在某个位置插入
// vector类似一个栈
/*
* vector<Elem> c; ... |
/*
* SPDX-FileCopyrightText: (C) 2017-2022 Daniel Nicoletti <dantti12@gmail.com>
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef CUTELYSTCUTELEE_H
#define CUTELYSTCUTELEE_H
#ifndef DOXYGEN_SHOULD_SKIP_THIS
# include <cutelee/taglibraryinterface.h>
# if defined(cutelyst_cutelee_urifor_EXPORTS)
# de... |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
using ll = long long int;
typedef pair <int,int> PII;
typedef pair <ll,ll> PLL;
#define F first
#define S... |
#include "linked_list.hpp"
int main(){
linkedList<int> lista;
lista.insertNode(5);
} |
#include <aulibdefs.h>
#include <aubase.h>
#include <auplc.h>
#include <autag.h>
#include "aupanelreg.h"
#include "ui_aupanelreg.h"
#include "trendchar/trendchart.h"
#include <QSettings>
#include <QRect>
#include <QDesktopWidget>
#include <QScreen>
#include <QFile>
#include <QDebug>
#include <QTimer>
#include <QClo... |
// This file has been generated by Py++.
#include "boost/python.hpp"
#include "generators/include/python_CEGUI.h"
#include "SingletonWindowRendererManager.pypp.hpp"
namespace bp = boost::python;
void register_SingletonWindowRendererManager_class(){
{ //::CEGUI::Singleton< CEGUI::WindowRendererManager >
... |
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
struct Node
{
Node *top, *left, *right;
int value;
};
void Print(Node * node)
{
if (node)
{
Print(node->right);
printf("%d\n", node->value);
Print(node->left);
}
}
void Insert(N... |
#ifndef KEYWORD_SUGGESTION_SERVER_INCLUDE_ONLINE_EVENT_LOOP_H_
#define KEYWORD_SUGGESTION_SERVER_INCLUDE_ONLINE_EVENT_LOOP_H_
#include <assert.h>
#include <stdio.h>
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <functional>
#include <map>
#include <memory>
#include <vector>
#include "acceptor.h"
#include ... |
#ifndef __DUI_DECORATE_H__
#define __DUI_DECORATE_H__
#include "DUIControlBase.h"
DUI_BGN_NAMESPCE
class DUILIB_API CDUIPaddingPanel: public CDUIControlBase
{
public:
typedef CDUIControlBase theBase;
virtual CRefPtr<IDUIControl> Clone();
};
class DUILIB_API CFrameUIData
{
public:
CRefPtr<CImageList> m_pImageLeft... |
#pragma once
#include "../TaskLayer/MetaMorpheusTask.h"
#include <string>
#include <vector>
#include "tangible_filesystem.h"
//C# TO C++ CONVERTER NOTE: Forward class declarations:
namespace TaskLayer { class DbForTask; }
namespace TaskLayer { class FileSpecificParameters; }
namespace TaskLayer { class MyT... |
#include<cstdio>
#include<iostream>
using namespace std;
const int maxn = 100010;
int city[maxn];
int flag[maxn];
int find_father(int n)
{
if(n == city[n])
return n;
return find_father(city[n]);
}
bool merge_nm(int n, int m)
{
int x = find_father(n);
int y = find_father(m);
if(x == y)
... |
/*
DS3231 library for the Arduino.
This library implements the following features:
- read/write of current time, both of the alarms,
control/status registers, aging register
- read of the temperature register, and of any address from the chip.
Author: Petre Rodan <petre.rodan@simplex.ro>
Av... |
#include "HelloWorld2.h"
void HelloWorld2::gets(double& in) const
{
in = s;
}
|
#include "graphics\Singularity.Graphics.h"
namespace Singularity
{
namespace Graphics
{
class VertexPositionColor
{
private:
#pragma region Static Methods
static VertexDeclaration* GetVertexDeclaration();
#pragma endregion
public:
#pragma region Static Variables
static V... |
#include <stdio.h>
#define TAM 5 //topofinal(qunatidade)
//int pilha[TAM];
int pilha[TAM];
int topo = 0;
void push(int valor);
int pop();
int main(){
printf("\n==============================\n");
push(666);
printf("\n==============================\n");
push(333);
printf("\n==============================\n");
... |
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2010 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
... |
#pragma once
#include <iostream>
#include "Base.h"
class Derived2 : public Base
{
public:
void ShowDerived2()
{
std::cout << "Derived2" << std::endl;
}
}; |
#include <Arduino.h>
#include <Morse.h>
/**
* @name writing a library
* @desc How to write and use an own library.
*
* @package Arduino Basics
* @author Michael <michael@zenbox.de>
* @since 2017/01/05
* @version v1.0.0
* @copyright (c) 2017 Michael Reichart
* @license MIT License <http://opensource.org/licens... |
#pragma once
#include <memory>
#include <string>
#include <vector>
#include "physicalentity.h"
#include "item.h"
#include "util.h"
using std::initializer_list;
using std::string;
using std::vector;
using std::unique_ptr;
namespace lab3 {
class Actor : public PhysicalEntity {
protected:
typedef vector<un... |
#include "edit_scientist.h"
#include "ui_edit_scientist.h"
#include "scientistservice.h"
#include "scientist.h"
Edit_scientist::Edit_scientist(QWidget *parent) :
QDialog(parent),
ui(new Ui::Edit_scientist)
{
ui->setupUi(this);
}
Edit_scientist::~Edit_scientist()
{
delete ui;
}
void Edit_scientist::on... |
#pragma once
#include "Command.h"
class LookCommand :
public Command
{
public:
LookCommand();
~LookCommand();
void Run(list<string>* parameters, Game * game);
};
|
#ifndef DRAWERS_REPLAY_GUIDRAWER_HEADER
#define DRAWERS_REPLAY_GUIDRAWER_HEADER
#include "GUIDrawer.h"
#include "GUI/ReplayControls.h"
namespace solar
{
class ReplayerViewer;
namespace drawers
{
class SceneDrawer;
//Renders UserInface for replayed simulation
class ReplayGUIDrawer
{
public:
ReplayGUI... |
/**
* Copyright 2016-2017 MICRORISC s.r.o.
*
* 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... |
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;
struct Node {
int a, b, c;
Node(){};
};
const int maxn = 55, maxv = 100005;
int t, n;
ll dp[maxn][maxv] = { 0 }, ans = 0;
Node node[maxn];
bool cmp(Node& i, Node& j) { return i.c * j.b < j.c * i.b; }
// #de... |
#include <iostream>
#include "Spiller.h"
vector<Spiller> spillere;
void leggTilSpillere() {
spillere.push_back(Spiller(0, "Peder", Konto(0, Konto::bitcoin)));
spillere.push_back(Spiller(1, "Kristoffer-Andre", Konto(1, Konto::bitcoin)));
spillere.push_back(Spiller(2, "Arne", Konto(2, Konto::bitcoin)));
}
... |
// compile (for debugging): g++ -Wall -Wextra -fsanitize=undefined,address -D_GLIBCXX_DEBUG -g <file>
// compile (as on judge): g++ -x c++ -Wall -O2 -static -pipe <file>
// Output file will be a.out in both cases
#include <bits/stdc++.h>
#include <vector>
#include <string>
#include<map>
#include <algorithm>
using names... |
// Copyright (C) 2017 Elviss Strazdins
// This file is part of the Ouzel engine.
#pragma once
#include <cstdint>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <memory>
#include <mutex>
#include <atomic>
#include <condition_variable>
#include "utils/Noncopyable.h"
#include "math/Rectangl... |
#include "zenlang.hpp"
# include "utils/fcgi/fastcgi.hpp"
//void FastCGI::OnRequestReceived(const FastCGI::Request& r) {
//}
|
#include "treepaint.h"
#include "ui_treepaint.h"
TreePaint::TreePaint(QWidget *parent) :
QWidget(parent),
ui(new Ui::TreePaint)
{
ui->setupUi(this);
}
TreePaint::~TreePaint()
{
delete ui;
}
void TreePaint::getNode(MyBinTree<char> *p){
this->tree=p;
}
struct TreePoint
{
TreePoint(QPoint po,int... |
#include "functions.h"
char share(string str, string &str1, string &str2){
int now = 1;
int ind_now = 0;
int flag = 0;
for(unsigned int i = 0; i < str.length(); i++) {
if (str[i] == '(')
flag = 1;
if (str[i] == ')')
flag = 0;
if (flag == 0) {
... |
#include <sys/types.h>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <fstream>
#include <memory>
#include <sstream>
#include <pqxx/pqxx>
#include <pqxx/except>
#include "sftp-callback.h"
#include "sftp-plugin.h"
static std::unique_ptr<pqxx::connection> dbConn_;
static std::string connStr_ = "postgr... |
#include <gtest/gtest.h>
#include <vector>
#include <deus/Constants.hpp>
#include <deus/unicode_view_impl/UTF8Impl.hpp>
//------------------------------------------------------------------------------
// FIXTURE
//-------------------------------------------------------------------... |
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
#define Nnum 31
#define Mnum 31
#define LL long long
struct matrix
{
int mat[31][31];
};
int n,m;
//ONE为单位阵
matrix ONE;
matrix mul(matrix A,matrix B)//矩阵相乘
{
int i,j,k;
matrix C;
for(i=1;i<=n;i++)
{
... |
#include <iostream>
using namespace std;
int main()
{
int a, nim, pilihan;
double angka1, angka2, angka3, hasil;
string nama;
cout <<"-------------------------------------------------------------------\n";
cout << "\tNama : "; getline(cin, nama);
cout << "\tNIM : "; cin >> a;
cout <<"---... |
// Problem: Nastya and Rice
// Link: https://codeforces.com/contest/1341/problem/A
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t>0){
int n,a,b,c,d;
bool flag=false;
cin >> n >> a >> b >> c >> d;
if((a-b)*n<=c+d){
... |
#include "createpagedialog.h"
#include "ui_createpagedialog.h"
#include <QFileDialog>
int CreatePageDialog::m_create_page_counter = 0;
CreatePageDialog::CreatePageDialog(QStringList modules,
QWidget *parent) :
QDialog(parent),
ui(new Ui::CreatePageDialog)
{
ui->setupUi(... |
//priority_queue.empty()判断优先队列是否为空
#include<stdio.h>
#include<queue>
using namespace std;
int main()
{
priority_queue<int> q;
if(q.empty()==true){
printf("Empty!\n");
}
else{
printf("No empty!\n");
}
q.push(100);
if(q.empty()==true){
printf("Empty!\n");
}
else{
printf("No empty!\n");
}
return 0;
}
|
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Data.Xml.Xsl.1.h"
WINRT_EXPORT namespace winrt {
namespace Windows::Data::Xml::Xsl {
struct IXsltProcessor :
Windows::Foundation::IInspectable,
impl::consume<IXsltP... |
//
// 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_FWD_SQL_DB_CONCEPT_TABLE_ENTITY_HPP
#define NBDL_FWD_SQL_DB_CONCEPT_TABLE_ENTITY_HPP
namespace nbdl::sql_db
{
tem... |
#include <bits/stdc++.h>
using namespace std;
struct node
{
int data;
struct node *l;
struct node *r;
node(int val)
{
data = val;
l = NULL;
r = NULL;
}
};
struct node *inorderSucc(struct node *root)
{
node *curr = root;
while (curr && curr->l != NULL)
{... |
/*
* StandardPressActionComponent.cpp
*
* Created on: Jan 30, 2014
* Author: Dawid Drozd
*/
#include "app/components/click/StandardPressActionComponent.h"
#include "app/components/Notifications.h"
namespace KoalaJump
{
StandardPressActionComponent::StandardPressActionComponent()
{
}
StandardPressActionC... |
#ifndef FASTCG_GRAPHICS_SYSTEM_H
#define FASTCG_GRAPHICS_SYSTEM_H
#if defined FASTCG_OPENGL
#include <FastCG/Graphics/OpenGL/OpenGLGraphicsSystem.h>
namespace FastCG
{
using GraphicsSystem = OpenGLGraphicsSystem;
}
#elif defined FASTCG_VULKAN
#include <FastCG/Graphics/Vulkan/VulkanGraphicsSystem.h>
namespace FastC... |
//
// RoomScene.cpp
// demo_ddz
//
// Created by 谢小凡 on 2018/2/15.
//
#include "RoomScene.hpp"
#include "FirstScene.hpp"
#include "RoomData.hpp"
#include "PlayerData.hpp"
#include "GameManager.hpp"
#include "UITable.hpp"
#include "UISeat.hpp"
#include "UITopInfoBar.hpp"
#include "CommonDefineSet.hpp"
#include "Comm... |
#ifndef SRC_PT_GT_H
#define SRC_PT_GT_H
/// @file src/pt/Gt.h
/// @brief Gt のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2011 Yusuke Matsunaga
/// All rights reserved.
#include "Constr.h"
BEGIN_NAMESPACE_YM_BB
//////////////////////////////////////////////////////////////////////
/// ... |
#include "parser.h"
#include "pugixml/src/pugixml.hpp"
#include "json11/json11.hpp"
#include <QtGlobal>
#include <QtDebug>
#include <vector>
#include <map>
#include <string>
#include <cassert>
#include <iterator>
#include <algorithm>
#include <QFile>
#include <QTextStream>
#include <QString>
using nam... |
// p215
// memoization exercise
#include <iostream>
#include <vector>
using namespace std;
// board 귀찮으니까 내용 안채울래^^;
int n, board[100][100];
int cache[2500][2500];
// memoization적용
int recursive2(int x, int y){
if (x>=n || y>=n) return 0;
if (x==n-1 && y==n-1) return 1;
int& res = cache[x][y];
if(res!=-1) r... |
/***********************************************************************
created: 22/2/2004
author: Paul D Turner
purpose: Defines interface for WindowFactoryManager class
*************************************************************************/
/******************************************************************... |
//rvargas
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
int main(), goback(), Mgame();
int randnum,inp;
char inpd[10];
int goback()
{
char again;
printf("\n\nPlay Again? (Y/N): "); scanf("%s",&again);
if (again=='Y'||again=='y')
{
system("clear");
return ... |
#if !defined(_FIELD_HPP)
#define _FIELD_HPP
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#define strdup _strdup
#endif
class Field
{
public:
Field()
{
mValue = NULL;
}
~Field()
{
if(mValue)
{
::free(mValue);
}
}
void SetValue(char* va... |
/*
Name: Mohit Kishorbhai Sheladiya
Student ID: 117979203
Student Email: mksheladiya@myseneca.ca
Date: 21/02/14
*/
#ifndef SDDS_LABELMAKER_H
#define SDDS_LABELMAKER_H
#include <iostream>
#include "Label.h"
namespace sdds {
class LabelMaker {
int m_noOfLabels;
Label* m_multiLab... |
#ifndef FOG_H_INCLUDED
#define FOG_H_INCLUDED
class fog{
public:
fog();
~fog();
void Render();
private:
bool gp; // G Pressed? ( New )
GLuint filter; // Which Filter To Use
GLuint fogMode[]; // Storage For Three Types Of Fog
GLuint fogfilter; // Which Fog To Use
GLfloat f... |
/*
* 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/System>
#include <flux/Date>
#include <flux/stream/TransferMeter>
#include "utils.h"
#include "NodeConfig.h"
#include "ClientConnection.h"
#include "C... |
#include <iostream>
#include <queue>
#include<vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
priority_queue<int, vector<int>, greater<int>>a;
int n;
int k;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> k;
switch (k)
{
case 0:
... |
#include "pb_background_static.h"
namespace Popbal {
BackgroundStatic::BackgroundStatic(void):
Background(),
mT(0.0),
mP(0.0),
mVC()
{}
BackgroundStatic::~BackgroundStatic(void)
{
}
BackgroundStatic::BackgroundStatic(
double T,
double P,
Transport::ViscosityCorrelation VC):
Backgroun... |
#include "Textbox.h"
#include "RegUtil.h"
const ItemTypeEnum Textbox::ItemType = eItemTextbox;
const int Textbox::TypeNameID = 119;
const int Textbox::ToolID = 120;
const int Textbox::CursorID = 144;
const unsigned Textbox::AllowedViews = 2;
Textbox* Textbox::COMCreate()
{
/*CComObject<Textbox>* obj = 0;
if ((((HRE... |
#pragma once
#include "base/Detector_t.h"
#include "unpacker/UnpackerAcqu.h"
#include <cassert>
namespace ant {
namespace expconfig {
namespace detector {
struct EPT :
TaggerDetector_t,
UnpackerAcquConfig // EPT knows how to be filled from Acqu data
{
virtual double GetPhotonEnergy(unsigned chan... |
#include<iostream>
#include<stack>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
stack<char>a, b;
int t;
char str[450], str2[450];
cin>>t;
while(t--)
{
cin>>str;
int len = strlen(str);
for(int i = 0; i < len; i++)
{
if(str[i] == '+'|| str[i] == '-'... |
#pragma once
#include "LoopAttribute.h"
#include "util.h"
#include "debug.h"
#include "rose.h"
#include <string>
#include <sstream>
#include <vector>
using namespace std;
namespace StencilTranslator {
struct IRNode {
virtual string unparse(bool isLVal = false) const = 0;
virtual ~IRNode() { };
};
struct Exp :... |
#include "worker.h"
Worker::Worker(QString fio, size_t uniqueNumber, QString login, QString password, QString department)
: Employee(fio, Positions::worker, uniqueNumber, login, password, department)
{
}
Worker::~Worker()
{
}
QString Worker::getTaskName()
{
if (tasks.size() > 0)
return tasks.front(... |
#ifndef IMAGEDIFFUSER_HPP
#define IMAGEDIFFUSER_HPP
#define _USE_MATH_DEFINES
#include <math.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include <iostream>
#include <iomanip>
#include "geometry/PrintFormat.hpp"
#include "geometry/Vector3D.hpp"
#include "optics/IDiffuser.hpp"
#include "optics/Ray.hpp"
... |
#ifndef GRADE_SCHOOL_H
#define GRADE_SCHOOL_H
#include <algorithm>
#include <string>
#include <vector>
#include <map>
using std::string;
using std::vector;
using std::map;
namespace grade_school {
class school {
map<int, vector<string>> database;
public:
const map<int, vector<string>> roster() const;
void add(... |
#pragma once
#include <memory>
#include "drake/common/drake_copyable.h"
#include "drake/common/drake_deprecated.h"
#include "drake/multibody/multibody_tree/multibody_plant/multibody_plant.h"
#include "drake/systems/framework/leaf_system.h"
// Forward declaration keeps us from including RBT headers that significantly... |
#ifndef EMPLOYEE_REPOSITORY_H
#define EMPLOYEE_REPOSITORY_H
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
class Employee_Repository
{
public:
Employee_Repository();
void read_employee_list();
private:
};
#endif // EMPLOYEE_REPOSITORY_H
|
#ifndef CONSTANTGENERATOR_HPP
#define CONSTANTGENERATOR_HPP
#include "generator.hpp"
#include <cstddef>
class Map;
class ConstantGenerator : public Generator
{
public:
explicit ConstantGenerator();
virtual void generate(Map *output);
virtual bool configure();
private:
size_t width_;
size_t height_;
double va... |
// Bluant_Clinic.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <string>
#include <fstream>
using namespace std;
struct pacijent {
int mbo;
string ime, prezime;
vector<string>popis_lijekova;
};
//FUNKCIJE
void meni();
void menu_ch... |
#ifndef CONNECTWINDOW_H_
#define CONNECTWINDOW_H_
#include <QMainWindow>
#include <stdio.h>
#include "Client.h"
namespace Ui {
class ConnectWindow;
}
class ConnectWindow : public QMainWindow
{
Q_OBJECT
public:
explicit ConnectWindow(QWidget *parent = 0);
~ConnectWindow();
private slots:
void on_co... |
#include<stdio.h>
#include<malloc.h>
#include<stdlib.h>
struct node{
int data;
struct node *next;
};
int push(struct node **,int);
bool isCycle(struct node **);
int main(void){
struct node *head=NULL;
push(&head,23);
push(&head,43);
push(&head,2);
push(&head,6);
push(&head,12);
push(&head,5);
head->next->next->next->... |
#include "Com.h"
namespace Concurrency::Native {
int CPU_Cores() {return std::thread::hardware_concurrency();}
void Sleep(int ms) {
#if defined(flagWIN32)
::Sleep(ms);
#elif defined(flagPOSIX)
usleep(ms * 1000);
#endif
}
struct StdThread {
std::thread* t = NULL;
typedef void(*Fn)(void*);
StdThread();
~StdTh... |
// This file has been generated by Py++.
#ifndef MouseEventArgs_hpp__pyplusplus_wrapper
#define MouseEventArgs_hpp__pyplusplus_wrapper
void register_MouseEventArgs_class();
#endif//MouseEventArgs_hpp__pyplusplus_wrapper
|
#include<cstdio>
int gcd(int a,int b)//求最大公约数的辗转相除法的递归写法
{
if(!b)
return a;
else
return gcd(b,a%b);
}
int main()
{
int m,n;
while(scanf("%d%d",&m,&n)!=EOF){
printf("%d\n",gcd(m,n));
}
return 0;
}
|
#ifndef __SYS_TIME_METHODS_H__
#define __SYS_TIME_METHODS_H__
#include <string>
#include <vector>
namespace utils
{
namespace sys
{
namespace time
{
/// \brief Get current system time with format used by strftime.
/// Default format is %Y.%m.%d %X
std::string get_time( const std::string& format = "%Y.%m.%d %X" );
... |
#include "MainComponent.h"
MainComponent::MainComponent()
: Thread ("Background Thread")
{
krushConfigOptions.applicationName = ProjectInfo::projectName;
krushConfigOptions.folderName = ProjectInfo::projectName;
krushConfigOptions.filenameSuffix = ".settings";
krushConfigOptions.commonToAllUsers = ... |
#include <iostream>
#include <algorithm>
using namespace std;
void dp(int A[], int C[][4], int X[][4], int N, int M){
for(int j=2; j<=M; j++){
for(int i=j; i<=N; i++){
int temp[i+1]; //min value of every k
for(int t=0; t<=i; t++){
temp[t] = 0;
}... |
#include "Stata.h"
#include "SQLite.h"
#include <boost/make_shared.hpp>
Context::Context(char *cursor, int length) : start(0), strls(false)
{
this->origin = cursor;
this->cursor = cursor;
this->length = length;
this->currentState = new OpenDTA();
this->buffer = new char[INITIAL_BUFFER];
this->buffer_size =... |
#include "Mensagem.h"
#include <string>
#include <iostream>
using namespace std;
int main(void) {
Mensagem mensagem("Escritório de projetos");
mensagem.exibirMensagem();
string mensagemRecebidaPeloUsuario;
cout << "Informe uma nova mensagem: ";
getline(cin, mensagemRec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.