text
stringlengths
8
6.88M
int length_union(const vector<pii> &a){ int n = a.size(); vector<pair<int, bool>> x(n*2); for(int i = 0; i < n; i++){ x[i*2] = {a[i].ff, false}; x[i*2+1] = {a[i].ss, true}; } sort(x.begin(), x.end()); int result=0; int c=0; for(int i=0;i<2*n;i++){ if(i and c and...
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. #include "InteractiveCutBPLibrary.h" #include "InteractiveCut.h" #include <Core.h> #include "Runtime/Engine/Classes/GameFramework/Actor.h" #include "Runtime/Engine/Classes/GameFramework/PlayerInput.h" #include "Runtime/Engine/Classes/GameFramework/InputSett...
cout << solution({"frodo", "fradi", "crodo", "abc123", "frodoc"}, {"fr*d*", "*rodo", "******", "******"}) << '\n';
/* * Copyright [2016] <Bonn-Rhein-Sieg University> * * Author: Oscar Lima (olima_84@yahoo.com) * * Creates PDDL problem definition automatically from knowledge base snapshot * */ #include <mcr_pddl_generator_node/pddl_problem_generator_node.h> #include <string> PDDLProblemGeneratorNode::PDDLProblem...
#include <iostream> #define C 8 #define N 200 int main() { int currency[] = {1,2,5,10,20,50,100,200}, ways[N+1] = {0}; ways[0] = 1; for (int c = 0; c < C; c++) for (int n = 0; n + currency[c] <= N; n++) ways[n+currency[c]] += ways[n]; std::cout << ways[N] << "\n"; }
#include "GameObject.h" GameObject::GameObject(int width, int height, Physics physics, SDL_Texture* texture) { this->width = width; this->height = height; this->physics = physics; this->texture = texture; } double GameObject::i() { return physics.position[0]; } double GameObject::j() { return ...
#pragma once class CD3DFont; namespace ui { class FPS { public: FPS(); ~FPS(); void render(); void reset(); // hack public: int xpos; int ypos; int draw; private: CD3DFont* d3dfont; unsigned int frames; unsigned int last_ms; float fps; }; };
#include <iostream> #include <bits/stdc++.h> using namespace std; class GraphInt{ int V; list<int> *l; public: GraphInt(int V){ this->V = V; l = new list<int>[V]; } void addEdge(int x, int y){ l[x].push_back(y); l[y].push_back(x); } void printAdjLis...
#include <systemc.h> #include <fstream> #include <iostream> SC_MODULE ( tester ){ sc_in <bool> clk ; sc_in <sc_uint <8> > out3; sc_out <sc_uint <8> > out1, out2 ; sc_out <sc_bv <3> > ctrl; ifstream infile; void tester_func (); SC_CTOR( tester ){ SC_THREAD( tester_func ) ; sen...
#include <FastLED.h> #define LED_PIN 1 #define NUM_LEDS 14 #define BRIGHTNESS 100 #define LED_TYPE WS2811 #define COLOR_ORDER GRB CRGB leds[NUM_LEDS]; #define UPDATES_PER_SECOND 10 CRGBPalette16 currentPalette; TBlendType currentBlending; // Gradient palette "otis_gp", originally from // http://solito...
#include <iostream> #include <cstdlib> #include <Windows.h> #include "Person.h" #include "Student.h" #include "GamingStudent.h" #include "NonGamingStudent.h" #include "Survey.h" int main() { srand(std::time(NULL)); bool proceed = false; // This will hold whether or not the user wants to process the data in the sur...
#ifndef INVENTORYBAR_H #define INVENTORYBAR_H #include "ui.h" #include "constant.h" #include "world/block/blockid.h" #include <array> class InventoryBar : public Ui { public: static InventoryBar &instance(); static void scrollCallback(GLFWwindow *, double, double yoffset); BlockId getItem() const; prot...
// g++ -O3 -Wall -shared -o rgbtohex.so -fPIC rgbtohex.cc #include <iostream> #include <stdint.h> #include <stdio.h> extern "C" void rgbtohex(const uint8_t* rgb, size_t n_pix, char* hex) { for (size_t i = 0; i < n_pix; ++i) { uint8_t red = rgb[i*4 + 0]; uint8_t green = rgb[i*4 + 1]; uint8_t...
#pragma once #include <Arduino.h> #include "font.h" namespace DRAW9486 { #define LCD_RD A0 #define LCD_WR A1 #define LCD_RS A2 #define LCD_CS A3 #define LCD_REST A4 #define YP A3 // must be an analog pin, use "An" notation! #define XM A2 // must be an analog pin, use "An" notation! #define YM 9 // can be a digital ...
#include "PuzzleRPC.h" #include "publicDef/gameConfig.h" #include "SaveDataManager.h" #include "json/stringbuffer.h" #include "json/writer.h" static std::string serverUrl = "http://localhost:8099/"; PuzzleRPC* PuzzleRPC::getInstance() { static PuzzleRPC* _ins = NULL; if (!_ins) { _ins = new PuzzleRPC(); } re...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2011 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 SEARCH_ENGINE // to remove compila...
#include "colordisplay.h" #include <QPainter> #include <QPen> #include <QBrush> colorDisplay::colorDisplay(QWidget *parent) : QWidget(parent) { } void colorDisplay::paintEvent(QPaintEvent *event) { QPainter p(this); QPen pen; QBrush brush; // preparando a caneta pen.setColor(QColor(150,150,150)...
/* * 基数排序 */ #include <bits/stdc++.h> using namespace std; class Solution{ public: void radix_sort(vector<int> &nums){ if(nums.empty() || nums.size() < 2){ return; } int bits = _get_bits(nums); _radix_sort(nums,bits); } private: void _radix_sort(vector<int> &n...
#ifndef QUEUE_H #define QUEUE_H #include <iostream> using namespace std; template<class T> class node{ private: T _data; node<T> *_next; public : node(){ _next = nullptr; } node(T data){ _data = data; _next = nullptr; } node<T>* next(){ ...
#pragma once #include "../../Toolbox/Toolbox.h" #include "Material.h" #include "../Shader/ShaderParameter/ShaderParameterTexture.h" #include "../Shader/ShaderParameter/ShaderParameterBool.h" namespace ae { /// \ingroup graphics /// <summary>Framebuffer shading settings for rendering.</summary> /// <seealso cref="M...
// Include standard headers #include <stdio.h> #include <stdlib.h> // Include GLEW #include <GL/glew.h> // Include GLFW #include <GLFW/glfw3.h> GLFWwindow* window; // Include GLM #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <cmath> #include "draw_single_frame.h" using namespace glm; #inclu...
#include <iostream> #include<algorithm> #include<cstring> using namespace std; __int64 v[100000]; //n=50时int超限 //__int64 ar[100000]; //存放要输出的数 int k=2; //避免重复计算 void fib(int n,int k) { for(int i=k; i<=n; i++)//之前的都计算过所以不用更改 { v[i] = v[i-1]+v[i-2]; // v[i-2] = v[i-1...
// Dll-Machine-Learning.cpp : Defines the exported functions for the DLL application. // #include "stdafx.h" #include "LinearPerceptron.h" #include "MLP.h" #include "RBF.h" extern "C" { class Toto { private: int titi; public: Toto() { titi = 42; } int getTiti() { return titi; } }; __declspec(dllexport) int r...
/* -*- 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...
// // ToppingList.hpp // TEST // // Created by ruby on 2017. 10. 14.. // Copyright © 2017년 ruby. All rights reserved. // #ifndef ToppingList_hpp #define ToppingList_hpp #include <stdio.h> #include <iostream> #include <string> using namespace std; class Topping; class ToppingList{ Topping * head; int size...
#include<iostream> #include<vector> #include<algorithm> using namespace std; class Solution { public: int hammingDistance(int x, int y) { int z=x^y,res=0; for(int i=0;i<32;i++) { if(z&1==1) res+=1; z=z>>1; } return res; } }; int ma...
#include "TextFile.hpp" TextFileChunk::TextFileChunk(/* args */) { } TextFileChunk::~TextFileChunk() { }
#ifndef OFFICERGUI_H #define OFFICERGUI_H #include <QDialog> namespace Ui { class OfficerGUI; } class OfficerGUI : public QDialog { Q_OBJECT public: explicit OfficerGUI(QWidget *parent = nullptr, QString _firstName="", QString _lastName="", QString _id=""); ~OfficerGUI(); private slots: void on_cmd...
#include <esp_now.h> #include <WiFi.h> uint8_t broadcastAddress[] = {0xAC, 0x67, 0xB2, 0x38, 0x23, 0xF4}; float incomingSmoke; float incomingFire; float incomingVib; int sFlag=0,fFlag=0,vFlag=0; typedef struct struct_message { float smke; float fir; float vib; } struct_message; struct_message incomingRea...
#ifndef TRIE_H #define TRIE_H #include<iostream> using namespace std; class Trie { private: class Node { public: char c; bool isWord; bool displayed; int e = 0 ; int count=0; Node *children[26]={0}; Node(ch...
#include "AnimationSystem.h" #include "Player.h" #include "Components/AnimationComponent.h" #include "Components/TransformComponent.h" #include "Renderer/Renderer.h" #include "Animation/Spritesheet.h" #include "Animation/Sprite.h" const float pixel_ratio = 0.02f; void update_animation_system(Player* player, float...
class Solution { public: set<ListNode*> S; ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) { while(headA!=NULL) { S.insert(headA); headA=headA->next; } while(headB!=NULL) { if(S.find(headB)!=S.end()) { ...
//-------程序说明---------------------- //照着抄的开发游戏的程序框架 //2016.8.6 //-------------------------------------- #include<Windows.h> #define WINDOW_WIDTH 800 #define WINDOW_HEIGHT 600 #define WINDOW_TITLE L"游戏程序开发框架" LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam); int WINAPI WinMain(HINSTANCE h...
#ifndef CONSTANTS_HPP #define CONSTANTS_HPP #include <algorithm> #include <cmath> #include <future> #include <initializer_list> #include <iostream> #include <chrono> #include <mutex> #include <numeric> #include <thread> #include <vector> constexpr int INF = 1'000'000; using graph_t = std::vector<std::vector<int>>; ...
// // SharedLibrary_UNIX.cpp // // $Id: //poco/1.4/Foundation/src/SharedLibrary_UNIX.cpp#3 $ // // Library: Foundation // Package: SharedLibrary // Module: SharedLibrary // // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX-License-Identifier: BSL-1.0 // #inclu...
/* Asynchronous TCP library for Espressif MCUs Copyright (c) 2016 Hristo Gochkov. All rights reserved. This file is part of the esp8266 core for Arduino environment. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as publishe...
/* -*-C++-*- */ /* * Copyright 2016 EU Project ASAP 619706. * * 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 appl...
/* * Copyright (C) 2007,2008 Alex Shulgin * * This file is part of png++ the C++ wrapper for libpng. PNG++ is free * software; the exact copying conditions are as follows: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions a...
// // Created by kevin yan on 2020-05-18. // #include "LRUcache.h" int main() { LRUcache *lrc=new LRUcache(3); lrc->Set("page1",7); lrc->showcache(); lrc->Set("page2",0); lrc->showcache(); lrc->Set("page3",1); lrc->showcache(); lrc->Set("page4",2); lrc->showcache(); ...
#include<cstdio> #include<cstring> #include<iostream> #include<queue> using namespace std; struct cmp1 { bool operator ()(long long &a,long long &b) { return a>b;//最小值优先 } }; int main() { int n,k; while(scanf("%d%d",&n,&k)!=EOF) { priority_queue<long long,vector<long long>...
#pragma once #include <iberbar/Poster/Elements/XmlCommon.h> namespace iberbar { namespace Poster { void __iberbarExports__ XmlReadProc_ElementBase( Xml::PTR_CNodeA node, CElementBase* pElement ); CResult __iberbarExports__ XmlReadProc_ElementLabel( UXmlReadProcContext& context ); CResult __iberbarExports__ Xm...
/* * @Description: 闭环检测算法 * @Author: Ren Qian * @Date: 2020-02-04 18:53:06 */ #include "lidar_localization/mapping/loop_closing/loop_closing.hpp" #include <cmath> #include <algorithm> #include <pcl/common/transforms.h> #include <pcl/io/pcd_io.h> #include "glog/logging.h" #include "lidar_localization/global_defina...
// // Parser.h // Odin.MacOSX // // Created by Daniel on 31/05/15. // Copyright (c) 2015 DG. All rights reserved. // #ifndef __Odin_MacOSX__Parser__ #define __Odin_MacOSX__Parser__ #include <string> #include <vector> #include <utility> #include <boost/property_tree/ptree.hpp> namespace core { class Parser ...
/**************************************************************************** * AAMLibrary * http://code.google.com/p/aam-library * Copyright (c) 2008-2009 by GreatYao, all rights reserved. ****************************************************************************/ #ifndef AAM_MOVIEAVI_H #define AAM_MO...
#include <iostream> using namespace std; int main() { int i=-1; int a[3]={0},b[3]={0}; for(i=0;i<6;i++)b[i]=i; for(i=0;i<3;i++) cout<<"a["<<i<<"]="<<a[i]<<' '; cout<<endl; i=8; a[3]=-100; cout<<"i="<<i<<endl; return 0; }
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #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> #inc...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2011 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 EXTENSION_SUPPORT #include "modules/...
/** * @file computeAlignments.hpp * @brief logic for generating alignments when given mashmap * mappings as input * @author Chirag Jain <cjain7@gatech.edu> */ #ifndef COMPUTE_ALIGNMENTS_HPP #define COMPUTE_ALIGNMENTS_HPP #include <vector> #include <algorithm> #include <fstream> #include <sstream...
#ifndef APPLICATION_TEXTVIEW_H #define APPLICATION_TEXTVIEW_H #include <QTextEdit> #include <QCompleter> class TextView : public QTextEdit { Q_OBJECT public: TextView(QWidget *parent = nullptr); ~TextView(); void setCompleter(QCompleter *c); QCompleter *completer() const; protected: void ke...
/*In this program we will be seeing all the Relational Operators like equal , unequal, lesser than , lesser than or equal to , greater than , greater than or equal to etc.. avaliable in C++ Program*/ /*including preprocessor in the program*/ #include <iostream> /*using namespace*/ using namespace std; /*creating a...
/* Binary Bunch Conversions */ #include <iostream> #include <fstream> #include <string> #include <sstream> #include <algorithm> #include <math.h> #include <map> using namespace std; string base2To16Table(string num) { map<string, string> table; string conversion; table.insert(pair<string,string> ("0000", "0")); ...
// // Created by OLD MAN on 2020/1/7. // //蒜头君有两个正整数 m 和 k,其中 1<m<100000,1<k<5,判断 m 能否被 19 整除,且各位数字中恰好含有 k 个 3。如果满足条件,则输出"YES",否则,输出"NO"。 // //输入格式 // m 和 k 的值,中间用单个空格间隔。 // //输出格式 // 满足条件时输出"YES",不满足时输出"NO"。 #include <iostream> using namespace std; int main(){ int m, k; cin>>m>>k; if (!(m ...
#include <iostream> #include <cstdlib> #include <fstream> #include <iomanip> #include <cmath> #include <string> #include <algorithm> #include <conio.h> using namespace std; enum Error_code { success,wrongPassword,notPresent }; //prototypes: void Title(); void getUser(string&,string&); Error_code check...
/* T. Horstmann * AT-TRA * DLR * Berlin * Germany */ #include <iostream> #include <fstream> #include <sstream> #include <cstdlib> #include <math.h> using namespace std; #include "ludwig.h" #ifndef __cplusplus #error C++ compiler is required #endif extern "C" void DumpMacroVTK(double **macro, int index){ int ...
// Copyright (c) 2019 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 Software Foundation, with special ...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "10079" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) int main(int argc, char const *argv[]) { #ifdef DBG freopen("uva" PROBLEM TESTC ".in", "r", stdin); freopen("uva" PROBLEM ".out", "w", stdout); #endif long long n...
/* Copyright (c) Lim Rui An, Ryan 2016 Creator(s) : Lim Rui An, Ryan Creation Date : 26 November 2016 18:52 PM File Name : ObjectManager.h Purpose : Defines the object manager */ #ifndef EVENT_SYSTEM_H #define EVENT_SYSTEM_H #include "../../Engine/Internal/System.h" #include "../../Engine/Internal/Singl...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <netdb.h> #include <arpa/inet.h> #include <unistd.h> #include <fcntl.h> #include <sys/epoll.h> #include <limits.h> #include <errno.h> #include <signal.h> //初始化服务端监听端口 int init_server(sockaddr_in *server_addr) { int socket_fd; ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef QUICK_BINDER_NUMBER_EDIT_H #define QUICK_BINDER_NUMBER_ED...
// 1006_1.cpp : 定义控制台应用程序的入口点。 //最大化 //输入数据包含多个测试实例,每个测试实例的第一行只有一个整数n(n <= 100), //表示你喜欢看的节目的总数,然后是n行数据,每行包括两个数据Ti_s, Ti_e(1 <= i <= n), //分别表示第i个节目的开始和结束时间,为了简化问题,每个时间都用一个正整数表示。 //n = 0表示输入结束,不做处理。 //对于每个测试实例,输出能完整看到的电视节目的个数,每个测试实例的输出占一行。 #include<iostream> using namespace std; int main() { int n; while (cin >> n)...
// ConvertEncoding.h #ifndef SIMPLE_CONVERT_ENCODING_H #define SIMPLE_CONVERT_ENCODING_H #include <string> namespace simple { std::string convertAnsiToOem( const std::string& ansi ); std::string convertUtf8ToOem( const std::string& utf8 ); } // simple #endif // SIMPLE_CONVERT_ENCODING_H
#pragma once #include <string> #include <Poco/Logger.h> #include <Poco/SharedPtr.h> #include <Poco/Timespan.h> #include <Poco/URI.h> #include <Poco/Net/HTTPClientSession.h> #include <Poco/Net/HTTPRequest.h> #include <Poco/Net/SocketAddress.h> #include "net/HTTPEntireResponse.h" #include "ssl/SSLClient.h" namespace ...
/* -*- 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. * */ #include "core/pch.h" #include "adjunct/quick/models/NavigationItem....
#pragma once #include <string> #include <map> #include <cmath> #include <vector> #include <boost/math/constants/constants.hpp> using namespace std; class AresInterface { public: AresInterface(); ~AresInterface(); void updateAres(map<string,double> params); void getTb(vector<doub...
#include <algorithm> #include <limits> #include <ostream> #include "wali/Common.hpp" namespace wali { namespace domains { namespace details { template <typename BackingUInt> class MinPlus { public: typedef BackingUInt value_type; private: value_type m_value; ...
#include <string> #include <vector> #include <cstring> #include <iostream> #include <algorithm> using namespace std; int solution(string s) { int len=s.size(); string b="067u85670p91023857189235719034681-0394019238491024i190284094656123151361445234"; s+=b; int answer=len-1; for(int i=1;i<=len;...
#include "stdafx.h" #include "Act_ManaHeal.h" #include "ACTEffect.h" #include "../Monster.h" #include "../../GameData.h" Act_ManaHeal::Act_ManaHeal() { m_ActionId = enManaHeal; } bool Act_ManaHeal::Action(Monster* me) { if (m_target == nullptr) return true; if (m_first) { float mp = me->GetMP(); if (mp < m_cos...
/* iffy: blinkt doesn't seem to work with this project */ #include <stdio.h> #include <string.h> #include "pico/stdlib.h" #include "hardware/spi.h" #include "hardware/gpio.h" #include "hardware/pwm.h" #include "hardware/clocks.h" #include "blinkt.h" using u8 = uint8_t; using u16 = uint16_t; #define PIN_SCK 2 #defi...
/* -*- 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 Manuela Hutter (manuelah) */ #include "core/pch.h" #i...
#include<bits/stdc++.h> #define ll long long int #define ull unsigned long long int #define vi vector<int> #define vc vector<char> #define pb push_back #define pf push_front using namespace std; class node{ public: int data; node* next; node(int val){ data = val; next = NULL; } }; ...
# include <stdio.h> int cmmdc (int x, int y){ int rest; do { rest = x%y; x = y; y = rest; } while (rest!=0); return x; } int main (){ int a,b; char raspuns; do { printf (" Introduceti 2 valori intregi pozitive -->"); scanf ("%d%d", &a, &b); if (b>a) { int c = a;a = b;b = c; } printf (" Cm...
#ifndef int_var_ll_h #define int_var_ll_h class IntVarLL : public IntVar { static const bool ll_dec = true; struct LitNode { int var, val, prev, next; }; vec<LitNode> ld; vec<int> freelist; Tint li, hi; Lit valLit; std::string varLabel; Lit getGELit(int v); Lit getLELit(int v); void channelMin(int ...
#include "KinectManager.h" // -------------------------------------------------------------------------------- // KinectManager::KinectManager() { haveOpenedKinect = false; //meshNeedsUpdating = false; imagesNeedUpdating = false; //sensorThresholdNeedsUpdating = false; } // -------------------------...
#pragma once #include <GL/glew.h> #include <GLFW/glfw3.h> #include <GL/gl.h> #include <glm/vec4.hpp> #include <glm/vec3.hpp> #include <glm/mat4x4.hpp> #include <glm/gtc/matrix_transform.hpp> #include "Constantes.h" class Camera { glm::vec3 position; glm::vec3 lookAt; glm::vec3 forward; glm::vec3 right; glm::vec...
#ifndef Circulo_h #define Circulo_h #include "Figura.h" class Circulo: public Figura{ private: double dRadio; public: Circulo(); Circulo(double); Circulo(Punto,string,double); void setRadio(double); double getRadio(); double calcularArea(); double calcularPerimetro(); void desplegar(...
#include <iostream> #include <fstream> using namespace std; int main() { ifstream infile; infile.open("input/dahab.in"); string n; infile >> n; printf("%d\n", n.length()); }
//////////////////////////////////////////////////////////////////////////////// #include "MeshUtils.h" #include <iomanip> #include <cassert> #include <igl/edges.h> #undef IGL_STATIC_LIBRARY #include <igl/median.h> //////////////////////////////////////////////////////////////////////////////// namespace cellogram { ...
// Copyright (c) 2012-2017 The Cryptonote developers // Copyright (c) 2018-2023 Conceal Network & Conceal Devs // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #pragma once #include <atomic> namespace unit_test { class ca...
#ifndef _DX11_GPU_ATTRIBUTE_DATA_H_ #define _DX11_GPU_ATTRIBUTE_DATA_H_ #include <map> #include "d3d11.h" #include "InputLayout.h" #include "GpuVertexData.h" namespace HW{ class DX11RenderSystem; class DX11InputLayout; /** This class is used to store Vertex Buffers created for GPU And maintain the vertex buffe...
/* This is a basic camera device adapter for micromanager. It reads * out a video4linux device from /dev/video0 using the V4L2 api. I * used a Logitech QuickCam Pro 9000 but any modern USB webcam should * work. For now I fixed the resolution to 640x480 and data type to * YUV. In the beginning the V4L2 api is fed w...
#include <iostream> #include "WordsParser.h" using namespace std; using namespace WordCounter; int main(int argc, char **argv) { #pragma region CheckInput if (argc < 3) { cerr << "Not enought arguments!" << endl; cerr << "Right function call is \"word_count.exe input.txt output.csv\"" << endl; return 0; } ...
#include "stdafx.h" #include "TankMap.h" TankMap::TankMap() { } TankMap::~TankMap() { } HRESULT TankMap::Init() { Load(); return S_OK; } void TankMap::Release() { } void TankMap::Update() { } void TankMap::Render() { for (int i = 0; i < TILEX * TILEY; i++) { // 지형 IMAGE->FrameRender("tileMap", GetMemDC(...
#include <iostream> #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <math.h> using namespace std; int n,x; int s[111]; void input(){ scanf("%d %d",&n,&x); for (int i=0;i<n;i++) scanf("%d",&s[i]); } int binary_search(int so){ int l = 0; int r = n-1;...
#pragma once #include <random> #include <chrono> class GilbertElliot { public: GilbertElliot( double beta = 1.0, double gamma = 0.0 ) :_goodState(true) { generator.seed(std::chrono::system_clock::now().time_since_epoch().count()); } GilbertElliot( const GilbertElliot& other ) { ...
#include "Shape.h" Shape::Shape(int xx, int yy) :x(xx), y(yy) { } void Shape::show() { cout << "this is shape" << endl; }
#ifndef noteediteur_h #define noteediteur_h #include <QWidget> #include <QFormLayout> #include <QVBoxLayout> #include <QHBoxLayout> #include <QDate> #include <QPushButton> #include <QLineEdit> #include <QComboBox> #include <QRadioButton> #include <QGroupBox> #include <QCheckBox> #include <QDateEdit> #include <QSpinBox...
#pragma once #include <stdio.h> #include <windows.system.h> #include <iostream> #include "ErrorForm.h" #include <string> namespace Calculator { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace...
#include "pch.h" #include "MergeSort.h" #include <vector> #include <chrono> MergeSort::MergeSort() {} MergeSort::~MergeSort() {} void MergeSort::merge(std::vector<int> &left, std::vector<int> &right, std::vector<int> &bars) { int nL = left.size(); int nR = right.size(); int leftLoop = 0, rightLoop = 0...
// Generated from D:/4IF/PLD-COMP/Compilateur01\fichierAntlr.g4 by ANTLR 4.7 #include "fichierAntlrBaseVisitor.h"
#include "fifo.h" CFifo fifo_AutoField(&_cpu);
#include<bits/stdc++.h> using namespace std; class Solution { public: int divide(int dividend, int divisor) { int res = 0, flag=1; int flag2 = dividend; if(dividend==-2147483648&&divisor==-1) return 2147483647; if(dividend==-2147483648) {dividend+=1;} if(dividend>=0&&divi...
#include <stdio.h> int main() { int num1, num2; printf("Digite o primeiro numero: "); scanf("%d", &num1); printf("Digite o segundo numero: "); scanf("%d", &num2); printf("Soma = %d", num1 + num2); }
#pragma once #include <map> #ifdef _WIN32 #include <SDL.h> #else #include <SDL2/SDL.h> #endif // _WIN32 class KeyboardHandler { private: std::map<int, bool> keyStates; public: KeyboardHandler(); ~KeyboardHandler(); void handle(SDL_Event event); bool is_pressed(int keyCode); void clear_events()...
/************************************************************************************** * File Name : ObjectFactory.cpp * Project Name : Keyboard Warriors * Primary Author : Doyeong Yi * Secondary Author : * Copyright Information : * "All content 2019 DigiPen (USA) Corporation, all rights reserved...
/* First missing number(starting from 1) in the range (L, R) strictly greater than k*/ #include <bits/stdc++.h> using namespace std ; const int N = (int)1e6 + 6 ; int L[5 * N], R[5 * N], T[5 * N], TT[5 * N], root[N], idx ; void build(int i, int b, int e, int k){ if(b == e){ T[i] = b > k ; TT[i] = 0 ; return ...
#pragma once #include "aeScene.h" namespace aeEngineSDK { class AE_ENGINE_EXPORT aeOctrisNode { public: aeOctrisNode(); aeOctrisNode(const aeOctrisNode& O); aeOctrisNode(const aeVector3& Min, const aeVector3& Max); ~aeOctrisNode(); public: bool IsOverloaded(uint32 Max); void CreateNewBranches(MultiMap...
#ifndef MOBILEOBJECT_H #define MOBILEOBJECT_H #include "GameObject.h" class MobileObject : public GameObject { public: MobileObject(float, glm::vec3, glm::vec3); //used to update position each tick virtual void update(double dTime); protected: glm::vec3 velocity; float speed; }; #endif
// Copyright (c) 2019 Thomas Heller // Copyright (c) 2017 Agustin Berge // Copyright (c) 2017 Google // // 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.txt) #include <pika/error...
/** * @author shaoDong * @email scut_sd@163.com * @create date 2018-09-16 09:41:40 * @modify date 2018-09-16 09:41:40 * @desc 爬楼梯,一步或两步 */ #include <iostream> using namespace std; // 递归法,n 需要小于一定值,否则时间爆炸 // int climbStairs(int n) { // if(n == 1) // { // return 1; // } // else if(n == 2) ...
#include "player.hpp" #include <iostream> #include <cstdio> #include <vector> #include <cassert> #include <cstdlib> #include <cmath> #include <ctime> #include "gametree.hpp" #include "simulate.hpp" #include "gpu_utilities.hpp" // Comment out to use CPU only #define GPU_ON // Comment out to only do a rollout from a ...