text
stringlengths
8
6.88M
#include<iostream> int main() { int i = 10, j = 20; int *pi = &i; std::cout << "*pi: " << *pi << std::endl; *pi = 30; std::cout << "*pi: " << *pi << std::endl; pi = &j; std::cout << "*pi: " << *pi << std::endl; return 0; }
#pragma once #include "PhysicsObject.h" #include <algorithm> #include "PhysicsMaterial.h" class RigidBody : public PhysicsObject { protected: bool m_isKinematic; //Linear float m_mass; vec2 m_position; vec2 m_velocity; float m_linearDrag; const float MIN_LINEAR_THRESHOLD; //Why can't this be static? //...
/* This file is part of the VRender library. Copyright (C) 2005 Cyril Soler (Cyril.Soler@imag.fr) Version 1.0.0, released on June 27, 2005. http://artis.imag.fr/Members/Cyril.Soler/VRender VRender is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as pub...
#include<iostream> using namespace std; int stack[100],top=-1 , size=100; int push() { int data; if(top==size-1) { cout<<"Overflow! "; } else { cout<<"Enter the data : "; cin>>data; top++; stack[top]=data; } } int pop() { if(top==-1) { cout<<"Underflow"; } else { int data=stack[top]; top--; ...
#include <iostream> using namespace std; struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; class SymmetricalTree { public: TreeNode* Mirror(TreeNode* pRoot) { if (pRoot == nullptr) return pRoot; TreeNode* newNode = new TreeNode(pRoot->...
// Created on: 1991-05-13 // Created by: Laurent PAINNOT // Copyright (c) 1991-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GN...
/* Name: �����⣿ Copyright: Author: Hill bamboo Date: 2019/8/18 15:44:23 Description: �õ���ջ̰�ĵ�ɨ���� */ #include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 10; int hist[maxn]; int stk[maxn]; int top; int n; int main() { string str; cin >> str; for (int i = 0; i < str.size(); i += 2, ++n) { ...
#include "newtonianrelativisticgravity.h" #include <cmath> NewtonianRelativisticGravity::NewtonianRelativisticGravity(double G) : m_G(G) { } void NewtonianRelativisticGravity::computeForces(Particle &a, Particle &b) { //initiating variables double m1 = a.getMass(); double m2 = b.getMass(); double ...
#pragma once #include <iberbar/RHI/Headers.h> #include <iberbar/RHI/Types.h> #include <iberbar/Utility/Result.h> namespace iberbar { namespace RHI { enum class UResourceType { Unknown, Texture, VertexBuffer, IndexBuffer, UniformBuffer, Shader, ShaderProgram, Effect, VertexDeclaration...
#include "imagio_sdl.h" #include "imgui.h" #include <stdlib.h> #if defined(_MSC_VER) #include "SDL.h" #else #include "SDL/SDL.h" #endif SDL_Surface *window; bool ImGuiSdl::Init() { if (SDL_Init(SDL_INIT_VIDEO) < 0) { fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError()); exit(1); } atexit(SDL_Quit); ...
#include <iostream> #include <fstream> #include <bitset> using namespace std; #define DEBUG //#define NUM_CHAR (1) //#define NUM_CHAR (8) #define NUM_CHAR (1024*512) // Frame number #define FRAME_NUM 22 // length of LFSR stored as bitmask #define LFSR1_BITMASK 0x0007FFFF // 19 bit LFSR #define LFSR2_BITMASK 0x00...
#include "schedulerwidget.h" #include "ui_schedulerwidget.h" using namespace std; SchedulerWidget::SchedulerWidget(QWidget *parent) : QDialog(parent), ui(new Ui::SchedulerWidget) { ui->setupUi(this); loaded_scheduler_ = ""; for(int row=0;row<24;row++){ for(int col=0;col<7;col++){ ...
/********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2010, LABUST, UNIZG-FER * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following c...
#include <map> #include "SpriteInfo.h" struct Assets { static void loadAssets(); static std::map<std::string, SpriteInfo> sprites; };
//算法:DP/模拟/(搜索) // 由题意可知,每一个点的答案 //可以由左下方,下方,右下方中的最大值得到 //由此,可以进行DP,也可以搜索 //状态转移方程: map[i][j]+=max(map[i+1][j+e[k]]) //[i+1][j+e[k]]为可以到达i的点 #include<cstdio> #include<algorithm> using namespace std; int n,m,ans=-2100000000; int map[210][210];//map存图, bool f[210][210];//存是否可以到达 int e[4]={0,-1,0,1};//存...
#include<cstdio> #include<iostream> using namespace std; #define PI 3.14159265358979323 int main(){ double r; cin>>r; double ans=PI*r*r; printf("%.7f",ans); return 0; }
#include <stdio.h> #define N 100 /* write an algorithm such that if an element in an M*M matrix is 0.its entire row and column is set to 0 */ typedef struct Record{ int pos_i; int pos_j; }Record; void my_replace(int matrix[][N], int pos_i, int pos_j,int length){ int i = 0; int j = 0; for(i = pos_i,j = 0; j<le...
#pragma once namespace Jaraffe { class GameObject; namespace Component { class BaseComponent : public Jaraffe::Object { // **************************************************************************** // Constructor/Destructor) // ---------------------------------------------------------------------------- public: Ba...
#include "PointLight.h" PointLight::PointLight() { _iRed = 0; _iGreen = 0; _iBlue = 0; _attenA = 0; _attenB = 0; _attenC = 0; } PointLight::PointLight(float c, Vertex v) { _iRed = _iGreen = _iBlue = c; _lightPosition = v; } PointLight::PointLight(float c, Vertex v, float aa, float ab, float ac) { _iRed = _i...
#include <iostream> #include <iomanip> #include "Tiempo.h" #include <ctime> #define UTC (-5) Tiempo::Tiempo(int h, int m, int s) { if (h == 0 || m == 0 || s == 0) { time_t rawtime; struct tm *ptm; std::time(&rawtime); ptm = gmtime(&rawtime); setTiempo((ptm->tm_hour + UTC...
/* Name : Aman Jain Date : 11-07-2020 Given a value N, if we want to make change for N cents, and we have infinite supply of each of S = { S1, S2, .. , Sm} valued coins, how many ways can we make the change? The order of coins doesn’t matter. https://www.geeksforgeeks.org/coin-change-dp-7/ For example, for N = 4 ...
// Copyright (C) 2013 Hartmut Kaiser // Copyright (C) 2007 Anthony Williams // // 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/barrier.hpp> #include <pika/futur...
#include "cuda_runtime.h" #include "device_launch_parameters.h" #include <math.h> #include<cmath> #include "mclmcr.h" #include<complex> #include <cuComplex.h> #include<stdlib.h> #include <stdio.h> #include <iostream> #include <windows.h> #include <cublasXt.h> #include <cublas_v2.h> //#include<complex.h> using namesp...
#include "Individual.h" ga::Individual::Individual( std::vector<size_t> & configuration, ANN::ANeuralNetwork::ActivationType activation_type, float scale, std::string data_source ) { this->configuration = configuration; this->activation_type = activation_type; this->scale = scale; this->RandomInit(); if (A...
#ifndef _FindPrivateRoomProc_H_ #define _FindPrivateRoomProc_H_ #include "IProcess.h" #include "ProcessFactory.h" class FindPrivateRoomProc :public IProcess { public: FindPrivateRoomProc(); virtual ~FindPrivateRoomProc(); virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket,Context* ...
/* * File: main.cpp * Author: Daniel Canales * * Created on June 24, 2014, 9:41 PM */ #include <cstdlib> #include <iostream> using namespace std; /* * */ int main(int argc, char** argv) { //5 items purchased float item1 = 12.95, item2 = 24.95, item3 = 6.95, item4...
// Copyright (c) 2021 ETH Zurich // // 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/modules/execution.hpp> #include <pika/testing.hpp> #include <pika/executio...
#ifndef _SORTING_HPP #define _SORTING_HPP 1 #include <thread> #include "seq_linear_list.hpp" namespace cs202 { template<class T> class Sort{ public: void insertionSort(LinearList<T>& A, int low, int high); void bubbleSort(LinearList<T>& A, int low, int high); void rankSort(LinearList<T>& A,...
#include "DirectInput.h" // static Singleton_cpp(DirectInput) // public DirectInput::DirectInput() { mDirectInput = NULL; mKeyboard = NULL; mMouse = NULL; } DirectInput::~DirectInput() { mMouse->Unacquire(); SafeReleaseCom(mMouse); mKeyboard->Unacquire(); SafeReleaseCom(mKeyboard); SafeReleaseCom(mDirec...
#include "deluser.h" #include "ui_deluser.h" deluser::deluser(QWidget *parent) : QWidget(parent), ui(new Ui::deluser) { ui->setupUi(this); } deluser::~deluser() { delete ui; } void deluser::closeEvent(QCloseEvent *event) { ui->masterkey->clear(); ui->usertabel->clear(); ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-file-style: "stroustrup" -*- * * Copyright (C) 1995-2005 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #include "core/pch.h" #include "modules/xmlutils/xmln...
// Copyright (c) 2017 Doyub Kim // // I am making my contributions/submissions to this project solely in my // personal capacity and am not conveying any rights to any intellectual // property of any third parties. #include <perf_tests.h> #include <jet/matrix_mxn.h> #include <jet/timer.h> #include <gtest/gtest.h> #...
#include <iostream> using namespace std; // recursive function to determine Greatest Common divisor of 2 numbers long long GreatestCommondivisor(long long FirstNum, long long SecondNum) { if (SecondNum==0) { return FirstNum; } else { if (FirstNum>SecondNum) { ...
#pragma once class QString; enum class Gender { None, Male, Female }; QString genderToString(Gender gender); Gender genderFromString(const QString &string); QString genderToJson(Gender gender); Gender genderFromJson(const QString &string);
/* * @Description: NDT 匹配模块 * @Author: Ren Qian * @Date: 2020-02-08 21:46:57 */ #ifndef LIDAR_LOCALIZATION_MODELS_REGISTRATION_NDT_REGISTRATION_HPP_ #define LIDAR_LOCALIZATION_MODELS_REGISTRATION_NDT_REGISTRATION_HPP_ #include <pcl/registration/ndt.h> #include "lidar_localization/models/registration/registration_i...
#pragma once #ifndef __GAMINGSTUDENT_H__ #define __GAMINGSTUDENT_H__ #include "Student.h" class GamingStudent : public Student { protected: // Arrays std::string listOfGameDevice[8] = { "PS5", "KFC Console", "GameCube", "PS2", "Google Stavia", "SouljaGame", "DS lite", "PSP" }; std::string gameDevic...
#include "Joystick.hpp" Joystick::Joystick() : hidDev(NULL), _userCallback(nullptr) { } void Joystick::setCallback(joystick::callback &cb) { _userCallback = &cb; } void CFSetCopyCallback(const void *value, void *context) { CFArrayAppendValue((CFMutableArrayRef)context, value); } void Joystick::setup() { ...
/* Copyright 2021 University of Manchester Licensed under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http: // www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, s...
// // main.cpp // client // // Created by Sergey Proforov on 05.05.16. // Copyright (c) 2016 Proforov Inc. All rights reserved. // #include <signal.h> #include <iostream> #include <memory> #include <thread> #include <chrono> #include "CClient.h" #include "../../common/CSafeCout.h" //condition to wait std::conditi...
#include <signal.h> #include "main.hpp" #include <generic_tcp_server.hpp> #include <argument_parser.hpp> #include <bad_args.hpp> #include <helper.hpp> #include <echo_handler.hpp> using namespace std; server::generic_tcp_server* global_server; int keep_running = 1; void register_signal_handlers(); void shutdown_serv...
/** Author: Andrew Shepherd Date: 19/11/11 Description: Counter to demostrate the Seg7LED board. Counts -999 to 9999 repeatedly at approx 1/100th second per count. Circuit: Arduino connected to Seg7LED board **/ #include <Seg7LED.h> const int pinLatch = 12; const int pinRTS = 11; const int pinData = 10; con...
// Copyright (c) 2007-2013 Hartmut Kaiser // Copyright (c) 2013-2015 Agustin Berge // // 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...
#ifndef CSTATISTICSWIDGET_H #define CSTATISTICSWIDGET_H #include <QWidget> #include "ui_CStatisticsWidget.h" #include "Define.h" class QTableWidgetItem; class CStatisticsWidget : public QWidget, public Ui::CStatisticsWidget { Q_OBJECT public: CStatisticsWidget(QWidget *parent = 0); ~CStatisticsWidget(); public...
#pragma once #include <Tanker/Client.hpp> #include <Tanker/DataStore/ADatabase.hpp> #include <Tanker/Identity/SecretPermanentIdentity.hpp> #include <Tanker/Network/SdkInfo.hpp> #include <Tanker/Session.hpp> #include <Tanker/Status.hpp> #include <Tanker/Trustchain/UserId.hpp> #include <Tanker/Types/VerificationKey.hpp>...
#include<iostream> #include<vector> #define FOR(i,n) for(i=0;i<n;i++) #define MAX(a,b) ((a)>(b)?(a):(b)) using namespace std; int main() { int N,i,temp,sum,ans; vector<int>in; while(true) { cin>>N; in.clear(); if(!N)break; FOR(i,N) {scanf("%d",&temp);in.push_back(temp);} sum=0;ans=0...
#include "PageSyncSlave.h"
#pragma once #include "ofMain.h" #include "BrushStone.h" #include "VoronoiLayer.h" #include "StoneCurtain.h" #include "RandomWalkLayer.h" #include "ofxPostProcessing.h" #include "ofxVectorField.h" class StoneCurtainLayer { public: StoneCurtainLayer(); ~StoneCurtainLayer(); void setup(); v...
// MouseGeniusDlg.h : 头文件 // #pragma once #include <vector> const int MSG_SET_RUNNING_BTN_STATE = WM_USER + 1; enum EmAction { EmErrAction, EmLButtonDown, EmLButtonUp, EmRButtonDown, EmRButtonUp, EmSleep, }; struct ActionRecord { EmAction action; int nValue1; int nValue2; ActionRe...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2006 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef SVG_DOM_ANIMATED_VALUE_IMPL_H #define SVG_DOM_ANIMATED...
#include "stdafx.h" #include "Goblin.h" #include "../../GameData.h" Goblin::Goblin() { m_anim[Monster::en_idle].Load(L"Assets/modelData/gob/gob_idle.tka"); m_anim[Monster::en_idle].SetLoopFlag(true); m_anim[Monster::en_walk].Load(L"Assets/modelData/gob/gob_walk.tka"); m_anim[Monster::en_walk].SetLoopFlag(true); ...
/* -*- 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. */ #ifndef MODULES_UTIL_OPFILE_OPFOLDER_H #define MODULES_UTIL_OPFIL...
#include "FXAAEffect.h" #include "RenderTarget.h" #include "SceneManager.h" #include "engine_struct.h" #include "ResourceManager.h" #include "pass.h" #include "RenderSystem.h" #include "TextureManager.h" void FXAAEffect::Init() { auto& rt_mgr = RenderTargetManager::getInstance(); auto& tm = TextureManager::getIns...
#include <iostream> #include <cmath> #include <string> #include <vector> using namespace std; class node; class Tree; class Tree{ public: vector <node> arr; unsigned int SizeOfTree; int t; //coeffcient int modul; //modul unsigned int FirstLeaf; vector<int> powers; Tree(string str); bool IsPal(int begin,...
#include <wx/wx.h> #include "help.h" extern "C" { extern bool apme_init(int argc, char* argv[]); } class ApmePoll : public wxTimer { void Notify(void) { FILE *f; f = fopen("./bla.txt", "a+"); fprintf(f, "periodic\n"); fclose(f); } }; class ApmeApp : public wxApp { pri...
#include <iostream> #include <vector> #include <queue> using namespace std; int t, n, u, v, m; vector<vector<int> > graph; vector<int> moves; vector<bool> visit; queue<int> fifo; void bfs() { while (!fifo.empty()) { int a = fifo.front(); fifo.pop(); for (int i = 0; i < graph[a].size();...
#include <iostream> #include <vector> #include <string> using namespace std; vector<string> getGray(int n) { vector<string> res; vector<string> getG; if(n==1) { getG.push_back("0"); getG.push_back("1"); } else res=getGray(n-1); for(auto it=res.begin();it!=res.end();it++) { getG.push_back("0"+*it); } ...
#include "Graphics.h" #include <assert.h> Graphics::Graphics() { m_ogl = NULL; m_spriteBatch = NULL; } Graphics::~Graphics() { } //Function: Release memory //PostCondition: Memory is released void Graphics::Release() { if(m_ogl) { delete m_ogl; m_ogl = NULL; } if(m_spriteBatch) { delete m_spriteBatch; ...
#include <iostream> using namespace std; int main() { float num = 365; float deno = 365; float p = 1; int n = 0; // p becomes less than 0.5, as we are starting from 1! while( p> 0.5) { p*= (num)/deno ; num--; n++; cout << p << " -> " << n << endl; } }
#include "include.hpp" /* Include Irrklang */ #include "Rectangle.hpp" #include "GUI.hpp" #include <iostream> #define PATH_TO_RES "../Res/" int main() { irr::IrrlichtDevice *device = irr::createDevice(irr::video::EDT_OPENGL, irr::core::dimension2d<irr::u32>(1920, 1080)); GUI gui(device); gui.cre...
#include "prefix.h" #include "Encode.h" /** * \brief 按照编码配置,创建encode线程,挂起 * \param encode 线程NULL指针 * \param VRLS_param 编码配置参数 * \param pAVList 指定编码源 * \param pPlist 指定输出链表 * \param privateSpace 线程私有空间 * \return -1: 失败; 0: 成功 */ int init_encode(HANDLE* encode, VRLSParam* VRLS_param, AVFrameList* pAVList, AVPkt...
#include <ncurses.h> #include <iostream> #include <unistd.h> #include <signal.h> #include <string.h> #include "cmdparser.h" #include "wellbore_state_subscriber.h" #include "units.h" using namespace units; using namespace units::literals; using namespace units::length; bool gTerminate = false; void SignalHandler(int3...
#include "Headers.h" #include "sudoku/caffe_prototype.h" class DnnClassifier { public: DnnClassifier(){}; ~DnnClassifier(){}; void init(const string& model_file, const string& trained_file, const string& mean_file, const string& label_file); void process(vector<Mat>& block_roi)...
#include "deploy.h" #include <stdio.h> #include "iostream" #include "fstream" #include "vector" using namespace std; int NodeNum, LinkNum, CostNum, ServeCost; //以二位数组形式存储地图,由于每条链路有两个值,所以最内层也是一个数组,第一个值为带宽,第二个为单位租用费 //若两个节点之间不相连,则值全为0,int默认值 vector<vector<vector<int>>> Net; //将消费节点单独存放,内部数组有两个值,第一个为相连网络节点ID,第二个为视频带宽消耗 v...
#include "piece.h" Piece::Piece(Piece_Shapes piece) { const int (*tempPiece)[PIECE_SIZE][PIECE_SIZE]; switch (piece) { case S_SHAPE: tempPiece = &s_piece; pieceColor = LIME; break; case Z_SHAPE: tempPiece = &z_piece; pieceColor = RED; break; case LI_SHAPE: tempPiece = &li_piece; pieceC...
#ifndef PROPERTYITEMDELEGATE_HPP #define PROPERTYITEMDELEGATE_HPP #include <QItemDelegate> #include <QListView> namespace Maint { class PropertyItemDelegate : public QItemDelegate { Q_OBJECT QListView* _listView; public: explicit PropertyItemDelegate(QListView* listView, QObject...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "Components/WidgetComponent.h" #include "MMOWidgetComponent.generated.h" /** * */ UCLASS(meta = (BlueprintSpawnableComponent)) class MMOPROJECT_API UMMOWidgetComponent : public UWidgetComp...
/* * The MIT License (MIT) * * Copyright (c) 2014 Matt Olan, Prajjwal Bhandari. * * 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 ...
#include <stdio.h> int main() { char s[12]; FILE *fin = fopen("input.txt", "r"); if (!fin) { fprintf(stderr, "Unable to open input file\n"); return 1; } int maxid = -1; while (fscanf(fin, "%s", s) == 1) { int id = 0; for (char *p = s; *p; p++) { id <<= 1; if (*p == 'B' || *p == 'R') id++; ...
#ifndef _C1_SYNTAX_TREE_CHECKER_H_ #define _C1_SYNTAX_TREE_CHECKER_H_ #include "SyntaxTree.h" #include "ErrorReporter.h" #include <cassert> class SyntaxTreeChecker : public SyntaxTree::Visitor { public: SyntaxTreeChecker(ErrorReporter &e) : err(e) {} virtual void visit(SyntaxTree::Assembly &node) override; ...
/** * Copyright (c) 2013, Timothy Stack * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of condi...
#pragma once #include "aux.h" #include <sophus/se3.hpp> void showGPUImage(string windowName, float *d_img, int w, int h, int winX = 0, int winY = 0) { cv::Mat mat(h, w, CV_32F); cudaMemcpy(mat.data, d_img, w*h*sizeof(float), cudaMemcpyDeviceToHost); CUDA_CHECK; showImage(windowName, mat, winX, winY); } void c...
#include "opt_alg.h" #include <fstream> #include <cmath> #include <string> #if LAB_NO>1 double* expansion(double x0, double d, double alfa, int Nmax, matrix O) { double* p = new double[2]; solution X0(x0), X1(x0 + d); X0.fit_fun(); X1.fit_fun(); if (X0.y == X1.y) { p[0] = x0; p[1] = x0 + d; ...
// // Created by jan on 08.10.20. // #include "ComplexNumber.h" float ComplexNumber::getRacional() { return this->racional; } float ComplexNumber::getImaginary() { return this->imaginary; }
#include "UpdateDialogWin32.h" #include "AppInfo.h" #include "Log.h" // enable themed controls // see http://msdn.microsoft.com/en-us/library/bb773175%28v=vs.85%29.aspx // for details #pragma comment(linker,"\"/manifestdependency:type='win32' \ name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \ processorArc...
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional>...
// 단지번호붙이기 // issue1 : 큐에 중복되어 들어가는 경우가 발생한다. // 해결방법 : 큐에 넣을 때도 큐에 들어간 좌표인지 구분해주기 위해 0으로 만들어주어야 한다. #include <iostream> #include <algorithm> #include <queue> using namespace std; struct location { int x, y; }; int dx[4] = { -1, +1, 0, 0 }; int dy[4] = { 0, 0, -1, +1 }; int N; int field[27][27]; int v_count = 0; ...
/** * Copyright (c) 2007-2012, Timothy Stack * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of ...
#include<cstdio> #include<algorithm> using namespace std; bool comp(const int &a,const int &b){ return a>b; } int main(){ //input vector<int> number; for(int i=0;i<11;++i){ char temp; fscanf(stdin,"%c",&temp); number.push_back(temp-'0'); } //deal with vector<int> a...
#include <iostream> #include "boardrep.hxx" using namespace std; void DisplayBoard( const Position& ); void WriteSquare( int ); int main() { Position game = START_POSITION; DisplayBoard( game ); SetPiece( game.board, 4, NO_PIECE ); SetPiece( game.board, 27, WHITE_KING ); DisplayBoard( game ); return 0; } voi...
// // EmptyFrameCondition.hpp // Fishnap // // Created by 山内一祥 on 2019/09/04. // Copyright © 2019 Crux One. All rights reserved. // #ifndef EmptyFrameCondition_hpp #define EmptyFrameCondition_hpp #include <stdio.h> // open cv #include <opencv.hpp> // fishnap #include "ICondition.hpp" class EmptyFrameCondition ...
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { int n; while(cin>>n) { string str; cin>>str; int len = str.size(); int i; if(len==1) { if(str=="0")cout<<"No"<<endl; else cout<<"Yes"<<endl...
/* -*- 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(_NATIVE_...
#pragma once #include "NetworkConnection.h" class EXPORT ClientConnection : public NetworkConnection { friend class NetworkingFactory; private: ClientConnection(int port, std::string ip); protected: virtual bool bindSocket() override; virtual void postSocketCreation() override {}; virtual void setToNonBlocking() ...
#ifndef configurationSaver_h #define configurationSaver_h #include <Arduino.h> #include <EEPROM.h> class ConfigurationSaver { public: ConfigurationSaver(){ EEPROM.begin(512); } void save(const String (&adresses) [5]){ //has to work jointly with retrieveConfig() //this function ...
#include <iostream> #include <vector> #include <algorithm> #define MAX 1001 using namespace std; int n; int arr[MAX]; int dp[MAX]; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; for(int i = 1; i <= n; i++){ cin >> arr[i]; } for(int i = 1; i <= n; i++){ int ...
#pragma once #include "formatter.hpp" namespace elog { class ColoredFormatter: public Formatter { public: ColoredFormatter(); virtual ~ColoredFormatter(); std::string format(const Record& record) override; private: }; }
#include "stm32f1xx_hal.h" #include "gpio.h" #include "usart.h" #include "tim.h" #include "dma.h" #include "DmxReceiver.h" extern "C" { void SystemClock_Config(); } void dmxFrameReceived(const uint8_t* buffer); void init(); volatile bool frameReceived = false; const uint8_t* dmxBuffer = nullptr; int main() { i...
/* -*- 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. */ #ifndef OP_PAGEBAR_H #define OP_PAGEBAR_H #include "modules/widg...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "ObjectInfo.h" #include "Trap1Info.generated.h" /** * */ UCLASS() class FPS_TEST_5_API UTrap1Info : public UObjectInfo { GENERATED_BODY() public: UTrap1Info(); void UtilityFunction()...
#include<bits/stdc++.h> using namespace std; main() { int n,a,b,c,i; while(scanf("%d",&n)==1) { for(i=1; i<=n; i++) { scanf("%d %d %d",&a,&b,&c); if(a+b>c && b+c>a && c+a>b) printf("OK\n"); else printf("Wrong!!\n"); ...
// TestCaller.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "Caller.h" #include "Server.h" #include "TopClass.h" #include <ctime> int _tmain(int argc, _TCHAR* argv[]) { // for virtual function call case Server * sobj = Server::getInstance(); // Caller* cobj = new Cal...
// implementation of sieve of eratosthenes to find the primes within a given range // all prime[i] (1<=i<=MAXN) is initialized to true before function call bool prime[MAXN]; void sieve(int n){ for(int i = 2; i <= n; i++){ if(prime[i]){ for(int j = i*2; j <= n; j+=i){ prime[j] = false; } } } }
// Fill out your copyright notice in the Description page of Project Settings. #include "SY_Projectile.h" #include "GameFramework/ProjectileMovementComponent.h" #include "Components/SphereComponent.h" // Sets default values ASY_Projectile::ASY_Projectile() { // Set this actor to call Tick() every frame. ...
#include "../include/cgal_objloader.h" #include "../include/molecule_surface.h" #include "../include/index_raytracer.h" #include "../include/atomloader.h" #include "../include/fade2d/Fade_2D.h" #include <ctime> #include <CGAL/boost/graph/copy_face_graph.h> typedef CGAL::Simple_cartesian<double> ...
#pragma once #include <qwidget.h> #include "stdafx.h" #include "Item.h" #include "City.h" #include "Dragwidget.h" #include "DropWidget.h" #include "Stock.h" #include "ItemDAO.h" #include "SuperSlider.h" class Sell : public QWidget { Q_OBJECT public: Sell(std::vector<City>& city, std::vector<Item>* getListItem); ...
#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...
// // EffectManage.cpp // GetFish // // Created by zhusu on 15/1/5. // // #include "EffectManage.h" #include "Effect.h" EffectManage::EffectManage() { } EffectManage::~EffectManage() { } bool EffectManage::init() { if(ActorManage::init()) { return true; } return false;...
#include <Arduino.h> #include "LineSensor.hpp" #include "configs.hpp" #include "controller.hpp" #include "motor.hpp" // create left and right motor objects Motor left_motor(MOTOR_PINL1, MOTOR_PINL2, false); Motor right_motor(MOTOR_PINR1, MOTOR_PINR2, false); // declare variables const uint8_t ir_pins[] = IR_PINS_ARRA...
// Created on: 2002-12-12 // Created by: data exchange team // Copyright (c) 2002-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...
#include<bits/stdc++.h> #define f(i,n) for(int i=0;i<n;i++) #define fr(i,n) for(int i=1;i<=n;i++) #define py printf("YES\n") #define pn printf("NO\n") #define pb push_back #define ll long long #define speed ios_base::sync_with_stdio(false); cin.tie(NUll);cout.tie(NUll); #define D(x) cout << #x " = " << (x) << endl #def...