text
stringlengths
8
6.88M
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; /** * Auto-generated code below aims at helping you parse * the standard input according to the problem statement. **/ int main() { int L; cin >> L; cin.ignore(); int H; cin >> H; cin.ignore(); str...
/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. 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 t...
#include <lld/Driver/Driver.h> int main() { std::vector<const char *> Args = { "ld", "test.o", "-o", "test" }; lld::elf::link(Args, false); return 0; }
// GetURLDialog.cpp : Defines a dialog that allows a user to enter an URL. // This is not really needed to host the PIEWebBrowser control. However, it's // implemented here in order to allow the user to navigate on Smartphone, // where the AddressBar property is not implemented. #include "stdafx.h" #include "GetURLD...
#include<iostream> using namespace std; void optimizedbubbleSort(int arr[], int n) { int count=0; for(int i=0;i<n-1;i++){ count++; int flag=false; for(int j=0;j<n-1-i;j++){ if(arr[j]>arr[j+1]){ flag=true; int temp=arr[j]; ...
#include<iostream> #include<fstream> #include<vector> #include<string> #include<cstdlib> using namespace std; char score2grade(int score){ if(score >= 80) return 'A'; if(score >= 70) return 'B'; if(score >= 60) return 'C'; if(score >= 50) return 'D'; else return 'F'; } string toUpperStr(string x)...
#include <bits/stdc++.h> using namespace std; double memo[10000000]={0}; int main(){ int c; cin>>c; while(c--){ int n; cin>>n; memo[0]=1; for(int i=1;i<=n;i++){ if(memo[i]==0){ memo[i]=memo[i-1]+log10(i); } } int r...
// Works on command produced by cflow -rlrd2 <c++ file> // Add support for same name different return val, params functions by changing fn_name #include "parser.h" map<string, list<pair<string, int> > > callee_graph; string fn_name = ""; list<pair<string, int> > callees; void add_callee_function(string line) { if (...
/** math.hpp **/ #ifndef MATH_HPP #define MATH_HPP float linear_function(const float x1, const float x2, const float y1, const float y2, const float x); float randomf(const float bottom, const float top); float clampf(const float value, const float bottom, const float top); #endif
#include <bits/stdc++.h> using namespace std; #define ll long long #define ar array int main() { ios::sync_with_stdio(0); cin.tie(0); int t; cin>>t; while(t--) { int n; cin>>n; int a[n], mini = INT_MAX ; int ans; for(int i=0 ; i<n; i++) { ...
#include <iostream> #include <Windows.h> using namespace std; typedef int Info; struct Elem { Elem* link; Info info; }; void push(Elem*& top, Info value); Info pop(Elem*& top); Info pop1(Elem*& top); int Input(Elem*& top,int i) { push(top, i); if (i < 20) Input(top, i + 1); else return 0; } v...
// ***************************************************************** // This file is part of the CYBERMED Libraries // // Copyright (C) 2012 LabTEVE (http://www.de.ufpb.br/~labteve), // Federal University of Paraiba and University of São Paulo. // All rights reserved. // // This program is free software; you can redist...
#include "graph.h" #include <iostream> #define MANUAL_DRIVER 0 int main() { if (MANUAL_DRIVER) { // this is for manual testing Graph graph; for (int i = 0; i < 4; ++i) { graph.add_vertex(); } graph.add_edge(1, 2); graph.add_edge(2, 3); graph.add_edge(3, 4); graph.add_edge(4, 1); ...
#include <iostream> #include <string> #include <SDL.h> int main(int argc, char* argv[]) { if (SDL_Init(SDL_INIT_EVERYTHING) != 0) { std::cerr << "SDL_Init error: " << SDL_GetError() << std::endl; return 1; } SDL_Window *window = SDL_CreateWindow("Very Simple SDL", 100, 100, 640, 480, SDL_WINDOW_SHOWN);...
#pragma once #include "Tree.h" class Path : public Tree { public: Path(string path); virtual void View(); };
// // main.cpp // Chord // // Created by Asjad Athick on 26/4/17. // Student: 4970512 // Compilation: g++ -o CHORD main.cpp Peer.cpp Chord.cpp // Copyright © 2017 asjad.io. All rights reserved. // #include "Chord.hpp" using namespace std; int main(int argc, const char * argv[]) { try { if (argc < 2) { th...
#include <tclap/CmdLine.h> #include <memory> #include <map> #include "File.h" using namespace TCLAP; using namespace std; class ActionParamers { public: string rootDir; float silConf; string featureSCP; string tsvfile; string doneFile; string prefixInSCP; bool createDummyChunks; ...
#include <ADC.h> #include <Arduino.h> #define SAMPLE_NO 50000 const int readPin_1 = A0; int j; bool flag; int buffer_1[SAMPLE_NO]; ADC *adc = new ADC(); void setup() { //Read pin is A3 (pin 17) on Teensy 3.6 //Oscilloscope signal generator attached to A3 and Analog GND pinMode(readPin_1, INPUT); Serial.beg...
#include <string> #include <fstream> #include <streambuf> #include <vector> #include <algorithm> #include <map> #include <iostream> #include <chrono> #include <iomanip> #include <random> #include <thread> #include <sys/syscall.h> #include <stdint.h> #include <stdio.h> #include <time.h> #include <sys/time.h> #include...
#include "spis.h" visualOutput::visualOutput(int startX, int startY, string label, int w, int h) { width = w; height = h; win = newwin(height + 3, width + 2, startY, startX); mvwprintw(win, 0, abs(float(width / 2 - label.length())), "%s", label.c_str()); wrefresh(win); visualWin = winBorder(height, width, startY...
#include "ComboRepository.h" #include "Combo.h" ComboRepository::ComboRepository() {} void ComboRepository::clean_vectors() { combo_vector.clear(); price_vector.clear(); } void ComboRepository::read_combolist() /// This function is used to read from DrinkList.txt into the combo_vector /// { ...
#include<iostream> using namespace std; typedef int ValueType; const int MAX_MARTIX_WIDTH=2; const int MAX_MARTIX_HEIGHT=2; const int ValueTypeConst=0; class Martix { private: int m,n; ValueType s[MAX_MARTIX_WIDTH][MAX_MARTIX_HEIGHT]; public: Martix(int m,int n) { this->m=m; this->n=n; for(int i=0;i<m;i++) ...
#ifndef TRAZADOR_HUMO_H #define TRAZADOR_HUMO_H #include <generador_numeros.h> #include "../../definiciones/definiciones.h" #include "../actor_movil.h" #include "../../recursos.h" #include "../../interfaces/objeto_juego_i.h" #include "../../interfaces/con_turno_i.h" #include "../../interfaces/generador_objetos_juego_...
#include <RFM69.h> //Library by Felix Rusu - felix@lowpowerlab.com //#include <WirelessHEX69.h> //Library by Felix Rusu - felix@lowpowerlab.com #include <SPI.h> #include <SPIFlash.h> //Library by Felix Rusu - felix@lowpowerlab.com #include <OneWire.h> #include <LowPower.h> //https://github.com...
#pragma once #include "drake/common/drake_copyable.h" #include "drake/systems/framework/context.h" #include "drake/systems/framework/leaf_system.h" #include "drake/systems/framework/output_port.h" namespace drake { namespace systems { /// An adder for arbitrarily many inputs of equal size. /// @ingroup primitive_sys...
#pragma once namespace mplc { struct nil {}; }
#pragma once #include <vector> #include <fstream> #include <iostream> //#include "COREFramework/CORETask.h" #include "COREUtilities/CORETimer.h" using namespace std; using namespace CORE; namespace CORE { class ICOREDataPoint{ public: virtual std::string GetValue(){return "?";}; virtual ~ICOREDataPoint(){}; ...
#include <iostream> #include <vector> #include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> using namespace std; using namespace cv; int main(int argc, char** argv) { // 载入原图 Mat image = imread("cat.jpg"); // 创建窗口 namedWindow("中值滤波[原图]");...
#include "CACLFloat.hpp" //重载乘法 CACLFloat CACLFloat::operator*(CACLFloat number) { CACLFloat ans; ans.initialize(); if (this->isZero() || number.isZero()) { return ans; } else { ans.integer = this->integer * number.integer; // 利用无符号小数乘法 unsignedMultiplication(&ans, *th...
#ifndef json_def #define json_def #include <regex> #include <sstream> using namespace std; class JSON { public: /** * This is used to define whether or not the json output should be pretty. */ bool nice; /** * \brief The indent string. * * This is inserted to structure the json. */ string indent; JSON...
#include <iostream> using namespace std; class Array { private: int* a; int* b; int* c; int n,mi,ma; public: Array(int* ap,int nu){ a = ap; n = nu; cout<<"n = "<<n<<endl; }; void copy_a(){ int i; int* temp1 = new int[n]; for (i = 0; i < n; i++) { temp1[n-i-1] = *(a+i); ...
//PK가능한 레벨 #define LIMIT_PK_LEVEL 20 // pluto PK허용 필드 전부 #define AUTOPLAYER_MAX 2048 #define AUTOPLAYER_MASK 2047 //유료 아이템 기본 사용시간 설정 #define PRIME_ITEM_TIME_THIRDEYES (60*60*24) #define PRIME_ITEM_TIME_EXPUP (60*60*24) #define PRIME_ITEM_TIME_THIRDEYESx7 (60*60*24*7) #define PRIME_ITEM_TIME_EXPUPx7 (60...
// // Created by yulichao on 2020/7/20. // #include <cstdio> #include <memory.h> #include <iostream> #include <ctime> #include <string> #include <chrono> using namespace std; /* * desc : 获得当前时间的时间戳 * return : 返回当前时间的时间戳,单位秒 */ time_t getTimeStamp() { std::chrono::time_point<std::chrono::system_clock,s...
// Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 #include <RcppArmadillo.h> #include <Rcpp.h> using namespace Rcpp; // cb NumericVector cb(NumericVector m1, NumericVector m2, NumericVector m3, IntegerVector d, IntegerVector e); RcppExport...
// 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.Gaming.Input.Custom.3.h" #include "internal/Windows.Gaming.Input.Preview.3.h" #include "Windows.Gaming.Input.h" WINRT_EXPORT na...
/**************************************** * * INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE * Copyright (C) 2019 Victor Tran * * 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 Foundati...
/*----------------------------------------------------------------------- Matt Marchant 2015 - 2016 http://trederia.blogspot.com Robomower - Zlib license. This software is provided 'as-is', without any express or implied warranty.In no event will the authors be held liable for any damages arising from the use of thi...
#include "main.h" int main(int argc, char *argv[]) { if (auto error = initialize()) { return -1; } auto create_name = "main"; SDL_Window *window; vkb::Instance instance; VkSurfaceKHR surface; if (auto error = create_window_instance_surface(create_name, window, ...
#ifndef ABSTRACT_INTERFACE_NODE_COLLECTION_TEMPLATES_C #define ABSTRACT_INTERFACE_NODE_COLLECTION_TEMPLATES_C // #include "rose.h" #include "rewrite.h" // ************************************************************ // ************************************************************ template <class T> void AbstractInte...
void generate(string s,vector<string> &res,string temp="",int start=-1) { if(start==s.size()) { return ; } if(temp.size()!=0) res.push_back(temp); for(int i=start+1;i<s.size();i++) { temp+=s[i]; generate...
#include "DHT_U.h" #include <Wire.h> #include "Adafruit_Sensor.h" #include "Adafruit_TSL2561_U.h" #define SDA D2 #define SCL D1 #define DHT_PORT D3 #define SOIL_PORT A0 int Humidnity, Tempurature, Soil, Light; DHT dht(DHT_PORT, DHT22); Adafruit_TSL2561_Unified tsl = Adafruit_TSL2561_Unified(TSL2561_ADDR_FLOAT, 12345)...
#include<iostream> #include<queue> #include<stdio.h> using namespace std; priority_queue<int> left_pq; // max_pq priority_queue<int, vector<int>, greater<int>> right_pq; // min_pq int main() { freopen("input.txt", "r", stdin); int n, mid, a, b; cin >> n >> mid; cout << mid << endl; for (int i = 1; i <= n / 2; i+...
/**************************************************** * RoseBin :: Binary Analysis for ROSE * Author : tps * Date : 3Apr07 * Decription : Interface to user ****************************************************/ #ifndef __RoseFile__ #define __RoseFile__ #include "RoseBin_abstract.h" #include <stdio.h> #include <io...
#include "kitchen.h" using namespace std; Kitchen::Kitchen(std::string name): Room(name) { _name = name; } void Kitchen::addComponent(std::string componentName) { for(std::vector<Component*>::iterator it = _components.begin(); it != _components.end(); ++it) { Component *c = *it; if(c->get...
// - PfR2000LaserScanner.cpp - // // The interface of class "cSick581LaserScanner". // // Author: sfe1012 // Date: 2018. 01. 18 // #include"sensor/Sick581LaserScanner.h" #include "lcm/lcm.h" #include "lcm/lcm_coretypes.h" void* LCMRecvTask(LPVOID pParam) { cSick581LaserScanner* oL...
#ifndef PROTECTION_H #define PROTECTION_H #include <objects/equipment.h> namespace lab3 { namespace objects { class Protection : public Equipment { public: Protection(const std::string &name, int defense_points, int price, int volume, int weight); ~Protection(); ...
#define buzzer 5 void setup() { // initialize serial: Serial.begin(9600); } void loop() { // if there's any serial available, read it: while (Serial.available() > 0) { // look for the next valid integer in the incoming serial stream: int i = Serial.parseInt(); // look for the newline. That'...
/*************************************************************************** fuzzyvar.h - description ------------------- begin : dom abr 13 2003 copyright : (C) 2003 by Oscar Germán Duarte Velasco email :...
#ifndef CLIENTTHREAD_H #define CLIENTTHREAD_H #include <QThread> #include <QSslSocket> #include <QString> #include "../src/message.h" class ClientThread : public QThread { Q_OBJECT public: explicit ClientThread(QObject *parent = 0, QSslSocket* socket = 0); ~ClientThread(); QString waitForName(); ...
#include "DrawingHitbox.h" #include "LogicEvent.h" #include "Logic.h" DrawingHitbox::DrawingHitbox(void) { } DrawingHitbox::DrawingHitbox( float x, float y,float width, float height ) { position.x = x; position.y = y; size.x = width; size.y = height; } DrawingHitbox::~DrawingHitbox(void) { } void DrawingHit...
#include <stdio.h> #include "typedValue.h" #include "paraphrase.h" #include "externals.h" #include "word.h" #include "stack.h" #include "context.h" #include "errorID.h" typedef std::unordered_map<NoParamErrorID, std::unordered_map<PP_Lang,std::string> > NoParamErrorMessageDict; typedef std::unordered_map<InvalidT...
#include <iostream> using namespace std; void main() { char ch; cout << "소문자 입력: "; cin >> ch; ch = ch + 'A'- 'a'; cout << "대문자 출력: " << ch << endl; }
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> using namespace std; int main() { cout <<"open the door\n"; cout <<"go out\n"; cout <<"close door\n"; cout <<"proseed on the stop bus\n"; cout <<"go into bus\n"; cout <<"seat on the chair\n"; cou...
#include "cell.h" /*//////////////////////////////////////////////////// CellArrayクラス 実装部 領域分割法を実装したクラス.Cell構造体を用いる. ////////////////////////////////////////////////////*/ CellArray::CellArray(){ ptclArray = 0; cell = 0; ptclNum = 0; t_ptclNum = 0; cellNum = 0; widthNum = depthNum = heightNum = 0...
#include "presentertest.h" #include <QtTest/QTest> #include <QUndoStack> #include <QUndoCommand> #include <QFile> #include "../encoderbackup.h" PresenterTest::PresenterTest(QObject *parent) : QObject (parent) { view.setUpTables(&model.getRoutesViewModel(), &model.getPointsViewModel()); presenter.setModel(&mod...
#include <bits/stdc++.h> using namespace std; typedef long long ll; bool cmp1(pair<ll,ll> a,pair<ll,ll> b) { if(a.first==b.first) return a.second>b.second; return a.first>b.first; } bool cmp2(pair<ll,ll> a,pair<ll,ll> b) { if(a.second==b.second) return a.first...
//=========================== // GENERAL //=========================== #include<vector> #include<cmath> #include<fstream> #include<cstdlib> #include<iostream> #include<string> #include<sstream> #include<cstring> #include<iomanip> #include<algorithm> #include<stdio.h> #include<stdlib.h> #include<math.h> #include<time.h...
#include <iostream> using namespace std; void main() { int a; cout << "정수 입력(0~25): "; cin >> a; cout << a << "번째 영어 대문자는 " << (char)('A' +a) << endl; }
#include <iostream> using namespace std; typedef struct Node{ int data; Node *next; } Node; class LinkedList{ private: Node *head; int nCount; public: LinkedList(); void Create(); void Traverse(); void Clear(); int Size(); void InsertTa...
#ifndef CHANNEL_H #define CHANNEL_H #include <string> #include <vector> #include "client.h" #include "chatmessage.h" struct Channel { std::string name; bool text_chat; bool voice_chat; std::vector<ChatMessage> text_messages; std::vector<Client> voice_clients; }; #endif // CHANNEL_H
/* * Author: Katharina Tinbergen * * header of program, including class and none-class/support methods * * 16.11.2020 v1 */ #include <string> using std::string; #include <vector> #include <list> #ifndef LIWANZE_H #define LIWANZE_H class Liwanze { public: //Task 1 enum Region {ndef = 0, amer = 1, apac = 2, emea ...
/* * File: ToyScan2.h * Author: donerkebab * * Implements a toy Markov chain Monte Carlo scan in a 2-dimensional parameter * space, using the Mcmc package. The scan seeks out a circle around a point in * the parameter space. * * This class serves as both a sort of test of the Mcmc package, and as a simple ...
//#include <cpuid.h> #include <fcntl.h> #include <sched.h> #include <string.h> #include <sys/time.h> #include <sys/types.h> #include <time.h> #include <unistd.h> #include <x86intrin.h> #include <array> #include <cmath> #include <cstdint> #include <experimental/filesystem> // link with -lstdc++fs #include <fstream> #in...
// github.com/andy489 // Second Solution #include <iostream> #include <vector> using namespace std; int q, R, C, r, c, i, j,a,b; vector<vector<char>> G, g; void inputGrid(int r, int c, vector<vector<char>>& grid){ for (i = 0;i < r;++i){ for (j = 0;j < c;++j){ cin >> grid[i][j]; } ...
// Copyright (c) 2015 University of Szeged. // Copyright (c) 2015 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 SPROCKET_BROWSER_UI_JAVASCRIPT_DIALOG_H_ #define SPROCKET_BROWSER_UI_JAVASCRIPT_DIALOG_H_ #if ...
#include <iostream.h> #include <conio.h> main () { int taban=0, tavan, tahmin, sonuc, deneme_sayisi=0; unsigned int rastgele; cout<<"0 ile kac arasinda sayi tutmami istersiniz:"; cin>>tavan; randomize(); rastgele=random(tavan); cout<<"Rastgele olusturulan sayi:"<<rastgele<<endl; do { cout<<"Benim tahminim "...
#ifndef DISPLAY_H #define DISPLAY_H #include <iostream> #include <QDialog> #include "perro.h" using namespace std; namespace Ui { class Display; } class Display : public QDialog { Q_OBJECT public: explicit Display(Perro *perro, QWidget *parent = 0); ~Display(); void setModel(Perro *perro); ...
// // Created by glumes on 2021/3/8. // #ifndef VULKANCAMERA_HAZEFILTER_H #define VULKANCAMERA_HAZEFILTER_H #include <VulkanFilter.h> static const char * HazeShader = "#version 400\n" "#extension GL_ARB_separate_shader_objects : enable\n" "#extension ...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.Security.Authentication.Web.Core.0.h" #include "Windows.Foundation.0.h" #include "Windows.Security.Credentials.0.h" #include "Windows.System.0.h" #include...
#ifndef FIGURE_H #define FIGURE_H #include <iostream> #include <QMainWindow> #include <QColor> #include <QPainter> #include <QPixmap> #include <QPen> using namespace std; class figure{ protected: int x; int y; public: virtual void draw(QPainter * painter)=0; virtual ~figure(); }; ...
#pragma once #include "geometry.h" class Quad : public Geometry { public: Quad(); virtual ~Quad(); bool create(LPDIRECT3DDEVICE9 pDevice); };
/* MCP7941x.h - Arduino Library for using the MCP7941x IC. Ian Chilton <ian@ichilton.co.uk> November 2011 */ #ifndef MCP7941x_h #define MCP7941x_h #define MCP7941x_EEPROM_I2C_ADDR 0x57 #define MAC_LOCATION 0xF2 // Starts at 0xF0 but we are only interested in 6 bytes. #define MCP7941x_RTC_I2C_ADDR 0x6F...
/* * Copyright (c) 2009-2012 André Tupinambá (andrelrt@gmail.com) * * 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...
#include <queue> #include <cstdio> using namespace std; int main(){ queue<int> que; que.push(1); que.push(2); que.push(3); printf("%d\n", que.front()); que.pop(); printf("%d\n", que.front()); que.pop(); printf("%d\n", que.front()); que.pop(); return 0; }
/*+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+, * FILE : Shape.h * PROJECT : OOP - Assignment 7 * PROGRAMMER : Filipe Brito * FIRST VERSION: 2020-07-17 *+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*/ // Purpose: The purpose of this class is to be a container for other generic and specific typ...
#pragma once #include "Collector.h" #include "LinearSetup.h" #include "ZonalCollector.h" #include "allocator.h" ////////////////////////////////////////////////////////////////////////// namespace location { class LinearCollector : public ZonalCollector , public fastmem::allocator { public: LinearColl...
//MouseMovingToBottom.cpp #include "MouseScrollingToBottom.h" #include "Form.h" #include "MemoForm.h" MouseScrollingToBottom::MouseScrollingToBottom(Form *form) :MouseAction(static_cast<MemoForm*>(form)){ } MouseScrollingToBottom::MouseScrollingToBottom(const MouseScrollingToBottom& source) :MouseAction(source){ ...
/* Find maximum meetings in one room. Find the maximum number of meetings that can be accommodated in the meeting room. Greedy Sort all meetings in increasing order of second number(Finish time) of each pair. Selected not-overlapped intervals */ // ref: Q1353. Maximum Number of Events That Can Be Attended int maxMeet...
class Solution { public: bool isValid(string s) { stack<char> pars; map<char, char> mates; mates[')'] = '('; mates['}'] = '{'; mates[']'] = '['; for (int i=0; i <s.length(); i++) { if (s[i] == '(' || s[i] == '{' || s[i] == '[') ...
#include "days.hpp" #include "input_utils.hpp" #include <range/v3/all.hpp> struct slope { unsigned int col; unsigned int row; }; auto num_trees_in_slope(const slope slope, const std::vector<std::string> &lines) -> unsigned int { unsigned int trees = 0; unsigned int col = 0; for (unsigned int row = 0; ro...
#include "MainUI.h" MainUI::MainUI() { //ctor } void MainUI::startui(){ char input; while(true){ cout << "1. Add salary record." << endl; cout << "2. Get all salary records for given kennitala." << endl; cout << "3. Get total salary for given year and kennitala." << endl; cout << "4. Get ...
#include "ARCH.h" #include "CToPAConstructor.h" #include "PTDef.h" struct TblItem { int idx; unsigned long long address; }; int CToPAConstructor::GetSizeEncodeValue(unsigned int size) { if (size & 0xfff) { // not 4k aliged size = GetSizeAligned(size); } size >>= 12; // divided 4k // search for 1 pos int pos...
#include <bits/stdc++.h> #include "../crio/cpp/io/FastIO.hpp" #include "../crio/cpp/io/ReadMatrix.hpp" #include "../crio/cpp/io/PrintMatrix.hpp" using namespace std; class MergeIntervals { public: // Implement your solution by completing the below function vector<vector<int>> merge(vector<vector<int>>& intervals) { ...
#include "Tracer.h" #include <iostream> #include <algorithm> Tracer::Tracer(int width, int height, float aspectratio, vec3 background) { ScreenWidth = width; ScreenHeight = height; AspectRatio = aspectratio; ReflectDepth = 5; Background = background; //CameraPosition = vec3(0.f, 0.f, -10.f); } Tracer::~Tracer()...
#include "std_lib_facilities.h" #include "Image.h" #include "ImageFilter.h" #include "ConvolutionImageFilter.h" #include <cmath> ConvolutionImageFilter::T ConvolutionImageFilter::getRadius() const { //gets the radius of the kernel return radius; } void ConvolutionImageFilter::setRadius(T r) { //set...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ZombieHorde.cpp :+: :+: :+: ...
#ifndef _LEVENSHTEINDISTANCE_ #define _LEVENSHTEINDISTANCE_ #include <string> using namespace std; size_t uiLevenshteinDistance(const string &s1, const string &s2); #endif
/************************************************************* * > File Name : P3796.cpp * > Author : Tony * > Created Time : 2019/05/26 17:55:25 * > Algorithm : [字符串]AC **************************************************************/ #include <bits/stdc++.h> using namespace std; co...
#define ma1 3 //กำหนด Pin motorA เดินหน้า #define ma2 4 //กำหนด Pin motorA ถอยหลัง #define mb1 5 //กำหนด Pin motorB เดินหน้า #define mb2 6 //กำหนด Pin motorB ถอยหลัง #define sensorL 10 //sensor ซ้าย #define sensorR 11 //sensor ขวา #define sensorB 12 //sensor หลัง #define sensorC A0 //sensor สี #define RED 1...
#ifndef BUFFACTION_H #define BUFFACTION_H #include "signaltype.h" #include <string> class BattleController; class BuffAction { public: bool isValidate() const; protected: struct Params { BattleController* battleController = nullptr; uint8 owner = INVALID_ID_8; uint8 carrier = IN...
#include <bits/stdc++.h> using namespace std; typedef long int ll; int main() { ll n, m, mx = 0; cin>>n>>m; vector<pair<pair<ll, ll>, ll> > a; ll t = n; while(t--) a.push_back(0); while(m--) { ll a1, b, k; cin>>a1>>b>>k; a.push_back(make_pair(make_pair(a1, b), k)); } cout<<mx<<endl; }
#include "../../../resources/unordered_access_view.h" #include <d3d11.h> #include <malloc.h> #include <stdio.h> extern DXGI_FORMAT kResourceFormat[]; bool lu::resources::CreateUnorderedAccessViewWithBuffer(const RendererDevice& device, const Buffer& buffer, bool structured, UnorderedAccessView& uav) { ID3D11Device* ...
// Copyright (C) 2017 Elviss Strazdins // This file is part of the Ouzel engine. #pragma once class RTSample: public ouzel::scene::Scene { public: RTSample(); private: bool handleGamepad(ouzel::Event::Type type, const ouzel::GamepadEvent& event); bool handleUI(ouzel::Event::Type type, const ouzel::UIEven...
#include "RandomTriangles.hh" #include <SFML/Window.hpp> void RandomTriangles::Compute() { int iterations = in_iterations->GetData(); sf::Vector2u size = in_size->GetData(); int x = size.x; int y = size.y; std::list<Triangle> triangle_list; // Not completely random - the triangles are made by splitting, // st...
/* * This is an interpreter for MindMeld, a BrainFuck derivative that uses two data pointers * Syntax: * Pointer movement: * >A Move data pointer A forward * >B Move data pointer B forward * <A Move data pointer A backward * <A Move data pointer B backward * Data modification...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
#include <iostream> #include <stdlib.h> #include "Operator.h" #include "CuboidalTank.h" #include "CylindricalTank.h" #include "HexagonalPrismTank.h" using namespace std; /* * Responsible for performing tank related operations * * * @param tank: Cuboidal, Cylindrical, or Hexagonal Prism tank */ template<typename TankT...
#include "PurgeMessageTestCore.hpp" void PurgeMessageFixture::SetUp() { _expectedPurgeMessage = std::make_unique<std::string>("[08:41][mnurzyns][test message]"); _message = std::make_unique<Message>("[0][2019-03-21 08:41:30][mnurzyns][test message]"); ASSERT_EQ(_message->messageToSave(), "[0][2019-03-21 08...
#include <irtkImage.h> char *input_name = NULL, *output_name = NULL; void usage() { cerr << "Usage: region_real [in] [out] <-Rx1 x1> <-Ry1 y1> <-Rz1 z1> <-Rt1 zt1> " << "<-Rx2 x2> <-Ry2 y2> <-Rz2 z2> <-Rt2 t2> " << endl; exit(1); } int main(int argc, char **argv) { bool ok; irtkRealImage in, out; in...
/* A simple server in the internet domain using TCP The port number is passed as an argument */ #include "datagram_socket_server.h" #include <iostream> #include <thread> #include <wiringPi.h> using namespace std; int str = 0; int thr = 0; void commandUpdater() { datagram_socket_server *s = new datagram_socket_se...