text
stringlengths
8
6.88M
/* Copyright (c) 2014 Mircea Daniel Ispas This file is part of "Push Game Engine" released under zlib license For conditions of distribution and use, see copyright notice in Push.hpp */ #pragma once #include "Core/Buffer.hpp" #include "Core/Stream.hpp" #include "Core/Variant.hpp" #include "Core/Settings.hpp" #include...
////////////////////////////////////////////////////////////////////////////////////////////////////// ///////// //////// ///////// //////// // // ////////// //// // /////// // // // // // // // // // // // // // // \\ // /////...
#include <iostream> using namespace std; int arr[202][2]={0,}; int big[202]={0,}; int small[202]={0,}; int resmax[202]={0,}; int resmin[202]={0,}; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n,m; cin>>n>>m; for(int i=0;i<m;i++){ cin>>arr[i][0]>>arr[i][1]; big[arr[i][1]]...
// Created on: 2000-09-29 // Created by: Andrey BETENEV // Copyright (c) 2000-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 a...
#include <iostream> #include <vector> using namespace std; class V{ public: int v; vector<int> locate; V(int v = 0):v(v) {} }; void dfs(V point[], int init, vector<int> stack, int size){ stack.push_back(init); // cout << "스택현황 : "; // for(auto it = stack.begin(); it != stack.end(); it++){ ...
//menu.h #ifndef MENU_H_ #define MENU_H_ #include <string> #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <vector> #include <fstream> #include <iomanip> #include <sstream> #include <math.h> //LogIn class LogIn { private: int tValue; std::string symbol = "\0"; static std::string serchS...
#include<stdio.h> #include<conio.h> struct node { node *left; node *right; int data; }; node *new_node(int a) { node *newnode = new node; newnode->data = a; newnode->left = newnode->right = NULL; return(newnode); } void print_list...
#include<bits/stdc++.h> using namespace std; main() { int test,i,j,sum=0,len; char txt[101]; while(scanf("%d",&test)==1) { for(i=0; i<=test; i++) { gets(txt); len=strlen(txt); for(j=0; j<len; j++) { if(txt[j]=='a'||txt[j]==...
#pragma once #include <string> #include <tuple> #include <vector> #include "exceptions.h" #include "_winapi.h" #include "logging.h" #include "result.h" Result<std::tuple<DWORD, DWORD>> write_to_pipe( HANDLE handle, std::string writeBuffer, int len) { DWORD written; BOOL ret; DWORD err; ret = WriteFile( ...
#ifndef AA_SIPP_H #define AA_SIPP_H #include "cSearch.h" #include "constraints.h" #include "aa_sipp_o.h" class AA_SIPP : public cSearch { public: AA_SIPP(double weight, bool breakingties, int constraints_type); ~AA_SIPP(); SearchResult startSearch(cLogger *Log, cMap &Map); Constraints...
/* others class must deriv from it this can be considered as the world */ #ifndef _GAMEPLAY_ #define _GAMEPLAY_ #include "cocos2d.h" #include <list> #include <map> #include "AbstractScene.h" //#include "Coordinate.h" USING_NS_CC; class Projectile; class Ship; class BaseEntity; class W...
#include "controller.h" #include "helpers.h" #include "vr_system.h" #include "tool.h" #include <iostream> #include <vector> Controller::Controller() : initialised_( false ), vr_system_( nullptr ), active_tool_( nullptr ), shader_( nullptr ), model_mat_location_( 0 ), index_( vr::k_unTrackedDeviceIndexInvalid ), ...
// Copyright (c) 2015 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 ...
//------------------------------------------------------------------------------ /* This file is part of Beast: https://github.com/vinniefalco/Beast Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com> Permission to use, copy, modify, and/or distribute this software for any purpose with or without f...
#ifndef PCH_H #define PCH_H #include <iostream> struct Vertex { int id; Vertex* next; }; struct Edge { int src, des, weight; }; class GraphAdjacencyList { public: int numOfVertex; Vertex* head; GraphAdjacencyList(Edge edges[], int numEdges, int numVertices) { this->head = new Vertex[numVertices](); thi...
// Created on: 1993-07-22 // Created by: Remi LEQUETTE // 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 ...
#pragma once #include "Shape.h" #include "Triangle.h" #include "Sphere.h" #include <vector> namespace RayTracer { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Dr...
#ifndef __LMenu__ #define __LMenu__ #include "publicDef/PublicDef.h" class LMenu; typedef enum { TouchBegin = 0, TouchMoved = 1, TouchMovedOutSide = 2, TouchUpInSide = 3, TouchUpSide = 4, }LMenuType; typedef enum { LMenuStateNormal = 0, LMenuStateHighlighted = 1, LMenuStateDisabled =...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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. ** */ #ifndef DOM_SELECTOR_H #define DOM_SELECTOR_H #include "modul...
// // Created by JACK on 11/9/2015. // #include "Preschool.h" Preschool::Preschool(): name(""),graduate(0),location(){ } Preschool::Preschool(string name,int capacity,string location): name(name),graduate(capacity),location(location){ } Preschool& Preschool::operator=(const Preschool& obj) { if (this == &obj) { ...
#include <iostream> #include <algorithm> #include <vector> #include <functional> #include <iterator> #include <sequtils.h> using namespace std; int main(int argc, char *argv[]) { vector<int> v1; populate_lseq(v1, 1, 9); print_seq(v1); reverse(v1.begin(), v1.end()); print_seq(v1); reverse(v1.begin()...
/* -*- 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. */ #if !defined MODULES_UTIL_UNICODE_UTF32_H && defined(USE_UNICODE...
#include <string> #include <vector> #include <cstdio> #include <cstdarg> bool format(std::string &str, const char* format, ...) { va_list ap; if(str.empty()) str.resize(2); va_start(ap, format); std::string::size_type liczba = vsnprintf(&str[0], 0, format, ap); va_end(ap); str.resize(liczba+...
/* * **************************************************************************** * * * * * Copyright 2008, xWorkshop Inc. * * * All rights reserved. * *...
/* * GccApplication1.cpp * * Created: 02.11.2019 14:34:55 * Author : Ness */ #include <avr/io.h> #include <avr/interrupt.h> #define F_CPU 1000000UL #include <util/delay.h> void ledOff(); void ledRed(); void ledYellow(); void init(){ DDRB = 0b11111111; DDRC = 0b00000000; PORTC = 0xFF; } void ledRed(){ w...
#include "abc.h" void printABC(){ fprintf(stdout, "This is ABC\n"); }
#include<cstdio> #include<cstring> #include<algorithm> #include<queue> using namespace std; typedef long long ll; const ll INF = 0x3f3f3f3f3f3f3f3f; const int M = 250; struct edge{ int f,t,n; ll w; }edg[M*M*2]; ll g[M][M]; int res[M*100],vol[M*100]; int d[M*5],head[M*5]; int n,p,cnt; int s,e; v...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2009 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef BTSelectionDialog_H #define BTSelectionDialog_H #include...
#include <boost/property_tree/json_parser.hpp> #include "CommandsManager.h" boost::property_tree::ptree CommandsManager::command(boost::property_tree::ptree &params) { std::string command = params.get<std::string>("body.text"); command = command.substr(0,command.find('\n')); if (command == "create chat") ...
#include <iostream> #include<cmath> using namespace std; int board[5][5]; int t = 0;//编号 void ChessBoard(int tr, int tc, int dr, int dc, int size)//子棋盘坐标,特殊方格,子棋盘大小 { int s, t1; if(size == 1) return; t1 = ++t; s = size / 2; if(dr < tr+s && dc <tc+s)//左上 { ChessBoard(tr,tc,dr,dc...
////////////////////////////////////////////////////////////////////// ///Copyright (C) 2011-2012 Benjamin Quach // //This file is part of the "Lost Horizons" video game demo // //"Lost Horizons" is free software: you can redistribute it and/or modify //it under the terms of the GNU General Public License as published ...
#include <iostream> #include <WS2tcpip.h> #include <stdlib.h> #include <stdio.h> #include <string> #include <iostream> #include <fstream> #include<chrono> #include <ctime> #include <vector> // Include the Winsock library (lib) file #pragma comment (lib, "ws2_32.lib") #pragma warning(disable : 4996) //_CRT...
#include "widget.h" #include "ui_widget.h" #include <QPixmap> #include <QPainter> #include <QPicture> Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); /////////////////////////////QPixmap//////////////////////// // //pixmap绘图设备 专门为平台做了优化 // QPixmap pix(30...
#pragma once #include "../../UI/Dependencies/IncludeImGui.h" #include "../../Graphics/Mesh/3D/CurveMesh.h" #include "../CurveEditor/CurveEditor.h" namespace ae { namespace priv { namespace ui { inline void CurveMeshToEditor( CurveMesh& _CurveMesh ) { ImGui::Text( "Curve Mesh" ); std::string Inter...
#pragma once #include <QWidget> #include <functional> using WindowStateChangeCallback = std::function<void()>; class QLabel; class QPushButton; class Alime_TitleBar : public QWidget { Q_OBJECT public: explicit Alime_TitleBar(QWidget* parent = 0); ~Alime_TitleBar(); bool SysButtonEventRegister(Windo...
#include <iostream> #include <limits> #include "../Project_2/RedBlackTree.cpp" #include "Dijkstra.cpp" using namespace std; int main() { //auto g = new Dijkstra<string>(); //if (g->read()) { // //g->insert_edge("Msk", "Vdk", 4); // //g->insert_edge("Msk", "Spb", 1); // //g->insert_edge("Spb", "Vdk", 1); // //g->...
#define ASIO_STANDALONE #define ASIO_HAS_STD_TYPE_TRAITS #define ASIO_HAS_STD_ATOMIC #define ASIO_HAS_STD_SHARED_PTR #define ASIO_HAS_STD_ADDRESSOF #define ASIO_HAS_CSTDINT #define ASIO_HAS_STD_ARRAY #include <cstdlib> #include <cstring> #include <vector> #include <iostream> #include <fstream> #include "asio.hpp" #incl...
#include<iostream> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #include<set> #include<map> #include<bits/stdc++.h> #include<queue> #define FOR0(i,n) for(i=0;i<n;i++) #define FOR(i,j,n) for(i=j;i<n;i++) #define FORD(i,j,k) for(i=j;i>=k;i--) inline long long MAX2(long long a, long...
// Copyright (c) 2021 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 ...
/** * \copyright * (c) 2012 - 2015 E.S.R. Labs GmbH (http://www.esrlabs.com) * All rights reserved. */ /** * Contains STL like algorithms. * \file SAlgorithm.h * \ingroup sstl */ #ifndef SALGORITHM_H_ #define SALGORITHM_H_ #include "SIteratorBaseTypes.h" /** * returns minimum of two values * \param T type ...
// Created on: 1992-02-18 // Created by: Christophe MARION // Copyright (c) 1992-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 ...
#include <iostream> #include "searchbar/SearchBar.h" int main() { SearchBar searchBar; std::cout << searchBar.process(10, 2000, 0) << std::endl; return EXIT_SUCCESS; }
#include <iostream> #include <vector> #include <map> #include <cmath> #include <queue> #include <algorithm> #include <iomanip> #include <set> #include <cstring> using namespace std; /* → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → → */ #define int long ...
#include "FontFabric.h" #include "EverydayTools/Exception/CallAndRethrow.h" #include "EverydayTools/Exception/ThrowIfFailed.h" #include "Resource/Texture/Texture.h" #include "yasli/STL.h" #include "Keng/Base/Serialization/SerializeMandatory.h" #include "Keng/FileSystem/ReadFileToBuffer.h" #include "Device.h" #include "...
// (C) Copyright 2002-2007 by Autodesk, Inc. // // Permission to use, copy, modify, and distribute this software in // object code form for any purpose and without fee is hereby granted, // provided that the above copyright notice appears in all copies and // that both that copyright notice and the limited warr...
// Copyright (c) 2019 Petr Petrov // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, d...
// // Created by abel_ on 23-08-2021. // #include <bits/stdc++.h> using namespace std; int main() { map<int,string> m; m[1]="abc"; // O(log(n)) m[5]="cdc"; m[3]="acd"; m.insert({4,"afg"}); map<int,string>::iterator it; for (it = m.begin(); it != m.end(); ++it){ cout << (*it).first...
/* * FLOWNET Complex Pipe Network Solver */ // FlownetCtlr.cpp : implementation of the CFlownetController class // #include "stdafx.h" #include "FlownetApp.h" #include "FlownetController.h" #include "FlownetDoc.h" #include "FlownetViewport.h" #include "MainFrame.h" #include "FlownetComponent.h" #inclu...
#ifndef _GIT_TEST_H_ #define _GIT_TEST_H_ #include <iostream> #include <string> class GitHello { public: GitHello(); GitHello(std::string _name) :name(_name){} ~GitHello(); void hello(); std::string getName(){ return name; } private: std::string name; }; #endif
// https://oj.leetcode.com/problems/reverse-integer/ class Solution { public: int reverse(int x) { bool minus = (x < 0); if (minus) { x = -x; } int ret = 0; while (x != 0) { int now = ret * 10 + (x % 10); if (now / 10 != ret) { ...
#include "stdafx.h" #include "Util.h" // namespace 이름 같으면 그 안에꺼 공유 됨 namespace MY_UTIL { float GetAngle(float startX, float startY, float endX, float endY) { // deltat x , y 구한거 float x = endX - startX; float y = endY - startY; float distance = sqrtf(x * x + y * y); float angle = acosf(x / distance); i...
#include <iostream> #include "bit_string.hpp" int main() { return 0; }
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 1995-2003 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" #if !defined(US...
/* -*- 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" #ifdef _NATIVE_S...
#include "ChangeMesh.h" ChangeMesh::ChangeMesh() :mesh(NULL) { } ChangeMesh::~ChangeMesh() { } void ChangeMesh::SetNewMesh(Mesh* newMesh) { mesh = newMesh; } Mesh* ChangeMesh::GetNewMesh() { return mesh; } void ChangeMesh::SetFlip(bool flip) { this->flip = flip; } bool ChangeMesh::GetFlip() { return flip; }
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> #include <stack> using namespace std; typedef long long ll; #define INF 10e10 #define rep(i,n) for(int i=0; i<...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 2008-2011 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ group "posix.localeutil"; require init; require POSIX_OK_MISC; include "platforms/posi...
// MIT License // Copyright(c) 2019 Erin Catto http ://www.box2d.org // --Modified based on box2d source code-- // Copyright (c) 2020 Marnix van den Berg <m.a.vdberg88@gmail.com> // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the...
#include <boost/asio.hpp> #include "vdf.h" using boost::asio::ip::tcp; const int max_length = 2048; const int kMaxProcessesAllowed = 3; std::mutex socket_mutex; void PrintInfo(std::string input) { print("VDF Server: " + input); } void CreateAndWriteProof(integer D, form x, int64_t num_iterations, WesolowskiCallb...
#include <list> #include <memory> #include <glm/glm.hpp> #include "Exception.h" class Component; class Core; //! The Object class that holds components. /*! Here is the class that holds components */ class Object { public: Object(); //! Use this function to add components to an Object /*! Here is where you ad...
//╔══════════════════════════════════════════════════════════════════════════════════════════╗ //║ main.cpp ║ //║ 16 cze 2014 ║ //║ by MrWeb123 ...
#pragma once #include <vector> #include <GLAD/include/glad/glad.h> #include <SeetyDog/Events/Event.h> #include "Shader.h" #include "Texture2D.h" #include "GameObject.h" /*class GameObject { public: // Object state glm::vec2 Position, Size, Velocity; glm::vec3 Color; GLfloat Rotation; GLboolean IsSolid...
#if !defined(BRESENHAM_LINE) #define BRESENHAM_LINE #include <cmath> #include <vector> #include "../custom-headers/Point.h" std::vector<Point<int>> BresenhamsLineDrawingAlgo(int x0, int x1, int y0, int y1) { int x = x0, y = y0; int dX = abs(x1 - x0), dY = abs(y1 - y0); int dT = 2 * (dY - dX), dS = 2 * dY; ...
#include <iostream> #include "TestBot.h" void TestBot::OnGameStart() { std::cout << "Hello, World!" << std::endl; vespene_harvesters = std::map<Tag, int>(); map = MapAnalyzer(); map.AnalyzeMap(Observation()); manager = MacroManager(); last_orders = manager.ThinkAndSendOrders(Observation()); ...
// Handout #1: Source code of a C++ Program, which // converts distance in miles to kilometers. #include <iostream> //inclusion of support for doing input & output #include <iterator> // std::ostream_iterator #include <vector> //inclusion of support for doing input & output #include <algorithm> //inclusion ...
#include <conio.h> #include <iostream.h> void main () { clrscr(); for(int i=0; i<10; i++) { for(int j=1; j<=10-i; j++) cout <<"*"; for(int k=1; k<=i+i; k++) cout <<" "; for(int l=1; l<=10-i; l++) cout <<"*"; cout <<"\n"; } for(i=1; i<=10; i++) { for(int j=1; j<=i...
// // TextureManager.hpp // sdltutorial // // Created by Siddharth on 06/06/19. // Copyright © 2019 Siddharth. All rights reserved. // #ifndef TextureManager_h #define TextureManager_h #include <stdio.h> #include <iostream> #include <map> #include "SDLHeader.h" class TextureManager{ public: ~TextureM...
class Blood_Trail : House { scope = 0; displayName = ""; accuracy = 0.1; // accuracy needed to recognize type of this target vehicleClass = "DayZ Epoch Buildings"; model = ""; nameSound = ""; animated = false; simulation = "house"; cost = 0; armor = 300; ladders[] = {}; placement = "slope"; }; class Blood_T...
#pragma once #include "stdafx.h" #include <stack> #include "MemoryFile.h" using namespace std; class History { public: class HistoryException : public exception{}; struct Cell { int x; int y; friend MemoryFile& operator << (MemoryFile&, const Cell); friend MemoryFile& operator >> (MemoryFile&...
// 0922_11.cpp : 定义控制台应用程序的入口点。 //统计元音 //统计每个元音字母在字符串中出现的次数。 //输入数据首先包括一个整数n,表示测试实例的个数,然后是n行长度不超过100的字符串。 #include<iostream> using namespace std; int main() { int n; cin >> n; int flag = 1; while (flag<=n) { char s[100]; int i; cin >> s; int len = strlen(s); if (len > 100) break; int num_a, num_e...
//Jump Search /*Time Complexity = O((n/m)+(m-1)) Space Complexity = O(n)*/ #include<stdio.h> #include<math.h> int jump_search(int a[], int data, int n) { int m = sqrt(n); //block size to be jumped. int low = 0; while(a[m] <= data && m < n) //finding block ...
//算法:DP/背包 //本题与01背包的区别: //物品分为k组,每组中的物品相互冲,故每组只能取1个物品 //在01背包上多加一维,表示有几组. //状态转移方程式: //f[j][a[i].g]=max(f[j-a[i].w][k]+a[i].c),k∈[0,a[i].g]; //注意k从0开始 #include<cstdio> #include<algorithm> using namespace std; struct baka9 { int c,w,g; }a[1010]; int n,m,ans; int f[1010][110]; int main() { scanf("%...
#ifndef OFXOBSERVERH #define OFXOBSERVERH #include <vector> #include <algorithm> #include <string> #include <iostream> #include <boost/thread.hpp> #include <boost/enable_shared_from_this.hpp> #include "ofxObservableEvent.h" class ofxObservable; class ofxObserver { public: //virtual void update(ofxObservable* pFrom,...
// DisplayDeviceArmband.cpp: implementation of the DisplayDeviceArmband class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "Chat.h" #include "DisplayDeviceArmband.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG...
#include <simplecpp> Turtle::Turtle(Composite* owner){ double pts_body[4][2] = {{0, 15}, {20, 0}, {0, -15}, {0,15}}; setColor(COLOR("red"), false); setFill(); penDown(); reset(canvas_width()/2, canvas_height()/2,pts_body, 4, owner); }
/* -*-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 app...
/************************************************************************ * @project : sloth * @class : ParticleSystem * @version : v1.0.0 * @description : 用于生成粒子 * @author : Oscar Shen * @creat : 2017年3月6日11:02:44 * @revise : *******************************************************************...
#include "ventadetalle.h" #include <sstream> VentaDetalle::VentaDetalle() { venID = 0; artID = 0; cantidad = 0; } VentaDetalle::VentaDetalle(sql::ResultSet* rs) { this->fillObject(rs); } VentaDetalle::~VentaDetalle() { //dtor } int VentaDetalle::getVenID() { return this->venID; } ...
// // BetterCarryingEachOther 2016.04.01 // model structure // #pragma once #include <vector> #include <GL/glew.h> #include "vec.h" using namespace std; class Color { public: static const vec3 red; static const vec3 darkred; static const vec3 yellow; static const vec3 black; static const vec3 white; static c...
#if !defined(avx_h) #define avx_h #if defined(__AVX__) namespace et { struct avx { enum { vector_size = sizeof(__m256d) / sizeof(double) }; typedef double value_type; __m256d d; avx() {} avx(__m256d a) : d(a) {} avx(value_type a) { d = _mm256_set_pd(a, a, a, a); } avx(value_...
#pragma once namespace Temporal { long long get_ms_since_epoch(); }
#ifndef ROOT_THcHallCSpectrometer #define ROOT_THcHallCSpectrometer ////////////////////////////////////////////////////////////////////////// // // THcHallCSpectrometer // ////////////////////////////////////////////////////////////////////////// #include "THaSpectrometer.h" //class THaScintillator; class THcHallC...
// // Created by 송지원 on 2020/07/03. // #include <iostream> using namespace std; int t[22]; int N; int Y() { int tot=0; for (int i=0; i<N; i++) { tot += 10*(t[i]/30+1); } return tot; } int M() { int tot=0; for (int i=0; i<N; i++) { tot += 15*(t[i]/60+1); } return tot; ...
#include<iostream> using namespace std; int merge(int *arr,int *LArr,int* RArr,int m,int n) { int i=0,j=0,k=0; int count = 0; while(i<m && j<n) { if(LArr[i]<=RArr[j]) arr[k++] = LArr[i++]; else { arr[k++] = RArr[j++]; count = count + m - i; ...
#include "geometry.h" #include "Voronoi_Tessellation.h" using namespace std; using namespace __gnu_cxx; Site::Site(Point p) { pos = p; edge = NULL; } Polygon Site::make_polygon() { deque<Point> pts; pts.clear(); bool attainbound = true; HalfEdge *ed = NULL; for (ed = edge; ed->next != NULL; ed...
#include "Bullet.hpp" Bullet::Bullet(SDL_Renderer* rend, SDL_Texture* ast, SDL_Rect mov): Unit(rend, ast), mover(mov) { bullet_src = {616, 201, 302, 96}; } void Bullet::draw() { Unit::draw(bullet_src, bullet_mover); // mover.x+=2; }
#include <algorithm> #include <iostream> #include <string> #include <vector> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); int n, m; std::cin >> n >> m; std::vector<std::vector<int>> matrix1(n, std::vector<int>(m)); for (int i = 0; i < n; ++i) ...
/* filename: event.h author: Sherri Harms last modified: 7/16/01 description: Class event interface file for episodes. Values of this type are a string. ****************************************************************************** Known bugs: The constraints are all disjuctive singular events. step 5 from alg 5...
#include<iostream> #include<vector> #include<algorithm> using namespace std; class Solution { public: int singleNumber(vector<int>& nums) { //基本思想:统计nums所有int元素在int32位中每一位上1的个数sum然后%3就得到只出现了一次的元素该位上的值 //最后将32位int拼接成一个整体就得到只出现了一次的元素 int res = 0; for (int i = 0; i < 32; i++) { int sum = 0; for (int j = 0...
#include <iostream> using namespace std; int n, m; int matrix[20][20]; class Dice { public: /* up, down, front, back, left, right */ int r, c; int board[6] = { 0, }; enum { UP, DOWN, FRONT, BACK, LEFT, RIGHT }; /* right, left, u...
#include "stdafx.h" #include "rom_file.h" #include "hex_editor.h" const TCHAR *HexEditor::ClassName = TEXT("RomEdit"); HexEditor::HexEditor(Buffer& buffer) : buffer_(buffer) { } HexEditor::~HexEditor() { } bool HexEditor::Create(LPCSTR lpWindowName, int x, int y, int width, int height, Window *...
using namespace System; namespace CSharpLibrary { public ref class UsefulManagedCppClass { public: UsefulManagedCppClass(); void RunTest(); private: String^ m_usefulString; }; }
// Created on: 2004-05-18 // Created by: Sergey ZARITCHNY <szy@opencascade.com> // Copyright (c) 2004-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 Publ...
// Starter code for CS241 assignments 9-11 // // C++ translation by Simon Parent (Winter 2011), // based on Java code by Ondrej Lhotak, // which was based on Scheme code by Gord Cormack. // Modified July 3, 2012 by Gareth Davies #include <stdlib.h> #include <iostream> #include <sstream> #include <string> #include <vect...
/* * 题目:剑指 Offer 50. 第一个只出现一次的字符 * 链接:https://leetcode-cn.com/problems/di-yi-ge-zhi-chu-xian-yi-ci-de-zi-fu-lcof/ * 知识点:哈希表、队列 */ class Solution { public: // 哈希表解法 char firstUniqChar(string s) { unordered_map<char, int> cnt; int n = s.length(); for (int i = 0; i < n; i++) { ...
/* ========================================== Copyright (c) 2011-2018 Dynamic_Static Patrick Purcell Licensed under the MIT license http://opensource.org/licenses/MIT ========================================== */ #pragma once #include "Dynamic_Static/Core/Defines.hpp" #ifndef DYNAMIC_STATIC_CORE_GLM...
#include "test_precomp.hpp" CV_TEST_MAIN(".")
#include "controller.h" #include <QGridLayout> #include <QHeaderView> Controller::Controller(QWidget *parent) : QWidget(parent), log(new QPlainTextEdit()), registred(new QTableView()) { QGridLayout *grid = new QGridLayout(this); grid->addWidget(log, 0,0, 1,1); grid->addWidget(registred, 0,1, 1...
/* * Kimura * * Copyright (c) 2009-2010 Chris Barber <chris@cb1inc.com> * All rights reserved. * * Use and distribution licensed under the BSD license. See the * COPYING file in the root project directory for full text. */ #include <kimura/lib/cli_args/flag.h> namespace kimura { namespace cli_args { co...
// // Avion.h // TorreDeControl // // Created by Catalina Peralta on 11/1/14. // Copyright (c) 2014 Catalina Peralta. All rights reserved. // #ifndef __TorreDeControl__Avion__ #define __TorreDeControl__Avion__ #include <stdio.h> #include <iostream> #include "Vuelo.h" class Avion { private: Vuelo* flight = nu...