text
stringlengths
8
6.88M
#pragma once #include "plbase/PluginBase.h" #include "CTask.h" #pragma pack(push, 4) class PLUGIN_API CTaskComplex : public CTask { CTaskComplex() = delete; protected: CTaskComplex(plugin::dummy_func_t a) : CTask(a) {} public: CTask *m_pSubTask; // vtable virtual void SetSubTask(CTask *subTask); virtual ...
// This file is MACHINE GENERATED! Do not edit. #ifndef TENSORFLOW_CC_OPS_LOOKUP_OPS_INTERNAL_H_ #define TENSORFLOW_CC_OPS_LOOKUP_OPS_INTERNAL_H_ // This file is MACHINE GENERATED! Do not edit. #include "tensorflow/cc/framework/ops.h" #include "tensorflow/cc/framework/scope.h" #include "tensorflow/core/framework/ten...
#include <iostream> #include <cstdlib> #include <ctime> #include "Sudoku.h" using namespace std; void Sudoku::giveQuestion(){ int i; int Sudo[81]={0,0,0,0,0,0,6,8,0,0,0,0,0,7,3,0,0,9,3,0,9,0,0,0,0,4,5,4,9,0,0,0,0,0,0,0,8,0,3,0,5,0,9,0,2,0,0,0,0,0,0,0,3,6,9,6,0,0,0,0,3,0,8,7,0,0,6,8,0,0,0,0,0,2,8,0,0,0,0,0,0}; for(i=...
#pragma once #include <stdio.h> #include <stdlib.h> class party; class player; class item; class enemy; class quest; class party { protected: int gold; player **ply_lst; int num_plys; int Max_members; item **inventory; int inv_size; quest *active_quest; bool game_over; public: party(); ~par...
#include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <string> #include <cstring> #include <numeric> #include <cstdlib> #include <cmath> using namespace std; typedef long long ll; #define INF 10e17 // 4倍しても(4回足しても)long longを溢れない #define rep(i,n) f...
#pragma once #include "common.hpp" void failTest(int line = __builtin_LINE(), const char* file = __builtin_FILE()) { fail("Test failed: failTest @ ", file, ":", line); } template <typename T> void checkEqual(T a, T b, int line = __builtin_LINE(), const char* file = __builtin_FILE()) { if(!(bool)(a == b)) { ...
// Created on: 1997-08-06 // Created by: Philippe MANGIN // Copyright (c) 1997-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 GN...
#ifndef PITCH_YAW_H #define PITCH_YAW_H #include "FreeRTOS.h" #include "PID.h" #include <main.h> #include "motor.h" #include "mpu6050_config.h" #include "dr16.h" #include "PCvision.h" extern CAN_HandleTypeDef hcan1; extern CAN_HandleTypeDef hcan2; extern myPID pitchSpeed,pitchAngle,yawSpeed,yawAngle; ...
#include "KickOutPlayerProc.h" #include "HallHandler.h" #include "Logger.h" #include "Configure.h" #include "GameServerConnect.h" #include "PlayerManager.h" #include <string> using namespace std; KickOutPlayerProc::KickOutPlayerProc() { this->name = "KickOutPlayerProc"; } KickOutPlayerProc::~KickOutPlayerProc() { }...
// Fill out your copyright notice in the Description page of Project Settings. #include "FinalMachineInteractorComponent.h" #include "FinalMachine.h" #include "FPS_test_5Character.h" bool UFinalMachineInteractorComponent::Interact(UObjectInfo* info) { int flaskUsed = 0; if (FirstFlaskId.Equals(info->ObjectId)) { ...
#include <QThread> class MumuThreadSend : public QThread { Q_OBJECT public: void run(); };
#include "CMyOpenGlWidget.h" CMyOpenGlWidget::CMyOpenGlWidget(QWidget * parent , Qt::WindowFlags f ) : QOpenGLWidget(parent,f) { //setFixedSize(200, 200); } CMyOpenGlWidget::~CMyOpenGlWidget() { } void CMyOpenGlWidget::initializeGL() { QSurfaceFormat theFormat = format(); int a1 = th...
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- // // Copyright (C) 2003-2007 Opera Software AS. All rights reserved. // // This file is part of the Opera web browser. It may not be distributed // under any circumstances. // // Julien Picalausa // //The delete operation will attempt to ren...
(English:'Romanian'; Native:'Română'; LangFile:''; DicFile:'romana.dic'; FlagID:'ro'; Letters:'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z'; LetterCount:'11,2,5,4,9,2,2,1,10,1,0,4,3,6,5,4,0,7,5,7,6,2,0,1,0,1'; LetterValue:'1,9,1,2,1,8,9,10,1,10,0,1,4,1,1,2,0,1,1,1,1,8,0,10,0,10'; NumberOfJokers:2; Read...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 2007-2011 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef POSIX_CAPABILITIES_H #define POSIX_CAPABILITIES_H __FILE__ /* Capabilities (n...
#pragma once #include <QOpenGLWidget> #include "opencv2/core.hpp" class XVideoWidget : public QOpenGLWidget { Q_OBJECT public: XVideoWidget(QWidget* p); virtual ~XVideoWidget(); public: void paintEvent(QPaintEvent* e); public slots: //½çÃæË¢Ð void SetImage(cv::Mat mat); protected: QImage img; };
#include <iostream> #include <vector> #include <algorithm> #include <fstream> #include <queue> #include <unordered_set> #include <unordered_map> #include <stack> #include <cstdio> #include <cmath> #include <cstring> using namespace std; #define INT_MIN (1<<31) #define INT_MAX (~INT_MIN) #define UNREACHABLE (INT_MAX>>2...
/***************************************************************************************************************** * File Name : insertionsort.h * File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\tutorials\nptel\DSAndAlgo\lecture01\insertionsort.h * Created on : Dec 28, 2013 :: 1:43:44 AM * ...
#include "view/WordScrambleWindow.h" using namespace view; int main (int argc, char ** argv) { srand(time(0)); WordScrambleWindow mainWindow(570, 375, "A4: Word Scramble by Jacob Slattery and Tristen Rivera"); mainWindow.resize(800, 300, 600, 375); mainWindow.show(); int exitCode = Fl::run(); ...
#include<iostream> #include<vector> #include<map> using namespace std; typedef vector<int> vi; class UnionFind{ public: vi p,rank,count; UnionFind(int N){ rank.assign(N,0);p.assign(N,0);count.assign(N,1); for(int i=0;i<N;i++)p[i]=i;} int findSet(int i){return (p[i]==i)?i:(p[i]=findSet...
#ifndef MIME_H #define MIME_H /** * Interface to mimedec in url2 */ struct mime_content_type_t { OpStringC* media; OpStringC* sub; }; // both able to decode whole rfc822 structures as well as single parts // to Mime_Decoder - add LoadData(FILE, file start pos (and length?)) /* class MimeDecoder { Decode(B...
//NAME: StackLinked.cpp //DESC: linked list implementation of stack //USAGE: #include "StackLinked.cpp" //COMPILER: GNU g++ compiler on Linux //AUTHOR: Bri Schmidt //LAST UPDATED: September 30, 2018 20:17 #include "StackLinked.h" //default constructor template <typename DataType> StackLinked<DataType>::StackLinked() ...
#include <iostream> const int EMPTY = -987654321; int n, board[50]; int cache[50][50]; int play(int left, int right) { if (left > right) return 0; int& ret = cache[left][right]; if (ret != EMPTY) return ret; ret = std::max(board[left] - play(left + 1, right), board[right] - play(left, right - ...
#pragma once class GameCursor; class AIEditNodeMenu; class AIEditNodeMenuSave; class AIEditNodeMenuOpen; class AIEditNodeProcess; class AIEditNodeSelectButtons : public GameObject { public: ~AIEditNodeSelectButtons(); bool Start(); void Update(); void Setmenuselect(bool a) { menuselect = a; } bool GetMen...
#include "TeamSprite.h" #include "GameDimens.h" TeamSprite::TeamSprite(){} TeamSprite::TeamSprite(const Team& t) { for(unsigned int i=0; i< t.getTeam().size(); i++) { cout << "on construit un charactersprite" << endl; CharacterSprite* c = new CharacterSprite(t.get(i)); cout << "on ajout...
#include <vector> #include <cmath> #include <algorithm> #include <iostream> /* Auxiliary class to calculate characteristics from the data distribution */ struct Sample{ std::vector<double> features; int label; int size; }; class Statistics { public: Statistics(); Statistics(std::size_t); ~Statistics(); std::...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2011 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef SCOPE_WIDGET_INFO_H #define SCOPE_WIDGET_INFO_H #includ...
#include<bits/stdc++.h> using namespace std; class Solution { public: int maxProfit(vector<int>& prices) { int min; int maxprofit=0; min=prices[0]; for(int i=0;i<prices.size();i++) { if(min>prices[i]) m...
// Algorithm :Linear Regression // Data : pop.csv #include <iostream> #include <vector> #include "algorithms/GradientDescent.h" using namespace std; int main(int argc, char const *argv[]) { mat X, y,theta; csv_to_xy("datasets/pop.csv", {"X1" ,"X2" ,"X3" , "X4"}, "X5", X, y); gradientDescent(X, y, theta, LeastSq...
#pragma once #ifndef MAT4_H #define MAT4_H #include <math/Vec3.h> #include <math/Vec4.h> namespace NoHope { class Mat4 { public: Mat4(); Mat4(const Vec4& column1, const Vec4& column2, const Vec4& column3, const Vec4& column4); Mat4(const float a11, const float a12, const float a13, const float a14, cons...
/* 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 in writing, software * distributed ...
INSANE_SKIP_xmlsec1-dev-static = "staticdev" xmlsec1-dev_files += "${prefix}/lib/lib*.so*" DEPENDS += "libgcrypt"
#include <iostream> #include <queue> #include <vector> #include "Graph.h" using namespace std; class GraphBFS{ private: Graph g; vector<bool> visited; vector<int> order; void bfs(int s){ queue<int> q; q.push(s); visited[s] = true; while (!q.empty()){ ...
//算法:DP/01背包 //本题为01背包变体,除体积外,另增一维质量 //只需要将一维数组转变为二维数组, //并多加一层循环即可 //状态转移方程式:f[j][k]=max(f[j][k],f[j-v[i]][k-w[i]]+c[i]); #include<cstdio> #include<algorithm> using namespace std; int vm,mm; int n; int v[51];//体积 int w[51];//质量 int c[51];//价值 int f[410][410];//前体积,后质量 int main() { scanf("%d%d%d",...
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2011 Bryce Lelbach // // SPDX-License-Identifier: BSL-1.0 // 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) ///////...
#ifndef FRAMEVIEWER_H #define FRAMEVIEWER_H #include <QTableWidget> class FrameViewer : public QTableWidget { Q_OBJECT public: explicit FrameViewer(QWidget *parent = 0); QModelIndexList selectedIndexesList(void); }; #endif // FRAMEVIEWER_H
/* -*- coding: utf-8 -*- !@time: 2020/1/11 上午10:02 !@author: superMC @email: 18758266469@163.com !@fileName: 0034_the_first_character_that_appears_only_once.cpp */ #include <environment.h> class Solution { public: int FirstNotRepeatingChar(string str) { map<char, int> mp; for (char i : str)...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) Opera Software ASA 1999-2004 */ #include "core/pch.h" #include "modules/ecmascript/carakan/src/es_pch.h" #include "modules/ecmascript/carakan/src/object/es_boolean_object.h" #include "module...
class Solution { public: bool isToeplitzMatrix(vector<vector<int>>& matrix) { int a = 0; int b = 0; while(a<matrix.size()&&b<matrix[0].size()){ int i = a; int j = b; ++a; while(i+1<matrix.size()&&j+1<matrix[0].size()){ if(matrix[i][j]==matrix[i+1][j+1]){ ++i; ++j; }else{ ret...
#pragma once #include "ResourceManager.h" #include "EngineUtil.h" #include "FreeImage.h" class Image{ public: string name;//file name string filepath; enum ImageFormat { IM_JPEG, IM_PNG, IM_TGA, IM_BMP, IM_HDR, IM_UNKNOWN }; enum ImagePixelFormat { UNSIGNED_BYTE, UNSIGNED_SHORT, UNSIGNED_IN...
#include <cstdio> #include <cstdlib> #include <fstream> #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Weverything" #endif #include "cxxopts.hpp" #include "json.hpp" #define DR_WAV_IMPLEMENTATION #include "dr_wav.h" #ifdef __clang__ #pragma clang diagnostic pop #endif #include "t...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> using namespace std; const int maxn = 20000 + 100; const int maxm = 100000 + 100; struct Edge{ int...
#include <cstdio> int main(int argc, char** argv) { int c; while ( (c=getchar()) != EOF ) { putchar(c); } return 0; }
// Created on: 2016-07-07 // Copyright (c) 2016 OPEN CASCADE SAS // Created by: Oleg AGASHIN // // 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 publi...
// The MIT License (MIT) // Copyright (c) 2013 lailongwei<lailongwei@126.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 r...
#include "../../include/Jogo/graph.h" #include <unistd.h> void Gbase::printG(int color){ int i,j; CubePoint p; for(i = x; i < x+3; i++) for(j = y; j < y+3; j++) { if(a[i - x][j - y] == 1) { p.setLocate(i,j); p.setColor(color); ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2012 Opera Software ASA. 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 "modules/logdoc/htm_ldoc.h" #in...
#include<iostream> #include<iomanip> #include <windows.h> #include <SFML/Graphics.hpp> #include<time.h> #include "Globals.h" #include"region.h" const int size = 2500;//rowSize ^2 const int rowSize = 50; const int maxDistance = 4; //declared as globals. Variables are declared to the heap rather than the stack, preven...
#pragma once #include "FwdDecl.h" #include <vector> #include "GlyphInfo.h" namespace keng::graphics::free_type { class Face : public core::RefCountImpl<core::IRefCountObject> { public: Face(Library& library, std::vector<uint8_t> fileData); ~Face(); GlyphData RenderGlyph(const Glyp...
#include <bits/stdc++.h> using namespace std; long long int camion[10009]; long long int x,i,n,p; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> p; for(i=1;i<=n;i++){ cin >> x; camion[i] = x; } for(i=1;i<=p;i++){ cin >> x; cout << camion[x] << '\n...
//---------------------------------------------------------------------------- // // This file should process command line arguments and call the main game function. //---------------------------------------------------------------------------- #include "game.h" //----------------------------------------------...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2002 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef OP_THUMBNAIL_PAGEBAR_H #define OP_THUMBNAIL_PAGEBAR_H #i...
/* *@author: profgrammer *@date: 31-12-2018 */ #include <bits/stdc++.h> #define inf 100000000 using namespace std; string s1, s2; int dp[1500][1500]; // function that returns minimum edits required to convert s1[0 .. i-1] into s2[0 .. j-1] int minEdit(int i, int j){ // base cases. if s1 finishes we need j ins...
#ifndef ___URL_CODE___HHH___ #define ___URL_CODE___HHH___ #include <string> using namespace std; //URL½âÂë string urldecode(string &str_source); //URL±àÂë string urlencode(string &str_source); string urlencode(const char* str_source, int nLen); #endif
// should produce same result with interact.cpp // use wrapped API in src/treeface/gl #include <SDL.h> #define GLEW_STATIC #include <GL/glew.h> #include <stdio.h> #include <stdlib.h> #include <set> #include "treeface/gl/GLBuffer.h" #include "treeface/gl/Program.h" #include "treeface/gl/VertexArray.h" #include "tree...
#include<iostream> #include<fstream> #include<iomanip> #include<queue> // limit of unsigned int using namespace std; int vCount, nEdges; bool writeToFile=false; struct nodeDistance { int node; long int distance; }; class Comparator { public: bool operator()(nodeDistance& n1, nodeDistance& n2) { ...
#include "Graph.h" void createGraph (Graph &G){ Start(G) = NULL; } adrPr AlokasiPr (string name,string type,string username){ adrPr p = new elmPr; nama(p) = name; jenis(p) = type; id(p) = username; nextCh(p) = NULL; nextPr(p) = NULL; return p; } adrCh AlokasiCh(string username){ adr...
#include "treeface/gl/Errors.h" #include "treeface/gl/TypeUtils.h" #include "treeface/gl/VertexTemplate.h" #include "treeface/misc/Errors.h" #include "treeface/misc/PropertyValidator.h" #include "treeface/misc/StringCast.h" #include <treecore/Array.h> #include <treecore/DynamicObject.h> #include <treecore/NamedValueS...
#pragma once #include <array> namespace oglml { struct Glyph { Glyph() = default; ~Glyph() = default; unsigned int TextureID; // ID handle of the glyph texture std::array<int, 2> Size; // size of glyph std::array<int, 2> Bearing; // offset from baseline to left/top of glyph unsigned int Adva...
#include <R.h> #include <Rinternals.h> #include <Rdefines.h> #include "mat.h" using namespace std; extern "C" { #ifdef _MSC_VER __declspec(dllexport) #endif SEXP WAPLS_fit(SEXP sexp_SpecData, SEXP sexp_EnvData, SEXP sexpNPLS, SEXP sexpIsWAPLS, SEXP sexpStandX, SEXP sexpLean) { SEXP dims, retNames=R_NilValue, R_...
#ifndef DPFORAM_H_ #define DPFORAM_H_ #include "fss.h" #include "protocol.h" class dpforam : public protocol { private: static fss1bit fss; uchar **rom[2]; uchar **wom; uchar **stash[2]; dpforam *pos_map; unsigned long stash_ctr; public: uint logN; uint logNBytes; uint nextLogN; ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. ** It may not be distributed under any circumstances. */ #ifndef ACT_H #define ACT_H #include "modules/search_engine/Bloc...
#include "hasharr.h" #include "othermethods.h" // // KONSTRUKTOR // template <typename T> MyHashArr<T>::MyHashArr(int size, char type){ if(!isPrime(size)){ std::cerr << "\nLiczba nie jest pierwsza. Przyjmuje domyslnie 7.\n"; size=7; } if(type!='l' && type!='p' && type!='d'){ std::cerr << "\nBledny typ kolizj...
#include "checkersboard.cpp" class HumanPlayer { public: CheckersBoard makeMove(CheckersBoard, bool) const; };
/* 200902 LG codepro - [20년도_1차] 안테나 송수신 4/10 : success (6 Timeouts) timeout solution */ #include <iostream> using namespace std; int N;//송수신 안테나 수 int H[100000 + 10];//송수신 안테나 높이 void InputData(){ cin >> N; for (int i = 0; i < N; i++) cin >> H[i]; } int Solve(){ int cnt = 0; int i, j, ...
// Created on: 1992-04-06 // Created by: Jacques GOUSSARD // Copyright (c) 1992-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 G...
#include <google/protobuf/text_format.h> #include <stdio.h> #include <condition_variable> #include <cstring> #include <experimental/filesystem> #include <fstream> #include <iomanip> #include <iostream> #include <mutex> #include <queue> #include <shared_mutex> #include <string> #include <thread> #include <utility> #incl...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin >> n; vector<ll> x; for(int i = 0; i < 5; i++) { ll tmp; cin >> tmp; x.push_back((n - 1)/tmp + 1); } cout << *max_element(x.begin(), x.end()) + 4 << endl; }
#ifndef __WPP__QT__IOS_TIME_ZONE_PICKER_H__ #define __WPP__QT__IOS_TIME_ZONE_PICKER_H__ #include <QQuickItem> #ifdef Q_OS_ANDROID #include <QAndroidActivityResultReceiver> #endif #include <QTimeZone> namespace wpp { namespace qt { #ifdef Q_OS_ANDROID class IOSTimeZonePicker : public QQuickItem, QAndroidActivityResu...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: State1.cpp * Author: Alessio Portaro * * Created on 10 dicembre 2018, 20.06 */ #include "../State1.h" #include "....
#include <iostream> #include <string> #include <cstring> #include <algorithm> #include <queue> const int INF = 1e9; struct qn{ int x, y, k; }; int n, m, k; int dist[1001][1001][11]; std::string map[1001]; std::queue<qn> q; int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0}; int main() { std::cin.sync_with_stdi...
#ifndef _PID_CALCULATOR_H #define _PID_CALCULATOR_H #include "PID_v1.h" class PidCalculator { public: PidCalculator(double sp, double kp, double ki, double kd); double calculate(double pv); private: double setpoint; double input; double output; PID *pid; }; #endif
/******************************************************************************************************//** * @file codestatisticswindow.cpp * @brief 代码统计窗口 源文件 * * 统计代码 * 选择路径, 配置后缀名, 计算代码量, 显示结果 * @author coolweedman * @version V1.00 * @date 2016-7-13 **...
//---------------------------------------------------------------- // Game_Debug.h // // Copyright 2002-2004 Raven Software //---------------------------------------------------------------- #ifndef __GAME_DEBUG_H__ #define __GAME_DEBUG_H__ #define DBGHUD_NONE (0) #define DBGHUD_PLAYER (1<<0) #define DBGHUD_PHYSIC...
#include "mutex.h" namespace chidouhu { }
#include <iostream> #include <cstring> using namespace std; bool check_permutation(string str1, string str2){ int len = str1.length(); int len2 = str2.length(); int check[256]; memset(check, 0 , sizeof(check)); for(int i = 0; i<len; i++){ int temp = (int)str1[i]; int temp2 = (int)str2[i]; check[temp]++; ...
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cstdio> #define REP(i,n) for (int i=0; i<n; i++) using namespace std; typedef long long ll; int main() { ll n,k; ll a[100005]; ll pos; cin >> n >> k; REP(i,n){ scanf("%lld", &a[i]); if (a[i] == 1) pos = i; } ...
// Copyright (c) 2011-2017 The Cryptonote developers // Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs // Copyright (c) 2018-2023 Conceal Network & Conceal Devs // // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php....
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- /** Copyright (C) 1995-2008 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * @file RichTextEditor.h * @author Owner: Alexander Remen (al...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
#include<iostream> #include<cmath> #include<algorithm> using namespace std; int main(){ int a[3]; for(int i=0;i<3;++i){ cin>>a[i]; } sort(a,a+3); if(!(a[0]+a[1]<a[2]||a[0]<a[2]-a[1])){ if(sqrt(a[0])+sqrt(a[1])==sqrt(a[2])){ cout<<"yes"<<endl; return 0; ...
#include <iostream> #include <map> #include <string> #include "timer.h" #ifndef NTIMER namespace timer { bool Timer::enabled = false; std::ostream *Timer::out = &std::cout; std::map<std::string, Timer> Timer::_timers; } // namespace timer #endif
#include <stdio.h> #include <windows.h> double time_measure(int mode) { static double PCFreq = 0.0; static __int64 CounterStart = 0; if (mode == 1) // start { LARGE_INTEGER li; if (!QueryPerformanceFrequency(&li)) printf("QueryPerformanceFrequency failed!\n"); PCFreq = double(li.QuadPart) / 1000.0; Q...
#include <Servo.h> const int TrigPinFront = 10; const int EchoPinFront = 9; const int TrigPinBack = 11; const int EchoPinBack = 12; const int SteerPin = 6; const int WheelPin = 7; const int LEDFront = 5; const int LEDBack = 4; int directio = 90; int speeds = 90; Servo Steer; Servo Wheel; bool error = false; int reading...
// Copyright (c) 2012-2017 The Cryptonote developers // Copyright (c) 2018-2023 Conceal Network & Conceal Devs // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <cstddef> #include <cstring> #include <fstream> #include...
int solution(vector<int> &A, vector<int> &B, vector<int> &C) { // write your code in C++14 (g++ 6.2.0) int N = A.size(); int M = C.size(); int beg = 1; int end = M; // M=5, N=4 int answer = -1; while (beg <= end){ int mid = (beg + end) / 2; // 2 vector<int> prefix...
// Byte order, big-endian, little-endian #include <cstdint> #include <iomanip> #include <iostream> #include <vector> using ::std::cout; using ::std::endl; using ::std::hex; union Int_bytes { int32_t value; uint8_t bytes[sizeof(int32_t)]; }; int main() { const int32_t test_value{0x01020304}; // #1 ...
#ifndef UISHADER_H #define UISHADER_H #include "abstractshader.h" class UiShader : public AbstractShader { public: UiShader(const std::string &vertexFile = "ui.vert", const std::string &fragmentFile = "ui.frag"); void loadProjectionMatrix(const Matrix4 &matrix); protected: void getUniforms(...
#ifndef __UTILS_H__ #define __UTILS_H__ #include "types.h" #include <string> extern "C" void bindTriangles(float* dev_triangle_p, unsigned int num_triangles); extern "C" void RayTraceImage(unsigned int*, int, int, int, float3, float3, float3, float3, float3, float3, float3, float3); ...
#include <math.h> #include "pageLib.h" int BYTE_OFFSET = 1 + sizeof(int); /** * Initializes a page using the given slot size */ void init_fixed_len_page(Page *page, int page_size, int slot_size) { page->data = (void *)malloc(page_size); page->page_size = page_size; page->slot_size = slot_size; int slot_bytes = s...
#ifndef ORDERS_H #define ORDERS_H #include "Order.h" class Orders { public: enum Priority { ATTACK, ECONOMY }; private: std::vector<Order> attack_orders; std::vector<Order> build_orders; Priority priority; public: Orders(); ~Orders(); const std::vector<Order> GetAttackOrders() { ...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "10976" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) int main(int argc, char const *argv[]) { #ifdef DBG freopen("uva" PROBLEM TESTC ".in", "r", stdin); freopen("uva" PROBLEM ".out", "w", stdout); #endif int number;...
/**************************************************************************** Copyright (C) 2002-2014 Gilles Debunne. All rights reserved. This file is part of the QGLViewer library version 2.6.3. http://www.libqglviewer.com - contact@libqglviewer.com This file may be used under the terms of the GNU General Pub...
#include "ovos.h" ovos::ovos() { type = "Tomato"; kol = 1; gmo = false; price = 10; } ovos::ovos(string str, double dob, bool boo, double doo, double shelf_lif) { type = str; kol = dob; gmo = boo; price = doo; shelf_life = shelf_lif; } void ovos::set_smth(bool boo) { gmo = boo; } bool ovos::g...
//模板题,不再赘述 //此题注意,先求所有路径的权值总和, //然后将总权值减去 最小生成树求得的路径值相减 #include<cstdio> #include<algorithm> using namespace std; struct baka9 { int x,y,w;//分存每一条边前,后坐标与权值 }a[10100]; int num;//存边的数量 int pre[150];//存并查集中的祖先 int n,m; int tot,ans; bool cmp(baka9 aa,baka9 bb)//结构体sort排序必须自定义排序函数 { return aa.w<bb.w; ...
#include <algorithm> #include <fstream> #include <iostream> #include <sstream> #include <iomanip> #include <writefile.h> Matlab::WriteFile::WriteFile(const std::string& filename, bool save) : fileName_(filename.c_str()) , save_(save) { } Matlab::WriteFile::~WriteF...
// Created by: NW,JPB,CAL // Copyright (c) 1991-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 Lesser General Public License...
// // PooledSessionImpl.h // // $Id: //poco/Main/Data/include/_Db/PooledSessionImpl.h#3 $ // // Library: Data // Package: SessionPooling // Module: PooledSessionImpl // // Definition of the PooledSessionImpl class. // // Copyright (c) 2006, Applied Informatics Software Engineering GmbH. // and Contributors. // // SPDX...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2010 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #include "core/pch.h" #ifdef DAPI_JIL_FILESYSTEM_SUPPORT #incl...
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno. // WARNING: Changes might be lost if you edit this file directly. #include <_root.app18_accessor_app18_Button_BackgroundColor.h> #include <app18.Button.h> #include <Uno.Bool.h> #include <Uno.Float4.h> #include <Uno.Object.h>...