text stringlengths 8 6.88M |
|---|
#include "aumelsec.h"
#include "aulibdefs.h"
#include "auplcdrive.h"
#include "autag.h"
#include "auplc.h"
#include "aubase.h"
#include <QString>
#include <QTcpSocket>
#include <QTimer>
#include <QDataStream>
#include <QFile>
AuMelsec::AuMelsec(AuBase &base,quint16 index, QObject *parrent): AuPlcDrive(base,index,pa... |
#pragma once
#include <vector>
#include <iostream>
#include <map>
#include <algorithm>
#include <functional>
#include "Cell.h"
#include "Board.h"
#include "CellsStateStatistic.h"
#include <thread>
Board::Board() : size(0)
{
}
Board::Board(int size) : size(size)
{
this->createBoard();
this->initAliveCells();
this->... |
#ifndef TurnBanksH
#define TurnBanksH
#pragma once
#include "RiverTree.h"
#include "..\..\..\..\Util\FileSwapping.h"
#include "..\..\..\..\Util\FileRec64.h"
#include "..\..\..\..\Util\Matrix.h"
#include "..\..\Source\defaultType.h"
#include "..\..\..\..\NeuroNet\NeuroNet.h"
#include "..\..\..\..\Util\\AnyType.h"
#if... |
#include "FightingSprite.h"
FightingSprite::FightingSprite(int resType, int index)
{
mCurrentFrame = 1;
mImage = NULL;
if (resType == DatLib::RES_ACP) // 怪物的
{
mImage = (ResImage *)DatLib::GetRes(DatLib::RES_ACP, 3, index);
}
else if (resType == DatLib::RES_PIC) // 玩家角色的
{
... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int s;
cin>>s;
if(s<1500) cout<<s+(0.1*s)+(0.9*s)<<endl;
else cout<<s+500+(0.98*s)<<endl;
}
return 0;
} |
#include<iostream>
#include<vector>
#include<set>
using namespace std;
class Solution
{
public:
bool isValidSudoku(vector<vector<char>>& board)
{
int size = board.size();
bool subBox[9][9]= {0};
for (int i = 0; i < size; i++)
{
//1.judge the row
int row[9]= {0};
for (int j = 0; j < size; j++)
... |
#include <FastCG/Rendering/MaterialDefinitionRegistry.h>
namespace FastCG
{
MaterialDefinitionRegistry *MaterialDefinitionRegistry::smpInstance = nullptr;
} |
//$Id: BatchEstimatorInv.cpp 1398 2011-04-21 20:39:37Z $
//------------------------------------------------------------------------------
// BatchEstimatorInv
//------------------------------------------------------------------------------
// GMAT: General Mission Analysis Tool
//
// Copyright ... |
/*
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... |
// This file has been generated by Py++.
#ifndef TypeAliasIterator_hpp__pyplusplus_wrapper
#define TypeAliasIterator_hpp__pyplusplus_wrapper
void register_TypeAliasIterator_class();
#endif//TypeAliasIterator_hpp__pyplusplus_wrapper
|
//CS 325 Project 4: TSP
//Alex Way, Kristin Swanson, Peter Rissberger
//Build with: g++ -std=c++0x -g -o tsp tsp.cpp
//Run with: tsp inFile.txt
//Optionally, add 2 or 3 as a final argument. This will run the 2-opt or 3-opt
//(respectively) until no more improvement can be found. Leave the 3rd
//argument off for a fas... |
#include "core.h"
#include "log.h"
#include <QFile>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJSValueIterator>
static const QLatin1String s_countriesFileName("countries.json");
Core::Core(QObject *parent) :
QObject(parent)
{
}
QString Core::init()
{
if (!QFile::exi... |
//
// ImageProcessFunction.h
// SMFrameWork
//
// Created by KimSteve on 2016. 12. 5..
//
// 여러가지 Image process 함수들...
#ifndef ImageProcessFunction_h
#define ImageProcessFunction_h
#include "ImageProcessor.h"
#include <platform/CCImage.h>
#include <2d/CCSprite.h>
#include <base/ccTypes.h>
class Intent;
class Ima... |
//
// Emulator - Simple C64 emulator
// Copyright (C) 2003-2016 Michael Fink
//
/// \file Processor6510.cpp MOS6510 processor emulation
//
// includes
#include "StdAfx.h"
#include "Processor6510.hpp"
#include "MemoryManager.hpp"
#include <algorithm>
using C64::Processor6510;
using C64::AddressingMode;
using C64::Regi... |
#include<stdio.h>
#include<malloc.h>
struct node{
int data;
struct node *next;
};
int reverse(struct node **);
int push(struct node **,int );
int printList(struct node *);
int main(){
struct node *head;
push(&head,22);
push(&head,11);
push(&head,4);
reverse(&head);
printList(head);... |
#include <iostream>
using namespace std;
int main(){
int r;
cout << "enter number of rows";
cin >> r;
for(int i=0; i< r; i++){
for(int j=0; j <= i; j++)
{cout << "*";
if(j==i){cout << endl;}
}
}
}
|
#include "coubsArmyWidget.h"
#include <QScreen>
void CoubsArmy::initializeGL()
{
colorOwner.setSources({&ambientLight , &directionLight , &pointLight});
ambientLight.setColor(QColor(255,0,0));
directionLight.setPosition(QVector4D( QVector3D(1,0,0), 1 ));
directionLight.setColor(QColor(2... |
BinaryTreeNode* Construct(int* preorder,int* inorder,int length)
{
if(preorder==nullptr||inorder==nullptr||length<=0)
return nullptr;
retr ConstructCore(preorder,preorder+length-1,inorder,inorder+length-1);
}
BinaryTreeNode* ConstructCore(int* startPreorder,int* endPreorder,int* startInorder,int* endI... |
/*
* fileio.cpp
*
* Created on: Feb 14, 2021
* Author: Madison Callan
*/
#include "../includes/fileio.h"
using namespace std;
int loadData(const std::string filename, vector<process> &myProcesses){
return UNIMPLEMENTED;
}
int saveData(const std::string filename, vector<process> &myProcesses){
return UNI... |
/**
* Copyright (C) 2017 Alibaba Group Holding Limited. 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
*
* ... |
/////////////////////////////////////////////////////////////////////////////////////////////
// Copyright 2017 Intel Corporation
//
// 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
//
... |
#ifndef __BEGIN_STAGE3__
#define __BEGIN_STAGE3__
#include "..\..\FrameWork\Sprite.h"
#include "..\..\FrameWork\SpriteManager.h"
//#include "..\..\FrameWork\Managers\SoundManager.h"
#include "..\..\FrameWork\InputController.h"
#include "..\..\FrameWork\StopWatch.h"
#include "../../FrameWork/Scene/PlayScene.h"
#incl... |
#include <iostream>
using namespace std;
class LL{
private:
struct node{
int data;
node *next;
};
node *head;
node *tail;
public:
LL();
~LL();
void InsertNodeAtEnd(int data);
void Concatenate(LL & secondlist);
void Print();
};
LL::LL(){
head = tail = NULL;
}
LL::~LL(){
}
void LL::InsertNodeAt... |
#ifndef SOLUTIONDATAIO_H
#define SOLUTIONDATAIO_H
#include "solutiondataio_global.h"
#include "qstring.h"
#include "vtkFloatArray.h"
#include "vtkCell.h"
#include "vtkCellArray.h"
#include "vtkCellType.h"
#include "vtkDataSet.h"
#include "vtkCellData.h"
#include "vtkPointData.h"
#include "qmap.h"
#include "vtkIdTypeAr... |
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include "opencv2/core/core.hpp"
using namespace cv;
using namespace std;
int main()
{
int i, j, k, B1[256] = { 0 }, G1[256] = { 0 }, R1[256] = { 0 };
Mat img = imread("C:\\Users\\ariji\\Desktop\\Extra\\te... |
// Longest substring without repeating characters
#include<iostream>
#include "bits/stdc++.h"
using namespace std;
int main(){
string s;
cin>>s;
vector<int> dict(256, -1);
int maxLen = 0, start = -1;
for(int i=0; i<s.size();i++){
if(dict[s[i]] > start){
start = dict[s[i]];
... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a, b, v, x;
ll solve() {
for(int i = 63; i >= 0; i--){
if( (v & (1LL<<i)) ){
x = v;
x ^= (1LL << i);
for(int j=i-1; j >= 0; j--){
x |= (1LL << j);
}
break;
}
}
return min(x,b);
}
int main() {... |
#ifndef MODEL_H
#define MODEL_H
#include "shader.h"
#include "mesh.h"
#include <assimp/scene.h>
#include <string>
#include <vector>
using namespace std;
class Model {
public:
// Constructor, expects a filepath to a 3D model
Model(const string& path);
// Render the model, and thus all its meshes
void render(S... |
#include<iostream>
#include"enums.hpp"
#include"enumTest.hpp"
// consider the following to be your existing enum
namespace Some { namespace Nested { namespace Namespace {
struct Struct
{
enum class ESomeEnum
{
a_0 = 1, b_1 = 4, c_2 = 8, d_3 = 3,
};
... |
/** @file Fraction.cpp
@brief The implementation for Fraction class
...
*/
#include "Fraction.h"
/** Default constructor initializes the fraction to 0/1.
numerator and denominator are default initialized
THEN it runs the code inside { ... }
*/
Fraction::Fraction() {
numerator = 0;
denomina... |
#include <Windows.h>
#include <sstream>
typedef unsigned __int64 QWORD;
extern "C" __declspec(dllexport) void __cdecl ExportFunc() {
MessageBox(NULL, TEXT("dummy export"), TEXT("info"), MB_OK);
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
if (ul_reason_for_call == DLL_... |
#pragma once
#include "Geometry/Public/Box.h"
#include "Geometry/Public/BoundedView.h"
namespace Geometry {
namespace Index {
namespace Detail {
template <typename Indexable>
long double Content (const Indexable& indexable) {
const auto& max = indexable.max_corner();
const auto& min = indexable.min_corner();
ret... |
#pragma once
#include <memory>
#include "drake/math/rotation_matrix.h"
#include "drake/multibody/multibody_tree/multibody_plant/multibody_plant.h"
#include "drake/solvers/mathematical_program.h"
namespace drake {
namespace multibody {
/**
* Solves an inverse kinematics (IK) problem on a MultibodyPlant, to find the
... |
//
// CircleCropSprite.cpp
// SMFrameWork
//
// Created by KimSteve on 2016. 12. 5..
//
//
#include "CircleCropSprite.h"
#include "../Base/ShaderNode.h"
static const GLfloat _texCoordStripConst[8] = { 0, 1, 1, 1, 0, 0, 1, 0 };
CircleCropSprite* CircleCropSprite::createWithTexture(cocos2d::Texture2D *texture, boo... |
// -*- 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... |
/*
XBFOG.CPP
FOG CLASS (c) g0at3r
*/
#include "XbFog.h"
CXBFog::CXBFog()
{
m_dwVertexDecl[0] = D3DVSD_STREAM( 0 );
m_dwVertexDecl[1] = D3DVSD_REG( 0, D3DVSDT_FLOAT3 );
m_dwVertexDecl[2] = D3DVSD_REG( 2, D3DVSDT_FLOAT3 );
m_dwVertexDecl[3] = D3DVSD_REG( 5, D3DVSDT_FLOAT2 );
m_dwVertexDecl[4] = D3DVSD_END();
... |
#include "resultados.h"
#include "ui_resultados.h"
Resultados::Resultados(QWidget *parent) :
QDialog(parent),
ui(new Ui::Resultados)
{
ui->setupUi(this);
//Cargar los votos del archivo
this->cargarVotos();
//Crear el lienzo
lienzo = QPixmap(660,500);
//Invocar al metodo dibujar
t... |
//#include <iostream>
//#include "typet.h"
#include "stubgen.h"
using namespace std;
//#include "hfss.h"
//#include "hfssstubc_t.h"
//extern int subi;
bool stubs = 1;
//extern int tabs = 0;
int main (int argc, char *argv[])
{
printf( "Vardist stubgen! \n");
if (argc<4)
{
printf("Usage: classname in_header... |
/*
* wayPoint.h
*
* Created on: Jun 20, 2015
* Author: colman
*/
#ifndef WAYPOINT_H_
#define WAYPOINT_H_
#include "Globals.h"
#include "Position.h"
class wayPoint{
public:
PositionState* _state;
Position* _position;
wayPoint();
virtual ~wayPoint();
};
#endif /* WAYPOINT_H_ */
|
/**
* @file single_board.cpp
* @author Hamdi Sahloul
* @date September 2014
* @version 0.1
* @brief ROS version of the example named "simple_board" in the Aruco software package.
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <aruco/aruco.h>
#include <aruco/boarddetector.h>
#include <aruco/cvdra... |
#include "cached_bit_writer.h"
#include "utils.h"
using namespace std;
const size_t CachedBitWriter::MAX_CACHED_BYTES = 10;
CachedBitWriter::CachedBitWriter(ostream& out) : out_(out), bucket_idx(0), bucket_bits_allocated(0) {
buffer.resize(MAX_CACHED_BYTES);
}
void CachedBitWriter::WriteNLastBits(uint code, uint... |
#pragma once
#include "data/traits.h"
#include "data/allocator.h"
#include "data/aerecord.h"
//////////////////////////////////////////////////////////////////////////
namespace data
{
/**
* @brief Хранилище аэ данных.
*
* хранит аэ записи, типы хранимых характеристик.
* является примитивным хранилищем, которое... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#include <map>
#include <sstream>
#include <cmath>
#include <unordered_set> // 需要c++ 11才能支持
#include <unordered_map> // 需要c++ 11才能支持
using namespace std;
class MagicIndex {
public:
/*
没做出来
... |
#ifndef UNTITLED5_GAME_H
#define UNTITLED5_GAME_H
#include "View.h"
#include <SFML/Graphics.hpp>
#include "../managers/ViewManager.h"
#include "../managers/GameManager.h"
#include "../gameparts/Board.h"
#include "../gameparts/SnakePart.h"
#include "../gameparts/Snake.h"
#include "../gameparts/Food.h"
class Game : publ... |
/*
This project uses Automatic Package Restore feature of NuGet to resolve Aspose.BarCode for .NET API reference
when the project is build. Please check https://docs.nuget.org/consume/nuget-faq for more information.
If you do not wish to use NuGet, you can manually download Aspose.BarCode for .NET API from http://www.a... |
#ifndef AROYA_DBSCAN
#define AROYA_DBSCAN
#include<vector>
using namespace std;
class AroyaDBSCAN {
public:
AroyaDBSCAN();
void setData(const vector<vector<double>>&newData);
void setRadius(const double&);
void setDensity(const int&);
void run();
vector<int>getFlag();
void writeFile(const char*fileName, const ... |
#include <iostream>
using namespace std;
void main()
{
char N;
bool result;
cin >> N;
if ((N >= 'a' && N <= 'z' )||(N>='A' && N<='Z')) result = true;
else result = false;
cout << result;
}
|
//
// Created by wojtekreg on 15.01.18.
//
#ifndef PYRAPORTFEL_PRODUKT_STRUKTURYZOWANY_H
#define PYRAPORTFEL_PRODUKT_STRUKTURYZOWANY_H
#include "Aktywa.h"
class ProduktStrukturyzowany : public Aktywa {
private:
int czasTrwania;
double udzialWZyskach;
double maksymalnyZysk;
void setCzasTrwania(int cz... |
#ifndef _INC__RPG2K__MODEL__data__BASE_HPP
#define _INC__RPG2K__MODEL__data__BASE_HPP
#include "Model.hpp"
namespace rpg2kLib
{
namespace model
{
class DataBase : public Base
{
private:
std::map< uint, std::vector< uint16_t > > charStatus_;
std::map< uint, std::vector< uint16_t > > terrain_;
std::ma... |
#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;
int cmmp(vector<int> v)
{
int min=1001;
for(int i=0;i<v.size();i++)
{
if(v[i] && min > v[i])
min=v[i];
}
return min;
}
int main() {
// your code goes here
unsigned int n;
cin>>n;
vector<int> v;
for(int i=0;i<n;i++)
{
unsign... |
#include "votante.h"
QString Votante::cedula() const{
return m_cedula;
}
void Votante::setCedula(const QString &cedula){
m_cedula = cedula;
}
QString Votante::nombre() const{
return m_nombre;
}
void Votante::setNombre(const QString &nombre){
m_nombre = nombre;
}
Votante::Votante(QObject *parent) : ... |
#ifndef _EXPLICIT_FDM_H_
#define _EXPLICIT_FDM_H_
#include "fdm_engine.h"
class ExplicitFDM: public FDMEngine {
public:
/* Constructors and destructor */
ExplicitFDM();
ExplicitFDM(double spot, double maturity,
unsigned int imax, unsigned int jmax,
double upper, double lower... |
class HighLevelRewrite : public MidLevelRewrite<HighLevelInterfaceNodeCollection>
{
// Interface classification:
// Permits String Based Specification of Transformation: YES
// Permits Relative Specification of Target: YES
// Contains State information: YES
public:
// ***********... |
#ifndef MAKSA_H
#define MAKSA_H
#include <QDialog>
#include "dllmysql.h"
namespace Ui {
class Maksa;
}
class Maksa : public QDialog
{
Q_OBJECT
public:
explicit Maksa(QWidget *parent = nullptr);
~Maksa();
public slots:
void asetaSaldo(double s){saldo=s;}
void asetaTili(int i){idTili = i;}
... |
#include "PJS.h"
class Baseline : PJS
{
};
|
// Module: Matrix.h
// Author: Miguel Antonio Logarta
// Date: April 17, 2020
// Purpose: Header file for Matrix class
// Bi-directional linked list
#pragma once
class Matrix
{
public:
// Constructor
Matrix(string, string, string, string, string);
// Accessors
TCHAR* GetName();
TCHAR* GetDec();
TCHAR* Ge... |
// *****************************************************************
// 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... |
#include "stdafx.h"
#include "Game\Parent.h"
#include "Title.h"
using namespace Sequence;
Child* Title::update(Parent* parent)
{
Child* next= this;
switch(b)
{
case 1:
next = new Game::Parent;
break;
}
return next;
}; |
/*#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <stdlib.h>
int main(){
int s = socket(AF_INET, SOCK_STREAM, 0);
if(s<0){
pr... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.UI.ApplicationSettings.0.h"
#include "Windows.Foundation.0.h"
#include "Windows.Security.Credentials.0.h"
#include "Windows.UI.Popups.0.h"
#include "Windo... |
#include <iostream>
using namespace std;
int main()
{
int qnt;
cin >> qnt;
bool flag = true ;
while(qnt != 0){
int numeros[qnt];
if(!flag)
cout << endl ;
flag = false ;
for(int i = 0; i < qnt; i++){
cin >> numeros[i];
... |
#include <iostream>
#include <iCub/iDyn/iDyn.h>
#include <yarp/sig/all.h>
#include <yarp/math/api.h>
#include <yarp/os/Log.h>
#include <yarp/os/all.h>
#include <yarp/os/Time.h>
#include "chain_conversion.h"
#include <kdl/chainfksolver.hpp>
#include "custom_kdl/chainidsolver_recursive_newton_euler_internal_wrenches.h... |
/* File: main-stack.cpp
* Name: Paulo Lemus
* Date: 3/13/2017
*/
#include <exception>
#include <iostream>
#include "stack-array.h"
#include "stack-list.h"
int main(){
// Stack objects from both implementations
ee::array::stack<int> arrayStk(5);
ee::list::stack<int> listStk(5);
// Verify size and... |
#ifndef HELP_HAND_H_INCLUDED
#define HELP_HAND_H_INCLUDED
#define _USE_MATH_DEFINES
#include <math.h>
#include <cmath>
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <sstream>
#include <ctype.h>
//#include <algorithm>
#define M_PI 3.14159265358979323846
using... |
/****************************************************************************
* *
* Project64 - A Nintendo 64 emulator. *
* http://www.pj64-emu.com/ *
* Copyrig... |
#ifdef HAS_VTK
///////////////////////////////////////////////////////////////
#include <vtkPoints.h>
#include <vtkFloatArray.h>
#include <vtkCellArray.h>
#include <vtkPointData.h>
#include <vtkPolyData.h>
#include <vtkRegularPolygonSource.h>
#include <vtkCubeSource.h>
#include <vtkSphereSource.h>
#include <vtkStruct... |
#include <bits/stdc++.h>
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
FILE *out;
out = fopen("B.out","a");
int t;
cin>>t;
for(int aa=0;aa<t;aa++){
fprintf(out, "Case #%d: ", aa+1);
cout<<"Case #"<<aa+1<<": ";
long long n, head=1;
int b, tmp=1, imin=100000;
cin>>b>>n;
int m[b], t[b], l... |
// Copyright Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
========================================================================... |
// Sandro Sobczynski, Maciej Leciejewski
#include <iostream>
using namespace std;
int main()
{
int number;
cout << "Enter the number: ";
cin >> number;
int *pointerToNumber;
pointerToNumber = &number;
cout << "Number is: " << number << " Pointer: " << pointerToNumber << endl;
}
|
/***************************************************************************
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 <QCoreApplication>
#include <IoNetClient.h>
#include <QSettings>
#include <QString>
#include <QStringList>
#include <QDebug>
#include "lireport.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QCoreApplication::setOrganizationName("Lynovitza");
QStringList hosts;
bool... |
#include <string.h>
#include <stdio.h>
#include <switch.h>
int main(int argc, char **argv)
{
gfxInitDefault();
consoleInit(NULL);
bpcInitialize();
bpcRebootSystem();
return 0;
}
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,i,j,cnt=0,cn=0,cd=0,a,b,c;
cin>>n;
for(i=0;i<n;i++){
cin>>a; cnt+=a;}
for(i=0;i<n-1;i++){
cin>>b; cn+=b;}
for(i=0;i<n-2;i++){
cin>>c; cd+=c;}
cout<<(cnt-cn)<<endl;
cout<<(cn-cd)<<endl;
}
|
/* _____
* /\ _ \ __
* \ \ \_\ \ __ __ __ /\_\
* \ \ __ \ /'_ `\ /\ \/\ \\/\ \
* \ \ \/\ \ /\ \_\ \\ \ \_\ \\ \ \
* \ \_\ \_\\ \____ \\ \____/ \ \_\
* \/_/\/_/ \/____\ \\/___/ \/_/
* /\____/
* ... |
/*
* 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 ... |
#include <cstdio>
#include <climits>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair<double, double> P; // first; x, second; y
const int MAX_N = 10000;
const int INF = std::numeric_limits<int>::max(); //2,147,483,647 == 2^31 -1
//INPUT
int N;
P A[MAX_N];
// comparing functi... |
#pragma once
#include <functional>
namespace imog {
class Async {
using asyncFn = std::function<void(void)>;
using floatFn = std::function<float(void)>;
static void
_periodic(const floatFn& timeFn, bool* threadFlag, const asyncFn& func);
public:
// Runs a function fn each wait time until flag is fals... |
//
// BattleScene.cpp
// CrossKaiser
//
// Created by 龚畅优 on 13-8-27.
//
//
#include "BattleScene.h"
#include "BattleController.h"
#include "Constant.h"
#include "json.h"
#include "ResultScene.h"
#include "SaveData.h"
#include "UserInfo.h"
const Rect ITEM_RECT = Rect(160,0, 160,40);
BattleScene::BattleScene(){
... |
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
// #define DEBUG
const int maxn = 2505;
int line;
string res[maxn];
void handle(int type) {
int a = 0, b = 0;
for (int i = 0; i < line; ++i) {
for (int j = 0; j < res[i].size(); ++j) {
if (res[i][j] == 'W')
... |
#include<bits/stdc++.h>
using namespace std;
vector<int>arr;
bool compare(pair<int,int>& a, pair<int,int>&b){
if(a.first == b.first) return arr[a.second] < arr[b.second];
return a.first > b.first;
}
int mygcd(int a, int b){
if(a < b) swap(a, b);
while(b){
int temp = a%b;
a = b;
b... |
// ----------------------------------------------------
// Timer.cpp
// Body for CPU Tick Timer class
// ----------------------------------------------------
#include "Timer.h"
// ---------------------------------------------
Timer::Timer()
{
Start();
}
// ---------------------------------------------
void Timer::S... |
/*
*****************************************************************************
* ___ _ _ _ _
* / _ \ __ _| |_| |__(_) |_ ___
* | (_) / _` | / / '_ \ | _(_-<
* \___/\__,_|_\_\_.__/_|\__/__/
* Copyright ... |
#include "git-rev-export.hpp"
#include <git-rev.hpp>
|
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
bool isPossible(vector<int> &A)
{
long total = 0;
int n = A.size(), a;
for (int a : A)
total += a;
sort(A.begin(), A.end());
while (true)
{
a = A[n - 1];
i... |
/***********************************************************************
created: 16/1/2005
author: Paul D Turner
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2006 Paul D Turner & The ... |
//Student Name: Bair Suimaliev
//Student email: bsuimaliev@myseneca.ca
//Student ID: 159350198
//Date: 09.27.2021
//I have done all the coding by myselfand only copied the code
//that my professor provided to complete my workshopsand assignments.
#pragma once
#ifndef _SDDS_TIMEDEVENTS_H_
#define _SDDS_TIMEDEV... |
#include <iostream>
using namespace std;
class X
{
public:
X() =default; //让编译器提供一个默认的构造函数,效率比用户写的高
X(int i)
{//写了带参的构造函数,编译器不会提供无参的构造函数
a = i;
}
int a;
};
//default只能修饰类中默认提供的构成员函数:无参构造,拷贝构造,赋值运算符重载,析构函数等
#if 0
class X2
{
public:
int f() = default; //err
X... |
///////////////////////////////////////////////////////////////////
//Copyright 2019-2020 Perekupenko Stanislav. All Rights Reserved.//
//@Author Perekupenko Stanislav (stanislavperekupenko@gmail.com) //
///////////////////////////////////////////////////////////////////
#pragma once
#include "CoreMinimal.h"
#include ... |
#ifndef H_BOBBLE
#define H_BOBBLE
#include "TranslatingGameObject.h"
class Bobble : public TranslatingGameObject {
public:
enum Type {RED, GREEN, BLUE, YELLOW};
Bobble::Bobble();
Bobble::Bobble(Type type, int x = 0, int y = 0, double angle = 0, float speed = 0);
Bobble::Bobble(const Bobble& other);
//Verandert... |
#include <TAH.h>
int Xaxis = A1;
int Yaxis = A2;
int Zaxis = A0;
TAH myTAH;
int X,Y,Z;
void setup()
{
Serial.begin(9600);
myTAH.begin(9600); // Start TAH ble serial port
pinMode(Xaxis,INPUT);
pinMode(Yaxis,INPUT);
pinMode(Zaxis,INPUT);
myTAH.enterCommandMode(); // Enters TAH command mode
myTAH.set... |
#include "TaskState.h"
using namespace Task;
bool BarrierOn::run()
{
entity->barrier = true;
result = true;
return false;
}
bool BarrierOff::run()
{
entity->barrier = false;
result = true;
return false;
}
bool VisibleOn::run()
{
entity->visible = true;
result = true;
return false;
}
bool VisibleOff::run()
... |
#pragma once
#ifndef POINT_H
#define POINT_H
#include <iostream>
#include <cmath>
class Point {
public:
Point();
Point(double a, double b);
Point(const Point& other);
double X() const;
double Y() const;
Point operator+ (const Point& a) const;
Point operator- (const Point& a) const;
... |
// we are traversing all nodes once so
// time complexity O(n)
// space complexity O(n)(hash map)
void solve(Node* root,int cur,int cur_level,int& max_depth,unordered_map<int,int>& hash)
{
if(root==NULL)
{
return ;
}
cur+= root->data;
hash[cur_level]=max(hash[cur_level],cur);
if(root-... |
/*
* Patrulla.cpp
*
* Created on: Mar 5, 2013
* Author: j2deme
*/
#include "Patrulla.h"
Patrulla::Patrulla() {
this->sirena = "Wiu! Wiu! Wiu!";
this->choques = 99;
sonarSirena();
}
Patrulla::~Patrulla() {}
void Patrulla::sonarSirena() {
cout << this->sirena << endl;
}
void Patrulla::detenerDelicuent... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Phone.Management.Deployment.1.h"
WINRT_EXPORT namespace winrt {
namespace ABI::Windows::Foundation {
#ifndef WINRT_GENERIC_cdb5efb3_5788_509d_9be1_71ccb8a3362a
#define WINR... |
#pragma once
namespace CMI
{
class Instrument;
class Session
{
public:
Session();
virtual ~Session();
virtual const Instrument *getInstrument(UInt32 index) const;
virtual void setInstrument(UInt32 index, Instrument *instrument);
private:
static const UInt32 MaxInstrumentCount = 24;
Instrument *_instruments... |
#include <iostream>
#include<stdlib.h>
#include<stdio.h>
#define STACK_INIT_SIZE 10
using namespace std;
typedef struct stackList
{
int * base;
int * top;
int stacksize;
} sqStack;
/**初始化栈**/
void createStack(sqStack * L)
{
L->stacksize = STACK_INIT_SIZE;
L->base = (int*)malloc(STACK_INIT_SIZE *... |
/**
* CalcSum0to10.h
* Concrete Command class which knows an operation (Calculator(Receiver) class and parameters)
*/
#ifndef __CALC_SUM_0TO10__
#define __CALC_SUM_0TO10__
#include "CalcCommand.h"
class CalcSum0to10 : public CalcCommand
{
public:
CalcSum0to10(Calculator &calculator);
virtual void execute();
};... |
{dede:addurls}beij.weierkq.com/zzal/{/dede:addurls}
{dede:batchrule}{/dede:batchrule}
{dede:regxrule}{/dede:regxrule}
{dede:areastart}<div class="al_list">{/dede:areastart}
{dede:areaend}<div class="zj_fenye">
{/dede:areaend}
|
#ifndef PROCESSSTEP_H
#define PROCESSSTEP_H
/*
Project: Stereo-vision-client
Author: Ben
Description: This class holds all the data of a processstep.
*/
// Global includes
#include <QObject>
#include <QStringList>
#include <QColor>
//Local includes
#include "DataTypes/Parameters/allparametertypes.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.