text stringlengths 8 6.88M |
|---|
//----------------------------------------------------------------
// ClientAFEntity.cpp
//
// Copyright 2002-2006 Raven Software
//----------------------------------------------------------------
#include "../../idlib/precompiled.h"
#pragma hdrstop
/*
=================================================================... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define show(x) for(auto i: x){cout << i << " ";}
#define showm(m) for(auto i: m){cout << m.x << " ";}
typedef long long ll;
typedef pair<int, int> P;
int main()
{
int n;
cin >> n;
vect... |
#include <vector>
#include <map>
#include <cmath>
#include <iostream>
using namespace std;
/*
PROJECT EULER PROBLEM 206 - Concealed Square
Find the unique positive integer whose square has the form 1_2_3_4_5_6_7_8_9_0,
where each “_” is a single digit.
*/
int main()
{
//1_2_3_4_5_6_7_8_9_0
long long int n... |
// Created on: 1997-02-06
// Created by: Laurent BOURESCHE
// 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 ... |
#include "math_utils.hpp"
#include <math.h>
namespace nora {
float inv_sqrt(float x)
{
float x_half = 0.5f * x;
int i = *(int*)&x;
i = 0x5f375a86 - (i>>1);
x = *(float*)&i;
x = x * (1.5f - x_half * x * x);
x = x * (1.5f - x_half * x * x);
x = x * (1.5f - x_half * x * x);
return 1 / x;
}
bool point... |
/*********************************************************\
* Copyright (c) 2012-2018 The Unrimp Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without
* restriction, including wit... |
#include <sstream>
#include <iostream>
using namespace std;
//craete InsertionSort function
void InsertionSort(){
int length;
cout << "Hello, and welcome to sorting 101" << endl;
cout << "Please enter in a length for how many numbers you wish to sort, without letters, spaces, or special characters." << endl;
... |
#include <string>
#include <vector>
#include <map>
#include <iostream>
using namespace std;
class PlatypusPaternity{
public:
int maxFamily(vector <string> femaleCompatibility, vector <string> maleCompatibility, vector <string> siblingGroups)
{
int ret = 0;
int cnt = 0;
string ssg,sfm,sml;
for (int sg = 0; s... |
template< typename T >
void push( const T& value )
{
static_assert( std::is_trivially_copyable< T >::value, "code_segment data must be trivially copyable!" );
const_pointer begin = reinterpret_cast< const_pointer >( &value );
const_pointer end = begin + sizeof( T );
insert( std::vector< char >::end(), begin, en... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2005 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef FORMVALUELIST_H
#define FORMVALUELIST_H
class HTML_El... |
#pragma once
#include "Stdafx.h"
#include "boneTransform.h"
#include "Utility_wrap.h"
#include "cutTreeUtil.h"
#include "boneAbstract.h"
#define CENTER_BONE 0
#define SIDE_BONE 1
#define VOL_SIMILAR_ERROR 0.1
struct indexBone
{
int boneType;
int idxInArray;
int getIdx(int nbCenterB)
{
if (boneType == CENTER_BO... |
#pragma once
#include<string>
#include <iostream>
#include <fstream>
using namespace std;
class FileCompare
{
private:
string source_file;//原始数据文件
string output_file;//解码后数据的文件
string compare_file;//比较文件
public:
FileCompare();//原始数据文件名,解码后数据文件名,比较文件输出路径
void compare(string source_path, string output_path, string a... |
/**
* Copyright (c) 2021, Timothy Stack
*
* All rights reserved.
*
* 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 the above copyright notice, this
* list of condi... |
#include <iostream>
float action(float firstNumber, float secondNumber, char oper, bool &check) {
switch(oper) {
case '+':
return (firstNumber + secondNumber);
case '-':
return (firstNumber - secondNumber);
case '*':
return (firstNumber * secondNumber);
... |
#ifndef PNG_TOOLKIT_H
#define PNG_TOOLKIT_H
#include <string>
#include "base_filter.h"
#include "image_data.h"
class png_toolkit
{
public:
enum class Error {
WrongSize,
WrongFormat,
Ok
};
png_toolkit();
~png_toolkit();
bool load( std::string const &pictureName );
bool ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
**
** Copyright (C) 1995-2000 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef _HTM_LEX_H_
#define _HTM_LEX_H_
class HLDocProfile;
c... |
#include<iostream>
#include<string.h>
using namespace std;
bool testPalindrome(string isPalindrome, int start , int last)
{
if (start == last)
{
return true;
}
if ( isPalindrome[start] != isPalindrome[last])
{
return false;
}
if (start < last)
testPalindrome(isPalindrome, sta... |
/*****************************************************************
//
// NAME: Cole Amparo
//
// HOMEWORK: project2
//
// CLASS: ICS 212
//
// INSTRUCTOR: Ravi Narayan
//
// DATE: December 1st, 2020
//
// FILE: llist.cpp
//
// Description:
// The database functions, that you... |
/*
给出n个模式串Si,然后给出一个字符串T,问模式串中有多少个Si是T字串(出现是指正或反向出现)
*/
#include<cstdio>
#include<cstring>
#include<algorithm>
#define maxa 26
using namespace std;
struct node{
int next[maxa];
int lab,fail;
bool collect; //这个点是否被收集过
node(){
memset(next,0,sizeof(next));
fail=lab=collect=0;
}
};
node a[250010];
int root,size... |
/*********************************************************\
* Copyright (c) 2012-2018 The Unrimp Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without
* restriction, including wit... |
#pragma once
#include <iberbar/RHI/D3D11/Headers.h>
#include <iberbar/RHI/Types.h>
namespace iberbar
{
namespace RHI
{
namespace D3D11
{
struct UEffectReflectionVariable
{
UEffectReflectionVariable()
: nShaderType()
, nVarType( UShaderVariableType::VT_Unknown )
, nOffset( 0 )
, ... |
#include "tiny_dnn/tiny_dnn.h"
#include <fstream>
#include <cmath>
using namespace std;
using namespace tiny_dnn;
using namespace tiny_dnn::activation;
#define EPS 0.0001
// bool pairsort (pair <int, int> f, pair <int, int> s)
// {
// return (f.second < s.second);
// }
int main(int argc, char const *argv[])
{
... |
#pragma once
#include <unistd.h>
#include "bibliotecas.h"
void resposta(){
cout << "----------------------------------------------------" << endl
<< "RESPOSTA" << endl
<< "----------------------------------------------------" << endl;
}
void entradas(string s){
cout << "--------------... |
#pragma once
////////////////////////////////////////////////////////////////////////////////
#include <cellogram/common.h>
#include <cellogram/Region.h>
#include <Eigen/Dense>
#include <vector>
////////////////////////////////////////////////////////////////////////////////
namespace cellogram {
///
/// @brief ... |
/*
* aws/token.cpp
* AwesomeScript Token
* Author: Dominykas Djacenka
* Email: Chaosteil@gmail.com
*/
/* ==============================================================================
* T O K E N CLASS
* ============================================================================*/
#include <iostream>
#incl... |
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... |
#pragma once
#include <stdexcept>
#include <deque>
#include <thread>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <mutex>
#include <functional>
#include <future>
#include <memory>
/******************************************************
usage:
*******************************************... |
/**
* @author divyakhetan
* @date 16/1/2019
*/
#include<bits/stdc++.h>
using namespace std;
int main(){
cout << "Enter length of 1st and 2nd array";
int n1, n2;
cin >> n1 >> n2;
int a[n1];
int b[n2];
for(int i = 0; i < n1; i++){
cin >> a[i];
}
for(int i = 0; i < n2; i++){
cin >> b[i];
}
for(i... |
//
// Created by faris on 5/5/2020.
//
#ifndef FINALPROJECT_ENGINE_H
#define FINALPROJECT_ENGINE_H
#include <Box2D/Dynamics/b2World.h>
#include <vector>
#include "Bomb.h"
#include "LShape.h"
#include "SShape.h"
#include "SideWallLeft.h"
#include "SideWallRight.h"
#include "TShape.h"
#include "ZShape.h"
#include "li... |
#ifndef __CBMC_DOMAIN_H__
#define __CBMC_DOMAIN_H__
#include <set>
#include <vector>
#include <backend/abstract_reaction.h>
#include "goto-programs/static_analysis.h"
class CBMCDomain : public domain_baset
{
enum DomainType
{
NODE_NORMAL,
NODE_ASSERT,
TRANS_NORMAL,
TRANS_ASSERT,
TRANS_GOTO_BACK,
TRANS_... |
// Chris Crider
// 12/3/2014
// Temperature Converter
#include <iostream> // I/O
using namespace std; // Standard Library
int main()
{
int temperature; // Hold the user temperature
int otherTemperature; // Holds the other temperature once converted
char celsiusOrFahrenheit; // Pick for celsius or Fahrenheit
... |
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#define pb push_back
using namespace std;
int n;
int s[111][111];
void input() {
int a, b;
for (int i = 0; i < 1000; i++)
for (in... |
#include "ResourceLoader.h"
ResourceLoader* ResourceLoader::sharedResourceLoader = nullptr;
bool ResourceLoader::init()
{
return true;
}
ResourceLoader::ResourceLoader()
{
CCLOG("INFO:Start Constructor ResourceLoader");
}
ResourceLoader* ResourceLoader::getInstance()
{
if (sharedResourceLoader ==... |
#include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
int checkAnagram(string query, string dictionary){
int alpha[122];
char *queryArr = new char[query.length() + 1];
strcpy(queryArr, query.c_str());
char *dictionaryArr = new char[dictionary.leng... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
**
** Copyright (C) 1995-2012 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Øyvind Østlund
**
*/
#ifndef DIRECT_WRITE_H
#define DIRECT_... |
#ifndef _GUARD_PERMLIB_H
#define _GUARD_PERMLIB_H
#include <iterator>
namespace boost
{
// permlib needs this to compile and I couldn't be bothered to build this
// program against an appropriate version of boost instead
template<typename ForwardIt>
ForwardIt next(
ForwardIt it,
typename std::iterator_traits<For... |
void setup() {
pinMode(7, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(7, HIGH);
delay(37);
digitalWrite(7, LOW);
delay(25);
digitalWrite(7, HIGH);
delay(37);
digitalWrite(7, LOW);
delay(25);
digita... |
/**
\file Trajectory.h
Trajectory class's declaration
\author Antoine Colmard (2014)
\author Nicolas Prugne (2014)
\copyright 2014 Institut Pascal
*/
#ifndef TRAJECTORY_H
#define TRAJECTORY_H
#define _USE_MATH_DEFINES
#include <cmath>
#include <vector>
#include "Point.h"
class Point;
/**
@brief Represents a set ... |
// Created on: 2006-03-10
// Created by: data exchange team
// Copyright (c) 2006-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 License version 2... |
//============================================================================
// Name : IceCream.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include ... |
//
// m.hpp
// act templates
//
// Created by Helena on 4/16/18.
// Copyright © 2018 Helena Ruiz. All rights reserved.
//
#ifndef m_hpp
#define m_hpp
#include <stdio.h>
#endif /* m_hpp */
|
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#inc... |
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
int thresh = 200;
int main( )
{
Mat src, gray;
// Load source image and convert it to gray
src = imread( argv[1], 1 );
c... |
//def permutation(str):
// if len(str) < 2:
// yeild str
// return None
// return __permutation_impl(str, [1 for i in str])
//def __perm_impl(str, mark) :
//assert(sum(mark) == len(str))
//temp = { str[m] for m in mark if m == 1 }
//if len(temp) < 2 :
// yield list(temp)
// return None
//res = []
//tmp = ... |
/********************************************************************************
** Form generated from reading UI file 'hotelwindow.ui'
**
** Created by: Qt User Interface Compiler version 5.11.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
**************************************... |
#ifndef PHILOSOPHER_H
#define PHILOSOPHER_H
#include <string>
#include <utility>
#include <stdlib.h>
#include "stick.h"
class Philosopher
{
private:
std::string name;
size_t think_t; // thinking time in milliseconds
size_t eat_t; // eating time in milliseconds
Stick *l_stick{}, *r_stick{};
public:
... |
// Created on : Sat May 02 12:41:15 2020
// Created by: Irina KRYLOVA
// Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V3.0
// Copyright (c) Open CASCADE 2020
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it un... |
#include "../common/common.h"
#include "../common/mypacket.h"
int main(int argc, char** argv)
{
struct sockaddr_in server_addr;
int port =atoi(argv[2]);
server_addr.sin_addr.s_addr = inet_addr(argv[1]);
server_addr.sin_port= htons(port);
server_addr.sin_family=AF_INET;
int cfd ;
if ((cfd = socket(AF_INET, S... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 2007-2011 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* Edward Welbourne (based on Espen Sand's earlier unix/base/common/unixfile.cpp)
*/
#i... |
//
// Game.cpp
// sdltutorial
//
// Created by Siddharth on 05/06/19.
// Copyright © 2019 Siddharth. All rights reserved.
//
#include <stdio.h>
#include "SDLImageHeader.h"
#include "Game.h"
#include "TextureManager.h"
#include "Player.h"
#include "Enemy.h"
//define static instance here!
Game* Game::s_pInstance =... |
// 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 <string>
#include <ionir/type_system/type_util.h>
#include <ionir/passes/semantic/entry_point_check_pass.h>
namespace ionir {
EntryPointCheckPass::EntryPointCheckPass(
ionshared::Ptr<ionshared::PassContext> context
) :
Pass(std::move(context)) {
//
}
void EntryPointChe... |
// Created on: 1995-06-28
// Created by: Modelistation
// 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 GNU ... |
/*****************************************************************************************************************
* File Name : Sizeoftree.h
* File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\sites\geeksforgeeks\trees\page08\Sizeoftree.h
* Created on : Dec 10, 2013 :: 1:59:08 PM
* Author ... |
/*list是一个线性双向链表结构,它的数据由若干个节点构成,每一个节点都包括一个信息块(即实际存储的数据),
一个前驱指针和一个后驱指针。它无需分配指定的内存大小且可以任意伸缩,这是因为它存储在非连续的内存空间中,
并且由指针将有序的元素链接起来。由于其结构的原因,list 随机检索的性能非常的不好,
因为它不像vector 那样直接找到元素的地址,而是要从头一个一个的顺序查找,这样目标元素越靠后,它的检索时间就越长。
检索时间与目标元素的位置成正比。虽然随机检索的速度不够快,但是它可以迅速地在任何节点进行插入和删除操作。
因为list 的每个节点保存着它在链表中的位置,插入或删除一个元素仅对最多三个元素有所影响,
不像vecto... |
#pragma once
#include "ezored/dataservices/TodoDataService.hpp"
#include "ezored/domain/Todo.hpp"
#include "SQLiteCpp/SQLiteCpp.h"
namespace ezored
{
namespace dataservices
{
using namespace domain;
class EZRTodoDataService : TodoDataService
{
public:
virtual ~EZRTodoDataService() {}
static Todo bindFromRo... |
// Friends.cpp : 实现文件
//
#include "stdafx.h"
#include "Talk2Me.h"
#include "Friends.h"
#include "afxdialogex.h"
// CFriends 对话框
IMPLEMENT_DYNAMIC(CFriends, CDialogEx)
CFriends::CFriends(CWnd* pParent /*=NULL*/)
: CDialogEx(CFriends::IDD, pParent)
{
m_id = 0;
memset(m_name,0,DB_LENGTH);
}
CFriends::~CFriends()
... |
#ifndef __PYTHON_DP_MULTISOLVER_HPP__
#define __PYTHON_DP_MULTISOLVER_HPP__
#include "DP_multiprec.hpp"
#include "threadpool.hpp"
#include "threadsafequeue.hpp"
#include <vector>
#include <utility>
#include <limits>
#include <type_traits>
#include <boost/multiprecision/gmp.hpp>
#include <boost/multiprecision/cpp_dec... |
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: s; c-basic-offset: 2 -*-
**
** Copyright (C) 2012 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef GLOBALSTORAGE_IMPL_H
#define GLOBALSTORAGE_IMPL_H
#include ... |
#ifndef VEHICLE_HPP
#define VEHICLE_HPP
#include "part.hpp"
#include <string>
namespace Game
{
class Vehicle : public Part
{
public:
virtual int getPrice() const;
const std::string& getImageName() const;
virtual bool canAttachPart(const Part& part) const;
Vehicle(const Json::Value&);
virtual void save(... |
// BEGIN CUT HERE
// PROBLEM STATEMENT
//
// John thinks 4 and 7 are lucky digits, and all other digits
// are not lucky. A lucky number is a number that contains
// only lucky digits in decimal notation.
//
//
//
// Some numbers can be represented as a sum of only lucky
// numbers. Given an int n, return a ve... |
//
// Created by abel_ on 06-06-2022.
/*
* Algorithm : Recursive Bubble Sort
* Time Complexity : O(n^2)
* Space Complexity : O(n)
*/
//
#include <bits/stdc++.h>
using namespace std;
void swap(int *a, int *b) {
int temp = *a;
*a = *b;
*b = temp;
}
void bubbleSort(int arr[],int n){
if (n==1)
... |
#pragma once
class MyVector
{
public:
MyVector();
virtual ~MyVector();
void push_back(int);
void push_front(int);
void insert(int, int);
void pop_back();
void pop_front();
void erase(int);
bool deleteKey(int key);
int seek(int);
void write();
int size() { return sizeOfVector; }
int get(int);
private:
int ... |
#pragma once
#include <Poco/SharedPtr.h>
#include <Poco/JSON/Object.h>
#include "gwmessage/GWRequest.h"
#include "model/DeviceID.h"
namespace BeeeOn {
/**
* @brief Represents a message sent by the server to the gateway, intended
* to unpair a paired device from the gateway.
*
* An example message:
* <pre>
* {... |
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <bitset>
#include <queue>
#include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <sstream>
using namespace std;
class RowAndManyCoins {
public:
string getWinner(string cells)
{
if (cells[0]=='A' || cell... |
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2015 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistribution... |
//Using Dijkstra. Time-1.080s
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
int dr[]={-1,1,0,0};
int dc[]={0,0,-1,1};
int main()
{
ll t,n,m;
cin>>t;
for(int i=0;i<t;i++)
{
cin>>n>>m;
ll w[n][m],dist[n][m];
for(int i=0;i<n;i++)
... |
#include"AbstractFactory.h"
#include"AbstractProductA.h"
#include"AbstractProductB.h"
#include"ConcreteFactory1.h"
#include"ConcreteFactory2.h"
int main() {
AbstractFactory* fc1 = new ConcreteFactory1();
AbstractProductA* pa1 = fc1->CreateProductA();
AbstractProductB* pb1 = fc1->CreateProductB();
pa1->Use();
pb1-... |
/*
* For a normal setup with the default prescaler, 1024 samples takes ~65,000us.
* So each sample takes ~63us (=65000us/1024), for a sampling frequency of ~15.8kHz (= 1/63e-6)
*/
#define AIN A0
//#define PIN_440 2
template<int N>
struct Buffer {
int capacity = N;
uint16_t data[N];
int size = 0;
int avail()... |
#ifndef WAVE_H_
#define WAVE_H_
#include "vector.h"
#include "complex.h"
namespace KFU
{
class Wave: public Vector<Complex>
{
public:
Wave():Vector<Complex>() {}
Wave(int n);
Wave(int n, int l, Complex al);
Wave(int n, int l, double al);
Wave(const Vector<Complex>& w, int first, int last);
int ... |
#ifndef Util_h
#define Util_h
#include <cstdlib>
class Color{
public:
unsigned char R,G,B;
void blend(const Color& c){
this->R = (this->R+c.R)>>1;
this->G = (this->G+c.G)>>1;
this->B = (this->B+c.B)>>1;
}
Color():R(0),G(0),B(0){}
};
struct Point{
double x,y;
Point(double ... |
#include <planeta.h>
Planeta::Planeta()
{
}
void Planeta::Asignar(float pxi, float pyi, float vxi, float vyi, float m, float rad)
{
posx=pxi;
posy=pyi;
velx=vxi;
vely=vyi;
acelx=0;
acely=0;
Masa=m;
radio=rad;
}
void Planeta::actualizar() //se actualizan todos los datos//
{
posx=p... |
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <memory.h>
#include <math.h>
#include <string>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#include <numeric>
#include <sstream>
typ... |
#include<iostream>
#include<fstream>
#include<deque>
#include<algorithm>
#include<math.h>
#define Offset(num,bits,l,r) (((((unsigned)num<<(bits-l)))>>(bits-1-l))>>r)
#define ShowBits(num,size) for (int i = size; i > 0; i--){cout << ((int)Offset(num, size, i, i));}
#define FILE_EXIST 1
using namespace std;
... |
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <time.h>
using namespace cv;
using namespace std;
int out_matrix[7][7];
int color_info = 0;
int minimax(int board[6][6], int player);
void DrawTable(int board[6][6]);
in... |
#include <iostream>
#include <cmath>
int inputNumber(int Number) {
std::cout << "Input your number please: ";
std::cin >> Number;
return Number;
}
int main() {
int Number=0;
bool isPrime = true;
inputNumber(Number);
int Root = (int)(sqrt(Number));
for (int i = 2; i <= Root; i++) {
if (0 == Num... |
#include <iostream>
using namespace std;
int add(int x, int y)
{
return x+y;
}
int sub(int x, int y)
{
return x-y;
}
int multiply(int x, int y)
{
return x*y;
}
int divide(int x, int y)
{
return x/y;
}
|
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "CSPowerUpSpawner.generated.h"
class UDecalComponent;
class USphereComponent;
class ACSPowerUpBase;
UCLASS()
class UE4COOP_API ACSPowerUpSpawner : public AAc... |
#ifndef HSV_WIDGET_H
#define HSV_WIDGET_H
#include <QWidget>
#include <QSlider>
class HSVWidget : public QWidget
{
Q_OBJECT
public:
HSVWidget(QWidget *parent = 0);
int getHMin() const { return p_hmin_slider->value(); }
int getHMax() const { return p_hmax_slider->value(); }
int getSMin() const { return p_smin_s... |
#include "./functions.cpp"
// C library headers
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <stdlib.h>
#include <jsoncpp/json/json.h>
// Linux headers
#include <fcntl.h> // Contains file controls like O_RDWR
#include <errno.h> // Error integer and strerror() function
#include <termios.h> // C... |
//Takes text file with a FASTA string of 1-letter amino acid codes, all on one line
//Outputs results to a text file
//Header code goes here
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <fstream>
//Namespace declaration
using namespace std;
//Define the memory check function us... |
#include "PhotonBox/util/FileWatch.h"
#include <thread>
#include "PhotonBox/resource/Shader.h"
#include "PhotonBox/core/ILazyLoadable.h"
#ifdef PB_MEM_DEBUG
#include "PhotonBox/util/MEMDebug.h"
#define new DEBUG_NEW
#endif
bool FileWatch::_loading = false;
std::map<std::string, FileWatch::ResourceFile> FileWatch::_... |
#ifndef _COLOUR_H
#define _COLOUR_H
#include "basecolour.h"
class Colour : public BaseColour
{
public:
Colour(void);
~Colour(void);
// constant colout values
public:
static const unsigned int White;
static const unsigned int Black;
static const unsigned int Yellow;
static const unsigned int Red;
stat... |
#include <jni.h>
#include <string>
//#include <people>
#include "people/People.h"
extern "C" JNIEXPORT jstring JNICALL
Java_com_yangdainsheng_anative_MainActivity_stringFromJNI(
JNIEnv* env,
jobject /* this */) {
std::string hello = "Hello from C++";
People people;
return env->NewStringUTF... |
#pragma once
#include <cocos2d.h>
#include<spine/spine-cocos2dx.h>
#include<vector>
#include "HelloWorldScene.h"
#include<spine/spine.h>
#include<string>
#include<ui/CocosGUI.h>
#include<iostream>
USING_NS_CC;
class Person :public Sprite
{
public:
//ui::Button* floor0, * floor1, * floor2, * floor3, * fl... |
#include <iostream>
using namespace std;
//By using BIT Manipulation.
bool setbitcheck(int n, int i) //Function to check setbit
{
int f = 1;
f = f << i;
return n & f; //Required operation to perform setbit search
}
int main(int argc, char const *argv[])
{
int n, i;
cout << "Enter th... |
class Solution {
public:
string longestPalindrome(string s) {
for(int mid=0;mid<s.size();mid++){
int i;
for(i=0;mid-i>=0 && mid+i<s.size() && s[mid-i] == s[mid+i];i++);
updateCurrentLongest(mid-i+1, mid+i-1);
for(i=0;mid-i>=0 && mid+i... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#ifndef _EXTERNAL_DIGEST_API_H_
#define ... |
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;
int n,nduong;
bool flag[111][111];
int q[111];
int d[111];
int lev[111];
int maxlen;
vector<int> vect;
void input(){
int... |
#include "GameScene.h"
#include "FishingJoyData.h"
#include "PersonalAudioEngine.h"
GameScene::GameScene()
{
}
bool GameScene::init()
{
do
{
CC_BREAK_IF(!CCScene::init());
_backgroundLayer = BackgroundLayer::create();
CC_BREAK_IF(!_backgroundLayer);
this->addChild(_backgroundLayer);
_fishLayer = FishLay... |
//
// ngram.h
// ngram
//
// Created by Axel Boldt-Christmas on 16/10/14.
// Copyright (c) 2014 HAL9000. All rights reserved.
//
#ifndef ngram_ngram_h
#define ngram_ngram_h
#include <unordered_map>
#include <utility>
#include <string>
#include <cassert>
#include <type_traits>
#include <limits>
#include <vector>
#i... |
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
int num = strs.size(),j=0;
if(num==0) return "";
string res = "";
string one = strs[0];
auto minlen = one.size();
for(int i=1; i<num; i++) {
if(strs[i].size()<minlen){
... |
#include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
#include <queue>
int n, m, cnt;
int parent[50001], visited[50001];
std::vector<std::pair<int, int>> list;
std::vector<int> next[50001];
int Find(int idx)
{
if(parent[idx] < 0)
{
return idx;
}
return parent[idx] = Find... |
#include "SM_Matrix2D.h"
#include <string.h>
namespace sm
{
inline
Matrix2D Matrix2D::operator * (const Matrix2D& b) const
{
Matrix2D ret;
Mul(*this, b, ret);
return ret;
}
inline
vec2 Matrix2D::operator * (const vec2& v) const
{
vec2 ret;
ret.x = (v.x * x[0] + v.y * x[2]) + x[4];
ret.y = (v.x * x[1] + v.y * ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef CARET_MANAGER_H
#define CARET_MANAGER_H
#if defined(KEY... |
#ifndef __SRC_UTILS_HASHFUNC_H__
#define __SRC_UTILS_HASHFUNC_H__
#include <stdint.h>
#include <unistd.h>
namespace Utils {
class HashFunction {
public:
typedef uint32_t (*func)(const char *, size_t);
public:
static uint32_t ap(const char * key, size_t nkey);
static uint32_t djb(const char * key, s... |
#include <iostream>
using namespace std;
int main()
{
int size;
cout << "Enter length of the desired array" << endl;
cin >> length;
int arr[length];
for (int a = 0; a < length; a++)
{
cout << "Enter value " << a + 1 << endl;
cin >> arr[a];
}
int sum = 0;
for (int ... |
#include<vector>
#include<algorithm>
#include<iostream>
#include<string>
using namespace std;
class Solution {
public:
vector<string> summaryRanges(vector<int>& nums) {
//基本思想:双指针,start连续数字的起始,end连续数字的结束
vector<string> res;
if (nums.size() == 0)
return res;
int start = nums[0], end;
for (int i = 0; i < nu... |
#pragma once
#include "utils/log.hpp"
#define COMMON_RESOURCE_TLOG __TLOG << setw(20) << "[COMMON_RESOURCE] "
#define COMMON_RESOURCE_DLOG __DLOG << setw(20) << "[COMMON_RESOURCE] "
#define COMMON_RESOURCE_ILOG __ILOG << setw(20) << "[COMMON_RESOURCE] "
#define COMMON_RESOURCE_ELOG __ELOG << setw(20) << "[COMMON_RESO... |
#include "cpptest.h"
CPPTEST_CONTEXT("core.threads.test.cpptest.TA_Thread_CppTest/core.thread.test.cpptest/ThreadPool/ThreadedWorker.cpp");
CPPTEST_TEST_SUITE_INCLUDED_TO("core.threads.test.cpptest.TA_Thread_CppTest/core.thread.test.cpptest/ThreadPool/ThreadedWorker.cpp");
class TestSuite_processWorkItem_c51be083 : p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.