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.ApplicationModel.Payments.1.h" WINRT_EXPORT namespace winrt { namespace ABI::Windows::Foundation::Collections { #ifndef WINRT_GENERIC_e2fcc7c1_3bfc_5a0b_b2b0_72e769d1cb7e #...
#include "sortwidget.h" #include "ui_sortwidget.h" #define GREY QColor(220,220,220) SortWidget::SortWidget(std::vector<double> gwPoint,std::vector<double> totPoint,std::vector<QString> names,QWidget *parent) : QWidget(parent) , ui(new Ui::SortWidget) { ui->setupUi(this); //creating visualizing scene and ...
/*************************************************************************** estrategia.cpp - description ------------------- begin : abr 13 2003 copyright : (C) 2003 by Oscar GermánDuarte Velasco email : ogdua...
#include <bits/stdc++.h> #include <cassert> #define rep(i, N) for (int i = 0; i < (N); ++i) #define rep2(i, a, b) for (ll i = a; i <= b; ++i) #define rep3(i, a, b) for (ll i = a; i >= b; --i) #define pb push_back #define eb emplace_back #define fi first #define se second #define nl '\n' #define endl '\n' #define all(c)...
/*====================================================================* - Copyright (C) 2001 Leptonica. 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 c...
#include "client.h" bool Client::connect() { #if !(defined __linux__) WSADATA WsaData; int err = WSAStartup(0x0101, &WsaData); if (err == SOCKET_ERROR) { return false; exit(0); } #endif sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) return false; server = gethostbyname(syst->host); if (se...
#include <bits/stdc++.h> using namespace std; int main() { string names[5] = {"Sheldon", "Leonard", "Penny", "Rajesh", "Howard"}; long long int a[29]; a[0] = 5; for(int i=1; i<29; i++) a[i] = a[i-1]+5*pow(2, i); long long int n, ans; cin>>n; if(n<=5) ans = n-1; else { int x = lower_bound(a, a+29, n)-a; a...
//#include <iostream> //#include <vector> // //int main(void) //{ // std::vector<int> iv(2, 0); // std::cout << "size = " << iv.size() << "\tcapacity = " << iv.capacity() << std::endl; // iv.reserve(14); // // for (int a = 1; a <= 8; a++) { // iv.push_back(a); // std::cout << "size = " << iv.size() << "\tcapacity = "...
#ifndef __STRAWBERRY_H__ #define __STRAWBERRY_H__ #include "Abstract.h" class Strawberry : public Abstract { protected: virtual std::string bread() override; virtual std::string jam() override; }; #endif // __STRAWBERRY_H__
// This file has been generated by Py++. #ifndef TextUtils_hpp__pyplusplus_wrapper #define TextUtils_hpp__pyplusplus_wrapper void register_TextUtils_class(); #endif//TextUtils_hpp__pyplusplus_wrapper
// @copyright 2017 - 2018 Shaun Ostoic // Distributed under the MIT License. // (See accompanying file LICENSE.md or copy at https://opensource.org/licenses/MIT) #pragma once #include <boost/winapi/basic_types.hpp> #include <boost/config/platform/win32.hpp> #include <distant/support/winapi/basic_types.hpp> #if !defi...
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<map> #include<math.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n,x,s; cin>>n>>x>>s; int u,v; while(s--) { cin>>u>>v; if(x==u) x = v; else ...
#include "ThinLensCamera.h" #include "tinyxml2.h" #include "Base/ParseHelper.h" #include "Film/Film.h" #include "Base/PCH.h" ThinLensCamera::ThinLensCamera() : Camera() , mLensRadius( 1.0 ) , mLensFocus( 1.0 ) { } ThinLensCamera::~ThinLensCamera() { } void ThinLensCamera::SetLensFocus( float LensFocus ) { mLen...
#ifndef I2CSOFTWAREBUS_H #define I2CSOFTWAREBUS_H #include "I2CBuffer.h" #include "I2CGpioBus.h" class I2CGpioSoftwareBus : public I2CGpioBus { int _address; int _sdaPin; int _sclPin; int _baudRate; I2CBuffer _receiveBuffer; I2CBuffer _sendBuffer; public: I2CGpioSoftwareBus(int address,...
#include "../include/nbody/Integrate.h" #include "../include/nbody/System.h" #include "gtest/gtest.h" TEST(TestExpectFalse, Positive) { EXPECT_FALSE(0 > 1); }
/*************************************************************************** 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...
class Solution { public: int maxProfit(vector<int>& prices) { if (prices.empty()) { return 0; } int n = prices.size(); // f[i][0]: 手上持有股票的最大收益 // f[i][1]: 手上不持有股票,并且处于冷冻期中的累计最大收益 // f[i][2]: 手上不持有股票,并且不在冷冻期中的累计最大收益 vector<vector<int>> f(n, vector<...
#ifndef _System_h_ #define _System_h_ class System{ public: static void startSystem(); static void stopSystem(); static void interrupt timer(...); }; #endif
#include "MyQPainter.h"
#include <bits/stdc++.h> using namespace std; class Solution { public: int findDuplicate(vector<int> &nums) { vector<bool> seen(nums.size(), false); int i = 0, j = nums.size() - 1; while (i <= j) { if (seen[nums[i] - 1]) return nums[i]; el...
#include <OneWire.h> #include <Time.h> #include <Wire.h> #include <SeeedOLED.h> // OneWire DS18S20, DS18B20, DS1822 Temperature Example // // http://www.pjrc.com/teensy/td_libs_OneWire.html // // The DallasTemperature library can do all this work for you! // http://milesburton.com/Dallas_Temperature_Control_Library #...
/* * SPDX-FileCopyrightText: (C) 2014-2022 Daniel Nicoletti <dantti12@gmail.com> * SPDX-License-Identifier: BSD-3-Clause */ #ifndef ROLEACL_H #define ROLEACL_H #include <Cutelyst/component.h> #include <Cutelyst/componentfactory.h> #include <Cutelyst/context.h> #include <Cutelyst/cutelyst_global.h> #include <QtCore...
#include "obstruction-map.h" ObstructionMap::ObstructionMap(int size_x, int size_y) : Grid<ObstructionType>(size_x, size_y) { for (int x = 0; x < size_x; x++) for (int y = 0; y < size_y; y++) at(x, y) = OT_EMPTY; } bool ObstructionMap::isObstructed(Position position) { return at(position) == OT_OBSTRUCTED; }...
// Sorting techniques #include <iostream> using namespace std; // Swapping variables int swap(int *a , int *b){ int temp ; temp = *a ; *a = *b ; *b = temp ; return 0 ; } // Bubble sort // 1) Time complexity worst O(n2) // 2) Time complexity best O(n) // 3) We can make this sorting technique ...
/* * The IzPack Launcher * http://izpack.org/ * http://izpack.codehaus.org/ * * Copyright (c) 2004 - 2008 Julien Ponge - All rights reserved. * * 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 ...
/******************************************************************************** ** Form generated from reading UI file 'gotocell.ui' ** ** Created by: Qt User Interface Compiler version 5.11.1 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! *****************************************...
#include "Game.hpp" #include "Unit.hpp" Game::Game() {} //Return 0 for no collision, 1 for touching sideways, 2 for jumping on other int Game::collisionCheck(sf::Sprite s1, sf::Sprite s2) { sf::FloatRect r1 = s1.getGlobalBounds(); sf::FloatRect r2 = s2.getGlobalBounds(); if (!r1.intersects(r2)) { ...
#include <iostream> using namespace std; int main() { int a, b, s = 0; cout << "첫 번째 정수: "; cin >> a; cout << "두 번째 정수: "; cin >> b; s = a + b; cout << "합: " << s; return 0; }
#include <cstdio> const int MAX_N = 100, MAX_M = 100; int N,M; char field[MAX_N][MAX_M +1]; void read(); void solve(); int main(){ read(); solve(); return 0; } void read(){ scanf("%d %d\n", &N, &M); for(int i=0; i < N; i++){ for(int j=0; j < M; j++){ scanf("%c", &field[i][j]); } scanf(...
#include "LZ77D.h" LZ77D::LZ77D(FILE* inputFile, int wb, int wl) : input(inputFile){ WB = wb, WL = wl; bitsWB = (WB == 0 ? 1 : 32 - __builtin_clz(WB)); bitsWL = (WL == 0 ? 1 : 32 - __builtin_clz(WL)); window = new uchar[MAX_WINDOW_SIZE]; windowOffset = availableBytes = 0; for(int i = 0; i < WB; ++i) window[...
#include<iostream> #include<stack> #include<algorithm> using namespace std; bool isOperator(char ch) { if(ch=='+'|| ch=='-'|| ch=='/' ||ch=='*' ||ch=='^' ) return true; else return false; } int precedence(char ch) { if(ch=='^') return 3; else if(ch=='*'||ch=='/') ...
/* CTC GO! MOTION LESSON 04 - Gears and Pulleys This sketch is written to accompany activity 1 of Lesson 4 */ #include <Servo.h> Servo waterServo; int button1 = 2; int button2 = 3; int waterLevel = 0; int b1_state = 0; int b2_state = 0; void setup() { waterServo.attach(9); Serial.begin(9600); } void ...
/* NO WARRANTY * * BECAUSE THE PROGRAM IS IN THE PUBLIC DOMAIN, THERE IS NO * WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE * LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE AUTHORS * AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT * WARRANTY OF ANY KIND, EITHER E...
// Copyright (C) 2005 by Piotr Hełka (piotr.helka@nd.e-wro.pl) // Linux C++ (not full) implementation of Borland's conio.h // v 1.01 // It uses Ncurses lib, so accept also its terms. // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // a...
#include<iostream> using namespace std; template<typename T> void fun1(T tNo) { cout<<"Size of T is\n"<<sizeof(T); if(1==sizeof(T)) throw tNo; else(4==sizeof(T)); throw tNo; cout<<"Exception not found"; } int main() { try { fun1(10.2f); fun1('A'); } catch(int exception) { cout<<"Interger exception f...
#include "repository_service.h" #include <vector> #include "inventory_updater.h" #include "inventory_visitor.h" #include "location.h" namespace inventory { namespace { struct InventoryItem { const ItemType type; Amount amount; Price price; }; #define FOR_EACH(objects, action) \ for (auto& it : objects) { ...
#ifndef NEW_PROJECT_2_GAME_HPP #define NEW_PROJECT_2_GAME_HPP #include <SFML/Graphics.hpp> #include <SFML/Audio.hpp> #include "player.hpp" #include "field.hpp" #include "button.hpp" #include "definitions.hpp" class Game { public: Game() = default; Game(sf::RenderWindow *window); ~Game() = default; ...
//header #include <iostream> using std::cout; void display_number(int num1); int square_number(int num);
#ifndef __Box2DRayCast__H__ #define __Box2DRayCast__H__ #include <typeinfo> enum Box2DRayCastType { Box2DRayCastType_Closest, Box2DRayCastType_AllFixtures, Box2DRayCastType_Anything, Box2DRayCastType_Ignore }; struct RayCastInformation { b2Body* m_pBody; b2Fixture* m_pFixture; b2Vec2 m_p...
#include <iostream> #include <string> using namespace std; char table[26][26]; void GenTable() { for(int i=0;i<26;++i) { for(int j=0;j<26;++j) table[i][j]='A'+(i+j)%26; } // for(int i=0;i<26;++i) // { // for(int j=0;j<26;++j) // cout<<table[i][j]<<" "; // cout<<endl; // } } int main() { GenTable(...
#ifndef WordHistogram_H #define WordHistogram_H #include "WordUnit.h" #include <vector> //Stores WordUnits #include <algorithm> //Used to sort vectors #include <iostream> //Cout, Used to debug #include <fstream> //Needed to read/write files using namespace std; class WordHistogram{ public: //Constructor explicit...
#pragma once #include "SwerveRotation2d.h" class SwerveTranslation2d{ protected: double m_x, m_y; public: SwerveTranslation2d(); SwerveTranslation2d(double x, double y); double Norm(); double GetX(); double GetY(); void SetX(double x); void SetY(double y); SwerveTranslation2d TranslateBy(SwerveTransl...
#include<stdio.h> #include<iostream.h> void menu(); int main() { int islem; menu(); scanf("%d", &islem); if { scanf("%d", islem); } void menu(){ printf("Bankamiza hosgeldiniz. Islem secimi yapiniz:\n 1.Para Cekme\n 2. Para Yatirma\n 3. Havale\n 4. Bakiye Sorgulama\n 5. Cikis"); }
/* * SPDX-FileCopyrightText: (C) 2013-2022 Daniel Nicoletti <dantti12@gmail.com> * SPDX-License-Identifier: BSD-3-Clause */ #include "actionrest_p.h" #include "context.h" #include "controller.h" #include "dispatcher.h" #include <QDebug> #include <QUrl> using namespace Cutelyst; /*! * \class Cutelyst::ActionREST ...
#include "PorkParser.h" #pragma warning( push ) #pragma warning( disable : 4482 ) using std::getline; using std::stack; using namespace PorkParserSpace; // Constructor for PorkParser - requires filename PorkParser::PorkParser(string filename, string name, string author): ParserBase(filename), theGameConta...
#include <iostream> using namespace std; struct Line{ int n; int *a; }; /*Вариант 16 Из входного потока вводится непрямоугольная матрица целых чисел [aij], i=1,…,m, j=1,…,n. Значения m и n заранее не известны и вводятся из входного потока. Сформировать вектор {bi}, i=1,…,m, i-ый элемент которого равен су...
#include <iostream> #include <stdlib.h> #include <time.h> using namespace std; const int lin=3; const int col=4; int num[lin][col]; void ingreso (int num[lin][col]){ srand(time(0)); for (int l=0;l<lin;l++) { for (int c=0;c<(col-1);c++) { num[l][c]= 1 + rand() %(100-1); ...
// -*- 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 "lucuma/math.h" #include "lucuma/renderer.h" #include "lucuma/input.h" #include "lucuma/utils/page_allocator.h" #include "lucuma/debug.h" #include "lucuma/file.h" #include "lucuma/utils/macros.h" #include "lucuma/utils/loaders/obj_loader.h" #include "lucuma/renderer/mesh.h" #include "lucuma/utils/imgui/imgui_i...
#pragma once //ShiftUpArrowKey.h #ifndef _SHIFTUPARROWKEY_H #define _SHIFTUPARROWKEY_H #include "KeyAction.h" class ShiftUpArrowKey :public KeyAction { public: ShiftUpArrowKey(Form *form = 0); ShiftUpArrowKey(const ShiftUpArrowKey& source); ~ShiftUpArrowKey(); ShiftUpArrowKey& operator=(const ShiftUpArrowKey& so...
#include "vrc_led.hpp" VRCLED::VRCLED(uint8_t pin, uint8_t num_pixels,neoPixelType t) : Adafruit_NeoPixel(num_pixels,pin,t) { current_color = 255 << 24; } void VRCLED::show_temp_color(uint32_t seconds) { //set up the operation temp_duration = seconds; current_color = temp_color; //make it happen ...
// MemoryManager.c // Implements memory manager. Yay! // #include "copyright.h" #include "MemoryManager.h" #include "system.h" #include "machine.h" MemoryManager::MemoryManager() { bit_mem = new BitMap(NumPhysPages); mem_size = NumPhysPages; mem_lock = new Lock("memory_lock"); DEBUG('m', "MEMORY MANAGER CREATED ...
#include <string> #include "node.h" #include "btree.h" using namespace std; // B Tree of order m means maximum m children // Tree initialization btree::btree(){ root = new node(); root->setLeaf(true); root->setNumKeys(0); root->setParent(NULL); count=0; } tuple<node*, int> btree::search(node* subtree, int ke...
#pragma once #include "NonMovable.h" #include "VertexArray.h" #include "glm/glm.hpp" class SelectedVoxelVisual : private NonCopyable, private NonMovable { public: SelectedVoxelVisual(); void setPosition(const glm::vec3& position); void setActive(bool active); void render(); private: VertexArray m_mesh; glm::...
#pragma once #include "Enemy.h" #include "Item.h" #include <iostream> #include <map> #include <vector> using namespace std; class Room { public: enum Size { Big, Medium, Small, Enormous, Tiny, Gigantic }; enum Lighting { Candle, Fireplace, Torch, DiscoFever, Window, Creek, Lamp, Holybal...
/******************************************************************************** ** Form generated from reading UI file 'snakegame.ui' ** ** Created by: Qt User Interface Compiler version 5.12.0 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ****************************************...
// Fill out your copyright notice in the Description page of Project Settings. #include "QBERTGameMode.h" //#include "Cube.h" // include Cube h to use the class AQBERTGameMode::AQBERTGameMode() { PrimaryActorTick.bCanEverTick = true; world = GetWorld(); TopCube = 274.0f; MostLeftCube = 0.0f; RightSideCube = 0.0...
#include<bits/stdc++.h> #include<vector> #include<map> using namespace std; struct Data { int start, ending, weight; }; bool compareData(Data i1, Data i2) { return (i1.weight < i2.weight); } void print(map<int , vector< pair<int, int > > > adjList){ for(map<int , vector< pair<int, int > > >::iterator i...
#include "log.h" #include "dominio.h" #include "servicio.h" #include "interfaz.h" #include "util.h" #include "configuracion.h" #include "servicioBackup.h" #include "servicioPOP3.h" #include "CrearBackupEmail.h" using namespace std; int main(int argc, char *argv[]) { //Inicializar el dominio cDominio dominio; if...
#ifndef TRACKER_H #define TRACKER_H #include <vector> #include "KalmanFilterToolBox.h" #include "track.h" class NearNeighborDisMetric; class IDDistributor; class tracker{ /* This is the multi-target tracker. Parameters ---------- metric : nn_matching.NearestNeighborDistanceMetric A distan...
/* * Copyright (c) 2016, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * 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/LICE...
#ifndef _GRAPHIC_PRINT_H_ #define _GRAPHIC_PRINT_H_ #include "graphic_manager.h" #include <string> class CGraphicString : public CGraphicObjWithRectArea { public: CGraphicString(CPixel base, alignment align = center, const char * capture = ""): CGraphicObjWithRectArea(base), _current_s(capture), _drawed_s(""),_...
#ifndef POINTSOURCE_HPP #define POINTSOURCE_HPP #include "geometry/Point3D.hpp" template <typename T, typename U> class PointSource3D { public: /* Members */ const Point3D<T> location; const U intensity; /* Constructors */ PointSource3D(const Point3D<T>& location, const U intensity) : location(loc...
/* * 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...
// // main.cpp // tensor factorization on wn18 // // Created by Vanellope on 5/19/16. // Copyright © 2016 Vanellope. All rights reserved. // #include <iostream> #include <fstream> #include <cstdlib> #include <math.h> #include <time.h> #define MAX_FACT 150000 #define MAX_ENTITY 50000 #define MAX_RELATION 20 #defin...
#include <iostream> #include <stdio.h> #include "Eigen/Core" #include "Eigen/LU" #include "opencv2/core/core.hpp" #include "opencv2/features2d/features2d.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/nonfree/nonfree.hpp" // Used Eigen 3.2.0 Library for matrix inversion [http://eigen.tuxfamily.org/index...
// Writing a function 'filter()' that implements a 1D Kalman Filter, // but using multi-dimensional equations //============================================================================ #include <iostream> #include "Eigen/Dense" #include <vector> //Kalman Filter variables Eigen::VectorXd x; // Object state Eigen::...
template <class Type> struct forecastSet; template <class Type> struct dataSet; struct confSet; template <class Type> struct paraSet; template <class Type> Type hcr(Type ssb, vector<Type> hcrConf); #define REPORT_F(name,F) \ if(isDouble<Type>::value && F->current_parallel_region<0) { \ Rf_defineVar(Rf_in...
#ifndef NPNHANDLE_H #define NPNHANDLE_H /// @file NpnHandle.h /// @brief NpnHandle のヘッダファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2005-2012 Yusuke Matsunaga /// All rights reserved. #include "YmTools.h" #include "NpnXform.h" BEGIN_NAMESPACE_YM ////////////////////////////////////////////////...
#include <cstdlib> #include <cstdio> #include <cmath> #include <fstream> #include <vector> #include <iostream> #include <cassert> #include <algorithm> #include <sstream> #include "Ray.h" #include "Light.h" #include "GeoObject.h" #include "Sphere.h" #include "Triangle.h" #include "Scene.h" #include "SimpleObject...
/** * John Bradley (jrb@turrettech.com) */ #pragma once #include "..\JavascriptExtension.h" #include <string> class AudioPlayerExtension : public JavascriptExtension { public: AudioPlayerExtension(); public: JSValue Handle(const std::string &functionName, const Awesomium::JSArray &args); }; class AudioPlay...
#include "Point.h" void Point::move(char dir) {// move point , down/right/left switch (dir) { case RIGHT_KEY: dir_x = 1; dir_y = 0; break; case KEEP_DOWN: dir_x = 0; dir_y = 1; break; case LEFT_KEY: dir_x = -1; dir_y = 0; break; } x += dir_x; y += dir_y; // update the cord of the points }
#ifndef __air_context_cpp__ #define __air_context_cpp__ #include "air_context.hpp" #include "diagnostic.hpp" #include "semantic.hpp" #include <llvm/Support/TargetRegistry.h> #include <llvm/Support/raw_os_ostream.h> #include <llvm/Target/TargetOptions.h> #include <llvm/IR/LegacyPassManager.h> #include <llvm/Support/Tar...
// // Recorder - a GPS logger app for Windows Mobile // Copyright (C) 2006-2019 Michael Fink // /// \file BluetoothActivator.hpp Bluetooth activator // #pragma once #include <bthutil.h> /// \brief activates bluetooth connection /// The class activates a certain bluetooth mode and on destruction restores the /// previ...
#include"Game.h" void Game::instructions() { cout << "Controls:" << endl; cout << "w - Start moving up" << " "; cout << "a - Start moving left" << endl; cout << "s - Start moving down" << " "; cout << "d - Start moving right" << endl; cout << "Space - Start/Stop moving" << endl; } Game::Game() :sco...
#include<iostream> #include<stack> using namespace std; struct Node { char data; struct Node* next; }; struct Node* newNode(char data){ struct Node* node = new Node(); node->data = data; node->next = NULL; } void printList(struct Node* head){ while(head!=NULL){ cout << head->data; ...
#include <bits/stdc++.h> using namespace std; const int MAX_INT = std::numeric_limits<int>::max(); const int MIN_INT = std::numeric_limits<int>::min(); const int INF = 1000000000; const int NEG_INF = -1000000000; #define max(a,b)((a)>(b)?(a):(b)) #define min(a,b)(a<b?a:b) #define MEM(arr,val)memset(arr,val, sizeof ar...
#include "jsonunitbox.h" #include "window.h" #define defaultWidth JsonUnitBox::DEFAULT_WIDTH #define defaultHeight JsonUnitBox::DEFAULT_HEIGHT #include <QDebug> #include <QWidget> #include <QLinkedList> #include <QPalette> JsonUnitBox::JsonUnitBox(QWidget *parent) : JsonUnitBox("", parent) {} JsonUnitBox::JsonUni...
// // channel.cpp // CRsim // // Created by Ji on 15/2/25. // Copyright (c) 2015年 lj. All rights reserved. // #include "channel.h" bool cmpID(const CRchannel &x, const CRchannel &y) { return x.ID < y.ID; }; bool cmpConAvaiTime(const CRchannel &x, const CRchannel &y) { return x.curConAvaiTime < y.curConAv...
#include<iostream> using namespace std; bool used[101]; int main() { int n; int l,r,k; int recl,recr; int ans=0; cin >>n; for(int i=0;i<=100;i++) { used[i]=false; } for(int i=0;i<n;i++) { cin >>l>>r; if(i==0) { recl=l; recr=r; } else { for(int k=l;k<=r;k++) { used[k]=true; }...
class Solution { public: int maxSatisfied(vector<int>& customers, vector<int>& grumpy, int X) // 滑动窗口 { int n = customers.size(); int satisfied = 0; for (int i = 0; i < n; ++i) { // 统计店主不使用“不生气”技能就可以让顾客满意的数量 if (grumpy[i] == 0) { satisfied += custome...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
// Initialize constants for input pins const int x_pin = A0; const int y_pin = A5; const int clear_button = 4; void setup() { // Put analog pins in input mode pinMode(x_pin, INPUT); pinMode(y_pin, INPUT); // Put digital pin in input mode (default: high) pinMode(clear_button, INPUT_PULLUP); ...
// 问题描述 //   在数列 a[1], a[2], ..., a[n] 中,如果对于下标 i, j, k 满足 0<i<j<k<n+1 且 a[i]<a[j]<a[k],则称 a[i], a[j], a[k] 为一组递增三元组,a[j]为递增三元组的中心。 //   给定一个数列,请问数列中有多少个元素可能是递增三元组的中心。 // 输入格式 //   输入的第一行包含一个整数 n。 //   第二行包含 n 个整数 a[1], a[2], ..., a[n],相邻的整数间用空格分隔,表示给定的数列。 // 输出格式 //   输出一行包含一个整数,表示答案。 // 样例输入 // 5 // 1 2 5 3 5 // 样例输出...
//std string -> const char*, char*, 배열 형태의 문자열을 할당 받을 수 있다. //덧셈 기호를 이용해서 문자열 이어붙이기가 가능하다. #define _CRT_SECURE_NO_WARNINGS #include <cstdio> #include <string> #include <iostream> //std::string은 사용자가 메모리 관리, 배열 관리를 하지않고 편안하게 쓰려고 만들었다. int main() { std::string myStr = "Hello World!"; // 연산자 오버로딩 myStr = myStr + "He...
/************************************************************* * > File Name : P1733.cpp * > Author : Tony * > Created Time : 2020/05/08 07:42:58 * > Algorithm : 交互 二分 **************************************************************/ #include <bits/stdc++.h> using namespace std; int ...
#include "Principal.h" char SystemTitle[16]; char SystemVersion[6]; char SystemSerial[17]; char SystemIP[15]; int hpbar; void Customs() { GetPrivateProfileStringA("B&W","SystemTitle","PGBrasil",SystemTitle,sizeof(SystemTitle),BWINI); GetPrivateProfileStringA("B&W","SystemVersion","22459",SystemVersion,sizeof(Syst...
#include<iostream> using namespace std; // //函数的定义 // 1.返回值类型 // 2.函数名 // 3.参数列表 // 4.函数体语句 // 5.return 表达式 //////////////////////////////////// // 返回值类型 函数名(参数列表) // { // 函数体语句; // return表达式; // } //////////////// //注意函数需要写在main函数前 int sum(int a1,int b1) { //此处的a,b在函数定义时,并没有实际的数据,只是一个形式上的参数,所以被成为形参 ...
/******************************************************************************** ** Form generated from reading UI file 'note_abs.ui' ** ** Created by: Qt User Interface Compiler version 5.14.1 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! *****************************************...
#pragma once #include "..\DXTK\pch.h" #include "..\capture\all_inc.h" #include "..\Win32\all_inc.h" #include "..\imageIcon\imageIcons.h" #include "..\common\general.h" class Anime { private: HWND hwnd; gdImageIcons icons; bool exit_step = 0; public: bool init(ID3D11DeviceContext1* context, HWND set_hwnd) { hw...
#include "xpowydialog.h" XPowYDialog::XPowYDialog(QWidget *parent) : QDialog(parent), ui(new Ui::XPowYDialog) { ui->setupUi(this); } XPowYDialog::~XPowYDialog() { delete ui; }
#include <benchmark/benchmark.h> #include "PerformanceTestsUtil.hpp" #include <deus/unicode_view_impl/UTF8Impl.hpp> //------------------------------------------------------------------------------ // SHORT //------------------------------------------------------------------------...
// // Created by Sweet Acid on 01.05.2021. // #pragma once #include <GLFW/glfw3.h> #include <Snow/Window.h> namespace Snow { class Renderer { public: static void swap_buffers(Snow::Impl::Window* window) { SNOW_CORE_ASSERT(window != nullptr, "Attempted to swap buffers but there's no window...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once WINRT_EXPORT namespace winrt { namespace ABI::Windows::Phone::Management::Deployment { struct IEnterprise; struct IEnterpriseEnrollmentManager; struct IEnterpriseEnrollmentResult; struct IIn...
#define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <string.h> //void bubble_sort(int arr[], int sz) //{ // int i = 0; // for (i = 0; i <= sz - 1; i++) // { // int j = 0; // int temp = 0; // for (j = 0; j <= sz - 1 - i; j++) // { // if (arr[j]<arr[j + 1]) // { // temp = arr[j]; // arr[j] = arr[...
#include<string> using namespace std; const int MAX_N = 1000; //INPUT int N, A[MAX_N]; int rev[MAX_N * 2], sa[MAX_N * 2]; int n,k; int myrank[MAX_N + 1]; int tmp[MAX_N + 1]; // compare (myrank[i], myrank[i+k]) vs (myrank[j], myrank[j+k]) bool compare_sa(int i, int j){ if(myrank[i] != myrank[j]) return myrank[i] ...
/* bayesdfa 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 of the License, or (at your option) any later version. bayesdfa is distributed in the hope that it will be useful, ...
#include "state_log.h" #include "log.h" uint32_t StateLog::fail_count_arr[MAX_GAME_ID]; uint32_t StateLog::suc_count_arr[MAX_GAME_ID]; int StateLog::cache_size_arr[MAX_GAME_ID]; extern std::vector<int> g_game_id_vec; // 打印失败信息和流量信息 void StateLog::PrintStateInfo() { std::vector<int>::iterator it = g_game_id_vec...
#include<iostream> using namespace std; #include "11_C++Primer4h.h" /* enum {MAX = 10}; // constant specific to class int * pitems; // holds stack items int size; // number of elements in stack int top; // index for top stack item */ Stack::Stack(int n) : size(n), top(0) // creates stack with n elements { if(n > 10 ...
#ifndef STADIUMMODIFY_H #define STADIUMMODIFY_H #include <QDialog> namespace Ui { class stadiumModify; } class stadiumModify : public QDialog { Q_OBJECT public: explicit stadiumModify(QWidget *parent = 0,QString selectedStad = " "); ~stadiumModify(); private slots: void on_pushButton_clicked(); ...