text stringlengths 8 6.88M |
|---|
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "BaseUI.generated.h"
/**
*
*/
UCLASS()
class SPIDERMANPROJECT_API UBaseUI : public UUserWidget
{
GENERATED_BODY()
};
|
#include "pointlistfile.h"
#include "qfile.h"
#include "qstringlist.h"
#include "qtextstream.h"
PointListFile::PointListFile(QObject *parent)
: QObject(parent)
{
}
PointListFile::~PointListFile()
{
}
bool PointListFile::hasLoadedRoute(){
return m_nMapNodeNum == 0 ? true : false;
}
void PointListFile::ResetList... |
#include <Windows.h>
#include "NvIFRToSys.h"
#include "NvIFRHWEnc.h"
#include <d3d11.h>
#include "nvcapture.h"
#include <tchar.h>
#include <stdio.h>
//#include <time.h>
extern "C"{
#include "mp4muxer.h"
}
#define NUMFRAMESINFLIGHT = 1
NvIFRToSys* toSys = NULL;
unsigned char *buff... |
extern "C" {
#include "cpu.h"
}
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <string.h>
#include <signal.h>
#include "system_controller_cpld.h"
#define RAM_SIZE 16*1024
#define ROM_SIZE 32*1024
#define EXIT_DEBUGGER -1
#define QUIT_APPLICATION -2
#define ... |
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <list>
#include <algorithm>
#include <sstream>
#include <set>
#include <cmath>
#include <map>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <bits... |
/***********************************************************************
h£ºIRenderer
desc: transfer data to Graphic memory
and use gpu to render
************************************************************************/
#pragma once
#include "_BaseRenderModule.h"
#include "Render... |
// Question 2 => Check whether a string is Palindrome or not
#include<iostream>
using namespace std;
int main(){
string str = "LOL";
int sizeee = str.size();
bool check = 1;
for(int i=0; i<sizeee; i++){
if(str[i] != str[sizeee - 1 - i]){
check = 0;
break;
}
... |
#include <iostream>
using namespace std;
int main(){
int n, res1=0 , res2=0, res;
for (int i=0; i<=9; i++){
cin >> n;
if (i%2==0){
res1= ((res1+n)+abs(res1-n))/2;
}
else {
res2= ((res2+n)+abs(res2-n))/2;
}
}
res = ((res1+res2)-abs(res1-res2))/2;
cout << "2nd largest value: " <<... |
#ifndef PROJECTILE_H
#define PROJECTILE_H
#pragma warning (disable:4786)
//-----------------------------------------------------------------------------
//
// Name: Raven_Projectile.h
//
// Author: Mat Buckland (www.ai-junkie.com)
//
// Desc: Base class to define a projectile type. A projectile of the c... |
#include <iostream>
#include <math.h>
#include <stdlib.h>
//#define EXPECTED_ARG_COUNT 1
using namespace std;
extern float f(float t);
int main (const int argc, const char * const argv[])
{
if (argc < 2){
cerr << "Error: Expected 1 argument; received " << argc-1 << "; exiting" << endl;
return ... |
#ifndef ITEM_H_
#define ITEM_H_
#include <string>
#include <vector>
#include <iostream>
#include "gameObjects.h"
#include "../rapidxml/rapidxml.hpp"
#include "../rapidxml/rapidxml_utils.hpp"
#include "../rapidxml/rapidxml_print.hpp"
using namespace std;
using namespace rapidxml;
typedef struct _turn_on{
string prin... |
//*************************************************************************************************************
//
// 自作の標準ライブラリのユーティリティ処理 [mystd_utility.h]
// Author : IKUTO SEKINE
//
//*************************************************************************************************************
#pragma once
#if... |
#include<bits/stdc++.h>
using namespace std;
#define maxn 1000010
#define maxm 2000010
int N,M;
int fa[maxn];
int mp[1005][1005];
int ind=1;
struct edge{
int x,y,w;
edge(int x=0,int y=0,int w=0):x(x),y(y),w(w){}
}e[maxm];
bool cmp(edge a,edge b){
return a.w<b.w;
}
int getfather(int x){
... |
#pragma once
class PlayerComp;
class GrapplerComp;
/*
Tri Segments:
1. 0 - 2.0944
2. 2.0945 - 4.1887
3. 4.1888 - 6.2832
*/
class AI_RadialPatrol : public Hourglass::IAction
{
public:
void LoadFromXML( tinyxml2::XMLElement* data );
void Start();
void Init( Hourglass::Entity* entity );
IBehavior::Result Update(... |
#include<iostream>
#include<cstring>
using namespace std;
const int p[]={3,5,7,11,13,17,19,23,29,31,37};
int num[25];
int use[25];
int n;
void order()
{
for (int i = 1;i < n; i++) cout << num[i] << " ";
cout << num[n] << endl;
}
bool prime(int a)
{
for (int i = 0;i < 11;i++)
if (a == ... |
/*
replay
Software Library
Copyright (c) 2010-2019 Marius Elvert
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, ... |
#ifndef SOPNET_GUI_ERRORS_VIEW_H__
#define SOPNET_GUI_ERRORS_VIEW_H__
#include <sstream>
#include <pipeline/all.h>
#include <gui/TextPainter.h>
#include <sopnet/evaluation/Errors.h>
class ErrorsView : public pipeline::SimpleProcessNode<> {
public:
ErrorsView() {
registerInput(_errors, "errors");
registerInpu... |
#include<bits/stdc++.h>
using namespace std;
main()
{
int n;
while(cin>>n)
{
int i, j, k, a[100], b[100], x, y, ans=0;
for(k=0; k<n; k++)
{
cin>>x>>y;
a[k] = x;
b[k] = y;
}
for(i=0; i<n; i++){
for(j=0; j<n; j++){
... |
#include <iostream>
#include <boost/random.hpp>
// g++ boost_example_random.cpp -lboost_random
int main() {
// 伯努利分布: 在0/1中随机产生一个数,就像抛硬币,不是0,就是1
// 随机数生成器
boost::random::mt19937 gen(time(nullptr));
// 随机数分布器
boost::random::bernoulli_distribution<> dist;
std::cout << "Test -lboost_random bernoul... |
#include <iostream>
#include <stdio.h>
#include <string>
#include <limits.h>
using namespace std;
int get_cost(int *dim, int num) {
int c[num][num];
int min, cost;
for(int i = 0; i < num; i++)
c[i][i] = 0;
for(int i =0; i < num; i++) {
for(int j = 0; j < num; j++)
printf("%12d", c[i][j]);
... |
#pragma once
#include"ybBasicMacro.h"
NS_YB_BEGIN
#define FORMAT_BMP (1);
class Image;
class FileHandle;
class ImageIO
{
public:
virtual bool Write(Image* img, FileHandle* file) = 0;
virtual Image* Read(FileHandle* name) = 0;
virtual int Format()=0;
};
NS_YB_END |
#include "../Hardware/Registers.hpp"
#include <avr/pgmspace.h>
#include <util/delay.h>
#pragma once
using namespace Hardware;
#define _str(x) (char*)x
namespace Drivers
{
class Display
{
public:
Display() = delete;
static const uint8_t Width = 84;
static const uint8_t Hight = 48;
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2008-2010 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef CRYPTO_SIGNATURE_IMPL_H
#define CRYPTO_SIGNATURE_IMP... |
/****************************************************************
* TianGong RenderLab *
* Copyright (c) Gaiyitp9. All rights reserved. *
* This code is licensed under the MIT License (MIT). *
*****************************************************************/
#pragma once
#include <cassert>
namespace ... |
#include <iostream>
#include <opencv2/opencv.hpp> //头文件
#include <opencv2/xfeatures2d.hpp>
using namespace cv; //包含cv命名空间
using namespace std;
int main()
{
//Create SIFT class pointer
Ptr<Feature2D> f2d = xfeatures2d::SIFT::create();
//读入图片
Mat img_1 = imread("/home/lcy/文档/opencvtest/img/3.jpg");
... |
#include <stack>
#include <cstdio>
#include <vector>
#include <iostream>
using namespace std;
vector<int> Tree[30];
vector<int> reslut;
/*遍历*/
void postOrderTraversal(int fNode)
{
if (Tree[fNode].size() == 1) {
postOrderTraversal(Tree[fNode][0]); //后序遍历的特点
reslut.push_back(fNode);
}
else if... |
// Created on: 1999-05-14
// Created by: Pavel DURANDIN
// Copyright (c) 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 Less... |
#include<iostream>
#include<vector>
#define FOR(i,n) for(i=0;i<n;i++)
using namespace std;
int main()
{
int i,n,m,k,v,temp,temp2;
while(cin>>n)
{
vector<vector<int>> graph(1000000);
cin>>m;
FOR(i,n)
{
cin>>temp;
graph[temp-1].push_back(i);
}
FOR(i,m)
{
cin>>temp>>temp2;
i... |
//main.cpp
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <string>
#include "Image.h"
#include "fileActions.h"
#include "Blending.h"
#include "ImageZoom.h"
using namespace std;
int main()
{
cout << "************************************" << endl;
cout << ... |
int freq = 440;
int channel = 0;
int resolution = 8;
void setup() {
Serial.begin(115200);
ledcSetup(channel, freq, resolution);
ledcAttachPin(25, channel);
ledcWriteTone(channel, freq);
}
void loop() {
// put your main code here, to run repeatedly:
}
|
//===-- client/db-client-impl-data.hh - DBClientImplData class-*- C++ ---*-===//
//
// ODB Library
// Author: Steven Lariau
//
//===----------------------------------------------------------------------===//
///
/// \file
/// Implementation of DBClient that communicate with serialbuffs
///
//===------------------------... |
#include "util.h"
/**
* Returns true if 'text' matches regex validation
* @param text
* @param regex
* @return bool
*/
bool is_correct(std::string text , const std::string regex) {
std::regex syntax(regex);
if(std::regex_match(text, syntax)) {
return true;
}
return false;
}
/**
* Displays the ... |
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <climits>
#define rep(i, n) for(int i = 0; i < (int)(n); i... |
#ifndef CIRCUTIL_H
#define CIRCUTIL_H
#include <ext/hash_map>
// #include <tr1/unordered_map>
// #include <chuffed/circuit/MurmurHash3.h>
#define SEED 0xdeadbeef
extern int stat_count;
// Utility stuff
template <class S>
struct AutoS {
struct eq {
bool operator()(const S& a, const S& b) const {
if (sizeof(S) %... |
#include "../headers/player.h"
#include "../headers/enemy.h"
#include "../headers/battle.h"
#include "../headers/item.h"
#include "../headers/areas.h"
#include "../headers/party.h"
#include <stdio.h>
#include <stdlib.h>
int main()
{
party Team;
player *Characters[3];
int PlayerNum = 3;
for (int i=0; i<PlayerNum... |
#include "polygons.h"
#include "math.h"
///////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief Trapezoid::Trapezoid
/// \param parent
///
Trapezoid::Trapezoid(QObject *parent) :
Figure(parent)
{
// Начальное значение цвета
color = Qt::darkRed;
}
... |
// Created on: 1997-09-30
// Created by: Roman BORISOV
// 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 ... |
/*
* Copyright (c) 2021 Morwenn
* SPDX-License-Identifier: MIT
*/
#include <forward_list>
#include <vector>
#include <catch2/catch.hpp>
#include <cpp-sort/probes/sus.h>
#include <cpp-sort/utility/size.h>
#include <testing-tools/internal_compare.h>
TEST_CASE( "presortedness measure: sus", "[probe][sus]" )
{
usin... |
//https://www.patest.cn/contests/gplt/L2-006
//20180331 review
#include<bits/stdc++.h>
using namespace std;
vector<int> inorder(50),postorder(50);
struct tree_node{
tree_node* father = NULL;
tree_node* left_child = NULL;
tree_node* right_child = NULL;
int key = -1, layer = -1;
};
tree_node* tree_s... |
#include <iostream>
using namespace std;
int main(){
int numB, L, T;
int chu = 0;
cin >> numB >> L >> T;
int a[numB][2];
for (int i = 0; i < numB; i++) {
cin >> a[i][0];
a[i][1] = 1; // 1 右 2 左
}
for (int i = 0; i < T; i++) {
for (int j = 0; j < numB; j++) {
... |
#include "_pch.h"
#include "ViewBrowserDVModel.h"
using namespace wh;
//-----------------------------------------------------------------------------
//virtual
unsigned int wxDVTableBrowser::GetColumnCount() const //override
{
return 4;
}
//---------------------------------------------------------------------------... |
/* Copyright 2019 Abner Soares e Kallebe Sousa */
#ifndef TU_ENTIDADES_HPP_
#define TU_ENTIDADES_HPP_
#include <string>
#include "../entidades/entidades.hpp"
class TU_Usuario {
protected:
string NOME_INVALIDO;
string NOME_VALIDO;
string TELEFONE_INVALIDO;
string TELEFONE_VALIDO;
string EMAIL_INV... |
#include<iostream>
using namespace std;
int main()
{
int ans[20], sum = 0, index = 0, zero = 0;
for(int i = 0; i < 20; i++)
scanf("%d", &ans[i]);
for(int i = 0; i < 20; i++)
if(ans[i] < 0)
index++;
else if(ans[i] > 0)
sum += ans[i];
else
z... |
#include <OpenCV/OpenCV.h>
#include <cassert>
#include <iostream>
const char * WINDOW_NAME = "Face tracker";
const CFIndex CASCADE_NAME_LEN = 2048;
char CASCADE_NAME[CASCADE_NAME_LEN] = "abc.xml";
using namespace std;
#define DRAWRECT(img, rect, color) \
cvRectangle(img, \
cvPoint((rect)->x, (rect)->y), \... |
#include <iostream>
#include <string>
using namespace std;
int isPatternPresent(string str, string st)
{
int count;
int l1 = str.length();
int l2 = st.length();
for (int x = 0; x < l1 - l2; x++)
{
int y;
for (y = 0; y < l2; y++)
{
if (str[x + y] != st[y])
... |
class Solution {
public:
int threeSumClosest(vector<int> &nums, int target) {
int ret=0;
if (nums.size() < 3) return ret;
sort(nums.begin(), nums.end());
ret = nums[0]+nums[1]+nums[2];
for (auto it = nums.begin(); it < nums.end()-2; ++it) {
auto jt = it+... |
#ifndef _IN_GAME_H_
#define _IN_GAME_H_
#include "GameState.h"
#include <vector>
#include <memory>
#include <chrono/physics/ChSystem.h>
class CObject;
class CText;
class PrimitiveBase;
class CInGame : public CGameState
{
enum PostProcessing
{
Saturation,
HorizontalPass,
VerticalPass,
Blur,
Count
};
publ... |
#ifndef OwnUnderscore_P_HPP
#define OwnUnderscore_P_HPP
#include <QObject>
class OwnUnderscorePrivate : public QObject
{
Q_OBJECT
public:
OwnUnderscorePrivate();
~OwnUnderscorePrivate();
};
#endif
|
#include <SDL.h>
#include <GL/glew.h>
#include <glm.hpp>
#include <openvr.h>
#include <gtc/matrix_transform.hpp>
#include <gtx/matrix_decompose.hpp>
#include <iostream>
#define TJH_CAMERA_IMPLEMENTATION
#include "tjh/tjh_camera.h"
#include "window.h"
#include "vr_system.h"
#include "scene.h"
#include "point_cloud.h"... |
#pragma once
#include "Core/Core.h"
#include "Utils/Timestep.h"
#include "Scene/SceneComponent.h"
#include "Scene/SceneNode.h"
#include "Scene/Component/SceneCamera.h"
#include "Scene/Component/EditorCamera.h"
#include "Scene/Component/PlanarMesh.h"
namespace Rocket
{
ENUM(SceneState) { Play = 0, Editor };
c... |
#include "config.h"
#include <fstream>
#include <filesystem>
Mode Config::getInputMode(){
return inputMode;
}
Mode Config::getOutputMode(){
return outputMode;
}
void Config::setInputMode(Mode mode){
inputMode = mode;
}
void Config::setOutputMode(Mode mode){
outputMode = mode;
}
Config::Config(Mode ... |
#include "stdafx.h"
#include "SoundGenerator.h"
#define __PI 3.14159265358979323846
class StopRunningException: public std::exception {
int code;
public:
StopRunningException(int code)
{
this->code = code;
}
int GetCode()
{
return code;
}
};
SoundGenerator::SoundGenerator(DWORD SamplesPerSec)
{
format.n... |
#include "Generated/W05ScriptIncludes.h"
using namespace myscript;
int main()
{
// VCZH_DEBUG_NO_REFLECTION is on
// so we don't need, and are not allowed, to start reflection
auto myapp = MakePtr<MyApp>();
myapp->CreateScripting()->Execute(L"Gaclib");
// we need to call this because we use generated code from ... |
#pragma once
#include "visibility_modifier.h"
#include "local_var_descriptor.h"
namespace ionir {
struct FieldDescriptor : LocalVariableDescriptor {
VisibilityModifier visibility;
};
}
|
#pragma once
#include <iostream>
#include <string>
#include <fstream>
class CodeWriter
{
public:
CodeWriter();
void setFileName(std::string fileName);
std::string outputFileName;
std::string moduleName;
std::ofstream outputFile;
int eqLabelNum;
int gtLabelNum;
int ltLabelNum;
void writeArithme... |
#include<bits/stdc++.h>
using namespace std;
#define maxn 505
int c[maxn];
int n;
int d[maxn][maxn];
int dp(int i,int j){
if(i>j) return 0;
if(i==j) return 1;
if(d[i][j]!=-1) return d[i][j];
int tans=dp(i+1,j)+1;
int t=INT_MAX;
for(int k=i+2;k<=j;k++){
if(c[i]==c[k]){
... |
#ifndef ENGIMON_HPP
#define ENGIMON_HPP
#include <string>
#include <list>
#include <vector>
#include <iostream>
#include "Skill.hpp"
using namespace std;
class Engimon
{
protected:
string name;
string species;
list<Skill> skill;
vector<string> element;
int* level;
int* experience;
int* cum... |
#include "CString.h"
#include "CDate.h"
int main()
{
CString cstring;
CString obj;
obj.display_string();
char s[] = { 'c', 'o', 'd', 'i', 'n', 'g' ,'\0' };
CString obj1(s);
obj1.display_string();
char ch = 'A';
CString obj2(ch, 1);
obj2.display_string();
string temp;
cout << " Enter a String: ";
getlin... |
#include "utils.h"
#include <algorithm>
#include <stdlib.h>
#include <time.h>
static const int BASE = 10;
static int NUM_DIGITS;
static int tempDigits[BASE];
static bool tempUsed[BASE];
bool isNumberValid(int number)
{
if (number < 0) return false;
std::fill(tempUsed, tempUsed + BASE, false);
for (int i ... |
#include "tipocontroller.h"
#include "tipoviewer.h"
#include "tipodao.h"
TipoController::TipoController()
{
//ctor
}
TipoController::~TipoController()
{
//dtor
}
void TipoController::abm()
{
TipoViewer* tv = new TipoViewer();
bool salir = false;
while (!salir)
{
switch (... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2006 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Peter Karlsson
*/
#if !defined ACCESSORS_LNG_H && defined PRE... |
#ifndef CMPRO_DEEP_PROCESS_H
#define CMPRO_DEEP_PROCESS_H
#include <dlib/opencv.h>
#include <opencv2/opencv.hpp>
#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/image_processing/render_face_detections.h>
#include <dlib/image_processing.h>
//#include "tensorflow/core/public/session.h"
//#include... |
#ifndef wali_util_WEIGHT_CHANGER_GUARD
#define wali_util_WEIGHT_CHANGER_GUARD 1
/**
* @author Akash Lal
*/
#include "wali/Common.hpp"
#include "wali/SemElem.hpp"
namespace wali
{
namespace util
{
/**
* @class WeightChanger
*
* Encapsulates a unary function for changing weights
*
*... |
//Using bipartite graph. Time-0.000s
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
int main()
{
ll n,l,a,b;
while(cin>>n)
{
if(n==0) break;
cin>>l;
vll AdjList[n];
ll color[n];
for(int i=0;i<l;i++)
{
c... |
#include <iostream>
using namespace std;
class Node{
private:
int idx;
int leftIdx, rightIdx;
public:
Node(int a = -1) : idx(a) {
leftIdx = -1;
rightIdx = -1;
}
void setLchild(int lc);
void setRchild(int rc);
int getLchild();
int getRchild();
int getIdx();
};
void ... |
/**
* jseb2Controller.cc
* Allocate DMA buffers only once in constructor.
* Do not deallocate buffer at the end of a run
*/
#include <jseb2Controller.h>
bool jseb2Controller::runcompleted = false;
bool jseb2Controller::rcdaqdataready = false;
bool jseb2Controller::dmaallocationsuccess = false; // signal DMA fai... |
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/ListMyCoupon.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#include <_root.app18_ButtonEntry_icon_Property.h>
#include <_root.app18_ButtonEntry_Value_Property.h>
#include <_root.ButtonEntry.h>
#include <_root.ItemListS... |
// Name : Angel E Hernandez
// Date : April 17
// CIS 1202.800
// Project name : Inheritance
#pragma once
#ifndef VEHICLE_H
#define VEHICLE_H
#include <string>
using namespace std;
// The vehicle class holds general data
class Vehicle
{
private:
string manufacturer;
int year;
public:
// defaul constructor
... |
//
// Created by 송지원 on 2020/07/04.
//
#include <iostream>
#include <algorithm>
using namespace std;
int arr[20] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
void swap(int a, int b) {
int temp;
int diff = b-a;
for (int i=0; i<(diff+1)/2; i++) {
temp = ... |
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
typedef struct node {
int val;
struct node * next;
} node_t;
node *head, *tail;
void print_list(node_t *head) {
node_t *current = head;
while (current != NULL) {
printf("%d\t", current->val);
current = curre... |
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*-
*
* Copyright (C) 1995-2002 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#include "core/pch.h"
#ifdef XSLT_SUPPORT
#include "modules/xslt/src/xs... |
#include <iostream>
#include <cstdlib>
#include <pthread.h>
#include <unistd.h>
#include <stdlib.h>
#include "sleeper.h"
using namespace std;
/*
int main( ) { //Example usage
rideTime();
cout << "Ride over" << endl;
walkAroundTime();
cout << "Finished walking around " << endl;
}
*/
void rideTime() {
... |
//算法:二分答案/图论
/*
题目要求 经过的所有城市中 最多的 一次收取的费用的 最小值 是多少
根据题目, 显然,答案满足单调性,
即较小答案合法,则比他大的答案都合法
就可以使用二分答案法
二分答案枚举 最多的一次收取的费用的最小值
并将其作为一个参数 x ,传递给子函数
在子函数中,跑一遍SPFA,
以损失的血量尽量少为目的,
同时对于收取费用大于x的城市,不可到达.
跑完一遍后,判断到达n点消耗的血量是否小于最大血量
如果比最大血量大,证明最多的一次收取的费用的最小值为x时,不可到达
否则则可到达
二分得到最后的答案后,再判断此答案是否合法
合法则输出,否则输出AFK
*/... |
// Created on: 1993-01-13
// Created by: CKY / Contract Toubro-Larsen ( Deepak PRABHU )
// 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 ... |
/* leetcode 121
*
*
*
*/
#include <vector>
#include <deque>
#include <algorithm>
#include <list>
using namespace std;
class Solution {
public:
// dp
int maxProfit(vector<int>& prices) {
if(prices.empty() || prices.size() < 2) {
return 0;
}
int minPrice = prices[0];
... |
/* leetcode 151
*
*
*
*/
class Solution {
public:
string reverseWords(string s) {
if (s.empty()) {
string ans;
return ans;
}
stack<string> words;
string currWord;
for (int i = 0; i < s.size(); i++) {
if (s.at(i) == ' ') {
... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ma... |
#include<bits/stdc++.h>
using namespace std;
int fib(int n){
int *ans = new int[n + 1];
ans[0] = 0;
ans[1] = 1;
for(int i=2;i<=n;i++){
ans[i] = ans[i - 1] + ans[i - 2];
}
return ans[n];
}
int main(){
int n;
cin >> n;
cout << fib(n) << endl;
return 0;
}
|
#ifndef AOC_21_H
#define AOC_21_H
namespace AoC_21 {
int A() {
return -1;
}
int B() {
return -1;
}
}
#endif |
// Prime verification sqrt(N)
bool prime(ll x){
if(x==2) return true;
else if(x==1 or x%2==0) return false;
for(ll i=3;i*i<=x;i+=2)
if(x%i==0)
return false;
return true;
}
|
#pragma once
#include "../../Toolbox/Toolbox.h"
#include "../Context/Context.h"
#include "../Renderer/Renderer.h"
#include "../../TimeManagement/Time/Time.h"
#include "../../Maths/Primitives/TRect.h"
#include "../../Maths/Vector/Vector2.h"
#include <string>
#include <memory>
struct GLFWwindow;
namespace ae
{
... |
#pragma once
#include "utils/ptts.hpp"
#include "proto/config_login_back_ground.pb.h"
using namespace std;
namespace pc = proto::config;
namespace nora {
namespace config {
using login_back_ground_ptts = ptts<pc::login_back_ground>;
login_back_ground_ptts& login_back_ground_pt... |
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// Пример использования перечислений, пользовательского ввода и структуры
// V 1.0
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
#include<iostream>
#include<string>
using namespace std;
enum class Position... |
#include "ssBBox.h"
#include "ssVector3.h"
#include "ssRay.h"
#include "ssSphere.h"
#include "ssPlane.h"
namespace ssMath
{
//-----------------------------------------------------------------
BBox Union(const BBox &b, const Point3 &p)
{
BBox tmp = b;
tmp.merge(p);
return tmp;
}
//---------------------------... |
#include <iostream>
#include <chrono>
using namespace std;
#define FIRSTDATATYPE unsigned int//32bits
#define SECONDDATATYPE unsigned short//16bits
FIRSTDATATYPE gcd(FIRSTDATATYPE a, FIRSTDATATYPE b) {
return b == 0 ? a : gcd(b, a % b);
}
class RSA {
private:
SECONDDATATYPE p;
SECONDDATATYPE q;
FIRSTDATATY... |
#include "Main.hpp"
#ifndef LOADFUNCTIONS_H
#define LOADFUNCTIONS_H
GLuint CompileShadersMakeProgram(const char * vertex_file_path,const char * fragment_file_path);
GLuint loadBMP_custom(const char * imagepath);
GLuint loadDDS(const char * imagepath);
bool loadOBJ(const char * path, std::vector<glm::vec3> & out_verti... |
// Copyright (c) 2007-2015 Hartmut Kaiser
// Copyright (c) 2011 Bryce Lelbach
// Copyright (c) 2014 Anuj R. Sharma
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.tx... |
// Moduł SOURCE.CPP
// =================
// Funkcje składowe klasy Source.
//
#include "Source.h"
Source::Source(const string& fnam): fn(fnam)
{
istr.open(fn.c_str());
if(!istr)
{ cout<<"Analang: blad odczytu pliku \""<<fn<<"\"\n";
exit(1);
}
cout<<"\nInterpreter Analang, v0.1, zadne prawa niezastrzeżone... |
#include <iostream>
#include "gtest/gtest.h"
#include "../apps/recognizer/include/intent.h"
TEST(Weather_test_case, basic_test_1)
{
Recognizer rec_intent;
std::stringstream sstr("What is the weather like today?");
EXPECT_EQ("Intent: Get Weather", rec_intent.Get_Intent(sstr));
}
TEST(Weather_test_case, bas... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#define rep(i,n) f... |
#pragma once
void NewFunction(std::ifstream& file1, std::string& temp, std::vector<std::string>& firstFileLines);
void NewFunction1(std::ifstream& file1, std::string& temp, std::vector<std::string>& firstFileLines);
|
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
int t, l, r;
char str[31];
cin >> t;
while(t--)
{
cin >> str;
int n = strlen(str);
for(l=0,r=n-1; l < r; ++l,--r)
{
char tmp = str[l];
str[l] = str[r];
str[r] = tmp;
}
... |
#pragma once
#include "Seaquence.h"
class Ending:public Seaquence
{
public:
Ending();
~Ending();
Boot* Update(SeaquenceController*);
private:
//エンディングイメージ
int mCount;
}; |
#include "FastIO_v2.h"
bool F_fastRead(const uint8_t pin) {
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)
if (pin < 8) return bitRead(PIND, pin);
else if (pin < 14) return bitRead(PINB, pin - 8);
else if (pin < 20) return bitRead(PINC, pin - 14);
#elif defined(__AVR_ATtiny85__) || defined(... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QDeclarativeItem>
#include <QDeclarativeView>
#include "sendkey.h"
class MainWindow : public QDeclarativeView
{
Q_OBJECT
public:
MainWindow();
public:
void toggle();
void focusin();
void focusout();
public:
QDeclarativeItem *rootItem;
... |
//
// CTest.hpp
// HttpSvr
//
// Created by yuzhan on 2016/11/15.
//
//
#ifndef CTest_hpp
#define CTest_hpp
#include <string>
#include "CHttpRequestHandler.h"
class CTest : public CHttpRequestHandler
{
public:
CTest(){}
~CTest(){}
virtual int do_request(const Json::Value& root, char *client_ip, ... |
/*
src/malloc.cpp -- Asynchronous memory allocation system + cache
Copyright (c) 2020 Wenzel Jakob <wenzel.jakob@epfl.ch>
All rights reserved. Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
*/
#include "internal.h"
#include "log.h"
#include "util.h"
... |
#include <stdio.h>
#define ROW 5
#define COL 9
int chess[ROW][COL] ; //棋盘
int step ; //记录步数
int search(int x1, int y1, int x2, int y2)
//x1和y1分别是当前位置行号和列号
//x2和y2分别是B位置行号和列号
{
int i, j ;
int success = 0 ;
if(x1 == x2 &... |
/***********************************************************
File name: AdeeptRemoteControl.ino
Description:
1.Push the left rocker up/forward and the robot will move forward. The farther you push each time, the faster the robot will move.
2.Pull the left rocker down/backward and the robot will move backward. The f... |
//
// Created by 송지원 on 2020-02-15.
//
#include <iostream>
int main() {
int N;
int five = 5;
int num_of_five = 0;
scanf("%d", &N);
// while (N/five >= 1) {
// num_of_five += (N / five);
// five *= 5;
// }
num_of_five = N/5 + N/25 + N/125;
printf("%d\n", num_of_five);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.