text
stringlengths
8
6.88M
#include <chrono> #include <cstring> #include <iostream> extern void calc(int, const int *, const int *, int *); int main() { std::ios_base::sync_with_stdio(false); int n; std::cin >> n; int *a = new int[n]; int *b = new int[n]; int *c = new int[n]; // Initialize the arrays std::memse...
#include <bits/stdc++.h> using namespace std; struct Node { int val; Node *next; Node() : val(0), next(NULL){}; Node(int val) : val(val), next(NULL){}; }; Node *insert(vector<int> nums) { Node *head = new Node(nums[0]), *temp = head; int i = 1; while (temp && i < nums.size()) { ...
// // Calendar.cpp // IMKSupply // // Created by KimSteve on 2017. 9. 7.. // // #include "Calendar.h" Calendar::Calendar() : _gapX(0), _gapY(0), _year(0), _month(0), _listener(nullptr) { _gridCellList.clear(); } Calendar::~Calendar() { _gridCellList.clear(); } Calendar * Calendar::create(unsigned int yea...
// // EchoServer.h // NetTest // // Created by uistrong on 13-3-20. // Copyright (c) 2013年 uistrong. All rights reserved. // #ifndef __NetTest__EchoServer__ #define __NetTest__EchoServer__ #include <vector> class EchoServer{ public: EchoServer(); ~EchoServer(); int StartServer(unsigned short port); ...
#include <iostream> #include <fstream> #include "LexTokenStream.hpp" #include "JavaRecognizer.hpp" #include "JavaTreeParser.hpp" ANTLR_USING_NAMESPACE(std) ANTLR_USING_NAMESPACE(antlr) static void parseFile(const string& f); static void doTreeAction(const string& f, RefAST t); int main(int argc,char* argv[]) { // U...
// // // #include "HelloTest.h" #include "LiquidCrystal.h" #include "HIC.h" #include "Mode.h" extern LiquidCrystal lcd; static void PrintHello () { hic.print (F ("Hello\n")); } void HelloTest::Activate () { lcd.clear (); lcd.print (F ("Print Hello")); Mode::Show (); } void HelloTest::Select () { Mode::Nex...
#include<iostream> #include<vector> #include<stack> #include<climits> #define FOR(i,n) for(int i = 0; i < n; i++) using namespace std; int gMaxAreaOfHistogram(int xArray[], int n) { int lMaxArea = INT_MIN; stack<int> lStack; FOR(i, n) { if (lStack.empty()) { lStack.push(i); } else { int lCurrTo...
// This file has been generated by Py++. #include "boost/python.hpp" #include "generators/include/python_CEGUI.h" #include "RenderTargetEventArgs.pypp.hpp" namespace bp = boost::python; struct RenderTargetEventArgs_wrapper : CEGUI::RenderTargetEventArgs, bp::wrapper< CEGUI::RenderTargetEventArgs > { RenderTarge...
#include <bits/stdc++.h> using namespace std; int dp[20002]; int main() { int t;scanf("%d",&t); while(t--) { int total,n;scanf("%d %d",&total,&n); int ara[n+3]; for(int i=0;i<=20000;i++)dp[i]=100000000; for(int i=1;i<=n;i++)scanf("%d",&ara[i]); dp[0]=0; for(int...
// Clang includes #include "clang/AST/ASTConsumer.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" #include "clang/AST/Type.h" #include "clang/ASTMatchers/ASTMatchFinder.h" #include "clang/ASTMatchers/ASTMatchers.h" #include "clang/Basic/Diagnostic.h" #include "clang/Frontend/CompilerInstance.h" #inclu...
#include<stdio.h> #include<stdlib.h> typedef char TElemType; typedef struct BiTNode { TElemType data; struct BiTNode *lchild,*rchild; }BiTNode,*BiTree; /****************************************************/ bool InitTree(BiTree *T) { *T = NULL; } void DestoryTree(BiTree *T) { if(*T==NULL) return; else { Dest...
#include <algorithm> #include "ControlPoint.h" ControlPoint::ControlPoint(unsigned long workers) : workers(workers) {} unsigned long clamp(unsigned long x, unsigned long min, unsigned long max) { if (x < min) x = min; if (x > max) x = max; return x; } void ControlPoint::occupyWorker() { busyWorkers =...
// github.com/andy489 /// Counting inversions using merge sort #include <iostream> using namespace std; size_t mergeSort(size_t *arr, size_t *temp, int left, int right); size_t merge(size_t *arr, size_t *temp, int left, int mid, int right); /* sorts the array and returns count of inversions */ size_t mergeSort(si...
#include <vector> #include <iostream> using namespace std; class FriendScore { public: int highestScore(vector<string> friends) { int N = friends.size(); int ans = 0; for (int i = 0; i < N; i++) { int match = 0; for (int j = 0; j < N; j++) { if (i == j) continue; if (friends[i][j] == 'Y') { ...
#ifndef PIECE_H_ #define PIECE_H_ class piece { private: bool is_white; char shape; int x_coord; int y_coord; public: virtual piece(void){} virtual ~piece(void){} virtual void move(void) = 0; virtual void set_color(void) = 0; }; #endif
#ifndef CSOLIDSPHERE_H #define CSOLIDSPHERE_H #include "../header/Angel.h" #include "CShape.h" typedef Angel::vec4 color4; typedef Angel::vec4 point4; #define SOLIDCUBE_NUM 36 // 6 faces, 2 triangles/face , 3 vertices/triangle class CSolidSphere : public CShape { private: GLfloat m_fRadius; GLint m_iSlices, m_i...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "BallBoy.h" #include "PlasmaBarrel.h" #include "CoreMinimal.h" #include "UObject/Class.h" #include "GameFramework/Controller.h" #include "GameFramework/GameMode.h" #include "BBGameMode.generated.h" /** * */ UCLASS...
#ifndef _HS_SFM_SFM_PIPELINE_SCENE_EXPANDOR_HPP_ #define _HS_SFM_SFM_PIPELINE_SCENE_EXPANDOR_HPP_ #include <vector> #include <map> #include "hs_progress/progress_utility/progress_manager.hpp" #include "hs_sfm/sfm_utility/key_type.hpp" #include "hs_sfm/sfm_utility/camera_type.hpp" #include "hs_sfm/sfm_util...
/* Copyright (C) 2011 by Ladislav Hrabcak 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, distrib...
#include <iostream> #include <string> #define MAX 1000 using namespace std; struct Person { string m_Name; int m_Sex; //1 male 2 female int m_Age; string m_Phone; string m_Addr; }; struct Addressbooks { // array to put contacts struct Person personArray[MAX]; // number of contacts now int m_Size; }...
#pragma once #include <stdlib.h> #include "cocos2d.h" using namespace cocos2d; //#define LITE_VER // LITE version //#define TEST_MODE #define IPAD_VER // IPAD version #define MAX_SIZE_OF_CHARACTER_POOL 128 #define FRAME_HEIGHT 960.0f #define FRAME_WIDTH 640.0f #ifdef IPAD_VER #define BUY_AT...
#pragma once #include <opencv2/opencv.hpp> using pii = std::pair<size_t, size_t>; namespace Kruskal { class Drawer { public: Drawer(const size_t height, const size_t width); void drawLine(const pii a, const pii b); cv::Mat& getMat(); private: size_t m_height; size_t m_width; cv::Mat m_mat...
#include <cstdio> #include <iostream> using namespace std; typedef long long ll; const int maxn = 1e5 + 5; int n, m, arr[maxn]; int dp[maxn][25]; inline int read() { int x = 0, sign = 1; char c = getchar(); // 符号 for (; c < '0' || '9' < c; c = getchar()) if (c == '-') sign = -1; ...
/* * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2020, Savely Pototsky (SavaLione) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must ...
#include "movil.h" using namespace App_Interfaces; Movil::Movil() :vector(0.0, 0.0) { } Movil::~Movil() { } float Movil::integrar_vector(float delta, float &vec, float factor) { float copia_vector=vec; vec+=factor * delta; float val=copia_vector + vec; return val * 0.5 * delta; } void Movil::sumar_vector(fl...
#include "StdAfx.h" Q_PGW_ELF Qest_PGW_ELF; void Q_PGW_ELF::Config() { int EnableExQuest = GetPrivateProfileInt("Quest", "Ativar", 1, CFG_QUEST_ELF); if (EnableExQuest < 1) { return; } } bool Q_PGW_ELF::IsBadFileLine(char *FileLine, int &Flag) { Qest_PGW.Config(); if (Flag == 0) { if (isdigit(FileLine[0...
/* * Copyright (C) 2007-2015 Frank Mertens. * * Use of this source is governed by a BSD-style license that can be * found in the LICENSE file. * */ #include <flux/stdio> #include <flux/DirWalker> #include "pack.h" namespace fluxtar { void pack(String path, ArchiveWriter *archive, bool verbose) { if (verbos...
#include "mobilefacenet.hpp" #include "face_align.hpp" using namespace std; using namespace cv; MobileFacenet::MobileFacenet(const std::string&dir){ int dims[8]; std::string proto=dir+"/MobileFaceNet.prototxt"; std::string model=dir+"/MobileFaceNet.caffemodel"; graph=create_graph(nullptr,"caffe",proto....
#include "ViewerWindow.h" #include <QPalette> #define PI 3.1415926535898 namespace data_server{ ViewerWindow::ViewerWindow(int argc, char **argv, QWidget *parent) : QWidget(parent), m_RobotThread(argc, argv), m_MathThread() { /** Set up the Controls **/ p_closeButton = new QPushButton(tr("&Quit...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Foundation.Metadata.2.h" WINRT_EXPORT namespace winrt { namespace Windows::Foundation::Metadata { struct ApiInformation { ApiInformation() = delete; static bool IsT...
// bfs // N*N행렬로 계산 // 큐 사용 // visit표시 중요 // 배열에서 1부터 시작하는거 유의 #include <iostream> #include <vector> #include <queue> using namespace std; void bfs(vector<vector <int> >&llist, int start, vector<int> &visit){ queue<int> q; visit[start]=1; cout<<start<<" "; q.push(start); while(!q.empty()){ int tmp = q...
#include <cstdio> const int MAX_N = 2000; int N; char S[MAX_N+1]; void read(); void solve(); int main(){ read(); solve(); return 0; } void read(){ scanf("%d\n", &N); for (int i=0; i<N; i++){ scanf("%c", &S[i]); } } void solve(){ int a=0, b=N-1; while(a<=b){ bool left = false; for (int ...
/* @brief Process.cpp * Este programa obtiene todas las variables * que son necesarias, asi como sus transformaciones */ #include <bits/stdc++.h> using namespace std; extern map<int, int> tablePermutation; void inversePermutation( string *valueofPhi ){ string previous = ""; register int auxCont = 1; ...
// Copyright 2020 JD.com, Inc. Galileo Authors. All Rights Reserved. // // 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 requ...
#include <iostream> #include <string> int main () { std::string str, preStr, maxStr; unsigned cnt = 0, tmpCnt = 0; std::cout << "Please input some words:"; while (std::cin >> str) { if (str == preStr) { tmpCnt++; } else { if (tmpCnt > cnt) { cnt = tmpCnt; maxStr = preStr; } tmpCnt = 0...
#ifndef __PlaneRippleObject_H__ #define __PlaneRippleObject_H__ const Vector4 PLANE_DEFAULT_COLOR = Vector4(0, 0, 20, 255); const float PLANE_RIPPLE_DEFAULT_DURATION = 6; const float DEFAULT_COLLISION_RADIUS_MODIFIER = 5.0f; class PlaneRippleObject : public GameObject { protected: std::vector<Vector4> m_collisio...
//C++ INCLUDES #include <vector> #include <fstream> #include <iostream> #include <math.h> //ROOT INCLUDES //#include <TSYSTEM.h> #include <TSystem.h> #include <TTree.h> #include <TLatex.h> #include <TString.h> #include <TFile.h> #include <TH1D.h> #include <TH1F.h> #include <TH2F.h> #include <TF1.h> #include <TBox.h>...
#ifndef _CGNSFAMILY_H_ #define _CGNSFAMILY_H_ #include "meshDataAPI.h" #include "meshSet.h" namespace MeshData { class MESHDATAAPI CgnsFamily : public MeshSet { public: CgnsFamily(QString name); CgnsFamily(); ~CgnsFamily(); ///添加子set void appendDataSet(vtkDataSet* set); void generateDisplayDataSe...
/*********************************************************************** created: 16/7/2013 author: Lukas E Meindl *************************************************************************/ /*************************************************************************** * Copyright (C) 2004 - 2012 Paul D ...
#include <iostream> #include <string> #include "Card.h" using namespace std; // BlackJack::BlackJack () { // card_deck = new string [52]; // } Card::Card(){ } Card::~Card(){ } void Card::assignValues(char suit, char value){ _suit = suit; _value = value; switch (_value) { case 11: _weight = 1...
#ifndef _HS_SFM_BUNDLE_ADJUSTMENT_CAMERA_SHARED_GRADIENT_DELTA_X_DOT_PRODUCT_CALCULATOR_HPP_ #define _HS_SFM_BUNDLE_ADJUSTMENT_CAMERA_SHARED_GRADIENT_DELTA_X_DOT_PRODUCT_CALCULATOR_HPP_ #include "hs_math/linear_algebra/eigen_macro.hpp" #include "hs_sfm/bundle_adjustment/camera_shared_vector_function.hpp" #include "h...
/* * Copyright (c) 2019 Eric Lange * * Distributed under the MIT License. See LICENSE.md at * https://github.com/LiquidPlayer/caraml-core for terms and conditions. */ #include "node.h" #include "caraml-core.h" using namespace v8; void Init(Local<Object> target) { } NODE_MODULE_CONTEXT_AWARE(caramlcore,Init) v...
/* * support.h * * Created on: Sep 6, 2016 * Author: nigel */ #ifndef SUPPORT_H_ #define SUPPORT_H_ #include <stdlib.h> #include <string> #include <ctime> using namespace std; //////////////////My functions///////////////////// int getCalendarDate(void); int string2int(string); int pow(int, int); //////...
class Solution { public: bool isValid(string s) { if(s.size()==0)return true; stack<char>stk; for(char ch:s) { if(ch=='('||ch=='{'||ch=='[') stk.push(ch); else { if(stk.empty())return false; if(ch=='...
/* 编译运行 g++ xx.cpp ./xx.out */ // 导入包 #include <iostream> // 命名空间 using namespace std; // 自定义函数 int example(char s){ return s+"ok"; } // 内联函数: 编译时,编译器会把该函数的代码副本放置在每个调用该函数的地方(类中函数默认inline) inline char bb(){ return "bb"; } // 主函数 int main(){ example("001"); }
#include "content\Singularity.Content.h" namespace Singularity { namespace Content { class IModelImporter : public Singularity::Content::IContentImporter { protected: #pragma region Properties virtual const int Get_ModelCount() = 0; #pragma endregion #pragma region Methods v...
#ifndef BOT_H #define BOT_H #include <QMutex> #include "cell.h" #include "collider.h" #include "customscene.h" #include "config.h" class Bot : public QThread, public Cell { public: Bot(CustomScene* map); void run(); char getDirection() const; Collider *getBotCollider() const; private: Cell* b...
#include <unordered_map> #include <vector> using namespace std; class Solution { public: int findSpecialInteger(vector<int>& arr) { unordered_map<int, int> m; for (auto elem : arr) { if (m.count(elem)) { ++m[elem]; } else { m[elem] = 1; } if (m[elem] * 4 > arr.size()...
#include "lab/dialogs/class_variables.h" #include "lab/labv2_internal.h" #include "ship/ship.h" #include "ship/shipfx.h" #include "weapon/weapon.h" void Variables::open(Button* /*caller*/) { if (dialogWindow == nullptr) { dialogWindow = (DialogWindow*)getLabManager()->Screen->Add(new DialogWindow("Class Variables",...
struct Verticies; struct Inventory; meta() struct Player { //u32 id = 0, weapon = 1; float health = 100.0f; float speed; Verticies *mesh, *model; Inventory *inventory; }; meta() int result; meta() void proc0() { puts("proc0"); } meta() int sum(int x, int y) { return x + y; } meta() void proc1(...
#pragma once #include "Logger.hpp" #include "LogSpace.hpp" class StringSumSquareBrackets { public: StringSumSquareBrackets() = default; ~StringSumSquareBrackets() = default; StringSumSquareBrackets(StringSumSquareBrackets &&) = default; StringSumSquareBrackets& operator=(StringSumSquareBrackets &&) = ...
///////////////////////////////////////////////////////////////////////////// // Name: wx/statusbr.h // Purpose: wxStatusBar class interface // Author: Vadim Zeitlin // Modified by: // Created: 05.02.00 // RCS-ID: $Id: statusbr.h 59568 2009-03-15 19:45:34Z FM $ // Copyright: (c) Vadim Zeitlin...
#include "gui.h" #include "file.h" #include <iostream> #include <QString> #include <QDebug> #include <QJsonObject> #include <QJsonArray> #include <QIcon> using namespace std; GUI::GUI(int argc, char** argv) { qDebug() << "Application started" << endl; QApplication app(argc, argv); QQmlApplicationEngine eng...
 /// @file LedDisp.cc /// @brief LedDisp の実装ファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2005-2006, 2013 Yusuke Matsunaga /// All rights reserved. #include "LedDisp.h" BEGIN_NAMESPACE_LED // @brief コンストラクタ // @param[in] parent 親のウィジェット // @param[in] flags ウィンドウフラグ LedDisp::LedDisp(QWidget* pare...
/*********************************************************************** * created: 21/4/2013 * author: Martin Preisler *************************************************************************/ /*************************************************************************** * Copyright (C) 2004 - 2013 P...
#include <math.h> #include <stdio.h> #include <iostream> #include <omp.h> #define REAL double void calc_aux_cy(REAL *q , int qSize, REAL *xq0 , int xq0Size, REAL *xq1 , int xq1Size, REAL *xq2 , int xq2Size, REAL *xi , int xiSize, ...
// // SMImageEditorScene.cpp // ePubCheck // // Created by KimSteve on 2017. 4. 18.. // Copyright © 2017년 KimSteve. All rights reserved. // #include "SMImageEditorScene.h" #include "../../SMFrameWork/Base/SMView.h" #include "../../SMFrameWork/Base/SMImageView.h" #include "../../SMFrameWork/Base/SMZoomView.h" #incl...
#include "BoyerMoore.h" #include "Zalgorithm.h" #include "gtest/gtest.h" #include "BoyerMoorePreprocessing.h" using testing::Test; #include <algorithm> #include <random> #include <string> #define NUM_TEST_CASES 10000 #define RANDOM_STRING_SIZE 100 #define RANDOM_SUBSTRING_SIZE 4 // Sanity check for BoyerMoore & Zal...
// // Created by crabman on 11.01.16. // #include "parsing_error_exception.h" parsing_error_exception::parsing_error_exception(): std::logic_error{"Parsing error!"} { }
/* // Definition for a Node. class Node { public: int val; Node* next; Node* random; Node(int _val) { val = _val; next = NULL; random = NULL; } }; */ class Solution { public: Node* copyRandomList(Node* head) { if(head==NULL)return NULL; Node* prev=NU...
#include "animemodel.h" #include <QColor> #include <QFont> #include <QLocale> AnimeModel::AnimeModel(QtDataSync::DataStoreModel *srcModel, QObject *parent) : QObjectProxyModel({tr("Id"), tr("Name"), tr("Season Count"), tr("Last updated"), tr("Season Overview")}, parent) { setSourceModel(srcModel); addMapping(0, Q...
/************************************************************* * > File Name : UVa12304.cpp * > Author : Tony * > Created Time : 2019/04/21 22:22:17 **************************************************************/ #include<cstdio> #include<cmath> #include<algorithm> #include<string> #include<...
#include "texture.h" Texture::Texture(WCHAR* textureFilePath, ID3D11Device* device): textureFilePath(textureFilePath), device(device) { textureResource = 0; } Texture::Texture(const Texture& other) { } Texture::~Texture() { } bool Texture::Initialize() { HRESULT result; // Load ...
#include "renderable.h" #include <glm/gtc/matrix_transform.hpp> #include <glm/gtc/type_ptr.hpp> #include <fmt/format.h> namespace GLPlay { EventSource<Renderable::RenderableEvent> Renderable::event_source_; Renderable::Renderable(std::string frag_shader, std::string vert_shader) { gl_texture_ = 0; glGenBuff...
/* * EE 205 Lab 2 * * File: task1.cpp * Name: Paulo Lemus * Date: 1/18/2017 * * Learn the size of various data types. */ #include <iostream> using namespace std; struct Empty{ }; struct Base{ int a; }; struct Derived : public Base{ int b; }; struct Bit{ unsigned bit : 1; }; int main(){ E...
#include "graph.hpp" #include <stdexcept> #include <fstream> // format: 1 line = 1 node // first line followed by it's neighbours. // separator is an empty new line // std::string vertexSerializer(const V& v) converts V into std::string // V vertexCreator(const std::string&s) converts std::string to V template <type...
#include "natives.hpp" #include "CLogManager.hpp" #include <fmt/format.h> // native Logger:CreateLog(const name[], E_LOGLEVEL:level = INFO | WARNING | ERROR, bool:debuginfo = true); AMX_DECLARE_NATIVE(Native::CreateLog) { const char *name = nullptr; amx_StrParam(amx, params[1], name); return CLogManager::Get()->...
#include <iostream> #include <time.h> using namespace std; void main(void) { //반복문 //1. for문 // 초기화 범위 연산 for (int i = 0; i < 12; i++) { cout << "haha" << endl; } //2중 for문 for (int i = 1; i < 10; i++) { for (int j = 1; j < 10; j++) { cout << i << " X " << j << " = " << i * j <...
#include <iostream> using namespace std; int MyFun(int *p, int s) { int min = p[0]; for (int i = 0; i < s; i++) { if (min > p[i]) min = p[i]; } int x=min; for(int i=0;i<s;i++) { if(p[i]>=x) { cout<<p[i]<<" "; x=p[i]; } ...
# include <Attributes.hpp> Attributes::Attributes(short unsigned health) : m_health(health) { // empty } const short unsigned & Attributes::get_health() const { return m_health; } void Attributes::healted() { if(m_health < 3) ++m_health; } void Attributes::attacked() { if(m_health > 0) --m_health; ...
#pragma once #include "ofMain.h" #include "rectangle.hpp" #include "Mover.hpp" #include "machina.hpp" class ofApp : public ofBaseApp{ public: void setup(); void update(); void draw(); void keyPressed(int key); void keyReleased(int key); void mouseMoved(int x, int y ); void mouseDragged(int x, int y, ...
#ifndef ANIREMSETTINGSVIEWMODEL_H #define ANIREMSETTINGSVIEWMODEL_H #include "datasyncsettingsviewmodel.h" #include "imageloader.h" class AniremSettingsViewModel : public DataSyncSettingsViewModel { Q_OBJECT QTMVVM_INJECT_PROP(ImageLoader*, imageLoader, _loader) public: Q_INVOKABLE explicit AniremSettingsViewMod...
#ifndef Automovil_h #define Automovil_h #include "Nave.h" class Automovil: public Nave { private: std::string color; public: // Constructores Automovil(); Automovil(std::string, std::string, double, Piloto); // string color, string fabricante, double precio, Piloto piloto; // Getters y Setters ...
#include "Application.hpp" int main(){ Application* App = new Application (800,600); App->EventHandle(); return EXIT_SUCCESS; }
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
/* Name: Mohit Kishorbhai Sheladiya Student ID: 117979203 Student Email: mksheladiya@myseneca.ca Date: 21/01/27 */ #define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include "File.h" #include "Employee.h" namespace sdds { FILE* fptr; bool openFile(const char filename[]) { fptr =...
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*-------...
/* Copyright (C) 2015 Willi Menapace <willi.menapace@gmail.com>, Simone Lorengo <simone@lorengo.org> - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential * Written by Simone Lorengo <simone@lorengo.org> */ #ifndef CURRENT_SENSOR_INCLU...
#include <cstdio> int get_id(int pa); int main() { typedef struct { // char no[16]; long long no; int pa; int pb; } List; int n = 0, // provide N infos i = 0, m = 0, // get M infos tmp = 0; scanf("%d", &n); List list[n]; for(i = 0; i < n; i++) { // scanf("%s %d %d",...
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
#include "MinimumHeap.hpp" #include <stdio.h> #include <assert.h> #include <iostream> using namespace std; void MinimumHeap::SiftDown(int index) { int length = _Groups_in_fact; int leftChildIndex = 2 * index; int rightChildIndex = 2 * index + 1; if (leftChildIndex > length){ if(_Groups_in_fact==...
#include <bits/stdc++.h> using namespace std; #define ar array #define ll long long const int MAX_N = 1e5 + 1; const ll MOD = 1e9 + 7; const ll INF = 1e9; // CF Contest Global Round # 14 (1515) ProgB void solve() { ll n; cin>>n; if(n == 0 || (n & 1)){ cout<<"NO\n"; return; } if((!(n%2...
#include "Item.h" #include <iostream> Item::Item() : name("Unknown"), price(0), purpose("Unknown") { //Constructors } Item::Item(std::string name, int price, std::string purpose) : name(name), price(price), purpose(purpose) { } std::string Item::GetName() { //Getter for the name of the item ...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
#ifndef STICKUINO_COMPONENTS_ACTIVATOR_H #define STICKUINO_COMPONENTS_ACTIVATOR_H #include "Component.h" namespace Stickuino { namespace Components { /// <summary> /// A component which can be active (HIGH) or inactive (LOW). /// </summary> class Activator : public Component { public: /// <summary> /...
#include "cybModel.h" #include "cybUpdateModel.h" CybUpdateModel::~CybUpdateModel(){}
#pragma once #include "Common.h" #include "SDL.h" #include "SDL_syswm.h" #include "GluStuff.h" #ifndef FO_OGL_ES # include "GL/glew.h" # include "SDL_opengl.h" #else # include "SDL_opengles2.h" #endif #include "SDL_vulkan.h" #ifdef FO_MSVC # pragma comment( lib, "opengl32.lib" ) # pragma comment( lib,...
#include <gmock/gmock.h> #include <gtest/gtest.h> #include <Transformation.h> #include <CompositeTransformation.h> #include <ID.h> namespace test { using namespace std; using ::testing::Contains; using ::testing::Return; using ::testing::AllOf; using ::testing::Pointee; using ::testing::UnorderedElements...
#ifndef Included_MontonCartas_H #define Included_MontonCartas_H #include <iostream> #include <ctime> #include <cstdlib> #include "Carta.h" using namespace std; class MontonCartas { Carta *p; // this is our stack, a simple pointer. Yeah, amazing xD Carta *deleted; void intercambiar(int pos1, int pos2);...
//////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006-2010 MStar Semiconductor, Inc. // All rights reserved. // // Unless otherwise stipulated in writing, any and all information contained // herein regardless in any format shall remain the sole proprietary of ...
#include <iostream> #include <string.h> #include <math.h> void RomToAr(); using namespace std; void ArToRom() { int num; cout << "Enter arabic number: "; cin >> num; if ( 1 <= num && num <= 3999) { cout << "Roman number: " << endl; for (; num >= 1000; num -= 1000) cout << "M"; i...
#ifndef H_TRANSLATING_GAME_OBJECT #define H_TRANSLATING_GAME_OBJECT #include "GameObject.h" class TranslatingGameObject : public GameObject { public: TranslatingGameObject::TranslatingGameObject(); TranslatingGameObject::TranslatingGameObject(AllKit::Sprite sprite, int x = 0, int y = 0, double movementAngle = 0, fl...
// // Created by glumes on 2021/3/7. // #include "FilterUtil.h" #include <VulkanFilter.h> #include <MirrorFilter.h> #include <RGBFilter.h> #include <ColorInvertFilter.h> #include <FilterType.h> #include <ExposureFilter.h> #include <GammFilter.h> #include <ContrastFilter.h> #include <HazeFilter.h> VulkanFilter* Filter...
#include <cmath> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <unordered_map> #include <unordered_set> #include <vector> #include <set> #include <stack> #include <sstream> #include <string> using namespace std; struct TreeNode { int val; TreeNode* left; Tr...
#include<iostream> #include<cmath> using namespace std; class Time{ private: int Hour; int Min; int Sec; public: Time(){ Hour = 00; Min = 00; Sec = 00; } Time(int Hour, int Min, int Sec){ (*this).Hour = Hour; this->Min = Min; this->Sec = Sec; } ~Tim...
/* Priority queue: * Thuộc tính: + Priority queue là một hàng đợi + Hàng đợi có ưu tiên (Priority queue) + Cấp phát động (Allocator-aware) * Template parameters <T, Container>: + T: Kiểu dữ liệu cần chứa (Type of ele contained) + Container: Kiểu dữ liệu sử dụng bên tr...
#include "StdAfx.h" #include "frmPCHistory.h"
// Copyright 2020 JD.com, Inc. Galileo Authors. All Rights Reserved. // // 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 requ...
#ifndef _PAINTTOOLS_H_ #define _PAINTTOOLS_H_ #include <QRect> #include <QObject> #include <QStringList> #include <QPainterPath> #include <QImage> #include "interfaces.h" class PaintTools : public QObject, public BrushInterface { Q_OBJECT Q_INTERFACES( BrushInterface ); public: QStringList brushes() const; QRe...
#ifndef _HS_SFM_SFM_PIPELINE_POINT_CLOUD_NORM_CALCULATOR_HPP_ #define _HS_SFM_SFM_PIPELINE_POINT_CLOUD_NORM_CALCULATOR_HPP_ #include <utility> #include <limits> #include <flann/flann.hpp> #include "hs_sfm/sfm_utility/camera_type.hpp" #include "hs_sfm/sfm_utility/projective_functions.hpp" namespace hs { ...