text stringlengths 8 6.88M |
|---|
#ifndef RAYTRACING_HPP
#define RAYTRACING_HPP
#include "main.hpp"
using namespace std;
RT_Vec3 ray_trace(const Ray& ray, int left)
{
// background
RT_Vec3 color(0.0f, 0.0f, 0.0f);
double distance = MAX_DISTANCE;
double shade = 1.0f;
int IntersectionObject = -1;
INTERSECTION_TYPE tmp;
for (i... |
/*
* Stopping Times
* Copyright (C) Leonardo Marchetti 2011 <leonardomarchetti@gmail.com>
*/
#include "tester.h"
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include "test-de-solver.h"
#include "test-maximizer.h"
#include "logger.h"
using namespace StoppingTimes;
using namespace StoppingTimes::Testing;... |
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#include <numeric>
#include <ss... |
/*Write a function to determine the number of bits required to convert integer A to
integer B*/
#include <iostream>
using namespace std;
int bitsToChange(int A, int B){
int n = A & B;
int sum = 0;
int max= A>B? A : B;
for(int i=0; max!=0; i++){
sum +=((n>>i)+1)%2;
max>>=1;
}
return sum;
}
int theirBitsTo... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#include "core/pch.h"
#if defined(_NA... |
#include<bits/stdc++.h>
using namespace std;
int f[50];
map<int,int> mp;
int main(){
f[0]=2;
f[1]=3;
mp[2]=1;
mp[3]=1;
for(int i=2;i<50;i++){
f[i]=f[i-1]+f[i-2];
mp[f[i]]=1;
}
int n;
while(scanf("%d",&n)!=EOF&&n){
if(mp[n]==1)
printf(... |
/*
===========================================================================
Copyright (C) 2017 waYne (CAM)
===========================================================================
*/
#pragma once
#ifndef ELYSIUM_DATA_MODEL_ENTITY
#define ELYSIUM_DATA_MODEL_ENTITY
#ifndef ELYSIUM_CORE_OBJECT
#incl... |
#pragma once
#include <iberbar/Gui/Element/BlendColor.h>
#include <iberbar/Gui/RenderElement.h>
namespace iberbar
{
namespace Renderer
{
class CFont;
}
namespace Gui
{
class __iberbarGuiApi__ CElementStateLabel
: public CRenderElement
{
public:
CElementStateLabel( void );
~CElementStateLabel()... |
//
// Created by roy on 12/13/18.
//
#ifndef PROJECTPART1_COMMAND_H
#define PROJECTPART1_COMMAND_H
#include <string>
using namespace std;
/**
* Interface of executable commands.
*/
class Command {
public:
virtual int execute() = 0;
};
#endif //PROJECTPART1_COMMAND_H
|
#include "transformcomponent.h"
namespace sge { namespace entity { namespace component {
TransformComponent::TransformComponent(const math::mat4& transform)
: transform(transform) {
}
} } } |
#include <chuffed/globals/dag.h>
#include <iostream>
using namespace std;
DAGPropagator::DAGPropagator(int _r, vec<BoolView>& _vs, vec<BoolView>& _es,
vec<vec<edge_id> >& _in, vec<vec<edge_id> >& _out, vec<vec<int> >& _en)
: DReachabilityPropagator(_r, _vs, _es, _in, _out, _en) {
if (!getNodeVar(ge... |
#include <iostream>
#include <vector>
using namespace std;
int n, t, count;
long long temp;
vector<pair<long long, long long>> seq;
bool visited[1000001];
void genPrime()
{
int prev;
for (long long i = 2; i * i <= 1000001; i++)
{
if (!visited[i])
{
for (long lon... |
#include "AboutWindow.h"
#include "ui_AboutWindow.h"
AboutWindow::AboutWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::AboutWindow)
{
ui->setupUi(this);
QString d = __DATE__;
d.append(" ");
d.append(__TIME__);
this->ui->compilationLabel->setText(d);
}
AboutWindow::~AboutWindow()
{
... |
#include <bits/stdc++.h>
using namespace std;
#define For(x) for(int i = 0; i < x; i++)
#define For2(x) for(int j = 0; j < x; j++)
#define For3(x) for(int k = 0; k < x; k++)
#define Forv(vector) for(auto& i : vector)
#define Forv2(vector) for(auto& j : vector)
#define show(vector) for(auto& abcd : vector){cout<<... |
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
using namespace std;
struct ListNode{
int val;
ListNode* next;
ListNode(int x):val(x),next(NULL){}
};
void printLL(ListNode* head){
ListNode* temp = head;
while(temp!=NUL... |
#pragma once
#define GLUT_DISABLE_ATEXIT_HACK
#include <stdlib.h>
#include <GL/GLUT.H>
#include <math.h>
#include <iostream>
#include <GL/GLAUX.H>
#include <Windows.h>
#include <random>
#include <time.h>
#include "Color.h"
#include <Windows.h>
#include <windef.h>
#include <vector>
#include <map>
#inclu... |
#pragma once
#include "Mesh.h"
#include "SimpleShader.h"
#include "Camera.h"
#include <wrl/client.h> // Used for ComPtr
class Sky
{
public:
// Constructor that loads a DDS cube map file
Sky(
const wchar_t* cubemapDDSFile,
Mesh* mesh,
SimpleVertexShader* skyVS,
SimplePixelShader* skyPS,
Microsoft::WRL:... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 2004-2011 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* Tord Akerbęk
*/
#include "core/pch.h"
#ifdef PREFS_DOWNLOAD
#include "modules/pre... |
#include "greenSegmentation.hpp"
void GreenSegmentation::run(cv::Mat imgTop, cv::Mat imgBot, PerceptionData *data)
{
#ifdef DEBUG_PERCEPTION
//Create an image vector, put the desired images inside it and atualize the perception data debugImages with it.
debugImgVector.assign(1, imgTop);
d... |
//------------------------------------------------------------------------------
/*
This file is part of rippled: https://github.com/ripple/rippled
Copyright (c) 2012, 2013 Ripple Labs Inc.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby ... |
#include "GnSystemPCH.h"
#include "GnWCharFunctions.h"
//GNFORCEINLINE gsize GnWStrlen(const gwchar* GNRESTRICT str)
//{
// return wcslen(str);
//}
//
//GNFORCEINLINE gwchar* GnWStrcpy(gwchar* GNRESTRICT dest, const gwchar* GNRESTRICT src, size_t destSize)
//{
//#ifdef __GNUC__
// return wcscpy(dest, src);
//#else
... |
#ifndef __UIGIF_H__
#define __UIGIF_H__
#pragma once
namespace UiLib
{
#define EVENT_TIEM_ID 100
class UILIB_API CGifUI : public CLabelUI
{
public:
CGifUI();
~CGifUI();
LPCTSTR GetClass() const;
LPVOID GetInterface(LPCTSTR pstrName);
void DoPaint(HDC hDC, const RECT& rcPaint);
void DoEvent(TEventUI&... |
#include "interpreter.h"
#include <unordered_map>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cstring>
//************************************************************
bool isRGBValid(fp_t r, fp_t g, fp_t b){
return in(0, r, 256) &&
in(0, g, 256) &&
in(0, b, 256);
}
//*********... |
/*
* CharMemCache.cpp
*
* Created on: Jun 29, 2017
* Author: root
*/
#include "CharMemCache.h"
#include "Log/Logger.h"
#include "util.h"
#include "SvrConfig.h"
CCharMemCache * CCharMemCache::m_instance = 0;
CacheTimeOut::CacheTimeOut()
{
}
CacheTimeOut::~CacheTimeOut()
{
}
void CacheTimeOut::AddCacheTim... |
//2016-12-09
//2016-12-10
//2016-12-11
#pragma once
#include "HSRIFF.hpp"
#include <mmreg.h>
/*
以下クラス定義
*/
//__CHSRiffReaderBaseTemplate<Type>
//__CHSRiffReaderBaseTemplate<Type>
template <typename Type> class __CHSWaveReaderBaseTemplate : public __CHSRiffReaderBaseTemplate<Type> {
private:
... |
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
==========================================================... |
/**************************************************************************************
Programme: point.cpp
Acteur: Kponaho Anne-Laure Magnane
Date de création: 07/04/21
But du programme: Definition des fonctions de l'objet point*
***********************************************************************************... |
#include <bits/stdc++.h>
using namespace std;
int main(){
string s, t, r;
cin >> s >> t;
r = s + t;
int n = stoi(r);
for(int i=1; i<=1000; i++){
if(n == i*i){
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
} |
// Fill out your copyright notice in the Description page of Project Settings.
#include "TankMovementComponent.h"
#include "TankTrack.h"
#include "DrawDebugHelpers.h"
void UTankMovementComponent::Initialise(UTankTrack* LeftTrackToSet, UTankTrack* RightTrackToSet)
{
if (!ensureAlways (LeftTrackToSet && RightTrackToS... |
#define PI 3.1415926535 // pi
#include <dfr_tank.h>
#include <SoftwareSerial.h>
#include "Enes100.h"
// Global variables
float theta; // tank angle in rad
float targetTheta; // Enter the target angle in the space here
int minMotorValue = 160; // minimum input value which will produce a turning movement in the tank
flo... |
#include "vectorChapter17.h"
vector:: vector (int s) // Конструктор
: sz{s}, elem { new double[s]} // Выделение памяти
{
for (int i = 0; i<s; ++i)
elem[i] = 0;
}
|
// Copyright Epic Games, Inc. All Rights Reserved.
/*===========================================================================
Generated code exported from UnrealHeaderTool.
DO NOT modify this manually! Edit the corresponding .h files instead!
========================================================================... |
// Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value.
// If target is not found in the array, return [-1, -1].
// You must write an algorithm with O(log n) runtime complexity.
class Solution {
public:
vector<int> searchRange(vector... |
#include "used_rolename_merger.hpp"
#include "tools/log.hpp"
#include "utils/assert.hpp"
#include "proto/data_global.pb.h"
namespace nora {
void used_rolename_merger::start() {
ASSERT(st_);
st_->async_call(
[this] {
ILOG <... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "ButtonInteractorComponent.h"
#include "ActionComponent.h"
bool UButtonInteractorComponent::Interact(UObjectInfo* info) {
GetOwner()->FindComponentByClass<UActionComponent>()->DoAction();
return true;
}
|
//
// Created by jerry on 2/17/2021.
//
#ifndef COMP345_WINTER2021_PLAYERDRIVER_H
#define COMP345_WINTER2021_PLAYERDRIVER_H
namespace player{
int main();
}
#endif //COMP345_WINTER2021_PLAYERDRIVER_H
|
#include "log_serverd.hpp"
#include "log.hpp"
#include "utils/service_thread.hpp"
#include "utils/process_utils.hpp"
#include "utils/time_utils.hpp"
#include "config/options_ptts.hpp"
#include "config/utils.hpp"
using namespace nora;
int main(int argc, char **argv) {
srand(time(0));
deamonize(argv);
... |
/*
The MIT License (MIT)
Copyright (c) 2017 Paul Marc Liu
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, modify, merge,... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long LL;
const LL mod = 1000000007;
LL p[100];
void init() {
p[... |
#ifndef FORMSTANDARDDEVIATION_H
#define FORMSTANDARDDEVIATION_H
#include <QWidget>
namespace Ui {
class FormStandardDeviation;
}
class FormStandardDeviation : public QWidget
{
Q_OBJECT
public:
explicit FormStandardDeviation(QWidget *parent = 0);
~FormStandardDeviation();
private:
Ui::FormStandardDeviati... |
#include "mainwindow.h"
#include "mdialog.h"
#include <QApplication>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
MDialog dialog;
if (dialog.exec() == QDialog::Accepted) {
w.show();
a.exec();
}
cout << ... |
#include <iostream>
#include "LList.h"
//----------------------------------------------------
// constructor & destructor
//----------------------------------------------------
LList::LList() {
head = NULL;
cout << "LList: constructed!\n";
}
LList::~LList() {
if (head != NULL)
delete head; // deletes each n... |
//
// Created by gurumurt on 4/11/18.
//
#ifndef OPENCLDISPATCHER_BASE_KERNEL_H
#define OPENCLDISPATCHER_BASE_KERNEL_H
#endif //OPENCLDISPATCHER_BASE_KERNEL_H
#include "headers.h"
#include "globals.h"
class base_kernel{
public:
string name,kernel_src;
cl_kernel kernel;
short no_of_argument;
short n... |
/*!
* \file DevMenu.h
*
* \author Shiyang Ao
* \date November 2016
*
* Developer's menu
*/
#pragma once
namespace Hourglass
{
class MenuItem
{
public:
std::string text;
virtual void Increase() {}
virtual void Decrease() {}
virtual std::string GetValString() const { return ""; }
};
template <typen... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2007 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* @file
* @author Owner: Karianne Ekern (karie)
* @author Co... |
#include "sanity.hh"
#include "address.hh"
using namespace std;
namespace S6M
{
void Address::pack(ByteBuffer *bb) const
{
switch (type)
{
case SOCKS6_ADDR_IPV4:
{
in_addr *rawIPv4 = bb->get<in_addr>();
*rawIPv4 = get<in_addr>(u);
break;
}
case SOCKS6_ADDR_IPV6:
{
in6_addr *rawIPv6 = bb->get<in6_a... |
#ifndef WIDGETSCROLLBAR_HH_
#define WIDGETSCROLLBAR_HH_
#include <pgscrollbar.h>
/** This class is used to derive the ParaGUI's scroll bar and fix/customize some
* behaviour. Fixes are:
* 1) Drag buttons size correlates to the page size and scroll area.
* 2) When scroll size is zero, the drag button doesn't posit... |
//Enunt:
// Daca intr-un algoritm exista: char a = '4'
// int b = 8
// bool c = false
// evaluati expresiile: (b>15) or c
// a>= '0'and a<='9'
// not c or (a = 'a')
// (a > b) and c
#include <iostream>
#include <string> // operatii cu std::string
int main() {
char a = '4';
int b = 8... |
#ifndef __NODE_MERGE_SCAN_H
#define __NODE_MERGE_SCAN_H
#include <ros/ros.h>
#include <laser_geometry/laser_geometry.h>
#include <tf/transform_broadcaster.h>
#include <sensor_msgs/PointCloud.h>
#include <sensor_msgs/LaserScan.h>
#include <tf/transform_listener.h>
#include <vector>
#include <string>
#include <boost/mak... |
// Generated from D:/4IF/PLD-COMP/Compilateur01\fichierAntlr.g4 by ANTLR 4.7
#include "fichierAntlrVisitor.h"
#include "fichierAntlrParser.h"
using namespace antlrcpp;
using namespace antlr4;
fichierAntlrParser::fichierAntlrParser(TokenStream *input) : Parser(input) {
_interpreter = new atn::ParserATNSimulator... |
// Created on: 1997-02-06
// Created by: Kernel
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser ... |
#include "types.h"
#include "../include/catch.hpp"
TEST_CASE("byte size") { REQUIRE(sizeof(core::byte) == 1); }
TEST_CASE("byte extreme values") {
REQUIRE((core::byte)(core::BYTE_MAX + 1) == core::BYTE_MIN);
REQUIRE((core::byte)(core::BYTE_MIN - 1) == core::BYTE_MAX);
}
|
class Category_660 {
duplicate = 585;
};
class Category_520 {
duplicate = 585;
}; |
//
// Fiber.h
// Landru
//
// Created by Nick Porcino on 10/29/14.
//
//
#include "LandruActorVM/Exception.h"
#include "LandruActorVM/FnContext.h"
#include "LandruActorVM/MachineDefinition.h"
#include "LandruActorVM/Property.h"
#include "LandruActorVM/State.h"
#include "LandruActorVM/VMContext.h"
#include "LandruAc... |
#include<iostream>
using namespace std;
int main()
{
int i,S,B,l,r,x,y;
int na[100003],pa[100003];
while(1)
{
cin>>S>>B;
if(S==0&&B==0) break;
for(i=0;i<S+2;i++)
{
na[i]=i;pa[i]=i;
}
while(B--)
{
cin>>l>>r;
x=na[r+1];y=pa[l-1];
while(x!=na[x])x=na[x];
w... |
#include <iberbar/RHI/D3D11/ShaderVariables.h>
#include <iberbar/RHI/D3D11/ShaderReflection.h>
#include <iberbar/RHI/D3D11/Device.h>
namespace iberbar
{
namespace RHI
{
namespace D3D11
{
template < typename T, UShaderVariableType tVarType >
FORCEINLINE void TShaderVariableTable_SetValue(
const CSh... |
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.String.h>
#include <Uno.UX.Property-1.h>
namespace g{namespace Uno{namespace UX{struct PropertyObject;}}}
namespace g{namespace Uno... |
//
// CommStation.cpp
// SAD
//
// Created by Marquez, Richard A on 4/9/15.
// Copyright (c) 2015 Richard Marquez. All rights reserved.
//
#include "CommStation.h"
CommStation& CommStation::getInstance() {
static CommStation instance;
return instance;
}
CommStation::CommStation() {
this->drone = Dron... |
// KC Text Adventure Framework - (c) Rachel J. Morris, 2012 - 2013. zlib license. Moosader.com
#include "GameState.h"
#include "../IOUtils/GameIO.h"
#include "../IOUtils/Utils.h"
#include <vector>
bool GameState::Init(lua_State* state)
{
m_state = state;
m_location.Init( state );
m_item.Init( state );
... |
#include <stdio.h>
#include "gc_detect_leaks.h"
int main() {
GC_find_leak = 1;
char *a;
while(1){
a = (char*)malloc(100); //t1.c line7
//free(a);
CHECK_LEAKS();
}
}
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
/* Copyright (C) 1995-1998 Eric Young (ea... |
#ifndef CODE_GENERATOR
#define CODE_GENERATOR
#include "include.h"
#include "utils.h"
#include "opengl_function.h"
class code_generator
{
public:
void init(unordered_map<string, opengl_function>* functions, string& out_host, string& out_guest);
void generate_code();
private:
void generate_video_call_table_();
... |
#include "Term.h"
istream& operator >>(istream& is, Term& x)
{
do
{
cout << "\n Nhap Ky han:";
is >> x.Kyhan;
if (x.Kyhan < 1)
{
cout << "\n ky han khong hop le!";
}
} while (x.Kyhan<1);
// Goi nhap cua cha poiter
Saving *cha = static_cast<Saving *>(&x);//ep kieu
is >> *cha;
return is;
}
ostream... |
#include <bhand_test/utils.h>
double err_thres = 1e-2;
void PRINT_INFO_MSG(const std::string &msg)
{
std::cerr << "\033[1m\033[34m" << "[INFO]: " << msg << "\033[0m\n";
}
void PRINT_ERR_MSG(const std::string &msg)
{
std::cerr << "\033[1m\033[31m" << "[ERROR]: " << msg << "\033[0m\n";
}
void parseArgs(std::strin... |
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<vector<int>> permute(vector<int>& nums) {
vector<vector<int>> curs(1, {nums[nums.size() - 1]});
for(int i = nums.size() - 2; i >= 0; i--){
vector<vector<int>> prevs = curs;
curs.clear(... |
#include "AttackEnemyInfo.h"
#include "game_scene/GameScene.h"
static int AttackEnemyInfoCount = 0;
AttackEnemyInfo::AttackEnemyInfo()
:m_bloodPro(NULL)
,m_level(NULL)
,m_nickName(NULL)
,m_widget(NULL)
{
log("AttackEnemyInfo:%d",AttackEnemyInfoCount++);
}
AttackEnemyInfo::~AttackEnemyInfo()
{
log("AttackEnem... |
#include "Application.h"
#include "SHARPENER_KNIFE.h"
#include "ModuleParticles.h"
#include "ModuleCollision.h"
#include "ModuleEnemies.h"
#include "ModuleRender.h"
#include "ModuleKatana.h"
#include "ModuleAyin.h"
#include "ModuleSceneTemple.h"
#include "ModuleInterface.h"
#include "SDL\include\SDL_timer.h"
SHARPENE... |
#include"Vec2.hpp"
#include<iostream>
namespace GPEngine
{
namespace GPMath
{
Vec2::Vec2()
: x(0.0f), y(0.0f)
{
}
Vec2::Vec2(float _x,float _y)
: x(_x),y(_y)
{
}
Vec2::Vec2(float scalar)
: x(scalar), y(scalar)
{
}
Vec2::~Vec2()
{
}
Vec2::Vec2(const Vec2 &other)
:x(other.x),y(o... |
#include <vector>
#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include "Верхний колонтитул.h"
#include <fstream>
#include <set>
#include <string>
using namespace std;
template <typename T>
set<vector<T>> CreateSets(const vector<T>& sets)
{
set<vector<T>> result;
for (int i = 0; i ... |
//https://projecteuler.net/problem=7
//Solution: 104743
#include <iostream>
#include <math.h>
using namespace std;
bool isPrime(int n)
{
if (n < 2)
return 0;
for (int i = 2; i <= sqrt(n); i++)
{
if (n % i == 0)
return 0;
}
return 1;
}
int findNthPrime(int n)
{
in... |
/* -*- 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.
*/
#ifndef SVG_MATRIX_H
#define SVG_MATRIX_H
#include "modules/svg/svg_nu... |
// BEGIN CUT HERE
// PROBLEM STATEMENT
//
// You are given an int N. The factorial of N is defined as
// N*(N-1)*(N-2)*...*1. Compute the factorial of N and
// remove all of its rightmost zero digits. If the result is
// more than K digits long, return the last K digits as a
// string. Otherwise, return the en... |
//: C02:Numconv.cpp
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
// Zamiana liczby dziesietnej na osemkowa i szesnastkowa
#include <iostream>
using namespace std;
int main() {
int number;... |
#pragma once
#ifndef POSIZIONE_H
#define POSIZIONE_H
class Posizione {
public:
Posizione();
Posizione(double x, double y, double z);
double getX();
double getY();
double getZ();
void setX(double x1);
void setY(double y1);
void setZ(double z1);
private:
double x;
double y;
double... |
#pragma once
#include <iberbar\Base\Lua\LuaBase.h>
#include <iberbar\Base\Unknown.h>
namespace iberbar
{
class CLuaStateRef
: public CUnknown
{
IBERBAR_UNKNOWN_CLONE_DISABLED( CLuaStateRef );
public:
CLuaStateRef( void );
~CLuaStateRef();
inline lua_State* get() { return m_pLuaState; }
void initia... |
// Nama : Naufal Dean Anugrah
// NIM : 13518123
// Tanggal : 6 Februari 2020
// Topik : Inheritance
#include <iostream>
#include "Rekening.h"
using namespace std;
// Konstruktor untuk menginisialisasi saldo
// Set saldo 0.0 apabila saldo bernilai negatif
Rekening::Rekening(double saldo) {
this->saldo = (saldo < ... |
#include <algorithm>
#include <iostream>
#include <vector>
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout.tie(nullptr);
int a;
std::cin >> a;
static int dp[1000001];
for (int i = 2; i <= a; ++i)
{
dp[i] = dp[i - 1] + 1;
if (!(i % ... |
#pragma once
#include "global.h"
#ifndef MAIN_H
#define MAIN_H
#include "game.h"
enum class GameState {INTRO, INTROMENU, LOADSCREEN, PLAY, MENU, CREDIT, EXIT};
class GameObject {
private:
GameState _gameState;
bool _gameStateLoaded;
float _FPS;
public:
GameObject();
void Run();
void Init();
void Loop();
... |
#include "engine/net/CommonNet.hpp"
void CommonNet::SendDataPosVelDeg(ENetPeer* peer, int x, int y, int velX, int velY, int deg){
char send_data[1024] = {'\0'};
sprintf(send_data, "0|%d|%d|%d|%d|%d", x, y, velX, velY, deg);
SendPacket(peer, send_data);
}
void CommonNet::SendDataThrowablePosVel(ENetPeer* p... |
#pragma once
#if defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__)
#else
#error "This file requires compiler support for c++11"
#endif
#include <cstddef>
#include <chrono>
template<typename Function, typename... Args>
double time_invocation(std::size_t num_trials, Function &&f, Args&&... args)
{
auto star... |
// Copyright (c) 2011-2014 Bryce Adelstein-Lelbach
// Copyright (c) 2007-2014 Hartmut Kaiser
// Copyright (c) 2013-2014 Thomas Heller
// Copyright (c) 2013-2014 Patricia Grubel
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2009 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#ifndef WEBSERVERPREFS_H
#define WEBSERVERPREFS_H
#ifdef WIDGET_... |
#pragma once
#include "CoreMinimal.h"
#include "Widget/ClosableWnd/ClosableWnd.h"
#include "Struct/ShopItemInfo/ShopItemInfo.h"
#include "Enum/TradeSeller.h"
#include "TradeWnd.generated.h"
DECLARE_MULTICAST_DELEGATE_OneParam(FTradeWndButtonSignature, class UTradeWnd *)
UCLASS()
class ARPG_API UTradeWnd : public U... |
#include "StdAfx.h"
#include "Show.h"
namespace ui
{
Show* Show::Create()
{
return new (std::nothrow) Show();
}
Show* Show::Clone() const
{
return Show::Create();
}
InstantAction* Show::Reverse() const
{
return Hide::Create();
}
void Show::Update(float time)
{
InstantAction::Update(time);
if (... |
/*
* @lc app=leetcode.cn id=69 lang=cpp
*
* [69] x 的平方根
*/
// @lc code=start
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
class Solution {
public:
long long f(long long x, long long t){
long long ans = x*x - t;
return ans;
}
int mySqrt(int x) {
if... |
/*********************************************************
* Copyright (C) 2017 Daniel Enriquez (camus_mm@hotmail.com)
* All Rights Reserved
*
* You may use, distribute and modify this code under the
* following terms:
* ** Do not claim that you wrote this software
* ** A mention would be appreciated but not needed
* *... |
#include <iostream>
#include <set>
typedef long long ll;
ll list[200001];
int main()
{
std::cin.sync_with_stdio(false);
std::cin.tie(NULL);
int n, ans = 0;
std::cin >> n;
for(int i = 1; i <= n; i++)
{
std::cin >> list[i];
}
std::set<ll> s;
ll sum = 0;
s.insert(0);
fo... |
//---------------------------------------------------------------------------
#include "GetDetailProcess.h"
#include "HallHandler.h"
#include "PlayerManager.h"
#include "GameCmd.h"
#include "ProcessManager.h"
REGISTER_PROCESS(CLIENT_MSG_TABLEDET, GetDetailProcess)
//----------------------------------------------------... |
#include "MenuTexture.hpp"
#include "ImageDimensions.hpp"
#include "Util/Logger.hpp"
#include "Util/Paths.hpp"
#include <inc/main.h>
#include <filesystem>
namespace fs = std::filesystem;
namespace {
std::map<std::string, SMenuTexture> textures;
}
const std::map<std::string, SMenuTexture>& MenuTexture::GetTextur... |
/*
Copyright (c) 2007-2022 Xavier Leclercq
Released under the MIT License
See https://github.com/ishiko-cpp/test-framework/blob/main/LICENSE.txt
*/
#include "TestSequenceTests.h"
using namespace Ishiko;
TestSequenceTests::TestSequenceTests(const TestNumber& number, const TestContext& context)
: TestS... |
#ifndef CVUTILS_h
#define CVUTILS_h
using namespace std;
#include <opencv/cv.h>
#include <opencv/cxcore.h>
#include <opencv/highgui.h>
#include <vector>
#include <cstdlib>
#include <stdio.h> /* printf */
#include <stdlib.h> /* system, NULL, EXIT_FAILURE */
using std::abs;
class CvUtils {... |
// Created by: Peter KURNEV
// 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 S... |
// 0927_6.cpp : 定义控制台应用程序的入口点。
//亲和数
//220的所有真约数(即不是自身的约数)之和为:
//1 + 2 + 4 + 5 + 10 + 11 + 20 + 22 + 44 + 55 + 110=284。
//而284的所有真约数为1、2、4、71、 142,加起来恰好为220。
//输入数据第一行包含一个数M,接下有M行,每行一个实例,包含两个整数A,B; 其中 0 <= A,B <= 600000
//对于每个测试实例,如果A和B是亲和数的话输出YES,否则输出NO。
#include<iostream>
#include<algorithm>
using namespace std;
i... |
/*
Copyright (c) 2015, M. Kerber, D. Morozov, A. Nigmetov
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditio... |
#include<bits/stdc++.h>
using namespace std;
const int MAXN=200010;
#define maxn 200005
using ll=long long;
template<class T>struct Segtree {
#define ls (o<<1)
#define rs (o<<1)|1
T data[MAXN<<2];
T lazy[MAXN<<2];
void pushup(int o) {
data[o]=data[ls]+data[rs];
}
void setlazy(... |
/*
* leds.cpp
*
* Created: 15.03.2020 12:43:54
* Author: pavel
*/
#include <avr/io.h>
#include "pins.h"
uint8_t get_active_relay(void);
uint8_t get_power_enabled(void);
uint8_t prev;
void led_init(void)
{
prev = 0x00;
}
void led_output(void)
{
uint8_t cur = (1 << (get_active_relay()-... |
#pragma once
#include "Deque.h"
#ifndef _UTIL_INCLUDED
#define _UTIL_INCLUDED
#include "Util.h"
#endif // ! _UTIL_INCLUDED
class Simple2TieredVector : public ArrayDataStructure {
public:
Simple2TieredVector(int32_t size);
Simple2TieredVector(void);
~Simple2TieredVector(void);
int32_t getElemAt(int32_t);
void in... |
#include <avr/io.h>
#include "display.h"
#include "FMTONE.h"
#include "changeParameter.h"
#include <avr/pgmspace.h>
int posx[2][8];
int posy[2][8];
const char op1[] PROGMEM = "OP1";
const char op2[] PROGMEM = "OP2";
const char save_text[] PROGMEM = "Save=F2";
const char load_text[] PROGMEM = "Load=F1";
const char mu... |
#include <iostream>
#include <string.h>
#include <set>
using namespace std;
int main()
{
int t, n, curSize, prevSize;
string s, bestPref;
bool failed;
set<int> bestIdx;
cin >> t;
for (int i = 0; i < t; i++)
{
cin >> n;
cin >> s;
// get all the possibl... |
/* -*- Mode: c++; tab-width: 4; 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.
*
*/
#include "core/pch.h"
#include "ViewixOpPlatformViewers.h"
#include "modules/pi/Op... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.