text stringlengths 8 6.88M |
|---|
/*
* (C) Copyright 2016-2018 Ben Karsin, Nodari Sitchinava
*
* 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 a... |
#include <iostream>
using namespace std;
int input;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> input;
int sCount = 0;
int maxLine = 1;
while(true){
maxLine += 6 * sCount;
if(input <= maxLine){
break;
}
sCount++;
}
cout... |
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
... |
//---------------------------------------------------------------------------
#ifndef SearchToolH
#define SearchToolH
//---------------------------------------------------------------------------
#define MAX_BUFFER 0x2000
#define SINGLE_WILDCARD 0x0100 // '??' Sign
#define COMPLEX_WILDCARD ... |
#include <fstream>
#include <sstream>
#include <unistd.h>
#include <bcm2835.h>
using namespace std;
std::string slurp(const char *filename)
{
std::ifstream in;
in.open(filename, std::ifstream::in | std::ifstream::binary);
std::stringstream sstr;
sstr << in.rdbuf();
in.close();
return sstr.str();
}
void dac_w... |
// #include <SFML/Graphics.hpp>
#include "SFML-2.5.1-macos-clang/include/SFML/Graphics.hpp"
/* The RectButton class are rectangular buttons. In this programme, it will be
* used for the different cleanup functions. This is why the class will be used
* directly in scene.cpp.
*/
class RectButton {
public:
/* T... |
#include "Singletom.h"
Singleton *Singleton::_instance = 0;
Singleton::Singleton() {
std::cout << "Singleton..........." << std::endl;
}
Singleton::~Singleton() {
}
Singleton *Singleton::Instance() {
if (!_instance) {
_instance = new Singleton();
}
return _instance;
}
|
#pragma once
#include <map>
#include <vector>
#include <mutex>
#include "../../system.hpp"
#include "test.h"
namespace sbg {
struct Group;
struct GroupContainer;
struct CollisionEngine : Engine {
CollisionEngine();
void execute(Time time) override;
void add(std::shared_ptr<Entity> object, std::vector<Group*> ... |
/** @file midl.c
* @brief ldap bdb back-end ID List functions */
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 2000-2018 The OpenLDAP Foundation.
* Portions Copyright 2001-2018 Howard Chu, Symas Corp.
* All rights reserved.
*
* Redistribution and use in sour... |
#include "vmManager.h"
#include "swapManager.h"
#include "system.h"
#include "fifo.h"
#include "lru.h"
VMManager::VMManager(){
swapMgr = new SwapManager();
// policy = new FIFO();
// policy = new LRU();
policy = new LRU();
// no pages in physical memory
for( int i = 0; i < NumPhysPages; i+... |
#include <stdio.h>
int main(){
int b;
printf("What integer do you want to convert? ");
scanf("%d", &b);
printf("%d 의 ASCII 값: %c\n", b, b);
}
|
#include <iostream>
#include <stdlib.h>
using namespace std;
#define MAX 500000
int A[MAX];
void maxHeapify(int i, int H){
int l, r, largest, tmp;
l = i * 2;
r = i * 2 + 1;
if(l <= H && A[i] < A[l]) largest = l;
else largest = i;
if(r <= H && A[r] > A[largest]) largest = r;
if(largest != i){
tmp =... |
#include "StdAfx.h"
#include "BonePacking.h"
BonePacking::BonePacking(void)
{
}
BonePacking::~BonePacking(void)
{
}
|
#include "Model.hpp"
#include "Helper.hpp"
#include "Integrator.hpp"
#include <fstream>
#include "Log.hpp"
#include <sstream>
#include <math.h>
#include <dcosmology.h>
ModelInterface::ModelInterface(map<string,double> params)
:
CosmoBasis(params)
{}
ModelInterface::~ModelInterface()
{}
double ModelInterfa... |
#include "GamePch.h"
#include "Chase.h"
#include "Common.h"
#include "Component\Separation.h"
#include "IKObject.h"
#include "IKComponent.h"
#include "GameUtils.h"
extern bool g_bDebugAIBehaviors;
static bool s_bDrawDebugAIChasingInfo = false;
void Chase::LoadFromXML(tinyxml2::XMLElement* data)
{
const char* target... |
#include <Poco/Exception.h>
#include "util/ArgsParser.h"
using namespace std;
using namespace Poco;
using namespace BeeeOn;
ArgsParser::ArgsParser(
const string &whitespace,
const char quote,
const char escape):
m_whitespace(whitespace),
m_quote(quote),
m_escape(escape)
{
if (whitespace.find(quote) != stri... |
#ifndef BASE_SCHEDULING_TASK_LOOP_FOR_IO_H_
#define BASE_SCHEDULING_TASK_LOOP_FOR_IO_H_
// This file is just for bringing in platform-specific implementations of
// TaskLoopForIO, and merging them into a single type. Users of TaskLoopForIO
// should include this file, and it will "give" them the right TaskLoopForIO
//... |
/*
* FieldAnalyse.h
*
* Created on: 12/feb/2012
* Author: jetmir
*/
#ifndef FIELDANALYSE_H_
#define FIELDANALYSE_H_
#include <iostream>
#include <math.h>
#include <mqueue.h>
#include "cv.h"
#include "highgui.h"
#include "Utils.h"
#include "ThreadAnalyse.h"
#define BALL_F 5
using namespace std;
using name... |
// Robert Fus
// CSCI 6626 - Object-Orientated Principles & Practices
// Program 3: Board
// File: Board.cpp
// 9/21/2019
#include "Board.hpp"
//----------------------------------------------------------------
Board::Board(int n, ifstream& strm, int nType) : N(n), data(strm) {
cout << "Board Constructing" << endl... |
#include "DeleteUser.h"
boost::property_tree::ptree DeleteUser::execute(std::shared_ptr<Controller> controller) {
return controller->deleteUser(commandParams);
}
DeleteUser::DeleteUser(boost::property_tree::ptree ¶ms) : BaseCommand("DelteChat") {
commandParams = params;
}
|
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "12250"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
int main(int argc, char const *argv[])
{
#ifdef DBG
freopen("uva" PROBLEM TESTC ".in", "r", stdin);
freopen("uva" PROBLEM ".out", "w", stdout);
#endif
map <string... |
#include <iostream>
#include <random>
#include <vector>
#include <stdio.h>
#include <conio.h>
#include <stdbool.h>
#include <Windows.h>
using namespace std;
#include <time.h>
bool gameOver; //游戏结束标志
bool gameWin; //游戏胜利标志
bool stop; //暂停标志
bool hit; //方向键按下标志
//边界
const int width = 50;
const int height = 20;... |
#pragma once
#include "../Common/Transform.h"
class GameObject
{
protected:
class Transform* transform;
int stride; // ΗΡ »ηΐΜΑξ
DWORD FVF;
LPDIRECT3DVERTEXBUFFER9 vb;
LPDIRECT3DINDEXBUFFER9 ib;
public:
GameObject();
~GameObject();
virtual void Init();
virtual void Release();
virtual void Update();
virt... |
#ifndef INFIXVISITOR_H_
#define INFIXVISITOR_H_
#include <iostream>
class InfixVisitor : public PrePostVisitor
{
public:
void PreVisit (Object&)
{ std::cout << "("; }
void Visit (Object& object)
{ std::cout << object; }
void PostVisit (Object&)
{ std::cout << ")"; }
};
#endif /*INFIXVISITOR_H_*/
|
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
//
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.... |
#include "stdafx.h"
#include <commctrl.h>
#include "window.h"
#include "rom_file.h"
HINSTANCE kInstance;
void GetErrorMessage(std::string& message, DWORD code)
{
message.clear();
if (!code) {
code = GetLastError();
}
TCHAR *lpMsg;
DWORD msgLen;
msgLen = FormatMessage(
FORMAT_ME... |
#include <iostream>
using ll = long long;
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(0);
std::cout.tie(0);
int l;
std::cin >> l;
std::string s;
std::cin >> s;
constexpr ll r = 31;
constexpr ll m = 1234567891;
ll h{};
for (int i = 0; i < s.size(); +... |
#include<bits/stdc++.h>
using namespace std;
int main(){
vector<int>v;
int n,num;
scanf("%d",&n);
for(int i = 0; i<n; ++i){
scanf("%d",&num);
vector<int>::iterator iV = lower_bound(v.begin(),v.end(),num);
if(v.end() == iV) v.push_back(num);
else
v[iV-v.begin()] = num;
}
printf("LIS = %d\n",v.size());
... |
// Created on: 1993-09-28
// Created by: Bruno DUMORTIER
// Copyright (c) 1993-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 GN... |
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
struct student
{
string name;
string sno;
int grade;
};
int main(int argc, char const *argv[])
{
int n;
scanf("%d", &n);
student max, min;
max.grade = -1;
min.grade = 0x7fffffff;
for (int i = 0; i < n; ++i)
{
student temp;
... |
/*
* 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<bits/stdc++.h>
using namespace std;
#define maxn 1000005
#define Mod 1000000007
using ll=long long;
ll p[maxn];
ll q[maxn];
void init(){
ll s=1;
p[0]=1;
for(int i=1;i<=1e6+1;i++){
s=s*2%Mod;
p[i]=p[i-1]+s;
}
}
int main(){
init();
string s;
cin>>... |
/*Complete the function(s) below*/
// Special Stack
void push(stack<int> s,int a)
{
//add code here.
if(s.empty())
{
s.push(a);
s.push(a);
return;
}
if(a < s.top())
{
s.push(a);
s.push(a);
return;
}
int min_value = s.top();
s.push(a... |
#pragma once
#include <SFML/Graphics.hpp>
#include <map>
namespace CAE
{
enum class ico_t
{
Editor_Delete = 0,
Editor_Add,
Folder,
File_img,
File_txt,
Refresh,
Magic,
Save,
Create,
Move,
Hand,
Arrow,
Selection
};
class IcoHolder
{
private:
static std::map<ico_t, sf::Texture> ico;
... |
#pragma once
#include <google/protobuf/descriptor.h>
#include <google/protobuf/message.h>
#include "utils/log.hpp"
#include "utils/assert.hpp"
#include <map>
#include <functional>
#include <exception>
#include <chrono>
using namespace std;
using namespace chrono;
using namespace google::protobuf;
namespace proto {
... |
#include "Timerfd.h"
#include <assert.h>
#include <stdlib.h>
#include <sys/timerfd.h>
#include "Logger.h"
namespace chatty {
namespace net {
int create_timerfd() {
int fd = ::timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK | TFD_CLOEXEC);
if (fd < 0) {
LOGERROR << "timerfd_create error" << std::endl;... |
#include "mythread.h"
#include <QtCore>
#include <QDebug>
MyThread::MyThread()
{
}
MyThread::~MyThread()
{
}
|
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <set>
#include <stack>
#include <cstdio>
#include <cstring>
#include <climits>
#include <cstdlib>
... |
#include "catch.hpp"
#include <Parser.hpp>
#include <iostream>
TEST_CASE("Test Parser", "[Parser]")
{
}
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
**
** Copyright (C) 2005-2007 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"
#ifdef SVG_... |
#include<bits/stdc++.h>
using namespace std;
struct node{
int to,w;
};
vector<node> e[300000];
long long dis[300000],ans=0;
int n;
bool f=0;
inline void ins(int u,int v,int w){
e[u].push_back((node){v,w});
}
void readit(){
int k;
scanf("%d%d",&n,&k);
for (int i=1;i<=k;i++){
int x,a,b;
scanf("%... |
#ifndef AFX_SCENE_H_
#define AFX_SCENE_H_
#include <stdio.h>
#include <vector>
#include <string>
using namespace std;
class Model
{
class Vec3
{
public:
double ptr[3];
void set(double *v)
{
for (size_t i = 0; i<3; i++)
ptr[i] = v[i];
}
inline double& operator[](size_t index)
{
return ptr[inde... |
#include "DetectMemoryLeak.h"
#include "CollisionManager.h"
#include "PlayerInfo\PlayerInfo.h"
#include "LevelStuff\QuadTree.h"
#include "LevelStuff\Level.h"
bool CollisionManager::CheckPointToSphereCollision(Vector3 point, EntityBase * ThatEntity)
{
if (!ThatEntity->HasCollider()) {
std::cout << "Entity does not h... |
#ifndef __Core__GUserCtlrManager__
#define __Core__GUserCtlrManager__
#include "GActorCtlrManager.h"
class GnIButton;
class GnInterfaceGroup;
class GInterfaceLayer;
class GUserCtlrManager : public GActorCtlrManager
{
static const gtuint NUM_BUTTON = 4;
private:
GInterfaceLayer* mpInterfaceLayer;
GAc... |
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int A[33];
bool flag[33];
int B[33];
int main(){
int T;
scanf("%d",&T);
while(T--){
int n;
scanf("%d",&n);
char str[5];
for(int i=0;i<n;i++){
scanf("%s"... |
// DataStructure.h : Include file for standard system include files,
// or project specific include files.
#pragma once
#include <iostream>
// Class
#include "Stack.cpp"
|
#ifndef _CONVERT2GRAY_HPP_
#define _CONVERT2GRAY_HPP_
#include<ros/ros.h>
#include<iostream>
#include<nav_msgs/Odometry.h>
#include<sensor_msgs/Imu.h>
#include<geometry_msgs/Pose.h>
#include<geometry_msgs/PoseStamped.h>
#include <nav_msgs/OccupancyGrid.h>
#include <nav_msgs/GridCells.h>
#include<message_filters/subscr... |
#ifndef _BetCallProc_H_
#define _BetCallProc_H_
#include "BaseProcess.h"
class Table;
class Player;
class BetCallProc :public BaseProcess
{
public:
BetCallProc();
virtual ~BetCallProc();
virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket,Context* pt ) ;
private:
int sendCallIn... |
#include <iberbar/RHI/OpenGL/VertexDeclaration.h>
#include <iberbar/RHI/OpenGL/Device.h>
#include <iberbar/RHI/OpenGL/ShaderProgram.h>
#include <iberbar/RHI/OpenGL/Types.h>
iberbar::RHI::OpenGL::CVertexDeclaration::CVertexDeclaration( CDevice* pDevice, const UVertexElement* pVertexElements, uint32 nVertexElementsCoun... |
/*
* Lanq(Lan Quick)
* Solodov A. N. (hotSAN)
* 2016
* LqThreadBase - Thread implementation.
*/
#include "LqOs.h"
#include "LqThreadBase.hpp"
#include "LqDfltRef.hpp"
#include "LqStr.h"
#include "LqSbuf.h"
#include "LqErr.h"
#if defined(LQPLATFORM_WINDOWS)
#include <Windows.h>
#include <process.h>
static int __Get... |
// P155
#include <iostream>
#include <cstdlib>
#include <string>
#include <sstream>
using namespace std;
const int maxn = 100000 + 10;
int in_order[maxn], post_order[maxn], lch[maxn], rch[maxn];
int best = 0, best_sum = 100000;
int n;
int read_list(int* a) {
string line;
if (!getline(cin, line)) return fals... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* @author Manuela Hutter (manuelah)
*/
#ifndef QUICK_ACTION_CRE... |
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <functional>
#include <map>
#include <set>
#include <cassert>
#include <list>
#include <deque>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cctype>
#include <queue>
#include <fstream>
#include <e... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2011 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef SPEED_DIAL_THUMBNAIL_H
#define SPEED_DIAL_THUMBNAIL_H
#... |
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdint.h>
#include <list.h>
#include <node.h>
#include <reader.h>
#include <parser.h>
#include <ll.h>
#include <context.h>
#include <logger.h>
/*
extern Context* context;
extern Logger* ll_lo... |
#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 <stdio.h>
/***************
* function bubble_sort()
*
* A int type of arrary
* len int type of A length
*
****************/
void bubble_sort(int A[],int len){
int i,j,temp;
// element from first to last-1
for(i=0;i<len-1;i++){
//element from last to first+1
for(j=len-1;j>i;j-... |
//////////////////////////////////////////////////////////////////////
///Copyright (C) 2011-2012 Benjamin Quach
//
//This file is part of the "Lost Horizons" video game demo
//
//"Lost Horizons" is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published ... |
#include "square.h"
#include <cmath>
#include <cassert>
square::square(const point& p1, const point& p2, const point& p3, const point& p4):
p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
square::square(std::istream& is) {
is >> p1_.x >> p1_.y >> p2_.x >> p2_.y >> p3_.x >> p3_.y >> p4_.x >> p4_.y;
assert(((p2_.x - p1_.... |
# include <iostream>
using namespace std;
double convertTemp(double);
void greet(void);
int main() {
//greet();
double fahrTemp, celsTemp;
cout << "Enter today's temperature in Fahrenheit: ";
cin >> fahrTemp;
celsTemp = convertTemp(fahrTemp);
//cout << "The converted Temperature in... |
/* https://www.codechef.com/OCT14/problems/CHEFGR/ */
#pragma warning(disable:4786)
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);
#define endl '\n'
#define gc getchar_unlocked
#define file freopen("... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <memory.h>
using namespace std;
int cnt = 0;
//防止重复访问
bool visit[22][22];
bool DFS(char Perimeters[22][22], int clickX, int clickY)
{
if (!visit[clickX][clickY])
{
visit[clickX][clickY] = true;
if (Perimeters[clickX][clickY] != 'X')
{
//cnt+... |
// Created by: DAUTRY Philippe
// Copyright (c) 1997-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 GNU Lesser General Public Li... |
#include "Scene.h"
#include "SnowPlane.h"
#include <API/Code/Graphics/Image/Image.h>
#include <API/Code/Aero/Aero.h>
Scene::Scene() :
m_Ball( 0.1f, 50, 50 ),
m_Lantern( "../../../Data/Projects/Snow/Lantern/Lantern.ply" ),
m_MooMoo( "../../../Data/Projects/Snow/MooMoo/spot_triangulated.obj" ),
m_MooMooTexture( "..... |
// Created on: 1995-06-13
// Created by: Jacques GOUSSARD
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the G... |
#ifndef DNA_ANALYZER_PROJECT_HELP_H
#define DNA_ANALYZER_PROJECT_HELP_H
#include "Icommand.h"
class Help:public IcontrolCommands
{
public:
/*virtual*/~Help(){}
/*virtual*/std::string run(Iwriter &writer, Ireader& reader, dataDNA& containerDna, const Paramcommand& param);
static void initia... |
// Author: WangZhan -> wangzhan.1985@gmail.com
#pragma once
class ScopedHandle
{
public:
ScopedHandle() : m_handle(NULL) {}
ScopedHandle(HANDLE handle) : m_handle(handle) {}
~ScopedHandle()
{
if (m_handle)
{
CloseHandle(m_handle);
m_handle = NULL;
... |
// Generated from D:/4IF/PLD-COMP/Compilateur01\fichierAntlr.g4 by ANTLR 4.7
#pragma once
#include "antlr4-runtime.h"
class fichierAntlrParser : public antlr4::Parser {
public:
enum {
T__0 = 1, T__1 = 2, T__2 = 3, T__3 = 4, T__4 = 5, T__5 = 6, T__6 = 7,
T__7 = 8, T__8 = 9, T__9 = 10, T__10 = 11, T__... |
#pragma once
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QObject>
#include <QSslConfiguration>
#include <QJsonObject>
#include "RequestType.h"
/**
* @brief Класс обеспечивает Rest API
*
* Реализация взята с https://habrahabr.ru/post/314932/
*/
class Requester : public QObject {
Q_OBJECT
public... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; -*-
**
** Copyright (C) 2002-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifdef UPNP_SUPPORT
#ifndef UPNP_UTIL_H_
#define UPNP_UTIL_H_
... |
// Copyright (c) 2016 peposso All Rights Reserved.
// Released under the MIT license
#pragma once
#include <sys/stat.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <algorithm>
#include <iterator>
#include <vector>
#include <tuple>
#include <atomic>
#include <mutex>
#include <lis... |
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define FOR(i,n) for(ll i=0;i<n;i++)
#define FOR1(i,n) for(ll i=1;i<n;i++)
#define FORn1(i,n) for(ll i=1;i<=n;i++)
#define FORmap(i,mp) for(auto i=mp.begin();i!=mp.end();i++)
#define vll vector<ll>
#define vs vector<string>
#define pb(x) push_... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
**
** Copyright (C) 1995-1999 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef DOM_XPATHRESULT
#define DO... |
#include <iostream>
#include <queue>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
class UnionFind {
public:
explicit UnionFind(int N) : V_NUM(N) {
par.resize(V_NUM);
rank.resize(V_NUM);
num.resize(V_NUM);
for (int i = 0; i < V_NUM; ++i) {
... |
#include <iostream>
#include <vector>
using namespace std;
#define MAX 200001
vector<int> edges[MAX];
bool visited[MAX];
bool dfs(int u)
{
bool ans = true;
visited[u] = true;
if(edges[u].size() != 2)
ans = false;
for(auto v : edges[u])
if(!visited[v])
ans = ans & dfs(v... |
/////////////////////////////////////////////////////////////////////
// Copyright Yibo Zhu 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)
//////////////////////////////////////////////... |
/*
* ·´×ªµ¥´Ê
*/
#include <bits/stdc++.h>
using namespace std;
class Solution{
public:
void exchange_part(string &s,int i){
_reverse(s,0,i);
_reverse(s,i+1,s.size()-1);
reverse(s.begin(),s.end());
}
private:
void _reverse(string &s,int start,int end){
while(start <= end)... |
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <algorithm>
#include <sstream>
#include <set>
#include <cmath>
#include <map>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <bits... |
/**
* @brief This will test if the Button passed in parameters has been pressed and change values accordingly
*
* @param PassedPressedButton Which button has to be pressed to make -
* @param PassedPressedButtonPlus Which button has to be pressed to do +
* @param PassedRepeatAllowed Can this value be changed by holdin... |
#include "KeyboardInterface.h"
#include <iostream>
conf::Dir KeyboardInterface::get_direction()
{
if (sf::Keyboard::isKeyPressed(sf::Keyboard::D))
{
if (sf::Keyboard::isKeyPressed(sf::Keyboard::W))
return conf::Dir::UP_RIGHT;
else if (sf::Keyboard::isKeyPressed(sf::Keyboard::S))
... |
//------------------------------------------------------------------------------
// <copyright file="KinectParams.h" company="UNAM">
// Copyright (c) Universidad Nacional Autónoma de México.
// </copyright>
//------------------------------------------------------------------------------
#include <wx/slider.h>
#inc... |
#ifndef UNOPNODE_H
#define UNOPNODE_H
#include <vector>
#include <string>
#include <iostream>
#include "Node.hpp"
using namespace std;
class UnOpNode : public Node {
private:
Node *expression = nullptr;
string op;
public:
UnOpNode(const string &op, Node *expression);
void printTree() override;
... |
#include "resource.h"
#include "logger.h"
std::string_view
sim::infra::IResource::PowerStateToString(PowerState state)
{
switch (state) {
case sim::infra::IResource::PowerState::kOff:
return "OFF";
case sim::infra::IResource::PowerState::kRunning:
return "RUNNING";
... |
#pragma once
#include "./Relays/Relay.h"
namespace Codingfield {
namespace Brew {
namespace Actuators {
class PwmRelay {
public:
PwmRelay(Relays::Relay* relay, Relays::States idleState, Relays::States activateState);
virtual ~PwmRelay() = default;
void Activate();
voi... |
#include <Adafruit_NeoPixel.h>
#include <Signaling.h>
#include <UpdateData.h>
Signaling Strip(16, 6, NEO_RGBW + NEO_KHZ800);
UpdateData Pattern1;
UpdateData Pattern2;
UpdateData Pattern4;
UpdateData Pattern3;
UpdateData Pattern5;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);... |
#include "StdAfx.h"
#include "FEUnit.h"
#include <stdlib.h>
FEUnit::FEUnit(char _face, int _skin, int _team, StatBlock* _stats, int _range, WEAPON_TYPE _weapon_type, int _weapon_accuracy, int _weapon_crit, string _name) : Creature(_face, _skin)
{
player = _team;
stats = _stats;
range = _range;
weapon_type = _weapo... |
#include "SpritePropertiesWidget.hpp"
#include "ui_SpritePropertiesWidget.h"
#include "PropertyWidget.hpp"
#include <SpriteInstance.hpp>
using namespace Maint;
SpritePropertiesWidget::SpritePropertiesWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::SpritePropertiesWidget),
_sprite(NULL)
{
ui->s... |
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
... |
/**
* @file np_arctan2_f4_hw.cc
* @author Gerbrand De Laender
* @date 07/04/2021
* @version 1.0
*
* @brief E091103, Master thesis
*
* @section DESCRIPTION
*
* Element-wise arc tangent of x1/x2 choosing the quadrant correctly.
* Single precision (f4) implementation.
*
*/
#include <hls_math... |
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*-
*
* Copyright (C) 1995-2009 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#include "core/pch.h"
#include "modules/inputmanager/inputmanager_module... |
#include<iostream>
#include<vector>
#include<string>
#include<utility>
#include<set>
#include<unordered_map>
using namespace std;
int main(){
// Vector: Dyanamic array (Resize is allowed)
//we don't want to declare the size of vector and pushing element using push_back
vector<int> ... |
#include<bits/stdc++.h>
using namespace std;
main()
{
string s1, s2;
while(cin>>s1>>s2)
{
for(int i=0; i<s1.size(); i++)
{
if(s1[i]<'a')
s1[i]+=32;
if(s2[i]<'a')
s2[i]+=32;
}
if(s1==s2)
cout<<0<<endl;
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
*/
#ifndef DOM_EXTENSIONS_BROWSERTABGROUPS_H
#define DOM_EXTENSIONS_BR... |
#include "Bone_Animation.h"
Bone_Animation::Bone_Animation()
{
}
Bone_Animation::~Bone_Animation()
{
}
void Bone_Animation::init()
{
root_position = { 2.0f,1.0f,2.0f };
// //
roottop_position = { 2.0f, 1.5f, 2.0f };
root_upp_trans = { 0.0f, 2.0f, 0.0f };
root_upptop_trans = { 0... |
#pragma once
#include "indexhashtableentry.h"
#include <string>
#include <vector>
namespace sdindex {
// The Index represented as a hashtable
class IndexHashtable {
public:
IndexHashtableEntry** hashtable = nullptr;
IndexHashtable(int size = 100000);
~IndexHashtable();
int get_size();
// Adds... |
#include <bits/stdc++.h>
using namespace std;
const int kCost1 = 10;//直移一格消耗
const int kCost2 = 14;//横移一格消耗
struct Point{
int x,y;//x为横坐标,y为纵坐标
int F,G,H;//F=G+H
Point *parent;
Point(int _x,int _y):x(_x),y(_y),F(0),G(0),H(0),parent(NULL){}
};
class Astar{
public:
void InitAstar(vector<vector<int>... |
#include "HUD.h"
HUD::HUD()
{
strawberryCount = 0;
cherryCount = 0;
orangeCount = 0;
hudBackground.objectId = PACMAN_SPRITESHEET::ID;
hudBackground.objectRect = Rect{ SCREEN_HEIGHT, INITIAL_Y, HUD_WIDTH, SCREEN_HEIGHT };
hudBackground.objectSpriteRect = Rect{ (Renderer::Instance()->GetTextureSize(PACM... |
/*
Автор: Орлов Никита
Описание: По latex запросу стоится посфиксная запись, для которой требуется список операторов
с их приоритетом. Если оператор правоассоциативный, то его приоритет отрицательный, иначе
положительный.
*/
#pragma once
#include <set>
#include <string>
#include <vector>
#include "StringTokenizer.h"... |
#pragma once
#include"Conversation.h"
#include "afxdialogex.h"
#include "Talk2Me.h"
#include "afxcmn.h"
using namespace std;
// CChatRoom 对话框
class CChatRoom : public CDialogEx
{
DECLARE_DYNAMIC(CChatRoom)
public:
CChatRoom(int id,int ownerId, CWnd* pParent = NULL); // 标准构造函数
virtual ~CChatRoom();
virtual... |
#include "terrain_shader.h"
namespace sloth {
TerrainShader* TerrainShader::m_Inst = nullptr;
TerrainShader::TerrainShader()
: Shader(TERRAIN_VERTEX_FILE, TERRAIN_FRAGMENT_FILE)
{
getAllUniformLocation();
}
TerrainShader::~TerrainShader()
{
delete[] m_LocLightPos;
delete[] m_LocLightColor;
delete[] ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.