text
stringlengths
8
6.88M
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Devices.Bluetooth.Rfcomm.1.h" #include "Windows.Foundation.1.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Foundation::Collections { #ifndef WINRT_GENERIC_97df6...
/** * Copyright (C) 2017 Alibaba Group Holding Limited. 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 * * ...
/*=================================== # Author: sjay05 # File: time.cpp # Desc: calculate execution time ===================================*/ #include <bits/stdc++.h> #include <time.h> #define start_time() clock_t tStart = clock() #define get_time (double)(clock() - tStart)/CLOCKS_PER_SEC #define print_time() prin...
#include<iostream> using namespace std; int main() { long long int t,i,l1,flag = 0; string s,l; cin>>t; while(t--) { cin>>s>>l; l1 = s.length(); for(i = 0;i < l1;++i) { if(s[i] == l[i]) continue; else if((s[i] == '?' && l[i] != ...
#include "init_devices.hpp" #include "sfr29.h" // extern "C" { extern void init_led(); extern void init_switch(); extern void init_motor(); extern void init_encoder(); } #include "encoder_driver.h" #include "led_driver.h" #include "motor_driver.h" #include "switch_driver.h" void init_cpu(); vo...
// // PartyVideoDJ - YouTube crossfading app // Copyright (C) 2008-2017 Michael Fink // /// \file VideoSearchView.cpp View to search for videos // #include "stdafx.h" #include "resource.h" #include "VideoSearchView.hpp" void VideoSearchView::SearchVideo(const CString& cszText) { ATLVERIFY(true == Navigate(_T("http:...
/******************************************************************** author: ConfigGenerator *********************************************************************/ #ifndef __CommonTemplate__HPP__NO_CONFLICT #define __CommonTemplate__HPP__NO_CONFLICT #include "ConfigDataTemplate.hpp" #include "ConfigLanguageSetting....
#ifndef VECTOR_EXT_H #define VECTOR_EXT_H #include "ublas_ext_config.hpp" #include "expression_types_ext.hpp" #include "vector_expression_ext.hpp" #include <boost\numeric\ublas\vector.hpp> #endif //VECTOR_EXT_H
#include <Windows.h> #include <iostream> using namespace std; namespace thread_event { int tickets=100; HANDLE _event; DWORD WINAPI threadFunc1(LPVOID lpParam)//函数形式 { while(TRUE) { WaitForSingleObject(_event,INFINITE);//可以使用事件对象,如果已经是拥有者,不可再次拥有,要等 //ResetEvent(_event);//对于手工的,没用的 if(tickets>0) { ...
/************************************************ * Project: Home Lighting Automation System * Date: 2019-May-04 * Author: William Becerra Gonzalez * * Description: This project allows a user to connect via the internet and connect to a NodeMCU ESP8266 * based circuit that controlls the lighting system via a web...
#include "headers.hpp" #ifndef WINDOWCONTROLLER_H #define WINDOWCONTROLLER_H class windowController{ GLuint programId; GLFWwindow* window; string windowName; int width, height; public: windowController(string windowName, int width, int height); GLFWwindow* getWindow(); GLuint getProgramId(); void setPro...
/// PROBLEMA PONTOS DE FENO uri1261 #include<bits/stdc++.h> using namespace std; int main(){ map<string, int> preco; int palavras, num_tex; cin >> palavras >> num_tex; string str; int val; for(int i = 0; i < palavras; i++){ cin >> str >> val; preco[str] = val; } for(int i = 0; i < num_tex;...
class CfgPatches { class SAEF_TOOLBOX_RADIATION { version=2; units[]={}; weapons[]={}; author="Rabid Squirrel"; requiredVersion=0.1; requiredAddons[]= { "A3_Data_F" }; }; }; class CfgFunctions { class RS_Radiation { class Radiation { file = "saef_radiation\Functions"; class ChemicalDe...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "Blueprint/UserWidget.h" #include "UI_PlayerHealthBar.generated.h" class UProgressBar; class UTextBlock; UCLASS() class THIRDPERSONSHOOTER_API UUI_PlayerHealthBar : public UUserWidget { GEN...
#include <TESTS/testcase.h> #include <TESTS/test_assertions.h> #include <CORE/types.h> #include <CORE/ARCH/endian.h> using core::endian::little; using core::endian::big; REGISTER_TEST_CASE(endianTestSwap8) { const u8 in = 0x0F; u8 lout = little(in); u8 bout = big(in); TEST(testing::assertEquals(in, lout)); ...
#include "decoder.h" Decoder::Decoder(string _filename) { init(NULL); config->TAG_IMAGE_FILE = _filename; config->ARGS_OK = true; } Decoder::Decoder(int argc,char **argv) { init(NULL); config->checkArgs(argc, argv); } Decoder::Decoder(Tagimage* _tagimage) { init(NULL); tagimage = _tagimage; if(tagimage != NU...
#include "SouvenirData.h" #include <iomanip> #include <fstream> #include <sstream> #include <limits> #include <ios> //creates a souvenir class based on the text file souvenirInfoList.txt SouvenirData::SouvenirData() { std::ifstream inFile; inFile.open("C:/Users/gdfgdf/Documents/findingnemo/souvenirInfoList.txt...
// -*- 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...
/* * polydatafiles2csv.cc * * Created on: Feb 13, 2015 * Author: paulaljabar */ #ifdef HAS_VTK /////////////////////////////////////////////////////////////// #include <string.h> //#include <sys/stat.h> // #include <irtkImage.h> #include <irtkMatrix.h> #include <abcdUtils.h> #include <vtkSmartPointer.h> ...
/*********************************************************************** created: Tue Feb 17 2009 author: Paul D Turner *************************************************************************/ /*************************************************************************** * Copyright (C) 2004 - 2011 Pa...
#include "RobotMovingFunctions.h" int time_on_black = 0; int time_on_white = 0; void setup() { setIOpins(); } void loop() { int lightSensorValue= analogRead(A1); if ( lightSensorValue < 400 ) { // BLACK area robotLeft(); time_on_white = 0; // reset time on white time_on_black++;   // meas. time ...
/* 2019 Oku Dan / oku_dan@yahoo.co.jp STMicroelectronics社製LPS331AP用のI2C版ライブラリです. 使用する際はデバイスのSDAとSCLをセンサに接続してください. 内部プルアップではないので注意. 1.LPS_331AP型クラスを作成 2.Initialize()で初期化 3.Wire.setClock(400000L)でI2Cを高速モードにするとよい 4.ReadPrs(&prs),ReadTmp(&tmp)で気圧、気温読み出し 5.4に戻る 49行目ODRでサンプリングレートを変更できる(デフォルトは25Hz,...
/*************************************************************************** # Copyright (c) 2020, NVIDIA CORPORATION. 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...
#include "../lib/Right_func.h" double right04_func(float **P_now,float **P_pre,float **P_aft, float **Px_now,float **Px_pre,float **Px_aft, float **Pz_now,float **Pz_pre,float **Pz_aft, float **Vx_now,float **Vx_pre,float **Vx_aft, float **Vz_now,float **Vz_pre,float **Vz_aft, ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; #define pb push_back #define all(x) x.begin(), x.end() #define rep(i, a, b) for(ll i = a; i < b; ++i) #define rsz(x, n) x.resize(n) using pi = pair<int, int>; #define f first #define s second void setIO(string name = "count...
#include <bits/stdc++.h> #include <cassert> #define rep(i,n) for (int i = 0; i < (n); ++i) #define ok() puts(ok?"Yes":"No"); template<class T> bool chmax(T &a, const T &b) { if(a < b) { a = b; return true; } return false; } template<class T> bool chmin(T &a, const T &b) { if(a > b) { a = b; return true; } return false;...
#include "file_verifier.h" #include "myqfileinfo.h" #include "ui_appmainwindow.h" #include <QDirIterator> #include <QHash> #include <QLabel> #include <QMessageBox> #include <QProgressBar> #include <QMainWindow> #include <QTransform> #include <QPixmap> #include <QThread> #include <QTreeWidget> #include <QStackedWidget> ...
#include <iostream> int main(void) { std::string str = "HI THIS IS BRAIN"; std::string *ptr = &str; std::string &ref = str; std::cout << "Printing pointer: " << *ptr << std::endl; std::cout << "Printing reference: " << ref << std::endl; }
#ifndef TRAFFIC_LIGHT_H #define TRAFFIC_LIGHT_H #include "recognitionVehicle.h" #include "TrafficLightPins.h" #include <stdio.h> #include <vector> #define RETURN_FLASHING_GREEN 2; #define YELLOW_TIME 2 #define SECOND 1000 class MainTrafficLight { private: int greenTime = 5, redTime = 15; int posledMainTLight = 0; ...
/* Generated SBE (Simple Binary Encoding) message codec */ #ifndef _SBE_ORDERTYPE_H_ #define _SBE_ORDERTYPE_H_ #if defined(SBE_HAVE_CMATH) /* cmath needed for std::numeric_limits<double>::quiet_NaN() */ # include <cmath> # define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN() # define SBE_DOUBLE_NAN std::num...
#include<iostream> using namespace std; int main() { int n; cin>>n; int line=1; int count=1; while(line<=n) { int no=1; while(no<=line) { cout<<count<<" "; count=count+1; no++; } line++; cout<<endl; } return 0; }
#ifndef _renderFace_H_ #define _renderFace_H_ using namespace cv; using namespace std; #define COLOR Scalar(255, 200,0) // drawPolyLine draws a poly line by joining // successive points between the start and end indices. void drawPolyline ( Mat &im, const vector<Point2f> &landmarks, const int start, con...
#include<string> #include<memory> #ifndef PARSER_INPUT #define PARSER_INPUT class Parser_Input { public: Parser_Input (); ~Parser_Input (); /** * \ingroup CXXinput * \name File open/close: * */ /** * \ingroup CXXinput * @{ */ /// \brief open \e filename for parsing int Open ...
#include "FtdcProperties.hpp" #include <map> typedef std::map< std::string, std::string > Properties; FtdcProperties::FtdcProperties() { }
class WordDictionary { class TrieNode { public: TrieNode() { isWord = false; for (int i = 0; i < 26; i++) { child[i] = nullptr; } } bool isWord; TrieNode *child[26]; }; TrieNode root; bool search(strin...
#include "lane_markings.h" #include <cmath> #include "engine/vertex.h" namespace { auto build_lane_markings() { using namespace apeiron::engine; const float line_width = 0.2f; const float line_length = 6.0f; const float line_gap = 12.0f; const float lane_width = 3.6f; std::vector<Vertex_simple> vert...
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ void inorder(TreeNode* A,TreeNode** ans,int* B) { if(A==NULL)return; inorder(A->left,ans,B); (*B)--; if(*B==0) {...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef SYNC_NOTIFIER_SYNC_NOTIFIER_REGISTRAR_H_ #define SYNC_NOTIFIER_SYNC_NOTIFIER_REGISTRAR_H_ #include <map> #include "base/basictypes.h" #inclu...
#ifndef RENDERER_H #define RENDERER_H #include <QThread> #include <QObject> #include <QAbstractVideoSurface> #include <QFuture> #include "worker.h" #include "instructions.h" #include "palette.h" class Renderer : public QThread { Q_OBJECT Q_PROPERTY(QAbstractVideoSurface* videoSurface READ videoSurface...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
#include <iostream> using namespace std; int main() { int x = 2629800; //okres zycia w wieku w niemowlecym w minutach 0-5 lat int y = 3681720 ; // dokres zycia w wieku w dzieciecymw minutachziecko w minutach 5-12 int z = 3155760 ;//okres zycia w wieku w mlodzienczym w minutach 12-16 int dzien, miesia...
#include <iostream> #include <vector> #include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <memory> using namespace std; using namespace cv; #define WINDOW_NAME1 "[原始图]" #define WINDOW_NAME2 "[修补后的效果图]" // 描述: 全局变量的声明 Mat srcImage1, inpaintMask; Point p...
#pragma once #include "../hw/api.h" #include "constants.h" #include "icons_manager.h" class PasswordWidget { public: enum EState { kStateHidden = 0, kStatePasswordEnter, kStateRequestSent, kStateDrawResult, }; PasswordWidget(API* api, IconsManager& iconsMan) : m...
/*Given an array A[] of size N and an integer K. Your task is to complete the function countDistinct() which prints the count of distinct numbers in all windows of size k in the array A[]. Input: The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case c...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.ApplicationModel.Background.2.h" WINRT_EXPORT namespace winrt { namespace Windows::ApplicationModel::Background { template <typename H> struct impl_BackgroundTaskCanceledEv...
#include <sstream> #include <gtest/gtest.h> #include "hs_test_utility/test_env/data_path.hpp" #include "hs_sfm/sfm_file_io/extrinsic_params_set_loader.hpp" #include "hs_sfm/sfm_file_io/intrinsic_params_set_loader.hpp" #include "hs_sfm/sfm_file_io/keyset_loader.hpp" #include "hs_sfm/sfm_file_io/object_index_loader.h...
/*********************************************************************** created: 20/2/2004 author: Paul D Turner purpose: Defines interface for main GUI system class *************************************************************************/ /***************************************************...
/* * Copyright (C) 2021 The Android Open Source Project * * 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...
#include<bits/stdc++.h> using namespace std; struct node { int data; struct node* left; struct node* right; }; typedef struct node Node; Node* newNode(int data) { Node* temp = new Node(); temp->data = data; temp->left = NULL; temp->right = NULL; return temp; } int largest_sum_util(Node* root,map<Node*,int>&...
// XMLControler.h - Contains declaration of Function class #pragma #ifdef XMLCONTROLER_EXPORTS #define XMLCONTROLER_API __declspec(dllexport) #else #define XMLCONTROLER_API __declspec(dllimport) #endif #define CUSCNTMAX 20000 #define ACCCNTMAX 20000 #include <boost/archive/xml_iarchive.hpp> #include <boost/archive...
#ifndef EXCEPTION_523908571309_HEADER #define EXCEPTION_523908571309_HEADER #include <stdexcept> namespace solar { //Exception class used by this program //Derived from std::runtime_error(so from std::exception too) class Exception : public std::runtime_error { using std::runtime_error::runtime_error; }; } ...
class gvert{ public: vect pos; vect nor; }; class gedge{ public: gvert ** ver; vect dir; bool ini; gedge(){ ini = false; } void set(gvert * av0, gvert * av1){ if(ini){ delete[] ver; ini = false; } if(av0==NULL||av1==NULL){ return; } ver = new gvert*[2]; ver[0] = av0; ver[1] = av1; ...
#include "DemoJavaLexer.hpp" #include "DemoJavaDocLexer.hpp" #include "DemoJavaParser.hpp" #include "antlr/TokenStreamSelector.hpp" #include <iostream> int main() { ANTLR_USING_NAMESPACE(std) ANTLR_USING_NAMESPACE(antlr) // Define a selector that can switch from java to javadoc TokenStreamSelector selector; try...
// // Created by Nitish Mohan Shandilya on 9/9/20. // // Test cases vector 1a, 1b, // Given two vectors T and R, find the score of passing test cases // Only if all the tests in the group is passed, then only the entire group is // a pass. class Solution { unordered_map<int, vector<int>> lookupMap; void buildL...
#include<bits/stdc++.h> using namespace std; // Right most set bit => number & (two's compliment of number( ~number+1)) int main() { int n; cin >> n; cout << n&(-n) << endl; return 0; }
#pragma once #include <landstalker-lib/patches/game_patch.hpp> #include <landstalker-lib/model/map.hpp> #include <landstalker-lib/constants/map_codes.hpp> /** * This patch optimizes a few laggy Tibor map by removing a few ghosts which are almost unnoticeable. */ class PatchOptimizeTiborMaps : public GamePatch { pub...
// This file has been generated by Py++. #ifndef ImageryComponentVector_hpp__pyplusplus_wrapper #define ImageryComponentVector_hpp__pyplusplus_wrapper void register_ImageryComponentVector_class(); #endif//ImageryComponentVector_hpp__pyplusplus_wrapper
#ifndef GAMESTATE_H #define GAMESTATE_H #include "states/State.h" #include "models/Model.h" #include "scene/Scene.h" #include "maths/Camera.h" #include <GxPhysics/GxPhysicsModel.h> #include <pcx/signals.h> class Graphics; class TestPc; class GameState : public State { public: explicit GameState(Events &even...
/* * Copyright 2012 Free Software Foundation, Inc. * * This file is part of GNU Radio * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later v...
/*************************************************************************** Copyright (c) 2020 Philip Fortier This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or...
// This file has been generated by Py++. #ifndef PropertyInitialiserMap_hpp__pyplusplus_wrapper #define PropertyInitialiserMap_hpp__pyplusplus_wrapper void register_PropertyInitialiserMap_class(); #endif//PropertyInitialiserMap_hpp__pyplusplus_wrapper
#ifndef MATHTOOLBOX_DATA_NORMALIZATION_HPP #define MATHTOOLBOX_DATA_NORMALIZATION_HPP #include <Eigen/Core> namespace mathtoolbox { class DataNormalizer { public: /// \param data_points An n-by-m matrix representing m data points lying in an n-dimensional space. DataNormalizer(const Eigen:...
/* * Copyright (C) 2012-2016 Open Source Robotics Foundation * * 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...
/*#include <iostream> #include <iomanip> #include <locale> #include <TROOT.h> #include <TChain.h> #include <TFile.h> #include <TKey.h> #include <TCollection.h> #include <TObject.h> #include <TList.h> #include <fstream> #include "vector" #include "vector" using std::vector; #include <TH2.h> #include <TStyle.h> #incl...
#ifndef COMMANDSPROCESSOR_H #define COMMANDSPROCESSOR_H #include <QSharedPointer> #include "Commands/CommandDescriptor.h" class CommandsProcessor : public QObject { Q_OBJECT public: CommandsProcessor(); public slots: void processHttpReply(class QNetworkReply *reply); // Separated mainly for testing purposes ...
/* * TCPSession.cpp * * Created on: 25 Sep 2018 * Author: Thomas Maters * Email : thomasmaters@hotmail.com (TG.Maters@student.han.nl) */ #include "TCPSession.hpp" namespace Communication::TCP { TCPSession::TCPSession(boost::asio::io_service& io_service, std::shared_ptr<R...
#ifndef IMGUIVIEWER_CAMERA_HEADER #define IMGUIVIEWER_CAMERA_HEADER #include <limits> #include "Source/Math/Math.h" #include "Source/Units/Unit.h" namespace solar { namespace openGL { class Shader; } //Abstract interface for a camera that consists of view and projection matrices stored in UBO and can follow si...
#include <iostream> using namespace std; int sum[2] = {0,}; void Fibonacci(int num1, int num2, int N){ if(N <= 1){ if(N == 0){ sum[0] = 1; sum[1] = 0; } else{ sum[0] = num1; sum[1] = num2; } return; } return Fibonacci(num2, num1 + num2, N - 1); } int main(){ int N =0; int T = 0; cin...
#include <stdio.h> int main(){ int N, K; scanf("%d %d", &N, &K); //PERSEGI 1 //baris for(int i = 0; i < N; i++){ //kolom for(int j = 0; j < N; j++){ printf("#"); } printf("\n"); } printf("\n"); //PERSEGI 2 //baris for(int i = 1; i < N; i++){ if(i % K...
#include <Arduino.h> #include <ArduinoJson.h> #include <AsyncTCP.h> #include <ESPAsyncWebServer.h> #include "AsyncJson.h" #include "file_utils.hpp" #include "networking.hpp" #include "html_pages.hpp" #include <driver/adc.h> #include "time.h" #include <ESP32Time.h> #include <functional> #include <esp_wifi.h> #include <e...
#pragma once #include "Task.h" #include "Camera.h" #include "../CWE/CWELib.h" // Task of the loading scene. class LoadingExec : public TaskBase { private: CWE::Polygon mLoadingImage; Camera mCamera; CWE::Timer mTime; public: LoadingExec(int priority); ~LoadingExec(); void Update(TaskExec::List& taskList) ...
#include "../../include/online/tcp_server.h" namespace keyword_suggestion { TcpServer::TcpServer(int port, const std::string &ip) : acceptor_(port, ip), event_loop_(acceptor_) {} void TcpServer::Start() { acceptor_.Init(); event_loop_.Loop(); } void TcpServer::Stop() { event_loop_.Unloop(); } void TcpServe...
#include<bits/stdc++.h> using namespace std; struct Student{ string name="",number=""; int score; Student(int s=0):score(s){} }; int main(){ int N; scanf("%d",&N); Student Max(-1),Min(101),temp; for(int i=0;i<N;++i){ cin>>temp.name>>temp.number>>temp.score; if(Max.score<temp....
#ifndef TerraNova_UserEvent_h #define TerraNova_UserEvent_h namespace terranova { struct UserEvent { uint32_t type; uint32_t timestamp; void* data; }; } #endif
#include <iostream> #include <list> #include <algorithm> using namespace std; void print(list<int>&lt) { list<int>::iterator it; for(it=lt.begin();it!=lt.end();it++) cout<<*it<<" "; cout<<endl; } class sequence { int value; public: sequence(int iv):value(iv){} int operator()() { return ...
#include <iostream> using namespace std; int main() { double a; int b; cout<<"boyinggizni kiriting(cm): "; cin>>a; cout<<"vazningizni kiriting(kg): "; cin>>b; a = a/100; cout<<" sizning vazn va boyingiz balansi: "<<b/(a*a); return 0; }
#include "opencv.hpp" using namespace cv; using namespace std; int main() { Mat srcImage = imread("alphabet.bmp", IMREAD_GRAYSCALE); if (srcImage.empty()) return -1; Mat tImage1 = imread("A.bmp", IMREAD_GRAYSCALE); Mat tImage2 = imread("S.bmp", IMREAD_GRAYSCALE); Mat tImage3 = imread("b.bmp", IMREAD_GRAYSCALE); ...
class Letter { public: enum { LETTER_W = 16, LETTER_H = LETTER_W, LETTER_X = 10, LETTER_Y = LETTER_X, }; static flt LETTER_SCALE = 1.0f; ~Letter(); Letter(ImagePtr img = NULL, int width = LETTER_W, int height = LETTER_H, flt scale = LETTER_SCALE, int xcount = LETTER_X...
#include<iostream> #include<cstring> using namespace std; int _sum[100][100]; int dp[100][100]; int dat[100]; int n; int ans=-1; const int _INT_MAX=10000000; int sum(int i,int j,int k) { return dat[i]*dat[(j+1)%n]*dat[(k+1)%n]; } int main() { cin >>n; for(int i=0;i<100;i++) { for(int j=0;j<100;j++) { dp[i...
/************************************************************* * > File Name : P3372.cpp * > Author : Tony * > Created Time : 2019年02月21日 星期四 12时31分17秒 **************************************************************/ #include <bits/stdc++.h> #define LL long long #define ls rt<<1 #define rs rt...
#include "netlist.h" using namespace std; int main (int argc, char * const argv[]) { //Make sure there is at least a document present if (argc < 2 ) { cerr << "Error! You must enter a filename as an argument." << endl; return -1; } evl_wires wires; evl_components comps; if (!parse_e...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "base.h" WINRT_WARNING_PUSH #include "internal/Windows.Storage.Streams.3.h" #include "internal/Windows.Foundation.3.h" #include "internal/Windows.Security.Authentication.Identity.Prov...
#include "Interface.h" void Interface::boader() { drawAtPoint(0, 0, "〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓〓", ""); for (int i = 1; i < HEIGHT - 1; i++) { drawAtPoint(0, i, "〓", ""); drawAtPoint(WIDTH - 2, i, "〓", ""); } drawAtPoint(0, HEIGHT - 1, "〓〓〓〓〓〓〓〓〓〓〓〓...
#ifndef _TNA_RENDERING_SCENE_H_ #define _TNA_RENDERING_SCENE_H_ #include "../math/matrix.h" #include "../math/vector.h" #include "../tools/colors.h" #include "renderer.h" #include "furious/common/dyn_array.h" namespace tna { #define _TNA_RENDER_HANDLER_INVALID 0xffffffff struct mesh_data_t; enum class render_o...
//В массиве размера N, заполненного случ.числами от 0 до 10, подсчитать количество элементов, встречающихся более одного раза. #include <iostream> #include <ctime> using namespace std; void initArray(int * arr, int size) { int * end = arr + size; for (arr; arr < end; arr++) { *arr = rand() % 11; } } ...
/********************************************************/ /* fontout.c */ /* Output Raster Font and Bitmap Font with GLUT */ /********************************************************/ #include <GL/glut.h> #include <GL/gl.h> #include <GL/glu.h> #include <stdarg.h> #include <str...
#include "AIBase.h" #include "Manager.h" #include "AILevel.h" #include "Player.h" AIBase::AIBase(unsigned short a_usX, unsigned short a_usY, unsigned int a_uiMaxArmy, unsigned short a_usOwner) : m_usX(a_usX), m_usY(a_usY),m_usOwner(a_usOwner) { m_uiMaxArmyStrength = a_uiMaxArmy; m_uiArmyStrength = m_uiMaxArmyStren...
#ifndef _HS_SFM_SELF_CALIBRATION_PROJECTIVE_SYNTHETIC_GENERATOR_HPP_ #define _HS_SFM_SELF_CALIBRATION_PROJECTIVE_SYNTHETIC_GENERATOR_HPP_ #include "hs_math/linear_algebra/eigen_macro.hpp" #include "hs_sfm/synthetic/flight_generator.hpp" namespace hs { namespace sfm { namespace sc { template <typename _Scalar, typen...
#include"LinkList.h" #include<iostream> using namespace std; class myList : public LinkList { public: myList() { head = nullptr; tail = nullptr; Curr_size = 0; } void add_node_tail(int data) { node* temp = new node(); temp->data = data; temp->next = nullptr; if (head == nullptr) ...
#include<stdio.h> #include<malloc.h> struct node{ int data; struct node *left; struct node *right; }; int isBST(struct node *root){ if(root==NULL) return 1; if(root->left!=NULL && root->left->data > root->data) return 0; if(root->right!=NULL && root->right->data < root->data) ...
#ifndef PARTICULA_CHISPA_H #define PARTICULA_CHISPA_H #include <herramientas/vector_2d/vector_2d.h> #include <generador_numeros.h> #include "particula_movil_base.h" namespace App_Juego_ObjetoJuego { class Particula_chispa: public Particula_movil_base { ////////////////// //Interface pública... public: Parti...
#include "stdafx.h" #include "UOneThingWorld.h" #include "CBox.h" #include "CDirectionalLight.h" #include "CCharacter.h" IMPLEMENT_CLASS(UOneThingWorld); UOneThingWorld::UOneThingWorld() { } UOneThingWorld::~UOneThingWorld() { } bool UOneThingWorld::DestroyWorld() { __super::DestroyWorld(); ...
#pragma once #include <curand.h> #include <random> namespace transprecision_floating_point { struct random_engine { template<typename Distribution> static void generate(float* a, size_t size, Distribution distribution); static void set_seed(size_t seed); static void destroy(); private: static void init()...
/* BAEKJOON 17135. 캐슬 디펜스 2. DFS (궁수 선택) + DP (적 선택) 적의 위치를 모두 벡터에 미리 저장해두고 각 궁수와의 거리를 모두 체크했다. D 이내 거리의 적들은 kill_enemy_temp 벡터에 저장한 후 sort하였다. 적들이 한 칸씩 내려올 때마다 적의 위치를 다시 찾아야해서 1번 방법보다 훨씬 오래걸린다. **놓쳤던 부분** 궁수가 N+1 행에만 위치한다는 말인데, N+1에도 존재할 수 있다고 이해했다. 문제가 짧지만, 문제를 잘 읽읍시다..^^ **주의할 부분** **같은 적이 여러 궁수에게...
#include <fstream> #include <iostream> #include <string> #include <map> #include <vector> #include <fstream> #include <algorithm> #include <string.h> using namespace std; int n, k; const int big = 26 * 26 * 26 *10; vector<int> v[big]; int main() { //freopen("a.txt", "r", stdin); //fstream cin("a.txt"); scanf("%d%d...
#include "Box2dWorld.h" #include <cstring> using namespace std; #include "SnagForestWorld.h" GameEntry g_gameEntries[] = { {"SnagForestWorld", SnagForestWorld::Create}, // {NULL, NULL} }; int g_totalEntries = sizeof(g_gameEntries) / sizeof(g_gameEntries[0]);
/* * sparql.cpp * xSWO * * Created by jim on 9/9/08. * Copyright 2008 Glamdring Inc. Enterprises. All rights reserved. * */ #include "sparql.h" //////////////////////////////////////////////////////////////////////////// // // Main program // ////////////////////////////////////////////////////////////////...
#ifndef GAMEFRAGMENT_H #define GAMEFRAGMENT_H #include "basefragment.h" #include "playtable.h" #include "card.h" #include "dealerlogo.h" #include "turnspark.h" #include "winlabel.h" #include "client_impl.h" #include "otherplayer.h" #include <QVector> #include <QWidget> #include <QPushButton> #include <QLabel> #inclu...
int Solution::removeDuplicates(vector<int> &vec) { unordered_set<int> s; for (int i : vec) s.insert(i); vec.assign( s.begin(), s.end() ); sort( vec.begin(), vec.end() ); return vec.size(); }
#include "ImageSaver.hh" void ImageSaver::Compute() { if (!in_texture->GetData().copyToImage().saveToFile(in_path->GetData())) { std::string error_msg = "Failed to save image file: " + in_path->GetData(); logger.LogE() << error_msg; throw error_msg; } } ImageSaver::ImageSaver(std::string _name) : Block(_name...