text stringlengths 8 6.88M |
|---|
#include<bits/stdc++.h>
using namespace std;
int main()
{
int testCases;
cout << "Enter Test Cases: ";
cin >> testCases;
while(testCases--)
{
stack<int> s;
int last;
unsigned long long int num;
cout << "Enter number: ";
cin >> num;
... |
#include "../include/colour.h"
#include <math.h>
RGBColor hsv2rgb(float H, float S, float V) {
float r, g, b;
float h = H / 360;
float s = S / 100;
float v = V / 100;
int i = floor(h * 6);
float f = h * 6 - i;
float p = v * (1 - s);
float q = v * (1 - f * s);
float t = v * (1 - (1 - f) * s);
switch (i %... |
#include "error.hh"
#include <execinfo.h>
#include <cxxabi.h>
#include <sstream>
#include <memory>
#include <stdlib.h>
namespace ten {
saved_backtrace::saved_backtrace() {
size = backtrace(array, 50);
}
std::string saved_backtrace::str() {
std::stringstream ss;
std::unique_ptr<char *, void (*)(void*)> m... |
/**
* @file TcpClient.cpp
* @author dtuchscherer <daniel.tuchscherer@hs-heilbronn.de>
* @brief TCP client implementation
* @details For connecting to and disconnecting from TCP servers.
* @version 1.0
* @copyright Copyright (c) 2015, dtuchscherer.
* All rights reserved.
*
* ... |
/* -*- coding: utf-8 -*-
!@time: 2019-12-27 14:13
!@author: superMC @email: 18758266469@163.com
!@fileName: 0028_number_that_appears_more_than_half_of_the_array.cpp
*/
#include <environment.h>
class Solution {
typedef unordered_map<int, int> uMap;
public:
int MoreThanHalfNum_Solution(const vector<int> ... |
/**
* @file sensor_distress.cc
*
* @copyright 2017 3081 Staff, All rights reserved.
*
* @author Zijing Mo <zijingmo888@gmail.com>
*/
/*******************************************************************************
* Includes
******************************************************************************/
#inclu... |
#ifndef HASHTABLE_HPP
#define HASHTABLE_HPP
#include "list.hpp"
class HashTable
{
public:
HashTable();
~HashTable();
void add(const std::string key, const std::string value);
bool get(std::string key, std::string& value);
bool remove(std::string key, std::string& value);
private:
int size;
... |
#include<iostream>
#include<stdio.h>
#include<bits/stdc++.h>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<map>
#include<queue>
#include<set>
#include<list>
#include<unordered_map>
#include<unordered_set>
#define ll long long
#define MAX 100000003
#define MAX_RLEN 50
#... |
// Copyright (c) 2018, tlblanc <tlblanc1490 at gmail dot com>
#ifndef IO_MEMIO_H_
#define IO_MEMIO_H_
#include <arpa/inet.h>
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
extern inline const uint8_t *readmem(const uint8_t *mem,
... |
#pragma once
#include "GcMediateObject.h"
class GcToolBarDockable : public CDockablePane, public GcMediateObject
{
DECLARE_DYNAMIC(GcToolBarDockable)
public:
class ToolBar : public CMFCToolBar
{
public:
virtual void OnUpdateCmdUI(CFrameWnd* /*pTarget*/, BOOL bDisableIfNoHndler)
{
CMFCToolBar::OnUpdateCmdUI... |
#pragma once
#include "../gl_command.h"
#include "../gl_strings.h"
namespace glmock
{
//
// http://www.opengl.org/sdk/docs/man3/xhtml/glBindTexture.xml
class GLBindTexture : public GLCommand
{
public:
GLBindTexture(GLenum target, GLuint texture);
virtual ~GLBindTexture();
static const char* EnumToString(G... |
#include "SoftwareI2C.h"
SoftwareI2C softwarei2c;
void setup()
{
Serial.begin(115200);
softwarei2c.begin(3, 2); // sda, scl
}
void loop()
{
softwarei2c.beginTransmission(5);
softwarei2c.write('H');
softwarei2c.endTransmission();
}
|
/* -*- 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.
*/
#ifndef XSLT_COMPILER_H
#define XSLT_COMPILER_H
#ifdef XSLT_SUPPORT
#in... |
#include<bits/stdc++.h>
using namespace std;
main()
{
int n;
while(cin>>n)
{
int as[n][n], i, j;
for(i=1; i<=n; i++)
{
for(j=1; j<=n; j++)
{
if(i==1)as[i][j]=1;
else if(i>1 && j==1)as[i][j]=1;
else
... |
#include"ClassDate.h"
//调整日期(加法调整)
Date& Date::AdjustDateAdd(Date& d)
{
//无需调整的情况
if (d._day <= 28 || (d._month != 2 && d._day <= 30) || (((d._month != 2) && ((d._month != 4) || (d._month != 6) || (d._month != 9) || (d._month != 11))&&d._day<=31)))
return d;
//需要调整的情况
while (!(d._day <= 28 || (d._month != 2 && ... |
//
// Activity_video_games.hpp
// projekt_programowanie_obiektowe
//
// Created by Phillip on 11/06/2018.
// Copyright © 2018 Phillip. All rights reserved.
//
#ifndef Activity_video_games_h
#define Activity_video_games_h
#include "Activity.hpp"
class Activity_video_games : public Activity {
public:
void start... |
#ifndef __WPP__QT__QUICK_VIEW_H__
#define __WPP__QT__QUICK_VIEW_H__
#include <QQuickView>
#include <QGuiApplication>
namespace wpp {
namespace qt {
class QQuickView : public ::QQuickView
{
protected:
QGuiApplication *app;
public:
explicit QQuickView(QGuiApplication *app, QWindow *parent = 0)
: ::QQuickView(pare... |
#pragma once
#include "CoreMinimal.h"
#include "Components/InputComponent.h"
#include "GameFramework/Pawn.h"
#include "Tank.generated.h"
UCLASS()
class TANKBATTLE_API ATank : public APawn
{
GENERATED_BODY()
public:
ATank();
protected:
virtual void BeginPlay() override;
public:
virtual void Tick(float DeltaTi... |
#include <iostream>
#include <math.h>
bool isPrime(int num) {
for(int i = 2; i <= sqrt(num); ++i){
if(num % i == 0) {
return false;
}
}
return true;
}
int inputNumber() {
int num = 0;
std :: cout << "Input number to find prime divisors : ";
std :: cin >> num;
wh... |
//
// FitnessFunction.cpp
// GA
//
// Created by Tom den Ottelander on 19/11/2019.
// Copyright © 2019 Tom den Ottelander. All rights reserved.
//
#include "FitnessFunction.hpp"
using namespace std;
using namespace nlohmann;
extern bool storeAbsoluteConvergence;
extern bool storeUniqueConvergence;
extern bool pr... |
class woodfence_foundation_kit: CA_Magazine
{
scope = 2;
count = 1;
type = 256;
displayName = $STR_BLD_name_WoodenFence_1_foundation;
descriptionShort = $STR_BLD_name_WoodenFence_1_foundation;
model = "\z\addons\dayz_epoch\models\supply_crate.p3d";
picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.... |
#include "State.h"
Transition* State::getTriggeredTransition(Agent* gameObject)
{
for (auto transition : m_transitions)
{
if (transition->hasTriggered(gameObject))
{
return transition;
}
}
return nullptr;
} |
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "QGSP_BERT.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
#ifdef G4UI_USE_TCSH
#include "G4UItcsh.hh"
#endif
#ifdef G4VIS_USE
#include "G4VisExecutive.hh"
#endif
#include "H_DetectorConstruction.h"
#include "H_Pr... |
#include "scene_lights.h"
SceneLights::SceneLights(State& state):
mState(&state),
mUniformBufferInfo(state.device),
mSphere(state),
ubo(nullptr)
{
descriptors = {};
}
SceneLights::~SceneLights()
{
if (ubo) {
vkUnmapMemory(mState->device, mUniformBufferInfo.memory);
ubo = nullptr;
}
}
void SceneLights::in... |
/* multiplicacion de matriz de 3x3 con vector
por Jorge Luis Mancera A1 PI LAD*/
#include <iostream>
using namespace std;
int main () {
float a[1][3], b[3][3], c[1][3];
int i=0, k=0, l=0 ;
for (int j=0;j<3;j++){
cout<<"Ingrese el elemento "<< i <<","<< j <<" del vector: ";
cin>>... |
//
// www.blinkenlight.net
//
// Copyright 2016 Udo Klein
//
// 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
// (at your option) any later version.
/... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#define INF 1000000000
#define REP(i,n) for(int i=0; i<n; i++)
#define REP_R(i,n,m) for(int i=m; i<n; i++)
#define MAX 50
using namespace std;
in... |
#include <cassert>
#include "PaletteRecords.h"
#include <fstream>
#include "StreamUtilities.h"
using namespace std;
using namespace OpenFlight;
namespace
{
const int kNumberOfColorEntries = 1024;
}
//-------------------------------------------------------------------------
//--- ColorPalette
//-----------------... |
//
// Created by Алексей Ячменьков on 04.11.2020.
//
#include "Variable.h"
double Symbol_table::get_value (string s)
{
for (int i = 0; i < var_table.size(); ++i)
if (var_table[i].name == s)
return var_table[i].value;
error("ERROR: get: undefined name ", s);
}
void Symbol_table::print_values(... |
#ifndef KOSARAJU_H
#define KOSARAJU_H
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
class KosarajuSCC {
protected:
int nb_nodes; // No. of vertices
std::vector<std::vector<int> > outgoing; // node-> outgoing edges
std::vector<std::vector... |
// Выведите значение наименьшего из всех положительных элементов в массиве. Известно, что в массиве есть хотя бы один положительный элемент.
// Формат входных данных
// В первой строке вводится количество элементов в массиве. Во второй строке вводятся элементы массива.
// Формат выходных данных
// Выведите ответ на з... |
// Copyright Lionel Miele-Herndon 2020
#pragma once
#include "CoreMinimal.h"
#include "AIController.h"
#include "ShooterAIController.generated.h"
/**
*
*/
UCLASS()
class SHOOTERSTARTER_API AShooterAIController : public AAIController
{
GENERATED_BODY()
protected:
virtual void BeginPlay();
public:
virtual void... |
#include "video.h"
#include <Windows.h>
namespace img
{
Video::~Video()
{
vin.release();
vout.release();
}
void Video::read(std::string vid)
{
vin.open(vid);
if (!vin.isOpened())
{
std::cout << "could not open the video" << std::endl;
std::cin.get();
exit(1);
}
vout.open("videoout/outcpp.... |
// Created on: 2016-07-07
// Copyright (c) 2016 OPEN CASCADE SAS
// Created by: Oleg AGASHIN
//
// 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 publi... |
#include <Wire.h>
#include <WiFiNINA.h>
#include <WiFiUdp.h>
#include <OSCMessage.h>
#include <OSCBundle.h>
///////////////
// OSC STUFF //
///////////////
int status = WL_IDLE_STATUS;
#include "arduino_secrets.h"
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID; ... |
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
int n, a[maxn][maxn], f[maxn][maxn];
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i; j++)
scanf("%d", &a[i][j]);
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i; j++)
f[i][j] = a[i][j] + max(f... |
#ifndef _GetServerInfoProc_H
#define _GetServerInfoProc_H
#include "CDLSocketHandler.h"
#include "IProcess.h"
class GetServerInfoProc :public IProcess
{
public:
GetServerInfoProc();
virtual ~GetServerInfoProc();
virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket ,Context* pt) ;
... |
#include <arm.h>
#include <Arduino.h>
#include <constants.h>
#include <Servo.h>
/*
Arm.cpp contains all functions related to moving the arm including collection, dispensing, and other movement.
*/
//This is so you dont have to write constants:: every time you want to use it.
//Its not really good practice but its ok... |
/* -*- 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.
*
*/
#include "core/pch.h"
#include "modules/forms/src/formsubmit... |
/* vi: set et sw=4 ts=4 cino=t0,(0: */
/*
* Copyright (C) 2012 Alberto Mardegan <info@mardy.it>
*
* This file is part of minusphoto.
*
* minusphoto 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... |
#include <SeetyDog.h>
#include "ImGui/imgui.h"
//#include "Platform/OpenGL/OpenGLTriangleLayer.h"
#include "Breakout/BreakoutLayer.h"
class ExampleLayer : public SeetyDog::Layer
{
public:
ExampleLayer()
: Layer("Example")
{
}
void OnUpdate() override
{
//./if (SeetyDog::Input::IsKeyPressed(SD_KEY_TAB)) {
... |
#include "Deck56.hpp"
Deck56::Deck56() :Deck52(){
//{ As 2 3 4 5 6 7 8 9 10 Valet Cavalier Dame Roi } * { Coeur Carreaux Trèfle Pique }
const Card CavalierCoeur = Card (0,12);
const Card CavalierCarreaux = Card (1,12);
const Card CavalierTrefile = Card (2,12);
const Card CavalierPique = Card (3,12);
(*thi... |
#include "Utils.h"
int GetProcessByName(PCSTR name)
{
DWORD pid = 0;
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
PROCESSENTRY32 process;
ZeroMemory(&process, sizeof(process));
process.dwSize = sizeof(process);
if (Process32First(snapshot, &process))
{
do
{
if (std::string(process... |
#include <iostream>
#include <math.h>
#include <stdlib.h>
using namespace std;
typedef struct { // x and y coordinates of points (x or gra)
double x;
double y;
} point;
point gradient(point arrx) { // gradient vector arrx
point gra;
gra.x = 2 * arrx.y - 2 * arrx.x;
gra.y = 2 * arrx.x + 2 - 4 ... |
/**
* @file Configuration.cpp
* @brief 包含类Configuration的实现
*/
#include "configuration.h"
#include <QSettings>
Configuration *Configuration::instance_ = NULL;
QMutex Configuration::mutex_;
/**
* @brief 获取实例函数
* @param void
* @return Configuration指针
*/
Configuration *Configuration::GetInstance() {
if... |
//https://www.hackerrank.com/challenges/flipping-bits
//List of 32 bit signed ints.
//Flip all the bits, output the result.
//Convenient that C++ has an operator for that
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int count;
cin... |
/*
Copyright (c) 2014 Mircea Daniel Ispas
This file is part of "Push Game Engine" released under zlib license
For conditions of distribution and use, see copyright notice in Push.hpp
*/
#include "Core/Log.hpp"
#include "Core/TypeID.hpp"
#include "Core/Settings.hpp"
#include "Render/OpenGL.hpp"
#include "Render/RenderS... |
// MIT License
// Copyright (c) 2020 Marnix van den Berg <m.a.vdberg88@gmail.com>
// 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 ri... |
#ifndef TRANSACTIONCOMMANDS_HH
#define TRANSACTIONCOMMANDS_HH
#include "nctypes.hh"
#include "ConnectionAwareTransaction.hh"
namespace NC {
enum struct TransactionCommands {
commit,
rollback,
begin
};
template<TransactionCommands c>
struct TransactionCommand {
};
template<>
struct TransactionCommand<Tr... |
//
// Created on 09/01/19.
//
//
// Code translated to C++ from the original: https://www.cs.cmu.edu/afs/cs/project/spirit-1/www/#Download.
// The original code was adpated for recovery in https://www.ifi.uzh.ch/en/dbtg/Staff/wellenzohn/dasa.html
//
#include <iostream>
#include <cmath>
#include <numeric>
#include <a... |
/* -*- 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.
*/
#ifndef __URL_B23TREE_REL_REP_H__
#define __URL_B23TREE_REL_REP_... |
//Lab 2£ºHierarchical Object Motion Control System
#include "stdafx.h"
#include <assert.h>
#include <math.h>
#include <GL/glut.h>
//screen size
int g_screenWidth = 0;
int g_screenHeight = 0;
//points on Spline
static int points = 0; //index of points
static int number = 7; //number of points
static GLfloat t... |
//find the min rank of the number
// index of the number in the sorted array where
//all the permutation of the number in the array
#include<stdio.h>
#include<conio.h>
int Index(int*, int);
int Fact(int);
void main(){
int size;
int a[100];
scanf_s("%d", &size);
for (int i = 0; i < size; i++)
scanf_s("%d", &a... |
#include <arba/evnt/evnt.hpp>
#include <gtest/gtest.h>
#include <cstdlib>
class int_event
{
public:
int value;
};
TEST(event_box_tests, test_connection)
{
evnt::event_manager event_manager(1);
evnt::event_box event_box;
evnt::event_manager other_event_manager(1);
int value = 0;
other_event_ma... |
#pragma once
#include "Vector2.h"
#include "object\Player.h"
#include "object\Enemy.h"
class Func {
static Player player;
public:
void SetPlayer(Player playerIn);
static void DrawRotaGraphFWithRate(float x, float y, double exRate, double angle, int handle, int trans);
static Vector2 GetVectorWithLength(float vecX... |
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
using namespace std;
#define LL long long
typedef pair<int,int> pii;
const int inf = 0x3f3f3f3f;
const int MOD = 998244353;
const int N = 1e5+10;
const int maxx ... |
/*
** EPITECH PROJECT, 2019
** OOP_indie_studio_2018
** File description:
** Game
*/
#ifndef GAME_HPP_
#define GAME_HPP_
#include "Menu.hpp"
#include "Core.hpp"
#include "Character.hpp"
#include "Assets.hpp"
#include "Map.hpp"
#include "Event.hpp"
#include "Sounds.hpp"
#include <memory>
#include <iostream>
#include <... |
// Created on: 1996-08-09
// Created by: Herve LOUESSARD
// Copyright (c) 1996-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GN... |
#ifndef LED13_H;
#define LED13_H;
#include <Arduino.h>
class LED13 {
private:
byte pin;
public:
LED13(byte pin);
void on();
void off();
void blink(int time);
};
#endif
|
#ifndef DTPUERTO_H
#define DTPUERTO_H
#include "DtFecha.h"
#include <iostream>
using namespace std;
class DtPuerto {
private:
string id;
string nombre;
DtFecha fechaCreacion;
int cantArribos;
public:
DtPuerto();
DtPuerto(string id, string nombre,... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cout<<"Enter number of cases\n";
cin >> t;
while (t--)
{
int n, k;
cout<<"Enter length of array and number of peaks\n";
cin >> n >> k;
vector<int> arr(n + 1);
int num = n;
... |
#include <iostream>
using namespace std;
int matrix[1001];
bool visited[1001];
int ans;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int tc;
cin >> tc;
while(tc--){
int n;
cin >> n;
for (int i = 1; i <= n; i++){
cin >> matrix[i];
vis... |
// (C) 1992-2016 Intel Corporation.
// Intel, the Intel logo, Intel, MegaCore, NIOS II, Quartus and TalkBack words
// and logos are trademarks of Intel Corporation or its subsidiaries in the U.S.
// and/or other countries. Other marks and brands may be claimed as the property
// ... |
#pragma once
#include "logger.h"
#include <ostream>
#include <string>
#include <sstream>
namespace lm {
//!A log to an output stream.
class ostream_logger
:public logger {
public:
//!Class constructor, creates an active log, with a file assigned and opened.
ostream_logger(std::ostream&);
protected:
//!This... |
#pragma once
class DBUser : public CPacketSession
{
public:
DBUser();
~DBUser();
private:
BOOL mIsConnected;
WCHAR ID[ID_SIZE];
public:
BOOL Begin(VOID);
BOOL End(VOID);
BOOL Reload(SOCKET listenSocket);
inline BOOL SetIsConnected(BOOL isConnected) { CThreadSync Sync; mIsConnected = isConnected; retur... |
#ifndef RADIAL_HPP
#define RADIAL_HPP
#include <vector>
#include <cmath>
#include <vector>
#include "armadillo"
#include "string.h"
#include <iostream>
#include "../atom/vect3.h"
#include "../atom/atom.h"
#include "../sim/unitcell.h"
#include "../sim/simulation.hpp"
void binsetup (int noBins, double cutoff, colvec&... |
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <windows.h>
#include<conio.h>
using namespace std;
bool game;
const int breadth = 20;
const int height = 20;
int x, y, fruitX, fruitY, score;
enum eDirection { STOP = 0, LEFT, RIGHT, UP, DOWN };
eDirection initialDir;
int tailY[50], tailX[50... |
//
// rvMemSys.h - Memory management system
// Date: 12/17/04
// Created by: Dwight Luetscher
//
// Date: 04/01/05
// Modified by: Marcus Whitlock
// Added permanent heap and new heap push function to push the heap that contains
// a specified piece of memory.
//
// Date: 04/04/05
// Modified by: Marcus Whitlock
// Add... |
#include <iostream>
#include <iomanip>
/*
Passing by value means that a copy of a variable is fed as an argument.
As a result, the original input is not changed.
*/
int passByValue(int y){
y += 5;
return y;
}
/*
Passing by reference means that the function has direct access to the argument.
As... |
#include "../DetectMemoryLeak.h"
#include "Controller.h"
#include <iostream>
#include "../AI FSM/Ai_1.h"
#include "../Minimap/Minimap.h"
#include "../Enemy.h"
#include "../UIManager.h"
using namespace std;
const bool _CONTROLLER_DEBUG = false;
Controller::Controller()
: thePlayerInfo(NULL)
{
}
Controller::~Contro... |
//
// Created by user on 2017/2/7.
//
#ifndef DD_GAMES_REDISOPRS_H
#define DD_GAMES_REDISOPRS_H
class RedisOprs {
public:
static int ModUserWinCoin(int uid,int64_t coin); //赢取金币
static int ModUserWealth(int uid,int64_t coin); //财富
static int BackUpWinCoinRank();
static int BackUpWealth();
//获取当天完成的局数
static i... |
/*
Manage collection of tokens.
2013, Tivins <https://github.com/tivins>
*/
#include <cstdlib>
#include "tokens.h"
namespace v {
Tokens::Tokens() {
rootToken = NULL ;
lastToken = NULL ;
export_legend = true ;
}
Tokens::~Tokens() {
dropAll() ;
}
void Tokens::add(Token * token) {
if (rootTo... |
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <fstream>
#include <sstream>
#include <functional>
#include <memory>
#include <map>
#include <cctype>
#include <cassert>
#define GLEW_STATIC
#include <GL/glew.h>
#include <SDL.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.... |
#include <math.h>
double breit(double m,double mr,double gamma)
{
double dr;
{
dr = mr*mr-m*m;
return(gamma*gamma*m*m/(dr*dr+m*m*gamma*gamma));
}
}
|
#include <cstdio>
int main(){
int albe, rosii, verzi;
scanf("%d", &albe);
rosii = 2 * albe;
verzi = rosii - 3;
printf("%d\n", albe + rosii + verzi);
return 0;
} |
//
// Created by 송지원 on 2020-02-15.
//
#include <iostream>
int countR(int input, int r) {
int r_temp = r;
int ret = 0;
while (input/r_temp >= 1) {
ret += (input/r_temp);
r_temp *= r;
}
return ret;
}
int main() {
int N;
int count2, count5;
scanf("%d", &N);
count2... |
#ifndef KNIGHT_H
#define KNIGHT_H
#include<string>
#include<sstream>
#include <Character.h>
#include<string>
#include<sstream>
#include<random>
#include "Character.h"
#include<iostream>
#include<thread>
#include<vector>
#include "Lance.h"
using std::string;
using std::stringstream;
using std::cout;... |
#include <iostream>
#include <vector>
using namespace std;
const int INF = 9999, SWITCHES = 10, CLOCKS = 16;
// linked[i][j] = 'x': i번 스위치와 j번 시계가 연결되어 있다.
// linked[i][j] = '.': i번 스위치와 j번 시계가 연결되어 있지 않다.
const char linked[SWITCHES][CLOCKS+1] = {
"xxx.............",
"...x...x.x.x....",
"....x.....x...xx"... |
// stdafx.h: dołącz plik do standardowych systemowych plików dołączanych,
// lub specyficzne dla projektu pliki dołączane, które są często wykorzystywane, ale
// są rzadko zmieniane
//
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // Wyklucz rzadko używane rzeczy z nagłówków systemu Windo... |
#include <algorithm>
#include <fmt/ranges.h>
#include <functional>
#include <iostream>
#include <range/v3/all.hpp>
#include <string>
#include <utility>
#include <vector>
int main(int argc, char *argv[]) { return 0; }
|
/*
* License does not expire.
* Can be distributed in infinitely projects
* Can be distributed and / or packaged as a code or binary product (sublicensed)
*
* Commercial use allowed under the following conditions :
* - Crediting the Author
*
* Can modify source-code
*/
/*
* File: Transformation.h
* Aut... |
#include "LogComingProc.h"
#include "Logger.h"
#include "HallManager.h"
#include "Room.h"
#include "ErrorMsg.h"
#include "GameApp.h"
#include "MoneyAgent.h"
#include "RoundAgent.h"
#include "GameCmd.h"
#include "Protocol.h"
#include "ProcessManager.h"
#include "BaseClientHandler.h"
#include "ProtocolServerId.h"
#includ... |
//本题为混合背包模板
//把多重背包和完全背包合体即可
//可以将完全背包的次数设为极大值
//并将多重背包二进制拆分,来优化时间
#include<cstdio>
#include<algorithm>
using namespace std;
int n,t;
int hs,ms,he,me;
int w[10010],v[10010],s[10010];
int f[1000010];
int w1[1000010],v1[1000010];
int num;
void time();
void brick(int);
int main()
{
scanf("%d:%d %d:%d",... |
//
// Copyright 2014 Dropbox, Inc.
//
// 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... |
#include "gtest/gtest.h"
#define QP_SOLVER_PRINTING
#define QP_SOLVER_USE_SPARSE
#include "solvers/qp_solver.hpp"
using namespace qp_solver;
class SimpleQP : public QP<2, 3, double>
{
public:
Eigen::Matrix<double, 2, 1> SOLUTION;
SimpleQP()
{
Eigen::MatrixXd P(2,2);
Eigen::MatrixXd A(3,2);... |
#include "admin.h"
#include "ui_admin.h"
#include "database.h"
#include <QSqlDatabase>
#include <QDebug>
#include <QMessageBox>
#include <QSqlError>
#include <QSqlQuery> //sql语句
#include <QVariantList>
#include <QPushButton>
Admin::Admin(QWidget *parent) :
QWidget(parent),
ui(new Ui::Admin)
{
ui->setupU... |
#include <Windows.h>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <random>
#include <functional>
#include <stdexcept>
#include <algorithm>
#include "CWTCore.h"
using namespace CWT;
// Suppress MSVC-specific strdup deprecation warning for pybind11.
#define strdup _strdup
#inclu... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 2006-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Patryk Obara
*/
#include "core/pch... |
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include "dat.hpp"
/*******
* DAT *
*******/
// CONSTRUCTORS
Dat::Dat(std::string filename, bool loadWork) :
numberParticles(), persistenceLength(), packingFraction(), systemSize(),
torqueParameter(), randomSeed(), timeStep(), fram... |
#include "utils.hpp"
#include "common_ptts.hpp"
#include "player_ptts.hpp"
#include "utils/dirty_word_filter.hpp"
#include "child_ptts.hpp"
#include <map>
namespace nora {
namespace config {
bool check_conditions(const pd::condition_array& ca) {
static const map<pd::con... |
// Created on: 1992-04-07
// Created by: Christian CAILLET
// Copyright (c) 1992-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 "stdafx.h"
#include <assert.h>
#include "PackedFile.h"
#include "UnpackedFile.h"
PackedFile::PackedFile(UnpackedFile* pFile, offset_type size):
m_pFile(pFile),m_Size(size),m_Buffer(4*1024)
{
m_Stream.zalloc = Z_NULL;
m_Stream.zfree = Z_NULL;
m_Stream.opaque = Z_NULL;
m_Stream.avail_in = 0;... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) Opera Software ASA 2002-2007
*/
/**
\file regexp_advanced_api.h
\brief "Advanced" API to the ECMAScript regular expression matcher.
A regular expression is created and compiled by calling RegExp::RegExp()
and then RegExp... |
#include <iostream>
#include <math.h>
using namespace std;
int powersum(int a, int nterms)
{ int psum=0,rem;
for(int i=nterms;i>0;i--)
{rem=a%10;
psum=psum + pow(rem,i);
a=a/10;}
return psum;
}
int main() {
int n;
cin>>n;
int terms=0, a=n;
while(a>0)
{terms++;
a=a/10;}
int ps=powersum(n,terms);
if(... |
// We use 4-character tabstops, so IN VIM: <esc>:set ts=4 and <esc>:set sw=4
// ...that's: ESCAPE key, colon key, then "s-e-t SPACE key t-s-=-4"
//
//-------- define these in your sketch, if applicable ----------------------------------------------------------
//-------- These must go in your sketch ahead of the #i... |
/**
* @file np_add_subtract_multiply_divide_f4_quad_hw.cc
* @author Gerbrand De Laender
* @date 21/04/2021
* @version 1.0
*
* @brief E091103, Master thesis
*
* @section DESCRIPTION
*
* Element-wise addition, subtraction, multiplication and division.
* Single precision (f4) implementation.
*... |
#ifndef TIME_H
#define TIME_H
#include <QDialog>
namespace Ui {
class time;
}
class time : public QDialog
{
Q_OBJECT
public:
explicit time(QWidget *parent = 0);
~time();
private:
Ui::time *ui;
};
#endif // TIME_H
|
// Copyright 2017 Elias Kosunen
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2005 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#include "core/pch.h"
#ifdef SVG_SUPPORT
#include "modules/svg/src/svg... |
#include<iostream>
#include<conio.h>
using namespace std;
main()
{ int inches;
cout<<"enter a height in inches";
cin>>inches;
cout<<"the height is ";
int a=inches/12;
int b=inches%12;
cout<<a<<"'"<<" "<<b<<"''"<< endl;
return 0; }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.