text stringlengths 8 6.88M |
|---|
#pragma once
#include <iostream>
#include <string>
#include <fstream>
#include <windows.h>
#define M_PI 3.14159265358979323846
using namespace std;
class Area {
public:
Area() {};
virtual ~Area() {};
virtual double Calc() = 0;
bool FileCheck(ifstream& pFile);
}; |
#include <TransferFunction.h>
bool TransferFunction::comparePoints(ControlPoint a, ControlPoint b){
return a.getPosition().x < b.getPosition().x;
}
void TransferFunction::orderPoints(){
//-- Bubble Sort Ordering
unsigned int n = control_points.size();
for (unsigned int i = 0; i < n -1 ; i++)
for (unsigned int j... |
#ifndef CIRCULAR_ARRAY_H_
#define CIRCULAR_ARRAY_H_
#include "CircularContainer.h"
template <typename T, int Capacity>
class CircularArray{
public:
CircularArray(){
_buffer.resize(Capacity);
}
size_t size() const{
return _buffer.size();
}
void fill(const T& val){
for(size_t i=0;i<Capacity;i++){
at(i) = ... |
// Created on: 1995-11-15
// Created by: Jean-Louis Frenkel <rmi@pernox>
// 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... |
#include <iostream>
#include<vector>
#include<conio.h>
#include<stdio.h>
using namespace std;
//Nhap xuat- vecto
void Nhap(vector<int>&arr)
{
cout<<"\n ---Menu----";
cout<<"\n Sau ok \n";
cout<<"\n An 1 de Dung\n";
cout<<"\n An Phim Khac Tiep\n";
cout<<"\n--------------------\n";
int i=0;
w... |
#ifdef _WIN32
#pragma comment(lib, "glfw3.lib")
#endif
#include "sandbox.hpp"
void m() {
SandBox sb;
while (sb.open()) {
sb.on_update();
sb.on_gui_update();
}
return;
}
int main(){
m();
std::cout << "Exiting\n";
}
|
#define BOOST_TEST_MODULE dmtk_algo_clustering_hierarchical
#include <boost/test/unit_test.hpp>
#include <tuple>
#include "dmtk.hpp"
using namespace dmtk;
BOOST_AUTO_TEST_CASE( euclidean_min_distance_metric_3_ele) {
std::vector<std::tuple<int, int>> data{{1, 1},{2, 2},{10, 10}};
BOOST_... |
#pragma once
#include "orientation.h"
#include <boost/noncopyable.hpp>
#include <memory>
class Transform : boost::noncopyable
{
public:
static std::shared_ptr<Transform> make_transform();
static std::shared_ptr<Transform> make_transform(std::shared_ptr<Transform> rhs);
static std::shared_ptr<Transform> make_trans... |
class CfgSounds {
sounds[] = {};
/*
class 'nomedoaudio' {
name = "nomedoaudio";
sound[] = {"\sounds\nomedoaudio.ogg",3.5, 1};
titles[] = {};
};
*/
// Efeitos sonoros bizarros
class aiaiiaiaia { // TAZER
name = "aiaiiaiaia";
sound[] = {"\sounds\aiaiiaiaia.ogg", 0... |
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*-
*
* Copyright (C) 1995-2005 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 XPATH_SUPPORT
#include "modules/xpath/src/... |
#pragma once
#include "../controls/RollupCtrl.h"
#include "../DecalEntity.h"
enum E_TERRAIN_BRUSH_TYPE
{
E_TERRAIN_BRUSH_NULL_TYPE,
E_TERRAIN_RISE,
E_TERRAIN_LOWER,
E_TERRAIN_BRUSH_TYPE_COUNT
};
class CTerrainModifyTool : public CEditTool
{
public:
DECLARE_DYNCREATE(CTerrainModifyTool)
C... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
// only gravity will pull me down
// Longest Common Prefix in an Array
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<string> vs(n);
string res;
cin >> res;
for(int i=1; i<n; i++) ... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ma... |
#include "str_functions.h"
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
// Parsing a protocol where each element consists of a starting and ending tag,
// and there are attributes associated with each tag. Only starting tags can
// have attributes. We can call an attr... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright 2006-2012 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Peter Krefting
*/
#include "core/pch.h"
#ifdef GEOLOCATION_SUPPO... |
/*
* day10.cpp
*
* Created on: Dec 10, 2019
* Author: sanja
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <unordered_set>
#include <cmath>
#include <algorithm>
const int noOfVaporized = 200;
std::pair<int, int> laser;
//for putting angle in range (0, ... |
#include "gtest/gtest.h"
float commission(int locks, int stocks, int barrels)
{
int lockprice = 45;
int stockprice = 30;
int barrelprice = 25;
int total = 0;
float com = 0.0;
if ( locks<1 || locks>70 || stocks<1 || stocks>80 || barrels<1 || barrels>90)
return -1;
total = l... |
#include <ctime> // for time()
#include <cstdlib> // for rand(), srand(), and RAND_MAX
#include <iostream>
#include <vector>
#include <string>
using namespace std;
struct text {
string word;
int occur;
vector<int> pages;
};
struct Node{
text txt;
Node* next[16];
};
Node *head = n... |
#include<iostream>
#include<vector>
using std::vector;
using std::cin; using std::cout; using std::endl;
int main()
{
vector<int> v;
int i;
while(cin >> i)
v.push_back(i);
for(auto i : v)
cout << i << endl;
return 0;
}
|
// Created on: 1998-07-09
// Created by: Stephanie HUMEAU
// Copyright (c) 1998-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... |
//
// Created by glyphack on 7/12/19.
//
#include "Portal.h"
|
//
// DlibKmeansInterface.h
// Author: Michael Bao
// Date: 9/8/2015
//
#pragma once
#include "shared/internal/dlib/DlibInterface.h"
#include "shared/algorithms/cluster/kmeans/KmeansInterface.h"
#include "shared/utility/type/dlib/DlibEigenInterop.h"
#include "dlib/clustering.h"
template<typename ImagePixelType, temp... |
/**
* @file
* @copyright defined in EOTS/LICENSE.txt
*/
#pragma once
#include <eotiolib/memory.h>
#include <eotiolib/print.hpp>
void* sbrk(size_t num_bytes);
extern "C" {
void* malloc(size_t size);
void* calloc(size_t count, size_t size);
void* realloc(void* ptr, size_t size);
void free(void* ptr);
}
|
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
#include "controller.hpp"
using namespace std;
Controller::Controller(int argc, char *argv[])
{
QApplication prog(argc, argv);
MainWindow w;
timer = new QTimer(this);
w.setWindowTitle("Frednator");
w.show();
videoThread = new VideoThread;
videoThread->moveToThread(&workerThread);
in... |
#ifndef __MAPPOINTTOBUCKET_H__
#define __MAPPOINTTOBUCKET_H__
#include <iostream>
#include <dax/Types.h>
#include <dax/Extent.h>
#include <dax/CellTag.h>
#include <dax/cont/UniformGrid.h>
#include <dax/exec/internal/TopologyUniform.h>
#include <dax/math/Compare.h>
#include <dax/math/Precision.h>
using namespace dax:... |
#pragma once
#include <vector>
#include <limits>
#include <memory>
#include <cassert>
#include <pybind11/pybind11.h>
#include <pybind11/numpy.h>
namespace py = pybind11;
enum class ShiftDir
{
NONE,
UP,
LEFT,
UPLEFT
};
struct ShiftDirHash
{
template <typename T>
std::size_t operator()(T t) co... |
// ####################################################################
// Auteur : Alix Dumay et Mehdi Taguema
// Date : 24/04/2019
// Version : 1.5
// Description : Ce programme permet de créer la classe Data_Météo
// Cette classe permet de réaliser toutes les fonctions nécessaire à la station... |
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
const int TC_M[4] = {3, 2, 4, 2};
const int TC_N[4] = {3, 4, 4, 2};
const vector<string> TC_BOARD[4] = {{"DBA", "C*A", "CDB"},
{"NRYN", "ARYA"},
... |
#include <bootcon.h>
#include <8259.h>
#include <kbdtest.h>
#include <port.h>
#include <regsave.h>
extern G2BootConsole console;
extern G2PIC pic8259;
void int2Hex(uint64_t x, char *buf, size_t size) {
// expect buf to be n characters long - last one gets \0
buf[size - 1] = '\0';
uint64_t num = x;
int i = size -... |
#include "RenderSystem.h"
#include "GlobalVariablePool.h"
#include "OMesh.h"
#include "PreDefine.h"
#include "GpuProgram.h"
#include "Entity.h"
#include "RenderTarget.h"
#include "Camera.h"
#include "Geometry.h"
#include "EGLUtil.h"
#include "ResourceManager.h"
#include "animation_helper.h"
#include "pass.h"
#include "... |
#include "SCEEventAction.hh"
#include "SCECalorimeterSD.hh"
#include "SCECalorHit.hh"
#include "SCEAnalysis.hh"
#include "G4RunManager.hh"
#include "G4Event.hh"
#include "G4SDManager.hh"
#include "G4HCofThisEvent.hh"
#include "G4UnitsTable.hh"
#include "Randomize.hh"
#include <iomanip>
//....oooOO0OOooo........oooOO... |
ld heron(int a, int b, int c){
ld s = (a+b+c)/2.0;
return sqrtl(s*(s-a)*(s-b)*(s-c));
}
ld heron(int a, int b, int c, int d){
ld s = (a+b+c+d)/2.0;
return sqrtl((s-a)*(s-b)*(s-c)*(s-d));
} |
/***********************************************************************
!!!!!! DO NOT MODIFY !!!!!!
GacGen.exe Resource.xml
This file is generated by Workflow compiler
https://github.com/vczh-libraries
***********************************************************************/
#ifndef VCZH_WORKFLOW_COMPILER_GENERATED... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2002 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_TREEWALKER_H
#define DOM_TREEWALKER_H
#ifdef DOM2... |
#include <iostream>
#include <cmath>
int main() {
long x = 600851475143;
long factor = 2;
long max_factor = sqrt(x);
while (x > factor && factor <= max_factor){
if (x % factor == 0) {
x = x/factor;
}else{
factor++;
}
}
std::cout << factor << std::... |
#include <bits/stdc++.h>
using namespace std;
int row[8], TC, a, b, lineCounter;
bool place(int r, int c);
void backtrack(int c);
int main()
{
scanf("%d", &TC);
while(TC--)
{
scanf("%d %d", &a, &b);
a--; b--;
memset(row, 0, sizeof(row)); lineCounter = 0;
printf("SOLN COLUM... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2007 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
/** \file
*
* \brief Include file for OpMemUpperTen object
*
* Y... |
#include "PageManage.h"
CPageManage * CPageManage::GetInstance()
{
static CPageManage page;
return &page;
}
map<PAGE_TYPE, PAGEINFO>& CPageManage::GetPageInfo()
{
return m_sPageInfo;
}
PAGE_TYPE CPageManage::GetCurPage()
{
return m_eCurrentShowPage;
}
void CPageManage::ShowPage(PAGE_TYPE ePageType, bool bIsExit... |
#include<bits/stdc++.h>
#define PI 3.14159
using namespace std;
int main()
{
double redius, volume;
cin>>redius;
volume = (4.0/3) * PI * (redius*redius*redius);
cout<<"VOLUME = "<<fixed<<setprecision(3)<<volume<<"\n";
return 0;
}
|
#pragma once
#include "ray.h"
#include "camera.h"
#include "random.h"
#include <shapes/shape_list.h>
glm::vec3 color(const Ray& r, ShapeList& world);
glm::vec3 get_random_sphere_unit_point();
double squared_length(const glm::vec3& v); |
#include "Adafruit_TFTLCD_8bit_STM32.h"
#include "s6b.h"
void wrBus(int b) {
GPIOB->regs->BSRR =0xFF000000 + (b<<8);
digitalWrite(PA13,LOW); //WR
delayMicroseconds(10);
digitalWrite(PA13,HIGH);
}
void wrBus2(int d1, int d2) {
wrBus(d1);
wrBus(d2);
}
void wrBus3(int d1, int d2, int d3) ... |
#include <cstdio>
#include <vector>
#include <cmath>
using namespace std;
vector <int> input;
int main(void)
{
int M, N;
scanf("%d %d", &M, &N);
int i,j;
for (i = 0; i <= 1000000; i++)
{
input.push_back(i);
}
input.at(1) = 0;
int num = 2;
int maxnum = input.at(input.size() - 1);
int len = sqrt(input... |
// Copyright Lionel Miele-Herndon 2020
#include "BTService_ClearPlayerLocation.h"
UBTService_ClearPlayerLocation::UBTService_ClearPlayerLocation()
{
NodeName == TEXT("Clear Player Location");
}
void UBTService_ClearPlayerLocation::TickNode(UBehaviorTreeComponent &OwnerComp, uint8* NodeMemory, float DeltaSecon... |
#include"tinyxml2.h"
#include<string>
#include<iostream>
#include<algorithm>
#include<cstddef>
#include<regex>
using namespace tinyxml2;
using namespace std;
void doWork();
void loadFile(int argc, char* argv[]);
string findAuthor(const string &hold);
void print(char* argv[]);
string trim(string str);
string capitali... |
/*
Copyright (c) 2015, Vlad Mesco
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 conditions and the follo... |
/*****************************************************************
Name :merge_sort
Author :srhuang
Email :lukyandy3162@gmail.com
History :
20191125 Initial Version
*****************************************************************/
#include <iostream>
#include <vector>
#define DEBUG (0)
#define SCALE (10000)
... |
// Created on: 1993-01-09
// Created by: CKY / Contract Toubro-Larsen ( Anand NATRAJAN )
// 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... |
//#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<conio.h>
#include<windows.h>
using namespace std;
int mapp[6][6],score,maxscore;
bool mappp[6][6];//判断这个点是否已经合成过
int c;
const char WALL[]="---------------------";
bool over();
void GetMaxScore();
void UpdateMaxScore();
void OutPut();
void Set();
void m... |
#include <iostream>
#include <math.h>
#include <string.h>
#include "add_control_noise.h"
#include "add_feature.h"
#include "add_observation_noise.h"
#include "compute_weight.h"
#include "data_associate_known.h"
#include "fastslam1_sim.h"
#include "feature_update.h"
#include "get_observations.h"
#include "linalg.h"
#inc... |
/*
Проект разрабатывается в рамках курсовой работы по теме: "Разработка объектной программы для задачи управления группами в социальных сетях".
Это основной файл для клиентского кода.
Выполнил студент 3-го курса Железняк Аркадий в 2018г.
*/
#include <iostream>
#include "SocNetwork.h"
using namespace std;
int main()
{... |
#include <iostream>
#include "cryptobox/core/HSM.hpp"
using namespace cryptobox;
void print(std::vector<unsigned char> const& v) {
for (auto const c : v)
printf("%c", c);
printf("\n");
}
int main() {
// simple test for the very basic functionality: create/sign/verify
auto hsm = std::make_sha... |
int Tree[maxn];
inline int lowbit(int x){
return (x&-x);
}
void add (int x,int value){
for(int i=x;i<=maxn;i+=lowbit(i)){
Tree[i]+=value;
}
}
int get(int x){
int sum=0;
for(int i=x;i;i-=lowbit(i)){
sum+=Tree[i];
}
return sum;
} |
#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 <map>
typedef long long LL;
typedef unsigned long long ULL;
#define PI 3.141592653589... |
#include<iostream>
#include "quick_sort.cpp"
int main(){
int arr[7] = {12, 2, 56, 23, 11, 45, 12};
quickSort(arr, 0, 6);
for(int i = 0; i < 7; ++i){
std::cout<<arr[i]<<" ";
}
return 0;
} |
#include "../include/Group.h"
unsigned int CAE::Part::_id = 0;
void CAE::Part::update()
{
auto[x, y, w, h] = box;
quad[0].position = sf::Vector2f(x, y);
quad[1].position = sf::Vector2f(x + w, y);
quad[2].position = sf::Vector2f(x + w, y + h);
quad[3].position = sf::Vector2f(x, y + h);
quad[4].... |
// system includes
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
// testing 3
// global namespace declaration
using namespace std;
// forward declaration
void EndOfExecPause();
void PrintVector( const vector< int >& inVec);
bool IsOdd ( int );
// -------------------... |
#ifndef __GAME_H__
#define __GAME_H__
/*
===============================================================================
Public game interface with methods to run the game.
===============================================================================
*/
// RAVEN BEGIN
// bgeisler: moved into scripts directory
//... |
#include <string>
#include <unordered_map>
using namespace std;
int lengthOfLongestSubstring(string s) {
string longest_substr;
string cur_substr;
int start_pos = 0;
unordered_map<char, int> tmp;
for (int i = 0; i < s.size(); ++i) {
std::unordered_map<char, int>::const_iterator iter = tmp.find(s[i]);
if (iter... |
#ifndef PLATFORMER_CONNECT_GAME_STATE_H
#define PLATFORMER_CONNECT_GAME_STATE_H
#include "Game.h"
namespace platformer {
/**
* Game state that attempts to find and connect to other devices to play
* the competitive multiplayer mode.
*/
class ConnectGameState : public GameState {
private:
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* George Refseth, rfz@opera.com
*/
#ifndef MBOXIMPORTER_H
# ... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: DataKind.h
* Author: frankiezafe
*
* Created on June 14, 2016, 8:51 PM
*/
#ifndef DATAKIND_H
#define DATAKIND_H
c... |
#pragma once
#include <fstream>
#include <list>
#include <ctime>
#include "kissnet.h"
#include "crossword_board.hpp"
#define CROSSWORD_PORT "3333"
class crossword_server
{
public:
crossword_server(std::ifstream& crossword_data, const std::string& port = CROSSWORD_PORT);
~crossword_server();
void start();... |
#ifndef INPUTVARIABLE_H
#define INPUTVARIABLE_H
#include "variable.h"
class InputVariable : public Variable
{
public:
/**
* @brief Constructor
* @param name Name of the variable
*/
InputVariable(std::string name);
/**
* @brief Methode creating the fuzzy... |
/**
* 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... |
/**
* Copyright 2015 ViajeFacil
* @author Hugo Ferrando Seage
* @author Fernando Saavedra
*/
#include "./fecha.hpp"
Fecha::Fecha() : dia_(0), mes_(0), anio_(0) {}
Fecha::Fecha(int dia, int mes, int anio)
: dia_(dia), mes_(mes), anio_(anio) {}
Fecha::~Fecha() {}
void Fecha::setFecha(int dia, int mes, int... |
#include "cpptest.h"
CPPTEST_CONTEXT("core.threads.test.cpptest.TA_Thread_CppTest/core.thread.test.cpptest/src/Thread.cpp");
CPPTEST_TEST_SUITE_INCLUDED_TO("core.threads.test.cpptest.TA_Thread_CppTest/core.thread.test.cpptest/src/Thread.cpp");
class TestSuite_getCurrentThreadId_35492577 : public CppTest_TestSuite
{
... |
#include <iostream>
using namespace std;
int main()
{
int a = 1;
const int b = 11;
//int * p = &b; //error,const object can`t just be reference by a pointer point to a const object
const int * pc;
pc= &a;
int * const cpa = &a;
const int * const cpb = &b;
int * const cpca = &a;
const int * const cpcb = &b;
/... |
#include <benchmark/benchmark.h>
#include <dummy.h>
using namespace dummy;
static void DummyBenchmark(benchmark::State &state) {
Dummy dummy(4);
for (auto _ : state) {
benchmark::DoNotOptimize(dummy.GetDummy());
}
state.SetComplexityN(state.range(0));
state.SetItemsProcessed(state.iterati... |
#include "../include/command_interface.h"
#include "../lib/rapidxml/rapidxml.hpp"
using namespace rapidxml;
using namespace std;
bool command_interface::load_device_params(string config_dir_name)
{
unscaled_device_params tmp_device_params;
xml_document<> doc;
ifstream file(config_dir_name);
stringstream buffer;... |
// 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 License version 2.1 as published
// by the Free Software Foundation, with spe... |
#include "sandtrap.h"
#include "globals.h"
#include "physics.h"
#include "game.h"
#include "math_extra.h"
#include <math.h>
Sandtrap* create_sandtrap(int x1, int x2, int y1, int y2){
Sandtrap* sandtrap = (Sandtrap*) malloc(sizeof(Sandtrap));
sandtrap->type = SANDTRAP;
sandtrap->x1 = x1;
sandtrap->x... |
//
// This file contains the C++ code from Program 7.2 of
// "Data Structures and Algorithms
// with Object-Oriented Design Patterns in C++"
// by Bruno R. Preiss.
//
// Copyright (c) 1998 by Bruno R. Preiss, P.Eng. All rights reserved.
//
// http://www.pads.uwaterloo.ca/Bruno.Preiss/books/opus4/programs/... |
/*
Author: Manish Kumar
Username: manicodebits
Created: 20:46:06 10-04-2021
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define PI 3.141592653589
#define MOD 1000000007
#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(0)
#define deb(x) cout << "[ " << #x << " = " << x <<... |
#ifndef CHAINING__H
#define CHAINING__H
#include <iostream>
#include "LinkedList.cpp" // Your Own Implementation
#include <cstring>
#include <fstream>
#include <cmath>
using namespace std;
class HashC
{
protected:
long tableSize;
int collisions;
int a;
LinkedList<string>* hashTable;
public:
HashC(int ... |
#include<bits/stdc++.h>
using namespace std;
int fib_helper(int n,int *ans){
if(n <= 1){
return n;
}
//Check if output already exists.
if(ans[n] != -1){
return ans[n];
}
//Calculate output.
int a = fib_helper(n - 1,ans);
int b = fib_helper(n - 2,ans);
//Save the ouput for future use.
ans[n] = a + b... |
/*
* @lc app=leetcode.cn id=78 lang=cpp
*
* [78] 子集
*/
// @lc code=start
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
vector<vector<int>> res;
vector<vector<int>> subsets(vector<int>& nums) {
res.clear();
vector<int> track;
backtrack(nums, 0, t... |
#ifndef GRAFOS_H
#define GRAFOS_H
#define INF 1073741822
#include <iostream>
using namespace std;
class Grafos
{
private:
int m;
int **W; //Matriz W
int **Q; //Matriz Q
public:
Grafos(void);
void pideleAlUsuarioTuMatriz(void);
void mues... |
//
// Created by 송지원 on 2020/05/20.
//
#include <cstdio>
using namespace std;
int main() {
char ch;
scanf("%c", &ch);
printf("%d", ch);
return 0;
} |
//
// LeftBullet.h
// ClientGame
//
// Created by liuxun on 15/3/4.
//
//
#include "stdafx.h"
#include "Player.h"
#include "Bullet.h"
#ifndef __ClientGame__LeftBullet__
#define __ClientGame__LeftBullet__
class LeftBullet : public Bullet {
public:
LeftBullet(Player* player);
};
#endif /* defined(__Cl... |
/*
* Copyright (c) 2015-2021 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_DETAIL_SORTING_NETWORK_SORT24_H_
#define CPPSORT_DETAIL_SORTING_NETWORK_SORT24_H_
namespace cppsort
{
namespace detail
{
template<>
struct sorting_network_sorter_impl<24u>
{
template<
typename Rand... |
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
//매크로 함수 정의
#define INF 1000 //무한대 값
#define TRUE 1
#define FALSE 0
#define MAX_VERTICES 20 //최대 점점 개수
//전역 변수
int distance[MAX_VERTICES]; //시작정점으로부터의 최단 경로 거리
int found[MAX_VERTICES]; //방문한 정점 표시
//필요한 함수 헤더 정의
void shortest_path(in... |
#include "GameResultManager.h"
//-------------------------------------------------------
//--コンストラクタ・デストラクタ
GameResultManager::GameResultManager( Drawer* drawer, InputChecker* inputChecker, Sounder* sounder, Player* player ) : SceneManager( drawer, inputChecker, sounder ){
_player = player;
_BGMsounded = false;
_p... |
// Created on: 2001-06-26
// Created by: Alexander GRIGORIEV
// Copyright (c) 2001-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 ... |
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*-
*
* Copyright (C) 1995-2002 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef XMLPARSER_XMLCHECKINGTOKENHANDLER_H
#define XMLPARSER_XMLCHECKING... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* Copyright (C) Opera Software ASA 1999-2004
*/
#ifndef ES_STRING_OBJECT_H
#define ES_STRING_OBJECT_H
#include "modules/ecmascript/carakan/src/object/es_object.h"
class ES_String_Object : public ES_Object
{... |
#include <DxLib.h>
#include <stdio.h>
#include "PlayersScore.h"
void PlayersScore::Load() {
FILE *fp;
fopen_s(&fp, "save.dat", "rb");
if (fp == NULL) {
for (int i = 0; i < 4; i++) {
for (int i1 = 0; i1 < 10; i1++) {
strcpy_s(score[i][i1].name, "NoName");
}
score[0][0].score = 200000;
score[0][1].... |
/*****************************************************************
* Copyright (C) 2017-2018 Robert Valler - All rights reserved.
*
* This file is part of the project: DevPlatformAppCMake.
*
* This project can not be copied and/or distributed
* without the express permission of the copyright holder
******... |
#pragma once
#include <vector>
#include "Point.h"
#include "GamePiece.h"
using namespace std;
class Region
{
private:
//id of the region
int id;
//token value of the region
int token;
//the player who controls this region
int owner_id;
string type;
string symbol;
bool borderRegion;
/// <summary>
... |
/**
GeekFactory - "INNOVATING TOGETHER"
Distribucion de materiales para el desarrollo e innovacion tecnologica
www.geekfactory.mx
EJEMPLO SENCILLO PARA LECTURA DE TEMPERATURA CON TERMISTOR NTC. EL PROGRAMA
ESTÁ DISENADO PARA TERMISTORES NTC DE 10K NOMINALES A 25 GRADOS CENTIGRADOS.
EL TERMISTO... |
//
// Created by dylan on 12-11-2019.
// Subclass of rectangle.
// This class is used to create rectangle objects that can move around.
//
#ifndef CPSE2_MOVING_RECTANGLE_HPP
#define CPSE2_MOVING_RECTANGLE_HPP
#include "rectangle.hpp"
class moving_rectangle : public rectangle {
public:
moving_rec... |
#include <mutex>
#include <thread>
class Singleton
{
private:
Singleton() {};
Singleton(const Singleton& s) = delete;
static std::mutex mtx;
static Singleton *m_instance;
public:
static Singleton* getInstance();
~Singleton();
};
Singleton* Singleton::getInstance() {
// 加锁使得线程同步,避开竞争
mtx.lock();
... |
#include "H/3D.h"
/*
void matrixMulVertices(Vertice3D &i,Vertice3D &o, mat4x4 &m){
o.x = i.x * m.m[0][0] + i.y * m.m[1][0] + i.z * m.m[2][0] + m.m[3][0];
o.y = i.x * m.m[0][1] + i.y * m.m[1][1] + i.z * m.m[2][1] + m.m[3][1];
o.z = i.x * m.m[0][2] + i.y * m.m[1][2] + i.z * m.m[2][2] + m.m[3][2];
float w ... |
#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
#define Max 10000000
double gh[1000][1000];
int N,M;
double mintree(){
int i,j,k;
double m,len=0,Min[1000];
int vis[1000]={0};
vis[0]=1;
for(i=0;i<N;i++)
Min[i]=gh[0][i];
for(i=1;i<N;i++){
for(j=1,m=Max... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*
* Copyright (C) 2003-2010 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* Morten Stenshorne
*/
#include "core/... |
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void)
{
int N;
scanf("%d", &N);
vector<long long> v(N);
for (int i = 0; i < N; i++)
{
scanf("%lld", &v[i]);
}
sort(v.begin(), v.end());
int nCount = 0;
int nMax = 0;
long long n... |
#include<bits/stdc++.h>
using namespace std;
void cntMoves()
{
int X, Y, moves;
X=Y=0;
cout<<"Number of Moves: ";
cin>>moves;
for(int i=0; i<=moves; i++)
{
if(moves%2==0)
{
if(i!=1 || i%2==0){
Y+=1;
}
}
else
... |
#include "aDDictMath.h"
/*float __cdecl sin(float v)
{
volatile float res;
__asm
{
fld v
fsin
fstp res
}
return res;
}
float __cdecl cos(float v)
{
volatile float res;
__asm
{
fld v
fcos
fstp res
}
return res;
}
float __cdecl sqrt(float v)
{
volatile float res;
__asm
{
fld v
fsqrt
fstp... |
class SystemManager
{
public:
SystemManager(ComponentManager& components)
: components{components}
{
}
template <typename T>
T& add()
{
auto t = new T{};
t->set(components);
auto& system = systems.emplace_back(t);
ComponentMap map = T::TYPE::get_map();
records.push_back({ map, *system })... |
/*
* A library for controlling a Microchip RN2xx3 LoRa radio.
*
* @Author JP Meijers
* @Author Nicolas Schteinschraber
* @Date 18/12/2015
*
*/
#ifndef rn2xx3_h
#define rn2xx3_h
#include "Arduino.h"
enum RN2xx3_t {
RN_NA = 0, // Not set
RN2903 = 2903,
RN2483 = 2483
};
enum FREQ_PLAN {
SINGLE_CHANNEL_E... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.