text
stringlengths
8
6.88M
#include <bits/stdc++.h> using namespace std; list <int> table[1000]; int hnum=997; int main () { ifstream inFile; inFile.open("hash.in.txt"); int n; inFile >> n ; for (int i=0;i<n;i++) { int in; inFile >> in; int key=in % hnum; table[key].push_back(in); } inFile.close(); cout << "H...
// 其实就是求逆序对的数量 #include <cstdio> const int maxn = 500010; int a[maxn], b[maxn]; long long num; void Merge(int a[], int start, int mid, int end) { int i = start, j = mid + 1, k = start; while (i <= mid && j <= end) { if (a[i] <= a[j]) { b[k++] = a[i++]; } else ...
#include<bits/stdc++.h> using namespace std; #define ll long long #define fr(i,n) for (ll i=0;i<n;i++) #define fr1(i,n) for(ll i=1;i<=n;i++) int main() { ll m,n,i,j,k; cin>>k; while(k--) { ll a,b,x,y, ans, ans1=0, ans2=0; cin>>n>>m>>a>>b; if(a>b) ...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
#include<bits/stdc++.h> using namespace std; int main(){ std::ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t; cin >> t; long long int n, k, aux; std::vector< long long int> v; std::vector<int> dist; while(t--){ long long int sum = 0; cin >> n >> k; for(int i=0;i<n;i++){ ...
#include "MangConTro.h" //bool MangConTro::Full(MangConTroDauSach value) //{ // return (value.soLuongSach == MAXDAUSACH ? true : false); //} void MangConTro::insert(ConTroDauSach data) { mangConTro.data[mangConTro.soLuongSach++] = data; int index; for (index = 0;index < mangConTro.soLuongSach && mangConTro.dat...
#include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) scanf("%lld", &n) #define scf(n) scanf("%lf", &n) #define pfl(x) printf("%lld\n",x) #define md 10000007 #define pb push_back #defi...
// // Created by troels on 8/10/16. // #ifndef VMMEF_ADCITERATOR_H #define VMMEF_ADCITERATOR_H #include <iterator> #include <cassert> #include <arpa/inet.h> class ADCiterator : public std::iterator<std::random_access_iterator_tag, uint16_t > { private: const uint16_t *p; public: typedef std::iterator<std::r...
#ifndef IMPLISTREC_H #define IMPLISTREC_H /// @file ImpListRec.h /// @brief ImpListRec のヘッダファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2005-2012 Yusuke Matsunaga /// All rights reserved. #include "ImpRec.h" #include "ImpVal.h" BEGIN_NAMESPACE_YM_NETWORKS //////////////////////////////////////...
/* * 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...
/* DOCUMENTATION BY CHANDAN KUMAR 01/03/2015 INTERFACE 4 WIRE RESISTIVE TOUCH SCREEN WITH ARDUINO ________________ | | | | | TOUCH | | | | | | SCREEN | ...
//Nurul Anissa binti Huzaini //A17DW4087 #include <iostream> using namespace std; enum minggu {sun,mon,tue,wed,thu,fri,sat}; main(void) { minggu hariIni; hariIni = sun; cout << "Sunday is "<<hariIni+1<<" day"; return 0; }
// // Copyright Jason Rice 2019 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #include <nbdl/js.hpp> #include <boost/hana/equal.hpp> #include <catch.hpp> namespace hana = boost::hana; TEST_CASE("get_elem...
#include <iostream> #include <fstream> #include <vector> #include <utility> #include <algorithm> #include <list> using namespace std; int main() { ifstream fin("date.in"); int n,i,j,x; vector <pair<int,char>>S,man; //grad,eticheta list <pair<char,char>>E; fin>>n; S.resize(n);man.resize(n); for(i=0;i<n;i++) { fin...
#include "SoundManager.h" SoundManager::SoundManager(void) { } SoundManager::~SoundManager(void) { } void SoundManager::addMusic(string file) { int namestart = file.find_last_of("/"); int nameend = file.find("."); ++namestart; if (nameend == -1) nameend = file.length(); string name = file.substr(namestar...
#ifndef GBMVARMGR_H #define GBMVARMGR_H /// @file GbmVarMgr.h /// @brief GbmVarMgr のヘッダファイル /// @author Yusuke Matsunaga (松永 裕介) /// /// Copyright (C) 2013, 2014 Yusuke Matsunaga /// All rights reserved. #include "YmTools.h" #include "GbmLit.h" #include "RcfNetwork.h" #include "RcfNode.h" BEGIN_NAMESPACE_YM ////...
#include<bits/stdc++.h> using namespace std; int solve(string input,string* output) { if(input.size()==0) { output[0]=" "; return 1; } int sm = solve(input.substr(1),output); for(int i=0;i<sm;i++) { output[i+sm]=input[0] + output[i]; } return 2*sm; } // recursion void solve1(string input,string output)...
#ifndef TINYENGINE_LTE_INIT_H_ #define TINYENGINE_LTE_INIT_H_ #pragma once #include <iostream> #include <signal.h> #include "LTE_Common.h" #include "LTE_Error.h" #include "LTE_Font.h" #include "LTE_Sound.h" #include "OpenGL/FTGLFontManager.h" #include "LTE_Globals.h" #ifndef _GNU_SOURCE #define _POSIX_C_SOURCE 2 // ...
#ifndef RTGLOBALS #define RTGLOBALS #define BLOCK_SIZE_X 16 #define BLOCK_SIZE_Y 16 #define WARP_SIZE 32 #define Z_ORDER_BLOCK_SIZE 16 #define CMP_RESULTS_BLOCK_SIZE 256 #define HRT_RAY_MISS 0xFFFFFFFE #define HRT_RAY_HIT 0xFFFFFFFF #define GMAXVARS 64 #define INVALID_TEXTURE 0xFFFFFFFE #define TEX_POINT_SAM ...
#include "WitnessSet.h"
#include <iostream> #include <string> #include <stdio.h> #include <stdlib.h> #include <fstream> #include <algorithm> #include "rapidjson/document.h" #include "rapidjson/prettywriter.h" // for stringify JSON #include "rapidjson/writer.h" // for stringify JSON #include "rapidjson/filestream.h" // wrapper of C strea...
#include <assert.h> #include "primitive.h" #include "body.h" #include "octree.h" namespace physics { Primitive::Primitive(PRIMITIVE_TYPE t) : id(0), tContact(-1), tProfile(-1), tPrimitive(t), body(0), parent(0), node(0), isStatic(false), isTrigger(false), interCount(0) { body = new RigidBody(this); } ...
#include "StdAfx.h" #include "utilites\unittest.h" #include "plot\range_test.h" #include "plot\buffer_test.h"
// 30. Write a program in C++ to compute the total and average of four numbers. #include <iostream> using namespace std; int main() { float n1,n2,n3,n4,tot,avrg; cout<<" Input 1st two numbers:"; cin>> n1 >> n2; cout<<" Input last two numbers:"; cin>> n3 >> n4; tot=n1+n2+n3+n4; avrg=tot/4; cout<<" The ...
#include "ibm.h" #include "mem.h" #include "video.h" #include "vid_svga.h" #include "vid_svga_render.h" #include "vid_svga_render_remap.h" void svga_render_null(svga_t *svga) { if (svga->firstline_draw == 4000) svga->firstline_draw = svga->displine; svga->lastline_draw = svga->displine;...
/* Author: Nayeemul Islam Swad Idea: - https://www.facebook.com/notes/facebook-hacker-cup/hacker-cup-2019-round-2-solutions/2860037857345430/ Note: The solution in the editorial uses flood-fill to find all the connected components whereas the following code uses dsu. */ #include <bits/stdc++.h> using name...
/*************************************************************************** dialogomodificador.cpp - description ------------------- begin : ago 2 2003 copyright : (C) 2003 by Oscar G. Duarte email : ogduarte@...
#include "liststack.h" // -------------------- // //拷贝功能函数 void ListStack::copy(const ListStack& other) { top = 0; ListNode *tmp = other.top; ListNode *prenode; while (tmp) { ListNode *newnode = new ListNode(tmp->data); if (top == 0) { top = newnode; } ...
#define NDEBUG #include "common.h" class ChainEnumerator { public: int n; Board &board; vector<vector<int>> paths; vector<int> path; int sum; ChainEnumerator(int n, Board &board) : n(n), board(board) { } void find() { assert(paths.empty()); for (int i = 0; i < board.size(); i++) { ...
#include "StandState.h" #include "../RunState/RunState.h" #include "../../../../GameDefines/GameDefine.h" StandState::StandState(GamePlayer* gp) : GameState(gp) { this->gp->setVx(0); } void StandState::handlerKeyBoard(std::map<int, bool> keys, float dt) { gp->setVy(Define::PLAYER_MAX_JUMP_VELOCITY); if (keys[VK_...
//////////////////////////////////////////// // Params.hh // // Header file for 'Params' class. // // Code for program TsArchive2Dsr // ///////////////////////////////////////////// #ifndef Params_hh #define Params_hh #include <vector> using namespace std; #include <iostream> #include <cstdio> #include <climits> #in...
// // Menu.h // tower // // Created by wangpeng on 15/8/18. // // #ifndef __tower__MenuScene__ #define __tower__MenuScene__ #include <stdio.h> #include "MyLayer.h" class MenuScene : public MyLayer { public: virtual bool init() override; virtual void notificationHandler(Ref* pSender) override; CRE...
// // // #include "TimeTest.h" #include "LiquidCrystal.h" #include "HIC.h" #include "Mode.h" extern LiquidCrystal lcd; static void PrintTime () { unsigned time = (unsigned)(millis () / 1000); hic.print (F ("Time ")); hic.print (time); hic.print ('\n'); lcd.setCursor (10, 1); lcd.print (time); } void Ti...
#include <cstdio> #include <iostream> using namespace std; typedef long long ll; struct People { int id; bool deleted; People *left, *right; People() { id = 0; deleted = false; left = right = NULL; } People(int _id, People* _left = NULL, People* _right = NULL, bool _dele...
class Solution { public: vector<vector<string>> groupAnagrams(vector<string>& strs) { unordered_map<string, vector<string>> table; for (int i = 0; i < strs.size(); i++) { string key = strs[i]; sort(key.begin(), key.end()); table[key].push_back(strs[i]); } ...
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* deleteDuplicates(ListNode* head) { if (!head||!head->next) { return head; } ListNode dummy(-1); ...
#ifndef SWIDGET_H #define SWIDGET_H #include <QWidget> #include <QPushButton> #include <QDebug> #include <QString> #include <QLabel> #include <QLayout> #include <QtMath> #include <QtCore/qmath.h> #include <QList> #include <QFont> #include <QRadioButton> #include <QButtonGroup> #include <QAction> #include <QMenu> #incl...
#include<bits/stdc++.h> using namespace std; #define ll long long map<ll, ll> mp; int main() { ll m, n, i, j; ll t; ll sm=0 , mx=0, ans=0; mp[0]=1; cin>>n; for(i=1; i<=n; i++) { cin>>m; sm+=m; cout<<mx<<" "<<sm<<endl; mx=max(mx, mp[sm]); cout<<an...
#include <Arduino.h> #include <Wire.h> #include "Preferences.h" #include "M5Stack.h" #include "math.h" #include "bmm150.h" #include "bmm150_defs.h" class BMM150class { public: Preferences prefs; struct bmm150_dev dev; bmm150_mag_data mag_offset; bmm150_mag_data mag_scale; // for Soft iron distortion ...
// Copyright 2020-2021 Russ 'trdwll' Treadwell <trdwll.com>. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Steam.h" #include "SteamEnums.h" #include "SteamStructs.h" #include "UObject/NoExportTypes.h" #include "SteamMatchmaking.generated.h" DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnFavor...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <vector> #include <queue> #include <set> using namespace std; const int N = 200222; vector<int> g[N], gt[N]; bool used[N]; int mark[N]; int inverse[N]; vector<int> order; void dfs(int x) { used[x] = true; for (int y : g[x])...
#include "JewelsGrid.h" #include "Jewel.h" #include "SimpleAudioEngine.h" using namespace CocosDenshion; JewelsGrid* JewelsGrid::create(int row, int col) { auto jewelsgrid = new JewelsGrid(); if (jewelsgrid && jewelsgrid->init(row, col)) { jewelsgrid->autorelease(); return jewelsgrid; } else { CC_SAFE_DEL...
/************************************************************* * > File Name : P2842.cpp * > Author : Tony * > Created Time : 2019/05/10 16:14:51 **************************************************************/ #include <bits/stdc++.h> using namespace std; typedef long long LL; const LL mod ...
/* * Copyright (C) 2007-2015 Frank Mertens. * * Use of this source is governed by a BSD-style license that can be * found in the LICENSE file. * */ #include <flux/System> #include "JobServer.h" #include "JobScheduler.h" namespace fluxmake { Ref<JobScheduler> JobScheduler::create(int concurrency) { return n...
/** * Airboat Control Firmware * * Provides low-level functionality for interacting with vehicle hardware such as * fans, servos, gyros, and simple sensors. Communication is achieved via the * Amarino library. * * Functionality is broken down into separate modules for each device/actuator that * is being con...
#include "SensitiveWordFilter.h" #include <iostream> using namespace std; std::wstring Ascii2Unicode(const std::string& str) { // 先计算转换后的大小 int nLen = MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, nullptr, 0); wchar_t* pUnicode = new wchar_t[nLen + 1]; MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, pUnicode, ...
#include <iostream> #include <vector> #include "solution.h" using namespace std; int main() { vector<int> nums = {2, 7, 11, 15}; int target = 9; Solution sol; auto ans = sol.twoSum(nums, target); if (ans.empty()) cout << "Not Found!" << endl; else { cout << nums[ans[0]] << " + " << nums[ans[1]]...
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** 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 ...
/** * 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 * * ...
// // Chord.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" unsigned int hash(std::string input, unsigned int chordSize){ unsigned int key = 0; ...
#pragma once class Graphics { public: Graphics(); ~Graphics(); void Background(float, float, float); void loop(void); };
#include <iostream> #include <algorithm> #include <vector> using namespace std; //a가 b의 앞에 와야할 때 true //그렇지 않을 때에는 false bool cmp(pair<int, string> a, pair<int, string> b){ //나이가 같은 경우 //if(a.first == b.first) return a.first < b.first; }; int main() { vector<pair<int, string>> vec; int N, age; ...
#include "Matchlock.h" Matchlock::Matchlock() : Ranged::Ranged() { range = 90; ammunition = 15; missile_damage = 2; recruitment_cost = 700; upkeep_cost = 400; } Matchlock::~Matchlock() { } char Matchlock::type_of_unit() { return 'm'; }
#include<bits/stdc++.h> using namespace std; int main() { int n,k,a[105]; while(~scanf("%d%d",&n,&k)) { for (int i = 0; i < n; i++) cin >> a[i]; int sum = 0,i; for(i = 0; i < n; i++) { if(a[i] <= k) sum++; else break; ...
int num(char c) { return c - '0'; } void reverse(string& A,int i,int j) { while(i<j) { swap(A[i],A[j]); i++; j--; } } string Solution::solve(string A) { int i; int n = A.size(); for(i=n-2;i>=0;i--) { if(num(A[i])<num(A[i+1])) break; } ...
#ifndef LTUI_HOME_VIEW_H #define LTUI_HOME_VIEW_H #include "./router.hpp" #include "./view.hpp" #include "ftxui/component/container.hpp" #include "ftxui/component/menu.hpp" #include <memory> namespace ltui { struct home_view : public view { explicit home_view(std::shared_ptr<router> router); protected: void in...
#include <CannonRush.h> #include <Kubot.h> #include <MacroManager.h> #include <Utils.h> #include <utils/Map.h> #include <utils/UnitTraits.h> #include <utils/UnitQuery.h> #include <BuildOrderExecutor.h> using namespace sc2; Kubot::~Kubot() {} Kubot::Kubot() : m_sc2(*this) { } void Kubot::OnGameStart() { auto...
// // PlayerMoveBehavior.h // Boids // // Created by Yanjie Chen on 3/10/15. // // #ifndef __Boids__PlayerMoveBehavior__ #define __Boids__PlayerMoveBehavior__ #include "BehaviorBase.h" class PlayerMoveBehavior : public BehaviorBase { public: PlayerMoveBehavior(); virtual ~PlayerMoveBehavior(); st...
#pragma region Properties inline const float IIntersector::Get_ContactPoint() const { return this->m_fContactPoint; }; #pragma endregion
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> // mkfifo #include <fcntl.h> #include <signal.h> #include <sys/wait.h> #include <time.h> #include <errno.h> #define READ 0 #define WRITE 1 #define BUFSIZE 100 #define MAX_JOBS 3 #define FINISHE...
#include "Common.h" #include "Tools.h" #include "Application.h" int __stdcall wWinMain(HINSTANCE, HINSTANCE, LPWSTR, INT) { #ifdef _DEBUG _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif auto res = make_unique<Application>()->Run(); #ifdef _DEBUG system("pause"); #endif return res; }
// ***************************************************************** // This file is part of the CYBERMED Libraries // // Copyright (C) 2011 LabTEVE (http://www.de.ufpb.br/~labteve), // Federal University of Paraiba. // All rights reserved. // // This program is free software; you can redistribute it and/or // modify i...
#include<stdio.h> class Character{ float m_pos; void Move(); }; class Item{ char* name; }; class Player:Character{ Item has_item; }; int main(){ return 0; }
int cdma_func( // config register int f_pingpong , int cbuf_dat0_address , int cbuf_dat1_address , int cbuf_wt0_address , int cbuf_wt1_address , int ddr_dat_address , int ddr_wt_address , int ddr_wt_size_norm , int ...
#include <bits/stdc++.h> using namespace std; template <typename T , typename V> class Pair{ T x; V y; public : T getx(){ return x;} V gety (){ return y; } void setx(T x){ this->x=x; } void sety(V y){ this->y=y; } }; int main(){ Pair <Pair<int , int>,int> p1; p1.s...
#include<bits/stdc++.h> using namespace std; main() { int m,n,a; while(cin >>m >> n >> a) { if(m+n+a != 180) cout << "Error\n"; else if(m == n && n == a && a == m && m == 60) cout << "Equilateral\n"; else if(m ==n || a == n || a == m) cout << "Isosceles\n"; else cout << "Scalene\n"; } }
/** * * @file Byte.cpp * @Naoki Takahashi * **/ #include "Byte.hpp" #include <cstdint> #include <cassert> #include <cstddef> namespace Tools { namespace Byte { constexpr size_t maximum_support_byte_lenght = 2; template <typename T> T low_byte(const T &x) { static_assert(sizeof(x) == maximum_sup...
// Factorial #include <iostream> using namespace std; int fact(int n){ if(n==0){ return 1; } int ChotaAns=fact(n-1); int BadaAns=n*ChotaAns; return BadaAns; } int main(){ int n; cin>>n; cout<<fact(n)<<endl; return 0; }
#ifndef TESTUTILS_H #define TESTUTILS_H namespace cpp_class2_test { void testAreEqualFloat(); void testAreEqualDouble(); } #endif // !TESTUTILS_H
/*************************************************************************** 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...
// Copyright [2014] <lgb (LiuGuangBao)> //===================================================================================== // // Filename: log.cpp // // Description: easyDB 日志模块实现 // // Version: 1.0 // Created: 04/26/2013 01:17:44 PM // Revision: none // Compiler: gcc // // ...
// // Created by Will Smith on 3/8/18. // #include "Person.h" const string &Person::getName() const { return name; } void Person::setName(const string &name) { Person::name = name; } int Person::getAge() const { return age; } void Person::setAge(int age) { Person::age = age; } Person::Person() { ...
#if !defined(AFX_PLTREEVIEW_H__69612D9C_A039_4AE2_8F26_4705535DD903__INCLUDED_) #define AFX_PLTREEVIEW_H__69612D9C_A039_4AE2_8F26_4705535DD903__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // PLTreeView.h : header file // ////////////////////////////////////////////////////////////////////////...
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { string a; cin>>a; int mx = 0; if(a.length()%2!=0) { cout<<"NO"<<endl; continue; } for(int i=0; i<a.length(); i++) { int c = 1; if(a[i]=='0') continue; for(int j=i+1; j<a.length(); j++) { if...
#ifndef _DIALOGMERGEMESHSET_H_ #define _DIALOGMERGEMESHSET_H_ #include "SelfDefObject/QFDialog.h" namespace Ui { class MeshSetMergeDialog; } namespace MeshData { class MeshData; }; namespace MainWidget { class MeshWidget; class MeshSetMergeDialog : public QFDialog { Q_OBJECT public: MeshSetMergeDialog(...
/* search routine generated by gen. skip=no, match=rev, shift=d12 */ /* * The authors of this software are Andrew Hume and Daniel Sunday. * * Copyright (c) 1991 by AT&T and Daniel Sunday. * * Permission to use, copy, modify, and distribute this software for any * purpose without fee is hereby granted, provide...
#pragma once #include <ge.hpp> namespace doodle { class Platform : public ge::Object { public: Platform(SDL_Texture *gamesheet, SDL_Rect &platformBounds, int x, int y, int scale); ~Platform(); void update(); void render(); bool moving; ...
#include <iostream> #include "circ_arr_queue.h" void PrintFront(CircArrQueue* queue) { try { int front = queue->Front(); std::cout<< "Front: " << front << std::endl; } catch (QueueEmpty) { std::cout << "Error: Queue is empty" << std::endl; } } void PrintSize(CircArrQueue* queue) { std::cout<< "Siz...
// This file has been generated by Py++. #include "boost/python.hpp" #include "generators/include/python_CEGUI.h" #include "TextureTarget.pypp.hpp" namespace bp = boost::python; struct TextureTarget_wrapper : CEGUI::TextureTarget, bp::wrapper< CEGUI::TextureTarget > { TextureTarget_wrapper() : CEGUI::Textur...
class Solution { public: // bool isUgly(int num) { // if (num<=0) return false; // while (num%30==0) num = num/30; // while (num%15==0) num = num/15; // while (num%10==0) num = num/10; // while (num%6==0) num = num/6; // while (num%5==0) num = num/5; // while (num%3==0) num = num/3; // w...
#include "personpage.h" #include "ui_personpage.h" #include <QDebug> #include <QDialog> #include<QSqlQueryModel> personpage::personpage(QWidget *parent) : QMainWindow(parent), ui(new Ui::personpage) { ui->setupUi(this); } personpage::~personpage() { delete ui; } void personpage::on_pushButton_mycon_...
#include <iostream> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <pHash.h> using namespace std; using namespace cv; int SimpleHashSim(Mat matSrc1, Mat matSrc2) { CV_Assert(matSrc1.channels() == 3); CV_Assert(matSrc2.channels() == 3); ...
/*************************************************** Materia: Gráficas Computacionales Tarea: 9 Texturas Fecha: 3 de abril de 2011 Autor 1: 1162205 Diego Alfonso Garcia Mendiburu ***************************************************/ #include <windows.h> #include <stdlib.h> #include <stdio.h> #include <GL/glut...
#ifndef CELDA_H #define CELDA_H #include "../interfaces/espaciable.h" #include "celda_base.h" namespace App_Niveles { class Celda: public Celda_base, public App_Interfaces::Espaciable { ////////// //Definiciones... public: enum class tipo_celda {solida}; /////////// // Interface pública public: Cel...
#include "Command.hpp" #include "CmdQueue.hpp" #include "SException.hpp" namespace rustling { CmdQueue::CmdQueue(): queue(0x0) {} CmdQueue::CmdQueue( Context &ctx, Device &dev, cl_command_queue_properties properties) { ret_code ret; auto context_ = ctx.getContext(); auto device_ = dev.get...
#include<stdio.h> int h[101],n;//设置数组存放完全二叉树,n为堆中元素个数 void swap(int x,int y);//结点x与结点y进行交换 void siftdown(int i);//从结点i开始向下调整 void creat();//建立堆的函数 void heapsort();//堆排序函数 int main() { int num,i; //读取堆中元素个数 scanf("%d",&num); //读入堆中元素 for(i=1;i<=num;i++) scanf("%d",&h[i]); n=num;//元素的个数会后面操作改变,num当作循环变量用 c...
#include <iostream> #include <fstream> #include <string> using namespace std; int opening_bracket = 0; int closing_bracket = 0; int simb = 0; int str_s = 0; int rec(string& str, ofstream& output) { while (str.size()) { //output << str << endl; cout << str << endl; cout << opening_bracket << endl; cout << ...
// Copyright 2017 The Ray Authors. // // 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 applicable law or agreed to i...
class Solution { public: bool isSafe(int board[][10],int i,int j,int n){ for(int row=0;row<i;row++){ if(board[row][j]==1){ return false; } } int x = i; int y = j; while(x>=0 && y>=0){ if(board[x][y]==1){ re...
#ifndef MEMORY_H #define MEMORY_H #include <iostream> #include <bitset> #define MEMORY_SIZE 4096 #define BIT_DEPTH 32 class Memory { private: int8_t mem[MEMORY_SIZE]; public: Memory(){}; //~Memory(); void init_mem(); int store(int addr, int8_t data); int8_t load(int addr); }; #endif
/////////////////////////////////////////////////////// // // Copyright � 1994 Jens Gebhard // // DATEI: GREEN.H // // ZWECK: Deklaration der Klasse GreenAlgorithmus // /////////////////////////////////////////////////////// #if !defined(__GREEN_H) #define __GREEN_H #include <iostream> #include "pitman.h" //...
#include <cstdio> // 二分查找框架, 特定值 int binary_search(int arr[], int len, int x) { int low = 0, high = len - 1; int mid; while(low <= high) { mid = (low + high)/2; if(arr[mid] == x) { return mid; } else if(arr[mid] < x) { low = mid + 1; } else { high = mid - 1; } } ret...
#ifndef IMPRIMIR_H #define IMPRIMIR_H class Imprimir { public: Imprimir(); virtual ~Imprimir(); protected: private: }; #endif // IMPRIMIR_H
#include "stdafx.h" #include <stdlib.h> #include <string> #include <iostream> #include <stdio.h> #include <sstream> #include <algorithm> #include <iterator> #include <vector> #include <set> #include <unordered_set> #include <direct.h> #include <assert.h> #include <fstream> using namespace std; stri...
/* netlibrary网络库给用户提供了两个主要的类 TcpServer : 用于编写服务器程序的 TcpClient : 用于编写客户端程序的 epoll + 线程池 好处:能够把网络I/O的代码和业务代码区分开 用户的连接和断开 用户的可读写事件 */ #include <netlibrary/TcpServer.h> #include <netlibrary/EventLoop.h> #include <iostream> #include <functional> #include <string> using namespace std; using nam...
#if defined(_WIN64) || defined(_WIN32) // cv-test.cpp : Defines the entry point for the console application. // #include <opencv2\core.hpp> #include <opencv2\imgproc.hpp> #include <opencv2\highgui.hpp> #include <opencv2\calib3d.hpp> #include <iostream> #include <vector> using namespace cv; using namespace std; in...
// Fill out your copyright notice in the Description page of Project Settings. #include "./UI_Interaction.h" #include "Components/Image.h" #include "Materials/MaterialInstanceDynamic.h" void UUI_Interaction::NativeConstruct() { Super::NativeConstruct(); SetInteractionProgress(0); } void UUI_Interaction::SetInter...
/* * Screen.h * * Created on: 10 сент. 2017 г. * Author: Соня */ #ifndef SCREEN_H_ #define SCREEN_H_ #include "Common.h" #include "Singleton.h" typedef struct { int width; int height; } ScreenSize; class Screen: public Singleton<Screen> { public: static Screen* GetSingletonPtr(void...
/* * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2020, Savely Pototsky (SavaLione) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must ...
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) #define ok() puts(ok?"Yes":"No"); using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<vi> vvi; typedef vector<ii> vii; typedef vector<bool> vb; typedef vector<vb> vvb; typedef set<int> si; ty...