text
stringlengths
8
6.88M
#include "utility/Histogram.h" #include <algorithm> Histogram::Bin::Bin(float minValue, float binSize) : minValue(minValue) , maxValue(minValue + binSize) , meanValue(minValue + 0.5f * binSize) , count(0) { } Histogram::Histogram(float binSize) : m_binSize(binSize) { } void Histogram::addValue(float value) { ...
// // Created by ssi on 25.05.15. // #include "Mongo.h" #include "../../renderexception.h" namespace feed { std::vector< Post > &Mongo::getFromDB() { mongo::Query query; std::auto_ptr< mongo::DBClientCursor > cursor = conn->query(base, query, 0); std::vector< Post > *vP = new std::vector< Post >; while (c...
#include "matrix.hpp" #include <iostream> #include <thread> #include <numeric> #include <cmath> Matrix::Matrix(size_t rows, size_t cols, int defVal, size_t threads) : m_rows{rows} , m_cols{cols} , m_threads{threads} , m_data{std::vector<std::vector<int>>{rows}} { for (auto& vec: m_data) { vec.reserve(...
// // Created by 钟奇龙 on 2019-04-15. // #include <vector> #include <deque> using namespace std; int getNum(vector<int> arr,int num){ if(arr.size() == 0) return 0; int res = 0; deque<int> qmax; deque<int> qmin; int i=0; int j=0; while(i < arr.size()){ while(j < arr.size()){ ...
#include <iostream> #include <utility> // std::swap #include <math.h> using namespace std; typedef long long ll; #include <string> #include <stdio.h> #include <iostream> #include <vector> int main() { int K=110011; string S=to_string(K); int n=S.length(); int count=0; //ans int num=0; fo...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> #include <iomanip> using namespace std; typedef long long ll; #define INF 10e17 // 4倍しても(4回足しても)long longを溢れない...
#pragma once #include <Eigen/Core> #include <Eigen/Geometry> namespace Cvl { void fixRotationMatrix(Eigen::Matrix3d & matrix); Eigen::Matrix<double, 6, 1> getModelViewParameters(Eigen::Affine3d const & modelView); Eigen::Affine3d createModelView(Eigen::Matrix<double, 6, 1> const & parameters); }
// ДАННЫЙ ПРИМЕР ОТОБРАЖАЕТ СОСТОЯНИЯ ВСЕХ КЛАВИШ НА ИХ СВЕТОДИОДАХ:// * Строки со звёздочкой являются необязательными. // (нажимайте кнопки клавиатуры) // // #include "../iarduino_I2C_Keyboard.h" ...
// Alfred Shaker // monitor.h // cs33901 #ifndef _UPPER_CASE_MONITOR #define _UPPER_CASE_MONITOR #include "observer.h" #include "observable.h" #include <vector> class UpperCaseMonitor : public Observable { public: //checks for upper case characters and keeps track of them UpperCaseMonitor() : c...
#ifndef HERA_PARALLEL_H #define HERA_PARALLEL_H #include <vector> #include <boost/range.hpp> #include <boost/bind/bind.hpp> #include <boost/foreach.hpp> using namespace boost::placeholders; #ifdef TBB #include <tbb/tbb.h> #include <tbb/concurrent_hash_map.h> #include <tbb/scalable_allocator.h> #include <boost/ser...
// Created on: 2014-10-20 // Created by: Denis BOGOLEPOV // Copyright (c) 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 pu...
#include<stdio.h> int visited[20]={0}; int n; int cost[20][20]={0}; void prims(){ int mincost=0,edges=1,i,j,a,b; visited[1]=1; printf("Enter the cost as matrix:\n"); int cost[n+1][n+1]; for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ scanf("%d",&cost[i][j]); if((cost[i][j]==0)||(i==j)){//if self loop or ...
#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...
// // test.cpp for training in /home/franco_n/tek_one/test/cpp/git/pokemon_poubelle/classes // // Made by François Clément // Login <franco_n@epitech.net> // // Started on Tue Sep 15 18:24:02 2015 François Clément // Last update Tue Sep 15 18:41:51 2015 François Clément // #include <cassert> #include <sstream> #i...
//-------------------------------------------------------- // musket/example/screen.cpp // // Copyright (C) 2018 LNSEAB // // released under the MIT License. // https://opensource.org/licenses/MIT //-------------------------------------------------------- #include <iostream> #include <spirea/windows/d3d11.hpp> #includ...
/* * @Description: key frames 信息发布 * @Author: Ren Qian * @Date: 2020-02-06 21:11:44 */ #include "lidar_localization/publisher/key_frames_publisher.hpp" #include <Eigen/Dense> namespace lidar_localization { KeyFramesPublisher::KeyFramesPublisher(ros::NodeHandle& nh, std::strin...
#pragma once #include "StaticObjectModel.h" #include "LevelModel.h" #include "AvatarModel.h" class StaticObjectLogicCalculator { public: StaticObjectLogicCalculator(); ~StaticObjectLogicCalculator(); public: void init(LevelModel* levelModel, StaticObjectModel* staticObjectModel); void computeLogic(); private: b...
#include<bits/stdc++.h> using namespace std; map<char,int> mp; int main(){ string s; cin>>s; int sz=s.size(); for(int i=0;i<sz;i++) mp[s[i]]++; int ans=0; for(int i=0;i<26;i++){ if(mp[i+'a']%2!=0) ans++; } if(ans%2!=0||ans==0) cout<<...
// // Created by arnito on 18/05/17. // #include "NoteTextEvent.h" #include "Resources.h" NoteTextEvent::NoteTextEvent(NoteTextEvent::NoteType type,int player){ _noteType = type; _isActive = true; _timeLeft = 1; _player = player; } NoteTextEvent::~NoteTextEvent(){ } void NoteTextEvent::draw(sf::Rende...
// Created on: 1998-12-16 // Created by: Roman LYGIN // Copyright (c) 1998-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 Le...
#include <iostream> #include <cstdlib> using namespace std; long long sum[2] = {0}; long long check(int n, int s, long long a[]) { long long cnt = 0; // 条件を満たすように修正した要素を格納するための配列 long long na[n]; for (int i = 0; i < n; i++) { na[i] = a[i]; // 偶数番目のsumが正の場合の操作回数をカウントする if (s ...
#pragma once #include <vector> #include <string> #include <unordered_map> //------------------- Debug mode switch #ifdef DEBUG #undef DEBUG #endif #define DEBUG false #define DBG(expr) if (DEBUG) {expr;} //------------------- All lexems present in grammar enum lexems_t { ID, VALUE, ASSIGN, ADD, SUB, MUL, DIV, LE...
/* * Created by Peng Qixiang on 2018/8/9. */ /* * 从1到n整数中1出现的次数 * 求出1~13的整数中1出现的次数,并算出100~1300的整数中1出现的次数?为此他特别数了一下1~13中包含1的数字有1、10、11、12、13因此共出现6次 * 求出任意非负整数区间中1出现的次数(从1 到 n 中1出现的次数) * */ # include <iostream> using namespace std; class Solution { public: // 暴力 int NumberOf1Between1AndN_Solution(int n...
#include "GetPlayerListProc.h" #include "Logger.h" #include "HallManager.h" #include "Room.h" #include "ErrorMsg.h" //#include "UdpManager.h" #include "ProcessManager.h" #include "GameCmd.h" #include "IProcess.h" REGISTER_PROCESS(CLIENT_MSG_GETPLAYERRLIST, GetPlayerListProc) GetPlayerListProc::GetPlayerListProc() { ...
// DyLua: SimpleGraphic // (c) David Gowor, 2014 // // UI Sub Script Header // // ========== // Interfaces // ========== // UI Sub Script Handler class ui_ISubScript { public: static ui_ISubScript* GetHandle(class ui_main_c*, dword id); static void FreeHandle(ui_ISubScript*); virtual bool Start() ...
#include "event.h" #include "ui_event.h" #include <QMouseEvent> #include <QKeyEvent> event::event(QWidget *parent) : QMainWindow(parent), ui(new Ui::event) { ui->setupUi(this); } event::~event() { delete ui; } void event::mousePressEvent(QMouseEvent *e) { ui->label->setText(tr("(%1,%2)").arg(e->x(...
#include <cmath> #include <map> #include <random> #include <set> #include "../space/initial_triangulation.hpp" #include "bilinear_form.hpp" int bsd_rnd() { static unsigned int seed = 0; int a = 1103515245; int c = 12345; unsigned int m = 2147483648; return (seed = (a * seed + c) % m); } using namespace spa...
#include <QCoreApplication> #include "arz.h" int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); ARZ arz; arz.doit(); return a.exec(); }
#include "GoRollingCmd.h" #include <maya/MGlobal.h> #include <maya/MSelectionList.h> #include <maya/MDagPath.h> #include <maya/MFnTransform.h> #include <maya/MString.h> #include <maya/MItSelectionList.h> #include <maya/MFn.h> #include <maya/MSyntax.h> #include <maya/MPlug.h> //#include <maya/MFnPlugin.h> MStatus GoRol...
#include "TreeDLA.h" #define Nw 320 #define Nh 240 #define MAXTREELEVEL 7 //#define Xoffset 0 testin as global variable ofFbo FboBackground; int NoutX; int NoutY; unsigned char Imin =0; unsigned char Imax = 255; ofDirectory dir; int FondSize; int FondSelect = 1; const int Nob=3000; const int Ntg=3000; int T...
#include "stdafx.h" #include "Rect.h" #include "Common\Camera.h" #include "./Animation/AnimationClip.h" Rect::Rect() { } Rect::~Rect() { } void Rect::Init() { // 쉐이더 초기화 // 에러값 확인이 어려우므로 // 쉐이더 로딩시 에러가 나면 에러 내용을 받아올 꺼 LPD3DXBUFFER pError = NULL; // 쉐이더 옵션 지정 DWORD shaderFlag = 0; // 지정되어야만 디버깅시 쉐이더 확인이 가능...
/*! \author Ken Jinks \date Aug 2018 \file jinks_math.h \brief This file contains math functions not in math.h */ #ifndef _JINKS_MATH_H_ #define _JINKS_MATH_H_ #define _PI_ 3.141592653589793 #define _PI2_ 6.283185307179586 #include <math.h> namespace JinksMath { template <class T> T lerp ( T& value1, T& value...
#include<bits/stdc++.h> using namespace std; int m, n; int a[100][100]; void input(){ cin >> m >> n; for(int i = 0; i < m; i++) for(int j = 0; j < n; j++) cin >> a[i][j]; } int main(){ freopen("COLSORT.inp", "r", stdin); freopen("COLSORT.out", "w", stdout); input(); for(int j = 0; j < n; j++){ ...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 1995-2008 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * @author Patricia Aas (psmaas) */ #include "core/pch.h" // Core : #include "modules...
// 问题的描述:荷兰三色国旗问题 // 给定一个只包含0、1、2的数组,要求返回排序后的数组 // 将0全部放到前面,将2全部放到后面 // 测试用例有2组: // 1、空数组 // 输入:[] // 输出:[] // 2、正常数组 // 输入:[0, 1, 1, 0, 2, 2] // 输出:[0, 0, 1, 1, 2, 2] #include <iostream> #include <vector> using namespace std; void SortThreeColors(vector<int> &nums, int array_length) { ...
// Created on: 2013-10-02 // Created by: Denis BOGOLEPOV // Copyright (c) 2013-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 ...
#include "pch.h" #include "InteractWithWorld.h" #include "WindowEventHandler.h" #include "Transform.h" #include "Orientation.h" #include "GameObject.h" #include "MapRepresentation/GameObjectGridMap.h" #include "Inventory.h" #include "IInteractable.h" #include "InteractableTypes/Seed.h" #include "InteractableTypes/NoIn...
#pragma once #include "dbcache_logic.hpp" #include "utils/assert.hpp" #include "utils/instance_counter.hpp" #include "dbcache_logic.hpp" #include <boost/any.hpp> #include <vector> using namespace std; namespace nora { namespace dbcache { template <typename T> class dbc_object...
//By SCJ //#include<iostream> #include<bits/stdc++.h> using namespace std; #define endl '\n' #define maxn 100005 struct Edge{ int to,cost,id; }; vector<Edge> G[maxn]; int n,q,s,in[maxn],out[maxn],now[maxn*2]; int bit[maxn*2],en[maxn],ck=0; bool used[maxn]; void add(int x,int c) { while(x<=n*2) { bit[x]+=c; x+=(x...
#include "2-1.h" #include<stdio.h> #include<iostream> using namespace std; typedef struct { char name[100]; char gender[4]; int age; char phone[100]; }Data; int main(void) { Data D[4] = {}; for (int i = 0; i < 4; i++) { cin >> D[i].name; cin >> D[i].gender; cin >> D[i].age; cin >> D[i].phone; } fo...
class Solution { public: pair<int,int> findlevel( TreeNode* root, int a,int height,int &parent){ if(!root) return {0,0}; if(root->val==a) return {height,parent}; // parent = root->val; pair<int,int> level = findlevel(root->left,a,height+1,root->val); if(level.first) return le...
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved. #include "PakMapToolsModule.h" #include "PakMapToolsModuleEdMode.h" #define LOCTEXT_NAMESPACE "FPakMapToolsModuleModule" void FPakMapToolsModuleModule::StartupModule() { // This code will execute after your module is loaded into memory; the exact timing i...
#include <SoftwareSerial.h> #include <VirtualWire.h> const int PIN_RX = 2; const int PIN_TX = 3; const int PIN_LED = 12; boolean isLED_On = false; SoftwareSerial serial(PIN_RX, PIN_TX); void setup() { serial.begin(9600); pinMode(PIN_LED, OUTPUT); digitalWrite(PIN_LED, LOW); } void loop() { // int data = an...
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */ #include "core/pch.h" #include "modules/ecmascript/carakan/src/es_pch.h" #include "modules/ecmascript/carakan/src/object/es_property.h" ES_Properties *ES_Properties::Make(ES_Context *context, unsigned size, un...
#ifndef GRAPHTRAVERSE_H #define GRAPHTRAVERSE_H #define UNVISITED 1 #define VISITED 0 #include "Graphm.h" class GraphTraverse { public: GraphTraverse(Graphm& g); void dfs(int vertex); void bfs(int vertex); private: bool* mark; int numVertex; Graphm& graph; void setMark(int v) { mark[v] = VISITED; } bool g...
#include "global.h" Source Data::read_source() { char file[256]; filename(file,"source.dat"); FILE *in = fopen(file,"r"); if (in == NULL) INFO("no input source.dat",true); int ns; fscanf(in,"%d",&ns); if (ns != 1) INFO("num. of sources is not 1",true); int relative; fscanf(in,"%d",&relative); float tmpx...
/** * @author Dmitry Lunin * @date 19.09.2018 * @version 1.0 * \file */ #include "Text.h" const size_t NUM_OF_BAD_SYMB = 30; const char BadSymbols[NUM_OF_BAD_SYMB] = ".,;:!?«»()—… []\"'*-"; bool InArray(const Symbol& a, const char* check_arr) { char a_symb_start = *(a.GetStartByte()); for (in...
// Copyright (C) 2018-2019 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // #pragma once #include <map> #include <unordered_map> #include <unordered_set> #include <string> #include <vpu/vpu_plugin_config.hpp> #include <vpu/private_plugin_config.hpp> #include <vpu/parsed_config_base.hpp> #include <vpu/gr...
#include "circulate_state_subscriber.h" CCirculateStateSubscriber::CCirculateStateSubscriber() : m_pOnDataAvailable(nullptr) { } CCirculateStateSubscriber::~CCirculateStateSubscriber() { } bool CCirculateStateSubscriber::ValidData() { return (m_sampleInfo.valid_data == DDS_BOOLEAN_TRUE); } DataTypes::Uuid C...
#include "ControlWidget.h" #include <QFileDialog> #include "MainWindow.h" #include "UrbanGeometry.h" #include "GLWidget3D.h" #include "global.h" #include "GraphUtil.h" #include "BBox.h" ControlWidget::ControlWidget(MainWindow* mainWin) : QDockWidget("Control Widget", (QWidget*)mainWin) { this->mainWin = mainWin; /...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "ListeningItem.h" #include "LuminousPlant.generated.h" /** * */ UCLASS() class HYPOXIA_API ALuminousPlant : public AListeningItem { GENERATED_BODY() public: ALuminousPlant(); virtual void BeginPlay() overrid...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2012 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 CPUUSAGETRACKING #include "modules...
#include "stdafx.h" #include "render.h" static GLint snowman_display_list; void quit() {} void processKeyboard(unsigned char key, int x, int y) { printf("key: %d\n",key); } void picked(GLuint name, int sw) { printf("my name = %d in %d\n",name,sw); } void init(camera *cam) { cam->pos[0] = 1.5; cam->pos[1]...
#include "treeface/gl/Errors.h" namespace treeface { } // namespace treeface
#include "XDemuxThread.h" #include "XDemux.h" #include "XVideoThread.h" #include "XAudioThread.h" extern "C" { #include "libavcodec/avcodec.h" } XDemuxThread::XDemuxThread() { } XDemuxThread::~XDemuxThread() { isExit = true; wait(); } bool XDemuxThread::Open(const char* url, IVideoCall* call) { if (url == NULL |...
#pragma once // CWizPg1 对话框 class CWizPg1 : public CPropertyPage { DECLARE_DYNAMIC(CWizPg1) public: CWizPg1(); virtual ~CWizPg1(); virtual BOOL OnSetActive(); // 对话框数据 enum { IDD = IDD_WIZPAGE1 }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 DECLARE_MESSAGE_MAP() };
#ifndef COORD_FRAME_HPP #define COORD_FRAME_HPP #include <glm/glm.hpp> #include <graphics/glarray.h> #include <graphics/RenderBundle.h> #include <graphics/Shader.hpp> typedef struct CoordFrame { float len; glm::mat4 pose; GLArray glarray; Shader* shader; } CoordFrame; //////////////////////////////////////////...
#include <stdio.h> /* for printf() and fprintf() */ #include "Packet/packet.h" #include <dirent.h> #include <iostream> #include "Utils/network_utils.h" int main(int argc, char const *argv[]) { Packet *packet = new Packet::Packet("Delete", "MESSAGE new one for new message "); printf("%s\n", packet->getAction()...
#pragma once #include "WndSuper.h" namespace ATLX{ int WINAPI AtlxMessageBox(ATLX::CString prompt, UINT type, TCHAR* lpszCaption=NULL); class CDataExchanger { public: CDataExchanger(HWND hDlg, BOOL bSaveAndValidate = FALSE); virtual ~CDataExchanger(); inline void UpdateText(int nIDC, BYTE& va...
//--------------------------------------------------------------------------- #ifndef AThreadLockH #define AThreadLockH //--------------------------------------------------------------------------- #include <vcl.h> class ThreadLock { private: CRITICAL_SECTION * m_Lock; public: ThreadLock(CRITICAL_SECTION * lock) ...
struct Node { int data; // 0 <= data <= 1E4 Node* left; Node* right; } bool checkBST(Node* root) { int min_so_far = -1; return checkSubtree(root, min_so_far); } bool checkSubtree(Node* node, int& min_so_far) { if (node->left != nullptr && !checkSubtree(node->left, min_so_far)) { return false; } if (node->da...
#ifndef _MSG_0X03_CHATMESSAGE_TW_H_ #define _MSG_0X03_CHATMESSAGE_TW_H_ #include "mcprotocol_base.h" namespace MC { namespace Protocol { namespace Msg { class ChatMessage : public BaseMessage { public: ChatMessage(); ChatMessage(const String16& _text); size_t serialize(Buffer& _dst, size_t _offset); size_t dese...
// -*- Mode: C++ -*- // Version.h // Copyright © 2005 Laboratoire de Biologie Informatique et Théorique // Université de Montréal. // Author : Philippe Thibault <philippe.thibault@umontreal.ca> // Created On : Wed May 11 10:07:28 2005 // $Revision$ // $Id$ ...
#include<bits/stdc++.h> using namespace std; #define PI 3.1415926535897932 void printMatrix(int arp[2][2]) { for (int i=0;i<2;++i) { for (int j=0;j<2;++j) { printf("%d行%d列の値は%d\n",i+1,j+1,arp[i][j]); } } return; } int main(){ int a[2][2] = {{1,5}, {4,8}}; printMatrix(a...
#ifndef CSOFTINSTALLRESULTSENDTH_H #define CSOFTINSTALLRESULTSENDTH_H #include <QThread> #include "common.h" class CSoftInstallResultSendThread : public QThread { Q_OBJECT public: CSoftInstallResultSendThread(QObject *parent = 0); ~CSoftInstallResultSendThread(); static CSoftInstallResultSendThread* Instance();...
#include "HeartProc.h" #include "Logger.h" #include "HallManager.h" #include "BackConnect.h" HeartProc::HeartProc() { this->name = "HeartProc"; } HeartProc::~HeartProc() { } int HeartProc::doRequest(CDLSocketHandler* client, InputPacket* pPacket, Context* pt ) { int cmd = pPacket->GetCmdType() ; if(cmd==HALL_H...
// -*- c++ -*- /****************************************************************************** * arenaalloc.h * * Arena allocator based on the example logic provided by Nicolai Josuttis * and available at http://www.josuttis.com/libbook/examples.html. * This enhanced work is provided under the terms of the MIT...
#ifndef GAME_H #define GAME_H #include <QObject> #include <QTimer> #include <QVector> struct Task { Task(int aScoreValue = 1) { scoreValue = aScoreValue; } Task(QString aQuestion, QString aAnswer, QString wrongAnswer1, QString wrongAnswer2, QString wrongAnswer3) : question(aQuestion), ans...
/* Author: Manish Kumar Username: manicodebits Created: 20:06:47 20-09-2021 */ #include <bits/stdc++.h> using namespace std; #define int long long #define PI 3.141592653589 #define MOD 1000000007 #define FAST_IO ios_base::sync_with_stdio(false), cin.tie(0) #define deb(x) cout<<"[ "<<#x<<" = "<<x<<"] " int...
#include "Input.h" // Singleton requirement Input* Input::instance; // --------------- Basic usage ----------------- // // The keyboard functions all take a single character // like 'W', ' ' or '8' (which will implicitly cast // to an int) or a pre-defined virtual key code like // VK_SHIFT, VK_ESCAPE or VK_TAB. The...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin >> n; string ans = ""; ll base = 1; while(n != 0){ if(n%(base*2) != 0){ n -= base; ans += "1"; } else ans += "0"; base *= -2; } ...
/** * @file poj3719.cc * @author FAN Kai (fankai@net.pku.edu.cn), Peking University * @date May 29 05:01:40 PM CST 2009 */ #include <iostream> #include <vector> #include <set> #include <algorithm> #include <map> #include <functional> #include <cassert> #include <cstdio> using namespace std; typedef vector...
//算法:模拟 //根据题意模拟即可 //详见注释 #include<cstdio> using namespace std; int main() { int n; scanf("%d",&n);//输入 int k=2; while(n>0) { for(int j=1;j<=k-1;j++)//找同一条对角线上的 { int l=k-j;//找到 n--;//找到一个数 if(n==0 && k%2==1)//找到要找的数且k为奇数 printf("...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2010 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #include "core/pch.h" #include "adjunct/quick/Application.h" #i...
#include <iberbar/RHI/OpenGL/CommonDynamic.h> #include <iberbar/RHI/OpenGL/Device.h> extern "C" __iberbarRHIOpenGLApi__ iberbar::RHI::IDevice* iberbarRhiDeviceCreate() { return new iberbar::RHI::OpenGL::CDevice(); }
#include "arpfind.h" int32_t arpGet(arpmac* srcmac, nexthop* nexthopinfo) { // fprintf(stderr, "begin arp\n"); arpreq arp_req; sockaddr_in *sin = (sockaddr_in*)&(arp_req.arp_pa); memset(&arp_req, 0, sizeof(arp_req)); sin->sin_family = AF_INET; sin->sin_addr.s_addr = nexthopinfo->nexthopaddr.s_addr; // fprintf(s...
#ifndef STATUSLABEL_H #define STATUSLABEL_H #include <QWidget> #include <QLabel> #include <QTimer> #include <QFont> #include <QFontMetrics> class statusLabel : public QLabel { Q_OBJECT public: explicit statusLabel(QWidget *parent = 0); explicit statusLabel(const QString &text, QWidget *paren...
#include<bits/stdc++.h> using namespace std; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); int month; cin>>month; switch(month) { case 1: cout<<"January\n"; break; case 2: cout<<"February\n"; break; case 3: cout<<"March\n"; break; case 4: cout<<...
// Fill out your copyright notice in the Description page of Project Settings. #include "ObjectPool.h" IObjectPoolable* UObjectPool::GetRecycledObject() const { // 요소의 개수가 0 이라면 nullptr 리턴 if (PoolObjects.Num() == 0) return nullptr; // 추가된 객체중 재사용 가능한 객체를 찾습니다. for (auto poolObject : PoolObjects) { if (poolO...
/* ** EPITECH PROJECT, 2019 ** tek3 ** File description: ** Contact */ #include "Contact.hpp" #include "ContactList.hpp" namespace babel { namespace graphic { Contact::Contact(babel::DataUser data, QWidget *parent) : QWidget(parent), _data(data) { _isSelected = false; setB...
// Solution 1 Reverse first n-k elements, reverse last k elements, and reverse all elements class Solution { public: void rotate(vector<int>& nums, int k) { int n = nums.size(); k %= n; reverse(nums.begin(), nums.begin() + n - k); reverse(nums.begin() + n - k, nums.end()); re...
#include "commands/ComRelease.h" //References the main header file #include <Robot.h> ComRelease::ComRelease() : frc::Command("ComRelease") { //tells comRelease that it needs the grabber object from the robot class Requires(&Robot::grabber); } //a function that runs once when a command is called void ComRelease...
#include <iostream> int main() { //Syntax: // for (declaration; logicExpresion; increment) { // code // } //Example: Print the multiplication table of a number int number = 0; std::cout << "Enter a number: "; std::cin >> number; for (int i = 0; i <= 10; i++) { std::cout << number << " *...
#include<cstdio> #include<cstring> #define MAXX 222 short dg[MAXX]; short n,r,i,j; int main(){ while(scanf("%hd %hd",&n,&r)!=EOF){ memset(dg,0,sizeof(dg)); while(r--) scanf("%hd %hd",&i,&j),++dg[i],++dg[j]; for(i=0;i<n;++i) if(!dg[i]||dg[i]&1) ...
// Created on: 1993-03-10 // Created by: JCV // Copyright (c) 1993-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser Gen...
#include<bits/stdc++.h> #define ll long long #define ull unsigned long long #define pb push_back #define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL)); using namespace std; int main() { fastread(); char str[20]; int n, four=0,seven=0,fourty...
#include<iostream> #include<vector> #include<algorithm> using namespace std; class Solution1 { public: vector<vector<int>> fourSum(vector<int>& nums, int target) { int i, j, k, t; vector<vector<int>> res; int len = nums.size(); if (len < 4) //当输入的元素小于4,返回"" return res; sort(nums.begin(), nums.end()); //...
/********************************************************** // // Wih (Wireless Interface Hockey) // // rs.cpp (RS232Cによるシリアル通信クラス) // // Copyright (C) 2007, // Masayuki Morita, Kazuki Hamada, Tatsuya Mori, // All Rights Reserved. **********************************************************/ #include...
#include<bits/stdc++.h> #define rep(i,n) for (int i =0; i <(n); i++) using namespace std; using ll = long long; const double PI = 3.14159265358979323846; int main(){ int N; cin >> N; string ans = ""; ans .push_back('1'); for(int i = 1; i < N; i++)ans.push_back('0'); ans.push_back(...
#ifndef _RENDER_TEXTURE_H_ #define _RENDER_TEXTURE_H_ #include <d3d11.h> #include "../pch.h" #include "Graphics.h" #pragma once class RenderTexture { public: RenderTexture(std::shared_ptr<Graphics> graphics); ~RenderTexture(); bool Initialize(int textureWidth, int textureHeight); void SetRenderTarget(); void...
#include "mainwindow.h" #include "apirequest.h" #include <QApplication> #include <QTableWidget> #include <QHeaderView> #include <QRect> int main(int argc, char *argv[]) { QApplication a(argc, argv); ApiRequest areq; areq.show(); return a.exec(); }
#pragma once #include <string> #include <sstream> #include <iostream> #include <algorithm> #include <SDL2/SDL.h> #include "fwd.hpp" #include "engine/audio/AudioSource.hpp" #include "engine/graphics/LButton.hpp" #include "engine/graphics/LTexture.hpp" #include "engine/graphics/PhysicsObject.hpp" #include "engine/grap...
// // linearList.h // linearList // // Created by Apple on 2017/3/7. // Copyright © 2017年 Apple . All rights reserved. // #ifndef linearList_h #define linearList_h #include <iostream> #include <sstream> #include "Exception.hpp" template <typename T> class linearList { public: virtual ~linearList() {}; ...
#include "SAT3.h" #include <cstring> #include <list> #include <cstdio> #include <iostream> #include "z3++.h" using namespace std; using namespace z3; bool SAT3::optimizedget() { cout<<"optimizedget"<<endl; bool get = false; int currentnum = this->graph.points.size()/4 + 1; int minimum = 1000000; const int t...
// Copyright (c) 2020 John Biddiscombe // // 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) #pragma once #include <pika/config.hpp> #if defined(PIKA_HAVE_GPU_SUPPORT) # includ...
#pragma once class Monster; class EFire :public GameObject { public: void init(Monster* target); bool Start(); void Update(); private: Monster* m_target = nullptr; CEffect* m_effect = nullptr; float m_time = 10.0f; };
/*********************************************************************** !!!!!! DO NOT MODIFY !!!!!! GacGen.exe Resource.xml This file is generated by Workflow compiler https://github.com/vczh-libraries ***********************************************************************/ #ifndef VCZH_WORKFLOW_COMPILER_GENERATED...
/**********************\ * Structs & Globals * \**********************/ struct language { std::vector<std::vector<std::string>> nouns; std::vector<std::vector<std::string>> verbs; std::vector<std::vector<std::string>> adjectives; std::vector<std::vector<std::string>> prepositions; }; /***************...
#ifndef _MSG_0X0A_PLAYER_CTS_H_ #define _MSG_0X0A_PLAYER_CTS_H_ #include "mcprotocol_base.h" namespace MC { namespace Protocol { namespace Msg { class Player : public BaseMessage { public: Player(); Player(bool _onGround); size_t serialize(Buffer& _dst, size_t _offset); size_t deserialize(const Buffer& _src, si...
#include <iostream> #include <stack> #include <queue> #include "dirgraph.h" class DepthFirstOrder { private: vector<bool> marked; queue<int> pre; //所有顶点的前序排列 queue<int> post; // 所有顶点的后序排列 stack<int> reversePost; // 所有顶点的逆后序排列 private: void dfs(Digraph &G,int v) { pre.push(v); m...