text stringlengths 8 6.88M |
|---|
//算法:单调栈
/*
使栈中的信号塔按照高度降序排列
对于一个新的信号塔,
当他加入栈中时,会挡住之前比它低的塔的传播
即,会接受到比它低的塔的信号
所以将栈顶所有比它低的塔删除,
(因为他们已经不能再传播给其他塔信号了)
同时,新的塔接收到的能量 加上 删掉的塔传播的能量
对于原有的高度比它高的信号塔,
离此新的信号塔最近的,会接受到新的塔的信号
故,将此时栈顶的塔,即 离此新的信号塔最近的,高度比它高的塔
接收到的能量,加上新的塔传播的能量
再将此新的信号塔加入栈中
O(n)复杂度扫一遍后,将所有塔接收到的能量排序一下
输出最大值即可
*/
#include<cst... |
/*
* @lc app=leetcode.cn id=144 lang=cpp
*
* [144] 二叉树的前序遍历
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<in... |
/* ------------------------------------------------------------------
* Copyright (C) 1998-2009 PacketVideo
*
* 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.o... |
//
// Created by tonell_m on 21/01/17.
//
#ifndef GGJ17_POS_HH
#define GGJ17_POS_HH
class Pos
{
public:
int x;
int y;
public:
Pos(const int x = 0, const int y = 0);
Pos(Pos const &cpy);
~Pos();
Pos &operator=(Pos const &pos);
};
#endif //GGJ17_POS_HH
|
#include <bits/stdc++.h>
using namespace std;
void recursion(vector<int> A, vector<int> &res, int lo, int hi, int sum) {
if (lo > hi) {
res.push_back(sum);
return;
}
recursion(A, res, lo+1, hi, sum + A[lo]); //for the subset including A[lo]
recursion(A, res, lo+1, hi, sum); //for... |
#ifndef __LOADING_SCENE_H__
#define __LOADING_SCENE_H__
#include <cocos2d.h>
#include "ResourceLoader.h"
#include "SimpleAudioEngine.h"
#include "WelcomeScene.h"
using namespace cocos2d;
using namespace CocosDenshion;
class LoadingScene :public Scene
{
public:
LoadingScene();
~LoadingScene();
virtua... |
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ncurses.h>
#include <string>
using namespace std;
bool checkArithPro(int itest) {
int a, b, c;
bool result;
result = true;
for (int j = 0; j < itest; j++) {
if (j == 0) {
sc... |
/*
A program that takes a text file of city names and temperatures, converts
the temperatures from F to C, and rewrites the city names and temperatures
to a separate file
*/
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include "CityDetails.h"
#include "Driver.h"
void Driver::ReadInp... |
//
// main.cpp
// POJ1678 I Love this Game!
//
// Created by Netiger on 1/19/15.
// Copyright (c) 2015 Netiger. All rights reserved.
//
#include <stdio.h>
#include <algorithm>
#define inf 1e9
int n, a, b;
int ary[10001];
//the number of maximum difference after m picks for the first player
int dp[10001];
int ... |
#ifndef __LINKEDLIST_H
#define __LINKEDLIST_H
#include <cstdlib>
/* This class just holds a single data item. */
class Node {
public:
int data;
Node* next;
};
/* This is the generic List class */
class LinkedList
{
public:
Node *head;
// Constructor
LinkedList();
// Copy Constructor
Lin... |
#ifndef CREDIT_H
#define CREDIT_H
#include "Customer.h"
#include "Account.h"
//Initialize the class, functions and variables
//Inherited from Account class
class Credit:public Account
{
public:
Credit();
Credit(string a_id, double a_bal, double lim, string a_date, Customer &a_cus);
void set... |
#include <cstdlib>
#include <cstdio>
#include <pcl/common/eigen.h>
#include <pcl/common/transforms.h>
#include <pcl/filters/filter.h>
#include <algorithm>
#include <loam_velodyne/common.h>
#include <loam_velodyne/build_transform.h>
using namespace std;
using namespace pcl;
Eigen::Affine3f vecToTransform(const vect... |
#pragma once
namespace texture
{
class DXTexture;
struct Material;
}
namespace q3shader
{
class Q3Shader;
}
namespace render
{
class VertexBuffer;
class IndexBuffer;
class RenderGroup
{
public:
RenderGroup();
~RenderGroup();
void acquire();
void release();
void update(void* vertexdata, void* inde... |
// Created on: 2015-11-23
// Created by: Anastasia BORISOVA
// Copyright (c) 2015 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... |
#include<bits/stdc++.h>
using namespace std;
int partition(int arr[],int first,int last)
{
int pivot=arr[last];
int i=first-1;
for(int j=first;j<=last-1;j++)
{
if(arr[j]<pivot)
{
i++;
swap(arr[i],arr[j]);
}
}
swap(arr[i+1],arr[last]);
... |
/*********************************************************************
*
* Software License Agreement (BSD License)
*
* Copyright (c) 2014, P.A.N.D.O.R.A. Team.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the follo... |
/*
* Copyright (c) 2011 Pierre-Etienne Bougué <pe.bougue(a)gmail.com>
* Copyright (c) 2011 Florian Colin <florian.colin28(a)gmail.com>
* Copyright (c) 2011 Kamal Fadlaoui <kamal.fadlaoui(a)gmail.com>
* Copyright (c) 2011 Quentin Lequy <quentin.lequy(a)gmail.com>
* Copyright (c) 2011 Guillaume Pinot <guillaume.pino... |
#pragma once
#include "State.hpp"
#include <algorithm>
#include <cstdio>
#include <map>
#include <set>
namespace SVParser {
class FiniteStateMachine : protected std::map< int, State* > {
typedef std::map< int, State* > _Base;
public:
using _Base::operator[];
using _Base::size;
using _Base::begin;
... |
//[1015]RE(実行時エラー)はSEGVを疑う
#include <iostream>
#include <vector>
#include <string>
using namespace std;
#define abs(x) (x > 0 ? x : -x)
#define max(x, y) (x > y ? x : y)
typedef pair<int, int> P;
vector<P> pnt;
long IntPow(int a, int n)
{
int num = 1;
for (int i = 0; i < n; i++)
{
num *= a;
}
... |
// Здесь будет представленна реализация класса "Социальная сеть" и всех необходимых методов.
#include "SocNetwork.h"
SocNetwork::SocNetwork()
{
}
SocNetwork::~SocNetwork()
{
}
//Здесь будет реализован функционал добавления группы в соц.сети с использованием
// однонаправленного списка с заголовком.
void SocNetwor... |
#include "EdushiPipeline.h"
#include "RenderTarget.h"
#include "SceneManager.h"
#include "engine_struct.h"
#include "ResourceManager.h"
#include "pass.h"
#include "RenderSystem.h"
#include "TextureManager.h"
#include "EngineUtil.h"
#include "EGLRenderTarget.h"
#include "EGLUtil.h"
#include "Camera.h"
void EdushiPipeli... |
#pragma once
#include <iostream>
#include "LinearSearch.h"
using namespace std;
int main()
{
int size = 10;
int a[10] = { 10, 9, 3, 6, 7, 2, 1, 5, 4, 8 };
int searchValue = 6;
cout << linearSearch(a, searchValue, size) << endl << endl;
system("pause");
return 0;
}
|
//
// Created by jan on 08.10.20.
//
#include <cstdlib>
#include <iostream>
#include "ConsoleManager.h"
ComplexNumber* ConsoleManager::getUserInput() {
auto* result = (ComplexNumber*)malloc(sizeof(ComplexNumber) * 2);
for (int i = 0; i < 2; i++) {
double real;
double imaginar;
std::co... |
#pragma once
#include <vector>
class Neuron
{
public:
Neuron(std::vector<float> dna, unsigned int inputCount);
float getOutput();
void compute(std::vector<float> inputValues);
void resetOutput();
private:
void setCoefficients(std::vector<float> dna);
std::vector<float> coefficients;
float ... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
#include <iostream>
using namespace std;
int find_k(int *tree, int m, int n_max) {
int x = 1;
while (2 * x < n_max) {
if (tree[x * 2] >= m) {
x *= 2;
} else {
m -= tree[x * 2];
x = x * 2 + 1;
}
}
if (tree[x] == 2)
return tree[2 * x + m - 1];
else if (tree[2 ... |
/*
Copyright 2021 University of Manchester
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 applicable law or agreed to in writing, s... |
#include <ros/ros.h>
#include "GraspObjectExecutor.h"
int main(int argc, char* argv[])
{
ros::init(argc, argv, "object_pickup_executor");
return GraspObjectExecutor().run();
}
|
#include "particle_system.h"
ParticleSystem::ParticleSystem(size_t size) {
pool_ = new PoolAllocator<Particle>(size);
}
ParticleSystem::~ParticleSystem() {
delete pool_;
}
void ParticleSystem::Update(float dt) {
for (Particle* particle : particles_) {
particle->lifetime -= dt;
particle->active = (particle->li... |
#ifndef MOVING_OBJECTS_TRACKER_H_
#define MOVING_OBJECTS_TRACKER_H_
#include <dynamic_reconfigure/server.h>
#include <kkl/alg/data_association.hpp>
#include <moving_object_msgs/MovingObjectArray.h>
#include <moving_object_tracker/MovingObjectsTrackerConfig.h>
#include <ros/ros.h>
#include <tf2_ros/transform_listener.h... |
#pragma once
#include <SFML\Graphics.hpp>
class GameObject
{
public:
GameObject(sf::Texture& texture);
~GameObject();
virtual void update(sf::Time deltaTime) = 0;
void draw(sf::RenderWindow& win);
protected:
void move(float x, float y);
void setPosition(float x, float y);
sf::Vector2f getPosition();
private:... |
#include "Display.h"
/*
This function computes the logic space to viewport space transformation.
This is uniformly done, so resizing the window, will not stretch to fit
the window. We want that the image be the same on every display, as movies
are. This function is from Laborator 3.
*/
glm::mat3 Display:... |
#include <string>
#include <cmath>
#include <fstream>
#include <iostream>
#include <sstream>
#include <list>
#include <algorithm>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <numeric>
#include <bitset>
#include <deque>
//#include <random>
#include <string.h>
#include <stdlib.h>
#include <ve... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int Z,I,M,L;
int f(int x)
{
return (Z*x + I)%M;
}
int floydCycleFinding(int x0)
{
int tortoise = f(x0), hare = f(f(x0));
while (tortoise != hare)
{
tortoise = f(tortoise);
hare = f(f(hare));
}
int mu = 0;
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2009 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef VEGAGLSHADER_H
#define VEGAGLSHADER_H
#ifdef VEGA_BAC... |
#pragma once
class BonusStationsPerMode;
class Qso;
class BonusStationsPerBandPerMode
{
public:
BonusStationsPerBandPerMode();
~BonusStationsPerBandPerMode();
// Calculate the bonus points for the given bonus station callsign
int CalculateBonusPoints(const string& bonusStation, const int bonusStationPoints, vect... |
//
// Created by abel_ on 16-07-2022.
//
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+10;
int parent[N];
int size[N];
// swap using xor
void swap(int &a, int &b){
a ^= b;
b ^= a;
a ^= b;
}
void make(int v){
parent[v] = v;
size[v] = 1;
}
int find(int v){
if(parent[v] == v)... |
#include "GameCmd.h"
#include "CDLReactor.h"
#include "Despatch.h"
#include "MoneyConnect.h"
#include "Logger.h"
#include "Configure.h"
static std::map<int, MoneyNodes*> _nodes_map;
static InputPacket pPacket;
//=================ConnectHandler=========================
ConnectHandler::ConnectHandler( Connector* connect... |
// Created on: 1993-07-27
// Created by: Christian CAILLET
// 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 ... |
/*
* Copyright (c) 2016-2020 Morwenn
* SPDX-License-Identifier: MIT
*/
#include <algorithm>
#include <functional>
#include <iterator>
#include <vector>
#include <catch2/catch.hpp>
#include <cpp-sort/sorters/std_sorter.h>
#include <testing-tools/algorithm.h>
#include <testing-tools/distributions.h>
#include <testing-... |
/*********************************************************\
* 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 "primitive.h"
class Sphere : public Primitive {
public:
void createSphere();
Sphere();
~Sphere();
}; |
#ifndef PROCESS_H
#define PROCESS_H
#include <QObject>
#include <QGraphicsRectItem>
#include <QGraphicsTextItem>
#include <QBrush>
#include <QMouseEvent>
#include <QGraphicsSceneMouseEvent>
#include <QTimer>
class Process : public QObject, public QGraphicsRectItem
{
Q_OBJECT
public:
explicit ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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.
*
* @author Arjan van Leeuwen (arjanl)
*/
#ifndef DESKTOP_OP_WINDO... |
#include "ArrayItem.h"
#include "generalArray.h"
void test_array(int array_size, basic_item* ref_item, bool order)
{
basic_sort_criteria srt_crt(order);
general_array test_array;
char data_entry_method='r';
// attach the "integer item" as referecen item
test_array.attachRefrenceItem(ref_item);
// now allocate t... |
#include <cstdio>
#include <vector>
void swap(int* a, int* b) {
int t = *a;
*a = *b;
*b = t;
}
void quickSort(int left,int right, int* data) {
int pivot = left;
int j = pivot;
int i = left+1;
if (left < right) {
for (; i <= right; i++) {
if (data[i] < data[pivot]) {
j++;
swap(&data[j], &data[i]);... |
#include <ESP8266WiFi.h>
#include <RF24Network.h>
#include <RF24.h>
#include <SPI.h>
#define led1 D1
#define led2 10
RF24 radio(D2, D8); // nRF24L01 (CE,CSN)
RF24Network network(radio); // Include the radio in the network
const uint16_t this_node = 00; // Address of this node in Octal format ( 04,... |
#include <cstddef>
#include "simpleCharManager.h"
simpleCharManager::simpleCharManager(){
for (int i = 0; i < BUF_SIZE; i++) {
buffer[i] = '\0';
}
free_place = buffer;
}
simpleCharManager::~simpleCharManager(){}
char* simpleCharManager::alloc_chars(int n){
char* temp;
temp = free_place;
if... |
#include "signal.hpp"
#include <utils/binary_functions/math.hpp>
#include <cstdlib>
#include <numeric>
Signal::Signal(double Te, std::size_t N): std::vector<double>(N), m_te(Te)
{}
Signal::Signal(double Te, std::size_t N, double value): std::vector<double>(N, value), m_te(Te)
{}
double Signal::mean() const
{
r... |
#include "../world/block.hpp"
#include "block_templates.cpp"
class BlockGrass : public Block
{
public:
BlockGrass(){
}
virtual bool IsTransparent() override{
return false;
}
GameObject3D GetMesh(int FaceFlags) override
{
GameObject3D gameObject{
BLOCK_STANDARD_VERT... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2006 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
/**
* @author Daniel Bratell
*/
#ifndef _VALIDATION_ERROR_WIN... |
EXTRA_OECONF += " --with-edje-cc=${STAGING_BINDIR_NATIVE}/edje_cc "
|
/*
Author: Visar Shehu
Email: v.shehu@seeu.edu.mk
File created: 19.10.2016
Last revision: 19.10.2016
*/
#include <iostream>
#include <string>
using namespace std;
struct Employee
{
int id;
int workedHours;
float payHour;
float Salary()
{
return workedHours * payHour;
}
void PrintInformation()
{
cout << "... |
#include "common_use.h"
/*
* Determine whether an integer is a palindrome. Do this without extra space.
*/
//不断的比较未访问的最后一位和第一位
bool is_palindrome(int x)
{
if (x < 0) return false;
int d = 1;
//记位数
while (x / d >= 10)d *= 10;
while (x > 0)
{
int front = x / d;
int back = x % 10;
if (front not_eq back)re... |
//
// Created by 钟奇龙 on 2019-05-07.
//
#include <iostream>
#include <vector>
using namespace std;
bool isValid(vector<int> mark,int curRow,int curCol){
for(int k=0; k<curRow; ++k){
if(mark[k] == curCol || abs(curRow-k) == abs(mark[k]-curCol)){
return false;
}
}
return true;
}
int... |
#include "../headers/ClassNode.hpp"
#include "../headers/FieldNode.hpp"
#include "../headers/AstNode.hpp"
#include <string>
#include <sstream>
#include <tuple>
#include <algorithm>
#include <vector>
#include <set>
#include <stdio.h>
using namespace std;
ClassNode::ClassNode() {
test->addFunction();
this->ance... |
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/MerchantsListPage.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.UX.Template.h>
namespace g{namespace Fuse{namespace Reactive{struct EventBinding;}}}
namespace g{namespace Uno{namespace UX{str... |
#ifndef _UpdateMemberProc_H
#define _UpdateMemberProc_H
#include "CDLSocketHandler.h"
#include "IProcess.h"
class UpdateMemberProc :public IProcess
{
public:
UpdateMemberProc();
virtual ~UpdateMemberProc();
virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket, Context* pt ) ;
vi... |
/** Kabuki SDK
@file /.../Source/Kabuki_SDK-Impl/_G/Font.h
@author Cale McCollough
@copyright Copyright 2016 Cale McCollough ©
@license Read accompanying /.../README.md or online at http://www.boost.org/LICENSE_1_0.txt
*/
#pragma once
#include <stdint.h>
#include <string>
using namespac... |
#include <iostream>
#include <vector>
#include <sstream>
int main() {
std::cout << "Enter equation : ";
std::string equation;
getline(std::cin, equation);
std::stringstream ss(equation);
std::vector<std::string> equationParts;
std::string part;
while (getline(ss, part, ' ')) {
equ... |
/* -*- Mode: c++; tab-width: 4; 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.
*
* @author Patricia Aas (psmaas)
*/
#include "core/pch.h"
#include "platforms/viewix/... |
/* -*- 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.
*
* @author Alexander Remen (alexr)
*/
#include "core/pch.h"
#inc... |
/*
* Copyright (C) 2017 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: kirigaya <kirigaya@mkacg.com>
* 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 3 of the License, or... |
/****************************************************************************
** Copyright (C) 2017 Olaf Japp
**
** This file is part of FlatSiteBuilder.
**
** FlatSiteBuilder 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 S... |
#include "StdAfx.h"
#include "LogManager.h"
#include <iostream>
#include <fstream>
#include <string>
#include <Windows.h>
#include <iomanip>
using namespace std;
LogManager::LogManager(void)
{
}
LogManager::~LogManager(void)
{
}
LogManager* LogManager::getInstance(void)
{
static LogManager instance;
return &inst... |
#ifndef PRINT_H
#define PRINT_H
#include<complex>
#include<iostream>
#include<string>
#include<vector>
#include<sstream>
#include<cctype>
#include"stdio.h"
#include"stdlib.h"
#include<fstream>
#include<cmath>
#include<cstring>
using namespace std;
int print(vector<vector<double> >&);
int printcomplexvector(vector<compl... |
#pragma once
#include "Display.h"
#include "Camera.h"
#include "Paddle.h"
#include "Ball.h"
#include "Wall.h"
#include "BrickManager.h"
#include "Brick.h"
#include <Component/SimpleScene.h>
#include <Core/Engine.h>
/*
This class represents the main scene drawn on the screen. It instatiates
all the ob... |
/**
******************************************************************************
* Copyright (c) 2019 - ~, SCUT-RobotLab Development Team
* @file Indicator.cpp
* @author Lingzi_Xie 1357657340@qq.com
* @brief State Indicaotr in Robomaster 2019
* @date 2021-04-30
* @version 1.0
* @par Change Lo... |
//
// c_board.cpp
// unblockme_solver
//
// Created by Alexander G Anderson on 12/16/13.
// Copyright (c) 2013 Alexander G Anderson. All rights reserved.
//
#include "c_board.h"
CBoard::CBoard() {
std::vector<loc> bl_h;
std::vector<loc> bl_v;
}
void CBoard::add_bl_h(int i, int j, int size) {
bl_h.pus... |
/*
Copyright 2021 University of Manchester
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 applicable law or agreed to in writing, s... |
#include "..\include\AppContext.h"
int AppContext::lineType(string line)
{
trim(line);
int type = 0;
if (line.empty() || line.at(0) == '#')
{
type = -1;
}
else if (line == "[symbol-list]")
{
type = 1;
cout << "\n>> <解析符号列表>" << endl;
}
else if (line == "[prod... |
#pragma once
#ifndef __ZIPHELPER_H_
#define __ZIPHELPER_H_
#include "CommonHelper.h"
#include <zip.h>
#include <unzip.h>
namespace PPSHUAI{
BOOL CompressZipFile(LPCTSTR lpCompressFileName, LPCTSTR lpCompressFilePath, LPSTR lpPassword = (""), LPTSTR lpResult = NULL, DWORD dwLength = MAXBYTE)
{
BOOL ... |
/*
Copyright (c) 2014 Mutantspider authors, see AUTHORS file.
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 without limitation the rights
to use, copy, modif... |
#pragma once
class EStage
{
};
|
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
string hizuke;
cin >> hizuke;
int heiseiflag = 0;
if (stoi(hizuke.substr(0, 4)) <= 2019){
if (stoi(hizuke.substr(5, 7)) <= 4){
if (stoi(hizuke.substr(8, 10)) <= 30){
heiseiflag++;
... |
#include "header.h"
#include "streams/streams.h"
#include "exceptions.h"
using namespace NAMESPACE_BINTABLE;
BinTableColumnDefinition::BinTableColumnDefinition(InputStream &stream)
{
stream.read_primitive_endian_aware(type);
validate_datatype(type);
name = new BinTableString(stream);
if (has_maxlen()... |
#include "MP3Lib.h"
#include "DynArray.h"
int main() {
Liedverwaltung liedverwaltung1;
char answer;
while(answer != 48){
cout << "************ Musikbibliothek Verion 0.1 **************\n"
<< "Hauptmenu:\n"
<< "1. (N)euen Eintrag anlegen\n"
<< "2. (D)etails eines Eintrags an... |
//
// Created by 钟奇龙 on 2019-05-16.
//
#include <iostream>
#include <vector>
using namespace std;
class Node{
public:
int value;
int arrNum;
int index;
Node(int value, int arrNum, int index):value(value),arrNum(arrNum),index(index){
}
};
/*
* 堆尾插入并向上调整
*/
void heapInsert(vector<Node*> &heap,int... |
#include <demo-data.hpp>
#ifdef CAPTURE
#include <limits>
float audioGetDuration()
{
return std::numeric_limits<float>::infinity();
}
#else
#define WIN32_LEAN_AND_MEAN
#define WIN32_EXTRA_LEAN
#include <windows.h>
static LARGE_INTEGER frequency;
static LARGE_INTEGER startTime;
void audioStart()
{
QueryPerforma... |
/****************************************************************************
** Copyright (C) 2017 Olaf Japp
**
** This file is part of FlatSiteBuilder.
**
** FlatSiteBuilder 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 S... |
#ifndef __TMODEL_H
#define __TMODEL_H
#include "dbFieldType.h"
#include "field_data.h"
#include "db_rec.h"
namespace wh{
//----------------------------------------------------------------------------
enum ModelState
{
msNull = 0,
msCreated, //NEW созданная(новая) модель
msExist, //модель, данные которой синхрониз... |
#include<iostream>
class base1{
int b1;
};
class base2{
int b2;
};
class derived:public base1,base2{};
int main(){std::cout<<"successful\n"; return 0;} |
#ifndef HcalAlgo_DDHCalTestBeamAlgo_h
#define HcalAlgo_DDHCalTestBeamAlgo_h
#include <map>
#include <string>
#include <vector>
#include "DetectorDescription/Core/interface/DDTypes.h"
#include "DetectorDescription/Core/interface/DDAlgorithm.h"
class DDHCalTestBeamAlgo : public DDAlgorithm {
public:
//Constructor and... |
#ifndef DIALOGADD_H
#define DIALOGADD_H
#include <QDialog>
#include <QDebug>
#include <QFile>
#include <QMessageBox>
#include "dbconnector.h"
namespace Ui {
class DialogAdd;
}
class DialogAdd : public QDialog
{
Q_OBJECT
public:
explicit DialogAdd(QWidget *parent = nullptr);
~DialogAdd();
void setPa... |
/** InsanePixels ************************************************************************************/
/* */
/* SOLUTION: InsaneWare */
/* PROJECT: Runtime */
/* FOLDER: Core/Windows */
/* FILE: InpixWindowsWindow.h */
/* AUT... |
#ifndef VERSION_H
#define VERSION_H
// Qt
#include <Qt>
#include <QString>
namespace RsaToolbox {
class Version
{
public:
Version();
Version(const QString &version);
~Version();
uint major() const;
void setMajor(uint number);
uint minor() const;
void setMinor(uint number);
uint b... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* 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.
*
* Espen Sand
*/
#include "core/pch.h"
#include "adjunct/q... |
#ifndef LIGHTIMAGE_TYPES_H
#define LIGHTIMAGE_TYPES_H
namespace li
{
typedef unsigned char LI_U8;
typedef unsigned short LI_U16;
typedef unsigned int LI_U32;
typedef unsigned long LI_U64;
typedef signed char LI_S8;
typedef signed short LI_S16;
typedef signed int LI_S32;... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*
* Copyright (C) 2003-2007 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
*/
#ifndef __X11_OPSYSTEMINFO_H__
#defi... |
#include <iberbar/Font/Types.h>
#include <iberbar/Font/TextAdjust.h>
#include <iberbar/Utility/Math.h>
namespace iberbar
{
// // 用户需要自己写这些类和函数的内容
// class CxFontChBitmap;
// int XFontGetChWidth( CxFont* pFont );
// int XFontChBitmapGetCharWidth( CxFontChBitmap* pChBitmap );
// int XFontChBitmapGetBmpWidth( ... |
/*****************************************************************************************************************
* File Name : FASTINPUTOUTPUT.h
* File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\sites\codechef\easy\FASTINPUTOUTPUT.h
* Created on : Jan 20, 2014 :: 12:37:08 PM
* Author ... |
/* -*- coding: utf-8 -*-
!@time: 2019-12-18 01:01
!@author: superMC @email: 18758266469@163.com
!@fileName: 0017_subStructure_of_tree.cpp
*/
#include <selfFun.h>
class Solution {
private:
bool isChild(TreeNode *A, TreeNode *B) {
if (!A && B) return false;
if (!B) return true;
if (A... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2007 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* @author Manuela Hutter
*/
#ifndef WIDGET_STATE_H
#define WIDGE... |
// Created on: 1993-01-09
// Created by: CKY / Contract Toubro-Larsen ( Kiran )
// 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... |
//
// Created by silvman on 3/1/19.
//
#include "Server.h"
eeskorka::server::server() : sd(0) {
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
serv_addr.sin_port = htons(config.port);
}
eeskorka::server::~server() {
if (sd > 0) {
close(sd);
}
}
void eeskor... |
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int matrixElementsSum(std::vector<std::vector<int>> matrix) {
int cost = 0;
for (int i = 0; i < matrix[0].size(); i++)
{
for (int j = 0; j < matrix.size(); j++)
{
if (matrix[j][i] == 0)
break;
else
cost += matrix[j][i];... |
DoublyLinkedListNode* reverse(DoublyLinkedListNode* head) {
DoublyLinkedListNode *prev = NULL , *temp;
while(head!=NULL)
{
temp= head->next ;
head->next = prev ;
head->prev = temp ;
prev = head ;
head=temp;
}
... |
#include <iostream>
#include "Game.h"
int main() {
Game game;
game.draw();
//メインループ
while (true) {
if (game.isClear())
break;
game.getInput();
game.update();
game.draw();
}
std::cout << "Congratulation's! you won." << std::endl;
char tmp;
std::cin >> tmp;
return 0;
} |
#include<iostream>
using namespace std;
struct Node
{
int data;
struct Node *next;
struct Node *prev;
};
struct Node *head=NULL;
void insert(int data)
{
if(head==NULL)
{
struct Node *new_node = (struct Node *)malloc(sizeof(struct Node));
new_node->data=data;
new_node->next=NULL;
new_node->pre... |
/* max frequent weight on the path u -> v */
/* alternate solution: Find the median value of the path and then get the frequency of the median */
#include <bits/stdc++.h>
using namespace std ;
const int N = (int)1e5 + 5;
int L[20 * N], R[20 * N], T[20 * N], root[N], a[N], idx, n, m ;
int dep[N], par[N][18] ;
vecto... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.