text stringlengths 8 6.88M |
|---|
#include<bits/stdc++.h>
using namespace std;
const int M = 10050;
int color[M], line[M][M];
//0为白,1为黑
bool bfs(int s, int n){
int i, beg;
queue <int> q;
q.push(s);
color[s] = 1;
while(!q.empty()){
beg = q.front();
q.pop();
for(i = 1; i <= n; i++){
... |
////////////////////////////////////////////////////////////////////////////////
//
// 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
... |
// Copyright (C) 2019 Greg Dionne
// Distributed under MIT License
#include "crtable.hpp"
std::string Reference::to_string(void)
{
return expression.to_string();
}
bool CRTable::addlabel(const char *modulename, const char *labelname, int location, char *filename, int linenum)
{
Label lbl(modulename, labelname, fi... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "PaladinCharacter.h"
ECharacterType APaladinCharacter::GetCharacterType()
{
return ECharacterType::Paladin;
}
|
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
typedef map<string, int> msi;
typed... |
/*
* 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 ... |
//
// WAVEchunk.cpp
// gtap
//
// Created by Mark Williamsen on 10/25/13.
// Copyright (c) 2013 Williamsonic. All rights reserved.
//
#include "WAVEchunk.h"
chunkWAVEchunk::chunkWAVEchunk(void) {memset(this, 0, sizeof(chunkWAVEchunk));}
riffWAVEchunk::riffWAVEchunk(void) {memset(this, 0, sizeof(riffWAVEchunk)... |
//Caret.h
#ifndef _CARET_H
#define _CARET_H
typedef signed long int Long;
class MemoForm;
class Caret {
public:
Caret(MemoForm *memoForm);
~Caret();
Caret(const Caret& source);
Caret& operator=(const Caret& source);
void UpdateCaret();
bool ChangeCaret();
bool ChangeImeCaret();
Long GetWidth() const;
Long G... |
#include<stdio.h>
int main() {
int a;
scanf("%d",&a) ;
if(a>100||a<0)
printf("error!");
else if(a<60)
printf("fail");
else
printf("pass");
return 0;
}
|
#include <string_view>
#include <iomanip>
#include <filesystem>
#include <string>
#include <vector>
#include <iostream>
#include <utility>
#include <misc/flags.hpp>
#include <misc/util/util.hpp>
#include <misc/repl.hpp>
#include <misc/argp.hpp>
#include <backend/eval/eval.hpp>
#include <frontend/parser/parser.hpp>
i... |
/*************************************************************************
> File Name : RootCaScope.cpp
> Author : YangShuai
> Created Time: 2016年07月29日 星期五 14时31分26秒
> Description :
************************************************************************/
#include"Itsdata.h"
#include"data_handle.h... |
#include "GfxConfiguration.hpp"
#include "config.h"
#include "AnimationManager.hpp"
#include "AssetLoader.hpp"
#include "DebugManager.hpp"
#include "InputManager.hpp"
#include "MemoryManager.hpp"
#include "Bullet/BulletPhysicsManager.hpp"
#include "SceneManager.hpp"
#include "BilliardGameLogic.hpp"
#if defined(OS_WEB... |
#include <stdio.h>
#include <sys/mman.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <monkit.h>
#include <semaphore.h>
#include <time.h>
#include "dmaManager.h"
#include "FlashIndication.h"
#include "FlashRequest.h"
#define BLOCKS_PER_CHIP 32
#define CHIPS_PER_BUS 8 // ... |
// Problem: Binary Period
// Link: https://codeforces.com/contest/1342/problem/B
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t>0){
string seq;
cin >> seq;
set<int> nums;
for(int i=0; i<seq.size(); ++i){
if(... |
/*
Validate BST: Implement a function to check if a binary tree is a binary search tree.
*/
#include <iostream>
#include <vector>
#include <array>
#include <queue>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <utility>
#include <climits>
#define TREE_SIZE 10000
class Node
{
public:
Node(){};... |
#include "algorithm/base_component/include/frame.h"
namespace OpticalFlow_SLAM_algorithm_opticalflow_slam {
int64_t Frame::static_new_id = -1;
/**
* @brief
* @author snowden
* @date 2021-07-16
* @version 1.0
*/
Frame::Frame(const int64_t timestamp, const cv::Mat left_image, const cv::Mat right_image) :
... |
/***************************************************************************
Copyright (c) 2020 Philip Fortier
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or... |
#include "commands/baseRoulante/ChangerVitesse.h"
#include "Robot.h"
ChangerVitesse::ChangerVitesse()
{
Requires(&Robot::m_baseRoulante);
}
void ChangerVitesse::Initialize()
{
Robot::m_baseRoulante.ChangerVitesse();
}
|
#include <iomanip>
#include "Product.h"
#include "TaxableProduct.h"
namespace w7 {
void TaxableProduct::display(std::ostream& os) const {
Product::display(os);
if (productTax == HST) {
os << " HST";
}
else if (productTax == PST) {
os << " PST";
}
}
} |
///////////////////////////////////////////////////////////////////////////////
/// @file lib/cgibase/unit_test.cpp
/// @~english
/// @brief unit test
/// @~
/// @authors Harry Oh (harry.oh@udptechnology.com)
/// @copyright UDP Technology
//////////////////////////////////////////////////////////////////... |
#include "Person.h"
#include <iterator>
unsigned int Person::myNoOfPeople ;
Person::Person()
{
}
Person::Person(std::string name, unsigned int no)
{
myNoOfPeople++;
myName = name;
myNo = no;
}
Person::~Person()
{
}
void Person::addValidBill(Own_bill_format)
{
}
void Person::printBills()
{
for (int i = 0... |
#include <iostream>
using namespace std;
int main()
{ string ism;
int a,b,c;
c=a+b;
string familiya;
string manzil;
int yosh;
string tel;
/*cout<< "Assalomu aleykum "<<" pdp acadey kompaniyasiga hush kelibsiz"<<endl;
cout<<"ismingizni kiriting; ";
cin>>ism;
cout<<"familiya: ";
... |
#pragma once
#include <iostream>
using std::cout;
using std::endl;
class Contained1
{
public:
Contained1()
{
cout << "Contained1 constructor." << endl;
}
};
|
#include <iostream>
using namespace std;
int main()
{
double h;
double w;
cout << "Input your height in metres: " << endl;
cin >> h;
cout << "Input your weight in kg: " << endl;
cin >> w;
double bmi;
bmi = w/(h*h);
cout << "Your BMI is " << bmi << endl;
}
|
#include "core\Singularity.Core.h"
namespace Singularity
{
namespace Components
{
class Behavior : public Singularity::Components::Component
{
DECLARE_OBJECT_TYPE
protected:
#pragma region Methods
void OnComponentAdded(GameObject* gameObject);
void OnComponentRemoved(GameObject*... |
//
// main.cpp
// agecalc
//
// Created by Ben Rockhold on 2/5/15.
// Copyright (c) 2015 Ben Rockhold. All rights reserved.
//
/*
Take month and year of birth, and month and year of the present, and return the age.
Do this until receiving an invalid value (0) for month.
*/
#include <iostream>
using namespace std;... |
#include "cpptools_FileWatcher.hpp"
#include "cpptools_Async.hpp"
#include "cpptools_Logger.hpp"
namespace imog {
// ====================================================================== //
// ====================================================================== //
// w/ default ctor the filewatcher is NOT launced ... |
#pragma once
#include <BWAPI.h>
//#include <BW/Offsets.h>
namespace BlackCrow {
class BlackCrow;
// Draws debug information
class Debug {
public:
Debug(BlackCrow &parent);
void onStart();
void drawOnFrame();
bool command(std::string text);
double elapsedMs;
std::list<double> frameTimeHistory;
dou... |
/*****
描述
菲波那契数列是指这样的数列: 数列的第一个和第二个数都为1,接下来每个数都等于前面2个数之和。
给出一个正整数a,要求菲波那契数列中第a个数是多少。
关于输入
第1行是测试数据的组数n,后面跟着n行输入。每组测试数据占1行,包括一个正整数a(1 <= a <= 20)
关于输出
n行,每行输出对应一个输入。输出应是一个正整数,为菲波那契数列中第a个数的大小
例子输入
4
5
2
19
1
例子输出
5
1
4181
1
提示
可用数组实现
*****/
#include <iostream>
usin... |
#include<bits/stdc++.h>
using namespace std;
int n,m;
int a[1010][1010];
bool vis[1010][1010];
int dx[4] = {0,-1,0,1};
int dy[4] = {1,0,-1,0};
void dfs(int val,int y,int x){
if(vis[y][x]) return;
if(x<=0||x>m||y<=0||y>n) return;
vis[y][x] = 1;
for(int i=0;i<4;i++){
int xx = dx[i]+x;
int yy = dy[i]+... |
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
int a[1005];
int main()
{
int n;
while(~scanf("%d",&n))
{
for(int i = 0; i < n; i++)
cin >> a[i];
int m=1,sum=0;
int max=0;
for(int i=1; i<n; i++)
{
if(a[i]-a[i-1]... |
/*
*
* Copyright (c) Karl Meerbergen & Kresimir Fresl 2003
*
* 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)
*
* KF acknowledges the support of the Faculty of Civil Engineering,
* University of Zagreb, Croa... |
#if !defined(PHONE_NUMBER_H)
#define PHONE_NUMBER_H
#include <string>
#include <iostream>
#include <stdexcept>
namespace phone_number {
class phone_number {
std::string digits = "";
std::string _area_digits = "";
std::string _number_digits = "";
void _area_code();
void _number();
public:
phone_number(std:... |
#include <stdinclude.hpp>
namespace
{
const char* SteamAPI_GetSteamInstallPath()
{
static std::string install_path {};
if (!install_path.empty())
{
return install_path.data();
}
HKEY reg_key;
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\WOW6432Node\\Valve\\Steam", 0, KEY_QUERY_VALUE,... |
// This file contains the common code every implementation uses for stage2
// It is intended to be included multiple times and compiled multiple times
// We assume the file in which it is include already includes
// "simdjson/stage2.h" (this simplifies amalgation)
#include "generic/stage2/tape_writer.h"
#include "gene... |
//
// NaturesAttendants.h
// Boids
//
// Created by chenyanjie on 3/31/15.
//
//
#ifndef __Boids__NaturesAttendants__
#define __Boids__NaturesAttendants__
#include "SkillNode.h"
class NaturesAttendants : public SkillNode {
private:
float _heal;
float _range;
float _duration;
float _interval;
f... |
#include "socket.h"
namespace moxu
{
bool Socket::Close()
{
#if defined(MOXU_WIN32)
int ret = ::closesocket(_handle);
#elif defined(MOXU_LINUX)_UNIX
int ret = ::close(_handle);
#endif
_handle = INVALID_SOCKET;
return ret != SOCKET_ERROR;
}
bool Socket::SetNoblock(int flag)
{
#if defined(MOXU_... |
/* Copyright 2017 Istio Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... |
#include "Common.h"
#include <map>
#include <sstream>
#include <unordered_map>
auto getIngredients(const std::string &str) {
auto loc = str.find("contains");
auto ingredientStr = str.substr(0, loc - 2);
return getWords(ingredientStr);
}
auto getAllergins(const std::string &str) {
auto loc = str.find("contain... |
#include "../Include/Window.h"
#include "../Include/UI.h"
//透视参数
GLfloat xwMin = 0, ywMin = 0, xwMax = 1280, ywMax = 720;
GLfloat dnear = 25, dfar = 125;
Window::Window(int width, int height, char* title)
{
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(width, height);
glutCreateWindow("test");
... |
/***********************************************************************
created: 7/8/2010
author: Martin Preisler
purpose: Defines the interface for the Animation class
*************************************************************************/
/***************************************************... |
#ifndef __LIFEUI_H__
#define __LIFEUI_H__
#include "EmptyObject.h"
#include "../../FrameWork/define.h"
#define GAP 10
class LifeUI : public EmptyObject
{
public:
LifeUI(GVector2 position, int number);
~LifeUI();
virtual void init();
virtual void update(float deltatime);
virtual void draw(LPD3DXSPRITE, Viewport... |
#include <vector>
using namespace std;
// GCD
int gcd(int a, int b) {
if (b==0) return a;
return gcd(b, a%b);
}
// extended GCD
// solve ax + by = gcd(a,b) when a and b are input
int extgcd(int a, int b, int& x, int& y){
int d = a;
if (b != 0){
d = extgcd(b, a%b, y, x);
y -= (a/b) * x;
} else {
... |
#include "head.h"
#include "multiplayer.h"
#include "Player.hpp"
#include "TempoMessage.hpp"
#include <unordered_map>
#include <thread>
#include <experimental/filesystem>
int partie(sf::RenderWindow& app, Carte& map, std::unordered_map<int, Player>& joueurs, Protocole& myProto){
int save;
bool musicIsOpen(false)... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.Media.ClosedCaptioning.0.h"
#include "Windows.UI.0.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Media::ClosedCaptioning {
struct __declspe... |
#include "httpendpoint.h"
HttpEndpoint::HttpEndpoint(const String &endpoint)
: endpoint(endpoint),
httpPathDelegate(&HttpEndpoint::requestDispatcher, this) {}
HttpEndpoint::~HttpEndpoint() {}
const String &HttpEndpoint::getEndpoint() const { return endpoint; }
HttpEndpoint::operator const HttpPathDelegate... |
#include <stdio.h>
int n,m;
int skip, save[201][201];
const int num = 1000000001;
typedef struct data
{
char array[201];
int size;
}data;
int min(long long a,long long b)
{
if(a<b)
return a;
else
return b;
}
void func(int arg_1,int arg_2,data output)
{
if(skip<0)
return;
if(arg_1 == 0 && arg_2 == 0)
{... |
#ifndef KEYWORD_SUGGESTION_SERVER_INCLUDE_ONLINE_MESSAGE_H_
#define KEYWORD_SUGGESTION_SERVER_INCLUDE_ONLINE_MESSAGE_H_
namespace keyword_suggestion {
struct Message {
int len;
int id;
char content[1024];
};
} // end of namespace keyword_suggestion
#endif
|
/*
NIKOLAAS BENDER HOMEWORK 3 FOR DATA STRUCTURES
CU BOULDER
*/
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
struct city{
city *next;
string cityName;
string message;
};
//======================================================================
//THIS BUILDS THE DEFAULT NETWROK
... |
//************************************************************************************************************/
//---------------- VMA209 measuring temperature by using input A4 --------------------------------------------/
//--- ATTENTION -- The symbol on the PCB is for sensor 18B20 !! If using LM35 it has to be upsid... |
#include <cstdio>
#include "exception.h"
static const char * __err_table[] =
{
"³É¹¦",
};
CGPSException::CGPSException(unsigned int errvalue) :
m_value(errvalue)
{
}
unsigned int CGPSException::ErrId()
{
return m_value;
}
const char * CGPSException::ErrDesc()
{
if(m_value < 0)
{
... |
#include "model.h"
#include "objReader.h"
#include "texture.h"
#include "Utilities.h"
#include "Renderer.h"
#include "Scene.h"
#include "Game.h"
#include "ShaderReader.h"
#include "GLFW/glfw3.h"
#include <iostream>
#include "Maths.h"
float getRandom(float min, float max)
{
return ((((float)rand()) / (fl... |
//
// internal_buffer.h
// str2-local
//
// Created by xiazhou on 10/22/13.
// Copyright (c) 2013 xiazhou. All rights reserved.
//
#ifndef str2_local_internal_buffer_h
#define str2_local_internal_buffer_h
enum BUFFER_STATUS{
CORRUPTED,
EMPTY,
USING,
FULL
};
static const int BUFFER_SIZE = 1024 * 1024;
class ... |
//This code is used to test the 4 Channel relay connections
//void Repeats(){
// Serial.println("15 second timer");
// digitalWrite(WATER_PUMP_PIN, LOW);
// digitalWrite(LIGHT_RELAY_PIN, LOW);
// digitalWrite(HUM_PIN, LOW);
// digitalWrite(led4, LOW);
//}
|
/*********************************************************************
Matt Marchant 2014 - 2016
http://trederia.blogspot.com
xygine - Zlib license.
This software is provided 'as-is', without any express or
implied warranty. In no event will the authors be held
liable for any damages arising from the use of this soft... |
#include <windows.h>
#include <gl/glut.h>
#include <stdio.h>
void DoDisplay();
void DoReshape(GLsizei width, GLsizei height);
void DoKeyboard(unsigned char key, int x, int y);
void DoMenu(int value);
GLfloat xAngle, yAngle, zAngle;
GLfloat left=-1, right=1, bottom=-1, top=1, Near=-1, Far=1;
GLfloat fov = 45;
int Proje... |
/**
* Copyright 2019 Utkarsh Bhatt
* Author : Utkarsh Bhatt
* Date : 05/10/2019 (5th October 2019)
* Struct : Stack
* Using : Dynamic Array
* Type : Generic (Templated)
*/
#ifndef INCLUDE_STACK_HPP_
#define INCLUDE_STACK_HPP_
#include <sstream>
#include <iostream>
#include <string>
templat... |
/***************************************************************************
Copyright (c) 2020 Philip Fortier
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or... |
#ifndef HR_H
#define HR_H
#include <string>
class HR
{
public:
virtual std::string getName() = 0;
virtual std::string getLastname() = 0;
virtual std::string getEmail() = 0;
virtual void setName(std::string &) = 0;
virtual void setLastname(std::string &) = 0;
virtual void setEmail(std::string &) = 0;
... |
// *****************************************************************
// This file is part of the CYBERMED Libraries
//
// Copyright (C) 2007 LabTEVE (http://www.de.ufpb.br/~labteve),
// Federal University of Paraiba and University of São Paulo.
// All rights reserved.
//
// This program is free software; you can redist... |
#ifndef THREADMAPPING_H_
#define THREADMAPPING_H_
#include "ThreadSLAM.h"
#include "sensor_msgs/LaserScan.h"
#include "obvision/reconstruct/grid/SensorPolar2D.h"
#include "obvision/reconstruct/grid/TsdGrid.h"
#include <boost/thread.hpp>
#include <deque>
namespace ohm_tsd_slam
{
class SlamNode;
/**
* @class Thre... |
// Return subsequences / subsets
vector<string> return_subsequences(string s, string ans)
{
if (s=="")
{
vector<string> result;
result.push_back(ans);
return result;
}
vector<string> ans1 = return_subsequences(s.substr(1), ans);
vector<string> ans2 = return_subsequences(s.... |
#include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
//#include <unordered_map>
#include <limits>
//#include <cmath>
using namespace std;
namespace Graph {
struct Vertex {
Vertex(int val, int d):Val(val),DStart(d)
{}
int Val;
int DStart;
operator int... |
//! Bismillahi-Rahamanirahim.
/** ========================================**
** @Author: Md. Abu Farhad ( RUET, CSE'15)
** @Category:
/** ========================================**/
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define fr(i,n) for(int i=0;i<n;i++)
#... |
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char string1[20];
char string2[]="string literal";
int i;
printf("Enter a string :");
scanf_s("%S",string1);
printf("stringl is : %s\nstring2 is : %s\n""stringl with spaces betweeen characters is :\n",string1,string2);
for (i = 0; string1[i] != '\0'... |
// Copyright (c) 2019 St. Mother Teresa HS All rights reserved.
//
// Created by: DJ Watson
// Created on: November 2019
// this program loops a number to add
#include <iostream>
#include <string>
int main() {
// variables
int numinput;
int loopc;
int loopn = 0;
int answer = 0;
std::string ln... |
#pragma once
#include <ncurses.h>
#include <string>
#include "Logger.hpp"
#include "LogSpace.hpp"
#include "ClasslessLogger.hpp"
class ChatWindow
{
public:
ChatWindow() = default;
~ChatWindow() = default;
ChatWindow(ChatWindow &&) = delete;
ChatWindow operator=(ChatWindow &&) = delete;
ChatWindow... |
#include "SearchParameters.h"
using namespace UsefulProteomicsDatabases;
using namespace EngineLayer;
namespace TaskLayer
{
SearchParameters::SearchParameters()
{
// default search task parameters
setDisposeOfFileWhenDone(true);
setDoParsimony(true);
setNoOneHitWonders(false);
setModPeptidesAreDifferent... |
// Wire Master Writer
// by Nicholas Zambetti <http://www.zambetti.com>
// Demonstrates use of the Wire library
// Writes data to an I2C/TWI slave device
// Refer to the "Wire Slave Receiver" example for use with this
// Created 29 March 2006
// This example code is in the public domain.
#include <Wire.h>
void se... |
//-----------------------------------------------------------------------------
// Perimeter Map Compiler
// Copyright (c) 2005, Don Reba
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:... |
/*
* transcoder.cpp
*
* Created on: 2016年4月27日
* Author: leo
*/
#include "pipeline_transcoding.h"
#include "transcoder.h"
using namespace std;
using namespace Transcoder;
void PrintHelp(msdk_char *strAppName, const msdk_char *strErrorMessage) {
msdk_printf(MSDK_STRING("Transcode Application. %s\n\n"),
M... |
#include "main.h"
void creating_td_clicker(){
//grid click
std::vector<SDL_Rect> grid_button = std::vector<SDL_Rect>();
grid_button.push_back({0,0,GRID_SIZE_X*SQUARE_SIZE, GRID_SIZE_Y*SQUARE_SIZE});
game->new_button("TD Grid", 0, 1, grid_button);
game->set_button_active("TD Grid", true);
//EVE... |
/*
turbineex0.cpp
*/
#include "turbineex0.hpp"
TurbineEx0::TurbineEx0(umComponent dictComp)
{
name = any_cast<const char *>(dictComp["name"]);
ef = any_cast<double>(dictComp["ef"]);
iPort = new Port(any_cast<mPort>(dictComp["iPort"]));
oPort = new Port(any_cast<mPort>(dictComp["oPort"]));
por... |
#include <iostream>
#include <ros/ros.h>
#include <geometry_msgs/QuaternionStamped.h>
#include <nav_msgs/Odometry.h>
#include <tf/transform_broadcaster.h>
#include <fstream>
// global variable
#define PI 3.1415926
ros::Publisher g_odom_pub;
boost::shared_ptr<tf::TransformBroadcaster> odom_broadcaster;
double g_kl, g_... |
#ifndef DWIZ_COMMON_STRING_UTILS_H
#define DWIZ_COMMON_STRING_UTILS_H
#include <common/dwiz_std.h>
#include <string>
#include <utility>
namespace dwiz
{
/// Splits a string of the format "host:port" into host and port.
/// Throws std::runtime_error if the string could not be parsed.
std::pair<std::string, unsigned in... |
#pragma once
#include"cocos2d.h"
#include"HelloWorldScene.h"
#include"time.h"
#include"stdlib.h"
#include"AStar.h"
#include<fstream>
#include"SimpleAudioEngine.h"
#include"Result.h"
USING_NS_CC;
class MyResult;
enum DIR {
up=28,down=29,right=27,left=26
};
class SnakeNode :public cocos2d::Sprite{
public:
static Sna... |
/*************************************************************
* > File Name : hdu3038.cpp
* > Author : Tony
* > Created Time : 2019/06/02 12:12:38
* > Algorithm : [DataStructure]UFSwithVal
**************************************************************/
#include <bits/stdc++.h>
usin... |
#include "arcpch.h"
#include "DeferredLightingPass.h"
#include <Arcane/Graphics/Window.h>
#include <Arcane/Graphics/Shader.h>
#include <Arcane/Graphics/Renderer/GLCache.h>
#include <Arcane/Graphics/Camera/ICamera.h>
#include <Arcane/Graphics/Renderer/Renderpass/Deferred/DeferredGeometryPass.h>
#include <Arcane/Scene/S... |
// Copyright 2017 Global Phasing Ltd.
#ifndef GEMMI_TO_CIF_HPP_
#define GEMMI_TO_CIF_HPP_
#include <fstream>
#include "cifdoc.hpp"
namespace gemmi {
namespace cif {
enum class Style {
Simple,
NoBlankLines,
PreferPairs, // write single-row loops as pairs
Pdbx, // PreferPairs + put '#' (empty comment... |
/*
* Copyright (c) 2014, Julien Bernard
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DIS... |
#include<bits/stdc++.h>
using namespace std;
bool solve(string str,set<string>& s)
{
string output="";
int n = str.length();
int i=0;
while(i < n)
{
output+=str[i];
if(s.find(output)!=s.end())
{
//word is present
output="";
}
i+=1;
}
if(output!="")
{
return false;
}
return true;
}
//recursi... |
//-----------------------------------------------
//
// This file is part of the Siv3D Engine.
//
// Copyright (c) 2008-2018 Ryo Suzuki
// Copyright (c) 2016-2018 OpenSiv3D Project
//
// Licensed under the MIT License.
//
//-----------------------------------------------
# pragma once
# include "IWebcam.hpp"
# includ... |
#ifndef TRUTHTABLE_H
#define TRUTHTABLE_H
typedef class truthtable {
public:
truthtable(int number, bool display = false);
~truthtable();
private:
char* _toBinString(long long int);
void _iterateTillZero(long long int);
long long int _digits;
bool _display;
long long int _rows;
} tt;
#endif
|
#include"iostream"
using namespace std;
int main(){
int size;
cout<<"enter the array size";
cin>>size;
int arr[size];
cout<<"enter the array elements";
for(int i=0;i<size;i++){
cin>>arr[i];
}
int lsum,rsum;
for(int i=0;i<size;i++){
for(int j=i+1;j<size;j++){
lsum=0;
rsum=0;
for(int r=0;r<i;r++){
... |
#include <iostream>
using namespace std;
int FromBin (int n)
{
int increment;
int Result;
increment = 1;
Result = 0;
while(n != 0)
{
if (n % 10 == 1){
Result = Result+increment;
n = n-1;
}
n = n/10;
increment = increment*2;
}
c... |
#include "Primitive.h"
#include "tinyxml2.h"
#include "Base/ParseHelper.h"
#include "Shape/Shape.h"
#include <assert.h>
#include "Material/Material.h"
#include "Light/AreaLight.h"
#include "Base/PCH.h"
Primitive::Primitive()
{
mMaterialPtr = nullptr;
mAreaLightPtr = nullptr;
}
Primitive::~Primitive()
{
// --------... |
// -*- C++ -*-
//
// Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory,
// Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC
//
// This file is part of FreePOOMA.
//
// FreePOOMA is free software; you can redistribute it and/or modify it
// under the terms of the Expat license.
//
// This progr... |
#include "Button.h"
enum buttonStates { BTN_IDLE = 0, BTN_HOVER, BTN_ACTIVE };
Button::Button(float x, float y, float width, float height,
std::string text, float size, sf::Font font,
sf::Color idleColor, sf::Color hoverColor, sf::Color activeColor)
{
// Default button state
this->buttonState... |
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms... |
#ifndef ROSE_X86INSTRUCTIONSEMANTICS_H
#define ROSE_X86INSTRUCTIONSEMANTICS_H
/* See tests/roseTests/binaryTests/SemanticVerification for ideas about how to test your work here. Note that the test is not
* run automatically because it depends on setting up a slave machine who's architecture is what is being simulated... |
#include "i2c_device.h"
bool device_triggered[256] = {false};
static void i2c_device_hook(struct avr_irq_t * irq, uint32_t value, void* adevice){
i2c_device* p = (i2c_device*)adevice;
avr_twi_msg_irq_t v;
v.u.v = value;
/*
* If we receive a STOP, check it was meant to us, and reset the transaction
*/
if (v.... |
#pragma once
class Food
{
private:
POSITION foodPos;
ege::PIMAGE foodImg;
public:
Food();
~Food();
void reDraw();
POSITION getFoodPostion();
};
|
/***********************************************************************
created: Thu Feb 16 2012
author: Paul D Turner <paul@cegui.org.uk>
*************************************************************************/
/***************************************************************************
* Copyrigh... |
// RPC stubs for clients to talk to lock_server, and cache the locks
// see lock_client.cache.h for protocol details.
#include "lock_client_cache.h"
#include "rpc.h"
#include <sstream>
#include <iostream>
#include <stdio.h>
#include "tprintf.h"
#include <time.h>
#include <vector>
#include <unistd.h>
using namespace st... |
#ifndef SEVENSEGMENT_H_
#define SEVENSEGMENT_H_
#include <ostream>
void printLargeDigit(int i, std::ostream &out);
void printLargeNumber(int i, std::ostream &out);
void printLargeError(std::ostream &out);
#endif /* SEVENSEGMENT_H_ */
|
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/components/fwupd/firmware_update_manager.h"
#include "base/check_op.h"
namespace ash {
namespace {
FirmwareUpdateManager* g_instance = n... |
#include "VulkanException.h"
VulkanException::VulkanException(char const* const message, int line, char const* file) throw()
: std::runtime_error(message), message(message), line(line), file(file)
{}
char const * VulkanException::what() const throw()
{
return message;
}
|
#include<stdio.h>
int main()
{
int i,j,k,count=0,arr[100],temp,np,n;
scanf("%d",&np);
for(k=0; k<np; k++)
{
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&arr[i]);
count=0;
for (i = 1; i < n; i++)
{
for (j = 0; j<n - i; j++)
{
... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
string a;
cin>>a;
bool vis[1000];
for(int i=0; i<1000; i++) vis[i] = 0;
int n = 0;
for(int i=0; i<a.length(); i++)
{
if(!vis[a[i]])
{
n++;
vis[a[i]] = 1;
}
}
if(n%2==0) cout<<"CHAT WITH HER!"<<endl;
else cout<<"IGNORE HIM!"<<endl;
} |
#ifndef __COMMONHEADER_H_
#define __COMMONHEADER_H_
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <WS2tcpip.h>
#include <WinSock2.h>
#include <fstream>
#include <process.h>
#include <sqlext.h>
#include <vector>
#include <queue>
#include <list>
#include <map>
#include <unordered_map>
#include <a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.