text
stringlengths
8
6.88M
#include<bits/stdc++.h> using namespace std; main() { double t, radius,i,length,leftside,rightside,wide,half; while(scanf("%lf",&t)==1) { for(i=1; i<=t; i++) { scanf("%lf",&radius); length=radius*5; leftside=(length*0.45); rightside=(length*0.5...
#pragma once #include "basis.hpp" #include "haar_basis.hpp" #include "hierarchical_basis.hpp" #include "orthonormal_basis.hpp" #include "three_point_basis.hpp" namespace Time { // Convenience object for constructing all the time trees. struct Bases { // The element tree. datastructures::Tree<Element1D> elem_tree;...
/* * HttpGiftWithIdItem.h * * Created on: 2017-8-28 * Author: Alex * Email: Kingsleyyau@gmail.com */ #ifndef HTTPGIFTITEM_H_ #define HTTPGIFTITEM_H_ #include <string> using namespace std; #include <json/json/json.h> class HttpGiftWithIdItem { public: void Parse(const Json::Value&...
#include <cmath> #include <iostream> #include "predefine.h" #include "matrix_elements.h" #include "lorentz.h" #include "simpleLogger.h" /// g+g --> g+g double M2_gg2gg(const double t, void * params){ // unpacking parameters double * p = static_cast<double*>(params); double s = p[0], Temp = p[1], M2 = 0.; // Deybe ...
// Created on: 2001-09-14 // Created by: Alexander GRIGORIEV // Copyright (c) 2001-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 ...
#include <iostream> #include <vector> #include <algorithm> using namespace std; long long n, k, a[200001], freq[200001]; vector<pair<int, int>> eleFreq; bool check(int x) { int count = 0; for (int i = 0; i <= eleFreq.size(); i++) count += eleFreq[i].first / x; if (count >= k) return true; ...
#include "brickstest.hpp" #include <bricks/collections/autoarray.h> #include <bricks/collections/listguard.h> using namespace Bricks; using namespace Bricks::Collections; TEST(BricksCollectionsListGuardTest, Test) { ArrayGuard<int> guarded; int i; for (i = 0; i < 4; i++) guarded.AddItem(i); i = 0; int ocount...
#ifndef USER_INTERFACE_H #define USER_INTERFACE_H #include <QMainWindow> #include <QWidget> #include <QLabel> #include <QTimer> #include <QSlider> #include <opencv2/core/core.hpp> #include <opencv2/opencv.hpp> #include "HSVWidget.h" class CvImageViewer; class CvVideoViewer; using namespace cv; class UserInterfa...
#include "GnMainPCH.h" #ifdef WIN32 GNMAIN_ENTRY void LinkError_GnMainFunc() { return; } #endif // WIN32
#pragma once #include <opencv2/opencv.hpp> #include <iostream> #include <math.h> #include<string> using namespace cv; using namespace std; //@breif generate code //@author shitaotao class QRCodeDrawer { private: string data; int currentX;//当前所需绘制矩形左上角的x坐标 int currentY;//当前所需绘制矩形左上角的y坐标 int code_pixel_col;//二维码纵向像素...
/* * License: * License does not expire. * Can be distributed in infinitely projects * Can be distributed and / or packaged as a code or binary product (sublicensed) * Commercial use allowed under the following conditions : * - Crediting the Author * Can modify source-code */ /* * File: Vertex...
#ifndef TRT_BUILDER_HPP #define TRT_BUILDER_HPP #include <string> #include <vector> #include <functional> #include <opencv2/opencv.hpp> namespace TRTBuilder { typedef std::function<void(int current, int count, cv::Mat& inputOutput)> Int8Process; void setDevice(int device_id); bool caffeToTRTFP32OrFP16( const...
#include "../render.hpp" namespace svg { void hypothetical(Graph const &, typename Graph::vertex_descriptor root, std::stringstream & ss); }
#ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include <QPainter> //painter #include <QKeyEvent> #include "draw.h" namespace Ui { class Dialog; } class Dialog : public QDialog { Q_OBJECT public: explicit Dialog(QWidget *parent = 0); ~Dialog(); //-------------------------------------- void...
//-------------------------------------------------------- // musket/include/musket/widget/scroll_bar.hpp // // Copyright (C) 2018 LNSEAB // // released under the MIT License. // https://opensource.org/licenses/MIT //-------------------------------------------------------- #ifndef MUSKET_WIDGET_SCROLL_BAR_HPP_ #define...
#ifndef _IMAGELIB_H_ #define _IMAGELIB_H_ #include <opencv2/core/utility.hpp> #include <opencv2/opencv.hpp> using namespace cv; struct ImgSet { Mat InitImg; Mat GrayImg; Mat FilterImg; }; Mat GetInitImg(String filename) { Mat InitImg; InitImg = imread(filename, 1); if (InitImg.empty()) { printf("Error...
#include <ESP8266WiFi.h> #include <WiFiUdp.h> const char *ssid = "__My_Disco__"; const char *password = "andy1996"; unsigned int localPort = 8888; // local port to listen on char packetBuffer[20]; //buffer to hold incoming packet, char ReplyBuffer[] = "ACK"; // a string to send back String da...
/** *AUTHOR:Harsh Agrawal* *Birla Institute of Technology,Mesra* **/ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; const int N=2e5+1; #define for0(i,e) for(ll i=0;i<e;i++) #define forx(i,x,e) for(ll i=x;i<e;i++) #define ln "\n" #define pb push_b...
#include<bits/stdc++.h> using namespace std; int f(int a){ for(int i=0;i<32;i++)if(!((a>>i)&1))return 1<<i;//返回最后1个0,的2的次方 } int main(){ int t,n; scanf("%d",&t); while(t--){ scanf("%d",&n); if(f(n)<n)printf("0\n"); else printf("1\n"); for(int i=2;i<n;i++)printf("%d ",f(...
#pragma once #include <string> // ShortForcast 对话框 class ShortForcast : public CDialog { DECLARE_DYNAMIC(ShortForcast) public: ShortForcast(CWnd* pParent = NULL); // 标准构造函数 virtual ~ShortForcast(); // 对话框数据 enum { IDD = IDD_DLG_ShortForcast }; protected: virtual void DoDataExchange(CDataExc...
#include "Components.h" #include <list> #include <functional> #include <glm/glm.hpp> class Texture; //! The Button class. /*! By adding this Button to your object you can then add callbacks to it to run when the button is clicked. Button is a child of Component so please use the Object class to add one to an Objec...
#ifndef __RESMANAGER_H #define __RESMANAGER_H #include "_pch.h" #define DEFINE_ICO(name,size) const wxIcon m_ico_##name##size #define LOAD_ICO(name,size,pos) m_ico_##name##size.CopyFromBitmap( wxImage( "..\\..\\RESOURCES\\"#name".ico",wxBITMAP_TYPE_ANY,##pos)) #define DEFINE_ICO_ALL(name) \ DEFINE_ICO(name,32); \...
#pragma once #include <cppunit/extensions/AutoRegisterSuite.h> namespace BeeeOn { typedef bool (*SkipTestFunc)(); template <typename Type> class SkippableAutoRegisterSuite { public: SkippableAutoRegisterSuite(SkipTestFunc skip) { if (!skip()) m_suite = new CppUnit::AutoRegisterSuite<Type>(); } ~SkippableA...
/**************************************** Cat Got Bored *****************************************/ #include <bits/stdc++.h> #define loop(i,s,e) for(int i = s;i<e;i++) //excluding end point #define pb(a) push_back(a) #define sqr(x) ((x)*(x)) #define CIN ios_base::sync_with_stdio(0); cin.tie(0); #define ll lon...
#include<iostream> #include<cstring> #include<vector> #include <fstream> using namespace std; int main() { /*利用循环输入文本*/ //这个代码模式适合EOF为结束的输入。具体细节,视系统而定 /*每次读取一个字符,直到遇到EOF的输入循环的基本设计如下:*/ ifstream fcin; fcin.open("test.txt",ios::in); string str; vector<char> str1; char ch; while(fcin.get(ch)) //cin会在...
/* ** EPITECH PROJECT, 2019 ** OOP_indie_studio_2018 ** File description: ** Map */ #include <fstream> #include <iostream> #include <exception> #include <string> #include <vector> #include <string.h> #include "Map.hpp" #include "Core.hpp" #include "Assets.hpp" #include "Exception.hpp" Map::Map() { } Map::~Map() { } ...
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// // Подсчёт символов в слове. // V 0.1 beta // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// #include<iostream> #include<string> using namespace std; int main() { cout << "Enter a word: "; stri...
class SmokeLauncherMag { weight = 2.0; }; class FlareLauncherMag { weight = 2.0; }; class 29Rnd_30mm_AGS30 { weight = 16; }; class 29Rnd_30mm_AGS30_heli { weight = 16; }; class 400Rnd_30mm_AGS17 { weight = 50; }; class 48Rnd_40mm_MK19 { weight = 25; }; class 2000Rnd_762x51_M134 { weight = 5...
/* * @lc app=leetcode id=26 lang=cpp * * [26] Remove Duplicates from Sorted Array * * https://leetcode.com/problems/remove-duplicates-from-sorted-array/description/ * * algorithms * Easy (41.30%) * Likes: 1634 * Dislikes: 3496 * Total Accepted: 638.6K * Total Submissions: 1.5M * Testcase Example: '[...
#ifndef USE_H #define USE_H #include <iostream> #include <string> class User { std::string status = "gold"; static int user_count; public: std::string fname; std::string lname; static int get_user_count(); std::string get_status(); void set_status(std::string status); Use...
#include <bits/stdc++.h> using namespace std; class Node { public: int key; int value; Node *next, *prev; Node(int key, int value) { this->key = key; this->value = value; this->prev = this->next = NULL; } }; class LRUCache { private: int size, capacity; unordered_map<int, Node*> lookup; N...
void calcSum();
#include <stdint.h> #include <avr/io.h> #include <util/twi.h> #include <util/delay.h> #include <avr/pgmspace.h> #include "ov7670.h" void setColor(void) { wrSensorRegs8_8(yuv422_ov7670); } void setRes(void) { wrReg(REG_COM3, 4); // REG_COM3 enable scaling wrSensorRegs8_8(qvga_ov7670); wrReg(0x11, 11); // PCLK ...
#include <iostream> #include <string> #include <vector> using namespace std; template <class T> void array_sort(T *a, int n) { int flag; for (int i = n - 1; i > 1; i--) { flag = 0; for (int j = 0; j < i; j++) { if (a[j] < a[j + 1]) { T temp =...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i++) #define show(x) for(auto i: x){cout << i << " ";} #define showm(m) for(auto i: m){cout << m.x << " ";} typedef long long ll; typedef pair<string,...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2012 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * @author Cezary Kulakowski (ckulakowski) */ #include "core/pch....
// Created on: 1996-08-30 // Created by: Yves FRICAUD // Copyright (c) 1996-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 L...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2007-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 _VIEWERS_ #define _VIEWERS_ /** * Design decisions and...
#pragma once #include "Rect.h" namespace cvfn { /* ref class Size2D; interface class IFrameProcessor; public interface class IVideoProcessor { public: Size2D^ getFrameSize(); IFrameProcessor^ getFrameProcessor(); void setFrameProcessor( IFrameProcessor^ fp ); System::String^ getDisplayOutput(); };...
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmLinkLibrariesCommand.h" #include "cmExecutionStatus.h" #include "cmMakefile.h" bool cmLinkLibrariesCommand(std::vector<std::string> const& args, ...
#include <iostream> #include <vector> #include <algorithm> int main() { int numberTolook = 0; std::cin >> numberTolook; unsigned long row = 0; std::cin >> row; unsigned long col = 0; std::cin >> col; int number = 0; std::vector<std::vector<int>> arr; //arr.resize(row, std::vector<i...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** $Id$ ** ** Copyright (C) 1995-2007 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" #...
#include<stdio.h> #include<conio.h> int main() { int count,c; for(count=1;count<=3;count++) { for(c=1;c<=count;c++) { printf("*"); } printf("\n"); } getch(); return 0; }
// // Created by Israel on 1/18/2019. // #include <jni.h> #include "Box2D/Box2D.h" extern "C" JNIEXPORT jlong JNICALL Java_KittyEngine_Engine_Physics_KFixture_getNext(JNIEnv *env, jobject /* this */, jlong fixturePtr) { b2Fixture* fixture = reinterpret_cast<b2Fixture*>(fixturePtr); return reinterpret_cast<j...
#include <iostream> #include <vector> #include <algorithm> #include <fstream> #include <queue> #include <unordered_set> #define INT_MIN (1<<31) #define INT_MAX (~INT_MIN) #define UNREACHABLE (INT_MAX>>2) using namespace std; ifstream fin("280_input.txt"); #define cin fin int main() { int n, m; cin >> n; while (n) ...
#include<stdio.h> int a,b,c,d; main() { scanf("%d %d %d",&a,&b,&c); d=a*b-c; printf("%d",d); }
#include "SmartPlayer.h" void SmartPlayer::Update() { if (!inGame) return; field->Update(); if (moveLeft > 0) { field->MoveLeft(); if (--moveLeft == 0) moveLeft = -1; } if (moveRight > 0) { field->MoveRight(); if (--moveRight == 0) moveRight = -1; } if (!field->IsMoving()) { for (int j = 0; j < f...
#ifndef CHATY_NONCOPYABLE_H #define CHATY_NONCOPYABLE_H namespace CHATY_NONCOPYABLE_H { class noncopyable { public: noncopyable() = default; ~noncopyable() = default; private: noncopyable(const noncopyable &) = delete; void operator=(const noncopyable &) ...
#include <iostream> #include <SDL/SDL_opengl.h> #include "draw.h" using namespace std; void drawRect(float x, float y, float w, float h){ glBegin(GL_TRIANGLES); glVertex2f(x - w, y - h); glVertex2f(x - w, y + h); glVertex2f(x + w, y + h); glVertex2f(x + w, y + h); glVertex2f(x + w, y - h); glVertex2f(x - w, y ...
#include "GetChatRoomCmd.h" GetChatRoomCmd::GetChatRoomCmd(int numRequest, const std::optional<std::string>& error, const std::string& body) : BaseCmd(numRequest, error, body) {} void GetChatRoomCmd::execute(std::shared_ptr<CallbacksHolder> holder) { std::shared_ptr<BaseObje...
#ifndef AFX_SCENE_H_ #define AFX_SCENE_H_ #include <stdio.h> #include <vector> #include <string> using namespace std; class Textures; class Model { class Vec3 { public: double ptr[3]; void set(double *v) { for (size_t i = 0; i<3; i++) ptr[i] = v[i]; } inline double& operator[](size_t index) { ...
/* * File: Enemey.cpp * Author: mohammedheader * * Created on November 24, 2014, 4:32 PM */ #include "HelloWorldScene.h" #include "Enemy.h" USING_NS_CC; Enemy* Enemy::create(HelloWorld* game) { Enemy *enemy = new (std::nothrow) Enemy(); if (enemy && enemy->init(game)) { enemy->autorelease...
#include <Poco/Exception.h> #include <Poco/NumberParser.h> #include <Poco/StringTokenizer.h> #include "util/TimespanParser.h" using namespace std; using namespace Poco; using namespace BeeeOn; bool TimespanParser::tryParseUnit(const string &input, Timespan::TimeDiff &multiplier) { if (input == "d") multiplier = T...
#ifndef UPDATE_RAY_HPP_ #define UPDATE_RAY_HPP_ #include <Eigen/Core> #include "affine_hull.hpp" namespace FC { enum class RAY_DIR {FROM_DRIVER, TO_DRIVER}; template <RAY_DIR ray_dir> struct compute_ray; /** @param lambda vector of at least ah.size() elements */ template <RAY_DIR ray_dir, typename PointCloud, t...
#include "List.h" #include <cstdlib> #include <iostream> #include <assert.h> #include "List.h" //to make sure header file got copied over using namespace std; #define NDEBUG //to enabled usage of assert List::List() { //default constructor setting all data members to null head = NULL; current = NULL; tem...
#ifndef __ZATOMIC_HPP__ #define __ZATOMIC_HPP__ #include <stdint.h> namespace atomic_impl { typedef enum memory_order { memory_order_relaxed, memory_order_consume, memory_order_acquire, memory_order_release, memory_order_acq_rel, memory_order_seq_cst } memory_order; #if defined( _MSC_VER ) namespace ...
#include <wire.h> void Wire::set(bool value) { if (signal != value) { signal = value; for_each(listers.begin(), listers.end(), [](WireListner *elm) { elm->stateChanged(); }); } }
//=====-- OR1KSubtarget.h - Define Subtarget for the OR1K -----*- C++ -*--==// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===---------------------------------------------------------...
#include <stdio.h> #include <octomap/octomap.h> #include <octomap/math/Utils.h> #include "testing.h" using namespace std; using namespace octomap; using namespace octomath; int main(int /*argc*/, char** /*argv*/) { OcTree tree (0.05); // point3d origin (10.01, 10.01, 10.02); point3d origin (0.01f, 0...
#ifndef VECTOR_H #define VECTOR_H #include <cassert> #include <cstring> template<typename T> struct vector { using value_type = T; vector(); vector(value_type); vector(const vector&); ~vector(); vector& operator=(const vector& other); value_type& operator[](size_t n) { return array[n]; }...
#include "Calculator.h" #include <exception> Calculator::Calculator() {} Calculator::~Calculator() {} double Calculator::plus(double left, double right) { return left + right; } double Calculator::minus(double left, double right) { return left - right; } double Calculator::divide(double left, double right...
/*** Table header in file system. ***/ /** Version 1. **/ /* FIXME: Ignore malloc() failure. */ /** Redundance check. **/ #ifndef TABLE_HEADER #define TABLE_HEADER /** Included files. **/ #include <stdint.h> /* Standard integers. E.g. uint16_t */ #include <stdlib.h> /* Standa...
/********************************************************************************************* cfglp : A CFG Language Processor -------------------------------- About: Implemented by Tanu Kanvar (tanu@cse.iitb.ac.in) and Uday ...
#include "physics.h" #include "vector.h" #include "sphere.h" namespace phys { Physics::Physics(){} void Physics::updateAcceleration(Sphere *sphere) { this->updateDragForce(sphere); sphere->setAcceleration(Vector{m_gravity+(sphere->getDragForce()/sphere->getMass())}); } void Physics::updateVelocity(Sphere *sp...
// // EnemyLayer.cpp // Aircraft // // Created by lc on 11/27/14. // // #include "EnemyLayer.h" EnemyLayer::EnemyLayer(void) { m_allEnemy1 = __Array::create(); m_allEnemy2 = __Array::create(); m_allEnemy3 = __Array::create(); m_allEnemy1->retain(); m_allEnemy2->retain(); m_allEnemy3->retain...
// Created on: 2014-01-09 // Created by: Denis BOGOLEPOV // Copyright (c) 2013-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 ...
//------------------------------------------------------------------------------ /* This file is part of rippled: https://github.com/ripple/rippled Copyright (c) 2012, 2013 Ripple Labs Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby ...
// Copyright (c) 2022 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 ...
// Created on: 2012-03-06 // Created by: Kirill GAVRILOV // Copyright (c) 2012-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 ...
/* * copyright: 2015 * name : Francis Banyikwa * email: mhogomchungu@gmail.com * * 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 retain the above copyright * notic...
// Ceres Solver - A fast non-linear least squares minimizer // Copyright 2015 Google Inc. All rights reserved. // http://ceres-solver.org/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistribution...
#include <iostream> #include <cstdlib> #include <sys/time.h> #include "Cluster_Redis.h" #include "cluster_client.h" #include "cluster_slots.h" #include "log.h" #include "crc16.h" using std::cout; using std::endl; int main(int argc, char** args) { (void)argc; (void)args; ClusterClient cr; cr.Init("12...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2009 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 _MIME_SUP...
#pragma once #include <SFML/Graphics.hpp> #include <math.h> #include <iostream> using namespace std; class worker { public: worker(sf::Vector2f start, sf::Vector2f position, sf::Vector2i range); ~worker(); void update(float t); void render(sf::RenderWindow& window); bool catchCheck(sf::Vector2f player); sf::F...
#include <bits/stdc++.h> using namespace std; vector<string> split_string(string); // Complete the roadsAndLibraries function below. long roadsAndLibraries(int n, int c_lib, int c_road, vector<vector<int>> cities) { if (c_lib <= c_road) { return c_lib * n; } long cost = 0; map<int, vector...
#include <algorithm> #include <cctype> #include <gsl/gsl> #include <regex> #include <benchmark/benchmark.h> #include "Files.h" #include <FuzzySearch.h> std::vector<std::string> StringSearch(const std::vector<std::string>& split_by_space, const std::vector<std::string>& files) { std::vector<std::string> results; re...
#include<bits/stdc++.h> using namespace std; main() { int n; while(cin>>n) { int i, a, b, p=0; for(i=1; i<=n; i++) { cin>>a>>b; if(a!=b)p=1; } if(p==1) printf("Happy Alex\n"); else printf("Poor Alex\n"); } return 0; ...
#include <iostream> using namespace std; int main(){ enum Sex{ MALE, FEMALE = -2, UNKNOWN, WHAT }; cout << MALE << FEMALE << UNKNOWN << WHAT << endl; int a = 2, b = 3; int arr[] = {1, a, 3}; cout << arr[1] << endl; printf("%p\n", &a); printf("%p\n", &b)...
int test1(int x) { return x+1; } int main() { int x = test1(1); return 0; }
#include <iostream> #include "Matrix.h" #include "ComplexNumber.h" #include "IntervalNumber.h" using namespace std; /* * TO DO: Причесать мейн */ int main(int argc, char * argv[]) { Matrix< ComplexNumber > CompMatrixA(3,3), CompMatrixB(3, 3), CompMatrixC; Matrix <IntervalNumber> IntervalMatrixA(3, 3), IntervalMatri...
#pragma once #include "ofMain.h" class Misc { public: Misc(); ~Misc(); static ofFbo::Settings getDefaultFboSettings(); static std::vector< ofPoint > getLineSplitPoints( ofPolyline linesToSplit, float length ); static void drawSplitLines( std::vector< ofPoint > points ); };
//#include <iostream> #include <stdio.h> //#include <vector> #include <map> //#include <queue> //#include <set> //#include <math.h> #include <algorithm> //#include <sstream> //#include <cmath> //#include <iterator> using namespace std; char grid[100][100]; //int number of 1`s //(i,j) start point of region int out_img...
#include "../include/router_input.hh" #include "../include/util.hh" #include <sstream> #include <iostream> #include <netinet/ip.h> #include <netinet/ether.h> router_input::router_input( std::shared_ptr<tracker> trk, std::shared_ptr<output> out, std::string input_interface, int cluster_id ) : trk(trk)...
/* -*- 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. */ #include "core/pch.h" #include "adjunct/quick_toolkit/widgets/Op...
#include "rdtsc_benchmark.h" #include "ut.hpp" #include <random> #include <algorithm> #include <math.h> #include <functional> #include <vector> #include "linalg.h" using namespace boost::ut; // provides `expect`, `""_test`, etc using namespace boost::ut::bdd; // provides `given`, `when`, `then` // // DataLoader f...
ZombieStalkerScientist[] = { {Loot_MAGAZINE, 5, FoodMRE}, {Loot_MAGAZINE, 1, ItemHotwireKit}, {Loot_GROUP, 3, MedicalLow}, {Loot_GROUP, 10, AmmoMilitaryZed}, {Loot_GROUP, 2, Consumable} }; ZombieStalkerScientistViral[] = { {Loot_GROUP, 10, ZombieStalkerScientist}, {Loot_MAGAZINE, 1, ItemAntibiotic...
// // Reliability.h // superasteroids // // Created by Cristian Marastoni on 12/06/14. // // #pragma once #include "Internal.h" class Connection; class Channel; class Reliability { public: Reliability(); ~Reliability(); void Reset(); void RegisterChannel(Channel *channel); void AddSentPacket(N...
#include "point.h" #include <iostream> using namespace std; Point::Point(int x, int y) :xpos(x), ypos(y) { } ostream& operator<< (ostream& ostm, const Point& ref) { ostm << '[' << ref.xpos << ", " << ref.ypos << ']' << endl; return ostm; } void Point::showPosition() const { cout << '[' << xpos << ", " << ypos << '...
#pragma once #include "Item.h" #include "Color.h" class Inventory : public Color { protected: vector<tagItemInfo> m_vItem; vector<tagItemInfo>::iterator m_viItem; tagItemInfo m_equipArmor; tagItemInfo m_equipWeapon; public: Inventory(); ~Inventory(); // 인벤토리 보여주기 int ShowInventory(int selectNum); // 아이템 추...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "1614" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) #define MAXN 100000 pair<int,int> table[MAXN+5]; int ANS[MAXN+5]; int main(int argc, char const *argv[]) { #ifdef DBG freopen("uva" PROBLEM TESTC ".in", "r", stdin); ...
// 0921_5.cpp : 定义控制台应用程序的入口点。 //蟠桃记 //第一天悟空吃掉桃子总数一半多一个,第二天又将剩下的桃子吃掉一半多一个,以后每天吃掉前一天剩下的一半多一个, //到第n天准备吃的时候只剩下一个桃子。聪明的你,请帮悟空算一下,他第一天开始吃的时候桃子一共有多少个呢? #include <iostream> using namespace std; int main() { int n; while (cin >> n) { if (n <= 1 || n >= 30) break; int sum = 1; int i; for (i = 1; i <n; i++) {...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i++) #define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;} #define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;} typedef long l...
#include "qItemA.hpp" #include "qItemB.hpp" #include "qItemC.hpp" #include "qItemD.hpp" int main(int, char**) { QItemA itemA; QItemB itemB; QItemC itemC; QItemD itemD; // Fails to link if the symbol is not present. return 0; }
#include <cstdio> #include <cstring> #include <algorithm> #include <vector> #include <queue> #define rep(i,n) for(int i=0; i<n; i++) #define clr(a) memset(a, 0, sizeof(a)) using namespace std; const int maxn = 100000, inf=~0U>>3; vector <int> E[maxn]; int n ; struct record { int a[2][2], b[2][2]; // a[i][j] ...
#include "Match.h" std::tuple<Eigen::Array2Xd, Eigen::Array2Xd> Cvl::Match::alignMatches( Eigen::Array2Xd const & allSrcPoints, Eigen::Array2Xd const & allDstPoints, std::vector<Match> const & matches) { Eigen::Matrix2Xd src(2, matches.size()); Eigen::Matrix2Xd dst(2, matches.size()); int i = 0; for (auto con...
// internal #include "tiny_ecs.hpp" // All we need to store besides the containers is the id of every entity and callbacks to be able to remove entities across containers unsigned int Entity::id_count = 1;
/* * Copyright (c) 2015-2020 Morwenn * SPDX-License-Identifier: MIT */ #ifndef CPPSORT_SORTERS_SPREAD_SORTER_FLOAT_SPREAD_SORTER_H_ #define CPPSORT_SORTERS_SPREAD_SORTER_FLOAT_SPREAD_SORTER_H_ //////////////////////////////////////////////////////////// // Headers ///////////////////////////////////////////////////...
#include "opencv2/objdetect/objdetect.hpp" #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <iostream> using namespace cv; using namespace std; CascadeClassifier face_cascade; std::vector<Rect> faces; int main() { VideoCapture stream1(1); VideoCapture stream2(2); //0 is the id...
#ifndef SNPSTREAMREADER_H #define SNPSTREAMREADER_H // RsaToolbox #include "Definitions.h" // Qt #include <QString> #include <QStringList> #include <QFile> #include <QTextStream> namespace RsaToolbox { class SnpStreamReader { public: // SnpStreamReader(); SnpStreamReader(QString filePathName); void se...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<algorithm> #include<cmath> using namespace std; int f[80][80][80]; int main() { int n; while (scanf("%d",&n) != EOF) { memset(f,0,sizeof(f))...