text stringlengths 8 6.88M |
|---|
#include<cstdio>
#include<algorithm>
#include<map>
#include<set>
using namespace std;
const int MAX_N = 100000;
int P;
int a[MAX_N];
void solve(){
set<int> all;
for (int i=0; i < P; i++){
all.insert(a[i]);
}
int n= all.size();
int s=0, t=0, num=0;
map<int, int> count;
int res = P;
for(;;){
wh... |
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
int main(int argc, char **argv)
{
if (argc != 2) {
return 0;
}
std::ifstream f(argv[1]); // first argument is the test file
while (true) {
std::string line;
std::getline(f, line);
if (f.fail()) ... |
#include<iostream>
#include<unordered_map>
#include<string>
using namespace std;
const int LM = (int)(1e6) + 3;
int k;
char str[LM];
int cnt[4];
struct Data {
int a, c, g, t;
};
struct myHash {
size_t operator()(const Data &d) const{
return d.a * (1000) * (1000) * (1000) + d.c * (1000) * (1000) + d.g * (1000) +... |
#if (stratos == 0)
void AIN()
{
for( channel = 0; channel < 8; channel++) /// per ognuno degli 8 channels del multiplexer vado poi a leggere tutti gli ingressi analogici (cioè l'uscita di ogni plexer)
{
#if (LED_rings == 1)
LED_rings_ ();
shifter.write();
#endif
#i... |
#include<iostream>
#include<string>
using namespace std;
class kolejka
{
private:
int pojemnosc;
int pocz;
int ile;
string *Q;
public:
kolejka(int x);
kolejka();
kolejka(const kolejka &queue);
kolejka(kolejka &&source);
kolejka(initializer_list<string>H);
~kolejka();
void wloz(string w);
s... |
#include "OneWire.h"
#include <SoftwareSerial.h> //"soft" serial port to prevent display corruption during upload
#define SensorPin A1 //pH meter Analog output to Arduino Analog Input 0
#define Offset 2.67 //deviation compensation
#define LED 12
#define samplingInterval 20
#define printInterval ... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.Security.ExchangeActiveSyncProvisioning.2.h"
WINRT_EXPORT namespace winrt {
namespace Windows::Security::ExchangeActiveSyncProvisioning {
struct WINRT_EBO EasClientDeviceIn... |
void setup() {
Serial.begin(9600);
pinMode(SEC_PIN, INPUT_PULLUP);
pinMode(RLS_PIN, OUTPUT);
//-----UDP-----
Ethernet.begin(mac, section);
Udp.begin(localPort);
//-----Leds-----
LED.begin();
//-----Boutons-----
pinMode(BTN_0, INPUT_PULLUP);
pinMode(BTN_1, INPUT_PULLUP);
pinM... |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll INF = (ll)(2e18);
struct LCASparse {
vector<vector<pair<int, int> > > dp;
vector<int> twos_power;
explicit LCASparse(vector<pair<int, int> > &a) {
size_t x = a.size() + 5;
twos_power.resize(x + 2);
for (si... |
//
// Created by zanbo on 2020/3/5.
//
#include <vector>
#include <stdlib.h>
#include <iostream>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <stdio.h>
using namespace std;
struct ListNode
{
int val;
ListNode* next;
ListNode(int x):... |
//
// Copyright (c) 2003--2009
// Toon Knapen, Karl Meerbergen, Kresimir Fresl,
// Thomas Klimpel and Rutger ter Borg
//
// 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)
//
// THIS FILE IS AUTOMATICALLY GENERATED
... |
//
// Copyright Toon Knapen, Karl Meerbergen
//
// 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 <jflib/linalg/lapack/ublas.hpp>
//#include <jflib/linalg/lapack/eigen.hpp>
#include <jflib... |
// { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
vector<int> kLargest(int arr[], int n, int k)
{
priority_queue<int,vector<int>,greater<int>> min_heap;
for(int i=0;i<n;i++){
if(i<k)
min_heap.push(arr[i]);
else if(arr[i]>min... |
#include <ESP8266WebServer.h>
#define SSID "FABLABKAMAKURA2_guest"
#define PASS "kamakura_1192"
#define LED_A 12
#define LED_B 13
ESP8266WebServer server(80);
char* html = "<!DOCTYPE html>\
<head>\
<meta charset='UTF-8'>\
<meta name='viewport' content='width=device-width'>\
</head>\
<body>\
<h1><a href='/both... |
#include "GPUOCLLayer.h"
#include "cl_scan_gpu.h"
void GPUOCLLayer::waitIfDebug(const char* file, int line) const
{
#ifdef _DEBUG
cl_int cErr = clFinish(m_globals.cmdQueue);
if (cErr != CL_SUCCESS)
{
const char* err = getOpenCLErrorString(cErr);
RUN_TIME_ERROR_AT(err, file, line);
}
#endif
}
void GPUO... |
/*
* 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.
*
*/
#ifndef FLUX_PROCESS_H
#define FLUX_PROCESS_H
#include <sys/types.h> // pid_t
#include <flux/Exception>
#include <flux/SignalSet>
#include <flux/String>
#include <f... |
/*
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... |
#include<stdio.h>
#include<stdlib.h>
int bubble(int [],int);
int swap(int *,int *);
int printArray(int [],int);
int main(void){
int arr[]={55,2,6,12,3,1};
int n=sizeof(arr)/sizeof(arr[0]);
bubble(arr,n);
printArray(arr,n);
return 0;
}
int bubble(int arr[],int size){
int i,j;
for(i=0;i<size;i++... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#include <map>
#include <sstream>
#include <cmath>
#include <unordered_set> // 需要c++ 11才能支持
#include <unordered_map> // 需要c++ 11才能支持
using namespace std;
class Distance {
public:
int getDistance(vector... |
#include <iostream>
using namespace std;
int main() {
int arr[]={3,4,5,6,0,0,0,0,7,0,8,9};
int n=sizeof(arr)/sizeof(arr[0]);
//cout<<n<<endl;
for(int i=0;i<n;i++)
cout<<arr[i]<<"\t";
int left=0;
int right=n-1;
while(left<right){
int currentLeftElement=arr[left];
... |
/****************************************************
* RoseBin :: Binary Analysis for ROSE
* Author : tps
* Date : Sep26 07
* Decription : Visualization in DOT
****************************************************/
#ifndef __RoseBin_Graph__
#define __RoseBin_Graph__
//#include <mysql.h>
#include <stdio.h>
#inclu... |
//
// Created by Nitish Mohan Shandilya on 9/9/20.
//
// Given Student Id and the courses that he has taken
// Find the overlapping courses of two students
class Solution {
struct UserGroupNotFoundException : exception {
const char* what() noexcept {
return "Bad Input passed";
}
}... |
/*
* FStream.h
*
* Created on: May 21, 2012
* Author: marchi
*/
#ifndef FSTREAM_H_
#define FSTREAM_H_
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <string>
using std::string;
using std::ios;
using std::ifstream;
using std::cout;
using std::endl;
#de... |
/**
* Regular expression matcher.
* Based on the work of Russ Cox: https://swtch.com/~rsc/regexp/regexp1.html
*
* Implements a Thompson NFA based RegEx matcher.
* Ken Thompson, “Regular expression search algorithm,” Communications of the
* ACM 11(6) (June 1968), pp. 419–422. http://doi.acm.org/10.1145/363347.3633... |
#pragma once
#ifndef HTTPDISPATCHERFACTORY_H
#define HTTPDISPATCHERFACTORY_H
#include "IHTTPDispatcher.h"
#include "CURLDispatcher.h"
//Why this factory method? Although now it only returns an instance of the CURLDispatcher class, when in a typical factory there's at least some choices as to what instance to return, ... |
#ifndef __SHOWEVENTSAPP_HPP
#define __SHOWEVENTSAPP_HPP
#include <vector>
#include <TApplication.h>
#include <TCanvas.h>
#include <TPad.h>
#include <TPaveText.h>
#include <TH1I.h>
#include "AxialShiftHook.hpp"
class AxialShiftApp: public TApplication
{
private:
TCanvas* main_canvas;
TPad* hist_pad;
TPaveText* ... |
#include "ProbabilityDistribution.h"
|
#ifndef user_hpp
#define user_hpp
#include "tstring.hpp"
using namespace std;
class user {
private:
tstring<20> name;
tstring<30> id;
tstring<30> pwd;
int purview = 0;
public:
void setName(const tstring<20> &_name) {
name = _name;
}
void setId(const tstring<30> &_id) {
id = _id;
}
void setPwd(const t... |
/***********************************************************************
created: Sun, 6th April 2014
author: Lukas E Meindl
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 20... |
#ifndef _H_GRID_
#define _H_GRID_
#include <list>
#include <vector>
class grid
{
public:
grid(int size, double resolution);
~grid();
void add_obstacle(double x, double y);
std::list<std::pair<double, double> > make_path(double x, double y, double px, double py) const;
private:
bool has_obstac... |
//------------------------------------------------------------------------------
// STKEphemerisFile
//------------------------------------------------------------------------------
// GMAT: General Mission Analysis Tool
//
// Copyright (c) 2002 - 2015 United States Government as repres... |
#include "../include/homogeneous_matrix.h"
#include <math.h> /* sin, cos, abs */
#include <array>
#include <cassert> // assert
#include <cmath> // std::abs
#include <iostream>
#include <limits> // std::numeric_limits, std::epsilon
#include <ostream>
RotationMatrix::RotationMatrix() {
m_matrix[0] = {1.0, 0.0, ... |
#include "util.h"
#include "Poco.h"
void D_TRANSFORMATIONSETTING::Jsonize(JsonIO & json)
{
json
("ID",data.ID )
("USERID",data.USERID)
("TRANSFORMTYPE",data.TRANSFORMTYPE)
("DELETEDORIGINALFILE",data.DELETEDORIGINALFILE)
("PROCCESSORDER",data.PROCCESSORDER)
;
}
D_TRANSFORMATIONSETTING D_TRANSFORMATIONSETTING:... |
//
// designConstants.cpp
// Nexus
//
// Created by Nick potts on 1/27/18.
// Copyright © 2018 Matthew Foote. All rights reserved.
//
/*
For labels at the top of a VC describing the VC make it this
FONT: System bold 20 point
Height: 40
WIDTH: Width of the safe area
ERROR LABELS:
TEXT COLOR: RED
HEIGHT: ... |
//h
#include "tic_tac_toe.h"
#include <fstream>
#include <string>
#include <vector>
#ifndef TIC_TAC_TOE_DATA_H
#define TIC_TAC_TOE_DATA_H
using std::vector;
class TicTacToeData
{
public:
void save_games(const std::vector<std::unique_ptr<TicTacToe>>& games);
std::vector<std::unique_ptr<TicTacToe>> get_games... |
//
// Created by engineer on 2020/5/7.
//
#ifndef PROJ_ANDROID_ACTOR_H
#define PROJ_ANDROID_ACTOR_H
#include "cocos2d.h"
USING_NS_CC;
class GlobalEnv {
public:
static void load();
};
class Actor {
public:
// Actor();
virtual void init() = 0;
virtual void collide(cocos2d::Rect &rect);
virtual c... |
//@@author A0112218W
#pragma once
#include "Command.h"
//Feedback message for different add operation result
const std::string MESSAGE_ADD_SUCCESS = "\"%s\" have been added succesfully.\nStart Date Time: %s\nEnd Date Time: %s";
const std::string MESSAGE_ADD_EMPTY = "Task text cannot be empty. New task is not added.";... |
//MouseActionCreator.cpp
#include "MouseActionCreator.h"
MouseActionCreator::MouseActionCreator() {
}
MouseActionCreator::MouseActionCreator(const MouseActionCreator& source) {
}
MouseActionCreator::~MouseActionCreator() {
}
MouseActionCreator& MouseActionCreator::operator=(const MouseActionCreator& source) {
... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int edges;
cin>>edges;
//int src;
//cin>>src;
int arr[n];
int adj[n][n];
for(int i=0;i<n;i++)
{
arr[i]=0;
for(int j=0;j<n;j++)
{
adj[i][j]=0;
}
... |
class Global_Clock
{
int counter;
};
|
#include <Windows.h>
#include <iostream>
using namespace std;
namespace thread_mutex
{
int tickets=100;
HANDLE mutex;//会记录拥有者的线程ID 和 拥有次数
DWORD WINAPI threadFunc1(LPVOID lpParam)//函数形式
{
while(TRUE)
{
WaitForSingleObject(mutex,INFINITE);//一直等待到可用,对Mutex,已经是拥有者线程,可以多次调用,计数器加1,
//如果没有ReleaseMutex线程退出,操作系统会... |
#include "Student.hpp"
#include <fstream>
#include <cstdlib>
int main()
{
Student *S=new Student[11];
ifstream F("Studenti.txt");
for(int i=0;i<11;i++)
F>>S[i];
cout<<"Datele pentru fiecare student:\n\n";
for(int i=0;i<11;i++)
cout<<S[i]<<endl;
Student St;
c... |
/* File: primes.cpp
* Name: Paulo Lemus
* Date: 1/26/2017
*/
/* This program will promp user for input, and then find all primes between
* 2 and n.
*
* USE SIEVE OF ERATOSTHENES
* * FINISHED
*/
#include <cmath>
#include <iostream>
using namespace std;
// Function that ensures the input is valid
void getInp... |
#ifndef FUZZYCORE_ENUMS_HPP
#define FUZZYCORE_ENUMS_HPP
enum InputTermTypes {
TRIANGLE = 1, TRAPEZOID = 2, GAUSSIAN = 3
};
enum OutputTermTypes {
CONSTANT = 1, LINEAR = 2
};
#endif
|
// app.cpp - application base class
// (c) 2020 Michael Fink
// https://github.com/vividos/OldStuff/
// This file contains reconstructed classes from lost source files that
// couldn't be recovered.
#include "app.h"
#include "keyboard.h"
app::app()
{
ende = false;
}
void app::init()
{
// nothing to do
}
void ap... |
#ifndef FRIENDWIDGETITEM_H
#define FRIENDWIDGETITEM_H
#include <QListWidgetItem>
#include "Widget_Name_Mood.h"
#include "Struct/PersonalInfoStruct.h"
#include "CompleteLineEdit.h"
class FriendInfoDetailDialog;
class FriendWidgetItem:public QListWidgetItem
{
public:
explicit FriendWidgetItem(PersonalInfoStruct &info... |
/*
(6 kyu)
Date: 1/15/20
Objective: Create a "tribonacci" sequence, like fibonacci but instead of the previous 2 integers sums its the previous 3
*/
std::vector<int> tribonacci(std::vector<int> signature, int n){
std::vector<int> result;
int z =0;
std::cout<<n<<std::endl;
for(int i = 0; i < (signature.... |
#pragma once
#include <cassert>
#include <vector>
#include <limits>
#include "../../hlt/location.hpp"
class Path
{
public:
std::vector<hlt::Location> waypoints;
std::size_t length;
Path ()
: waypoints()
, length(0)
{ }
public:
void add (hlt::Location const location)
... |
class Solution {
public:
int divide(int dividend, int divisor) {
if(divisor == 0 || (dividend == INT_MIN && divisor == -1))
return INT_MAX;
int sign = (dividend < 0 && divisor < 0) || (dividend > 0 && divisor > 0)? 1 : -1;
long long did = labs(dividend), div = labs(divisor);
... |
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
bool dfs(
const std::vector < std::vector < int > >&g,
int src, int dest,
int x)
{
visited[x] = true;
if (x == dest)
return true;
bool visit = false;
for (const auto &next: g[x]){
if (!visi... |
template <int b>
int sigP(double Ps)
{
return Ps>b ? 1 : -1;
}
class NOperators;
class TBath{
public:
int ifl,bind;
TBath(int ifl_=-1, int bind_=0): ifl(ifl_), bind(bind_) {}
};
class Njj{
public:
function2D<double> M;
int istate, i_m_state;
int ifl1, ifl2, ii;
};
class ClusterData{
function2D<int> F... |
#ifndef GUN_H_INCLUDED
#define GUN_H_INCLUDED
#include "rendering/renderlist.h"
#include "bullet.h"
#include <memory>
#include <gameobjects/gameobject.h>
class Gun : public GameObject{
public:
void render(RenderList& list) const;
void render_aim(RenderList& list, double gun_angle) const;
void update() {}... |
#pragma once
#include "MacroHelper.h"
class CRTTI{
public:
CRTTI( const char* name, const CRTTI& parent ) : m_name(name), m_parent(parent) {}
const char* GetType(){
return m_name;
}
private:
const char* m_name;
const CRTTI& m_parent;
};
#define DEFINE_RTTI(CLASS_NAME) \
public:\
static ... |
#include "WindowX.hpp"
#include "Logger.hpp"
#include "Utility.hpp"
#include "IJob.hpp"
namespace engine
{
enum Events
{
WM_SHUTDOWN,
WM_WAKE_UP
};
WindowX::WindowX()
: m_initialized(false)
, m_fullscreen(false)
, m_show(false)
, m_terminal(false)
... |
#include "Background.h"
Background::Background(sf::Texture* background_texture, sf::Texture* overlay_texture,
sf::Texture* inactive_overlay_texture)
{
setUpBody(background_body, background_texture, sf::Vector2f(settings.window_size.x, settings.window_size.y),
sf::Vector2f(0.0f, 0.0f)... |
//
// SelectorGroup.hpp
// DDCSSParser
//
// Created by 1m0nster on 2018/8/7.
// Copyright © 2018 1m0nster. All rights reserved.
//
#ifndef SelectorGroup_hpp
#define SelectorGroup_hpp
#include <stdio.h>
#include <iostream>
#include <list>
#include "Selector.hpp"
namespace future {
class GroupSelector: public... |
//
// Created by Peter Eichinger on 04.10.18.
//
#pragma once
#include <cmath>
#include <vulkan/vulkan.hpp>
vk::DeviceSize nextPowerOfTwo(vk::DeviceSize value) {
return static_cast<vk::DeviceSize>(std::pow(2, std::ceil(std::log2(value))));
} |
#pragma once
/* Disable Screen Shake
* PATCHES: Renderer2.dll
*/
#include "../Main.h"
#include "../Singleton.h"
#include "GenericPatcher.h"
class CPatcher_DisableScreenShake : public IGenericPatcher {
public:
CPatcher_DisableScreenShake();
bool ReadINI(void);
bool WriteINI(void);
private:
// Hook functions
/... |
#include <cstdio>
#include <cstdlib>
#include <cmath>
#define MAXSIZE 1000
typedef struct Node {
int val;
Node *left, *right;
}Node, *Tree;
int compare (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}
Tree CreateTreeBST(int a[], int start, int end); // 创建完全二叉查找树
int FindRoot(int start, int ... |
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// #define DEBUG
const int maxn = 20;
int n, cnt[maxn] = { 0 }, ans = 0;
string word[maxn];
char startChar;
struct Candidate {
int idx, len;
Candidate() {}
Candidate(int _idx, int _len)
... |
#ifndef _token_h__
#define _token_h__
#include <string>
class Tokenizer {
public:
Tokenizer();
double evaluate(std::string parsee) const;
};
#endif // ifndef _token_h__
|
#pragma once
#include <iostream>
//Main Shape class
class DrawShape {
public:
DrawShape();
private:
std::string shape_type;
int shape_count;
int shape_height;
int shape_length;
int shape_radius;
public:
DrawShape(const std::string, const int, const int, const int, const int);
~DrawShape();
std::string get_sha... |
/******************************************************************************
* Copyright (c) 2018, Xilinx, Inc.
* 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. Redistribut... |
class Solution {
public:
int nthUglyNumber(int n) {
// 三个指针
int a = 0;
int b = 0;
int c = 0;
vector<int> dp;
dp.push_back(1);
if(n == 1) return 1;
n--;
int min_num;
while(n)
{
min_num = min(dp[b]*3,dp[a]*2);
... |
#include "widget.h"
#include "gridreport.h"
#include <QtGui/QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
widget *w=new widget;
QTextCodec::setCodecForTr( QTextCodec::codecForName("GBK") );
w->resize(820,850);
w->show();
return a.exec();
}
|
// 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::Media::Devices::Core {
struct ICameraIntrinsics;
struct ICameraIntrinsics2;
struct ICameraIntrinsicsFactory;
struct IDepthCorrelatedCoo... |
#include "TriMesh.h"
#include "meshFIM.h"
#include "math.h"
#include "tinyxml.h"
#include <iostream>
#include <sstream>
#include <string>
#include "vnl/vnl_vector.h"
#define _USE_MATH_DEFINES
int main(int argc, char *argv[])
{
if(argc != 2)
{
std::cout << "-------------------------------" << std::endl... |
#include <iostream>
#include "Menu.h"
using namespace std;
Menu::Menu()
{
selection = 0;
}
void Menu::displayMainMenu()
{
cout << "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n";
cout << "@ @\n";
cout << "@ T E X T E X P L O R E R @\n";
cout << "@ ... |
#include "plot/HistogramFactories.h"
#include "base/std_ext/string.h"
#include "TMath.h"
#include "TDirectory.h"
#include "TTree.h"
#include "TH1D.h"
#include "TH2D.h"
#include "TH3D.h"
#include <iomanip>
using namespace ant;
using namespace ant::analysis;
using namespace ant::std_ext;
using namespace std;
void H... |
#include "Fixed.hpp"
Fixed::Fixed(void) {
std::cout << "Default constructor called" << std::endl;
this->_fpValue = 0;
return;
}
Fixed::~Fixed(void) {
std::cout << "Destructor called" << std::endl;
return;
}
Fixed::Fixed(Fixed& cop) {
std::cout << "Copy constructor called" << std::endl;
*t... |
//
// main.cpp
// hw6
//
// Created by Christopher Chandler on 3/21/16.
// Copyright © 2016 Christopher Chandler. All rights reserved.
//
#include <iostream>
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream> // string streams
#include <stdlib.h> /* atoi */
using namespace std;
//std... |
/*
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... |
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include<cmath>
using namespace std;
/* 对比计算二叉树的深度 */
class Solution {
public:
int helper(TreeNode* r){
if(r == NULL) return 0;
int left = helper(r->left);
int right = helper(r->right);
if(left == -1 || righ... |
#include "Spool.h"
#include "Bullet.h"
void ABullet::OnProjectileHit(class AActor * OtherActor, UPrimitiveComponent * OtherComp, FVector NormalImpulse, const FHitResult & Hit)
{
if (Hit.GetActor())
{
FDamageEvent DamageEvent;
Hit.Actor->TakeDamage(BaseDamage, DamageEvent, GetInstigatorController(), this);
}
D... |
#include "sound.h"
SoundSystem::SoundSystem()
{
m_DirectSound = NULL;
m_PrimaryBuffer = NULL;
m_SecondaryBuffer1 = NULL;
}
SoundSystem::SoundSystem(const SoundSystem& other)
{
}
SoundSystem::~SoundSystem()
{
}
bool SoundSystem::Initialize(HWND window)
{
bool result = InitializeDirectSound(window);
if (!res... |
#include <gtest/gtest.h>
#include <ostream>
#include <istream>
#include <sstream>
#include <vector>
#include <elements/element.h>
#include <elements/simple_text_element.h>
TEST(sample_test_case, sample_test)
{
EXPECT_EQ(1, 1);
}
TEST(simple_text_element, can_add_tags)
{
const std::vector<core::UID> tag_ids {... |
#include <limits.h>
#include <iostream>
#include <ctime>
#include "data_region_2d_bare_base.h"
#include "gtest/gtest.h"
using namespace std;
const int kRowCount = 32;
const int kColCount = 1024*1024;
const int kRepetition = 10;
void Setup2DArray(DataRegion2DBareBase<float> ®ion2d_obj){
for(int i=0; i<kRowCount;... |
//Jason Strange
//CS222-01-13W
//This is the header file for my node object.
#ifndef _NODE_
#define _NODE_
#include <string>
#include <cstdio>
#include <cstdlib>
#include "Comparable.h"
#include "Item.h"
#include "DRT.h"
#include "TitleKey.h"
#include "TitleData.h"
#include "BinaryDataBase.h"
using name... |
#include <bits/stdc++.h>
#define MAX 1000001
#define M 1000000007
#define ll long long
#define ld long double
#define ESP 0.0001
using namespace std;
int main() {
int t;
cin >> t;
while(t--) {
int n, k;
cin >> n >> k;
int a[n];
for (int i=0;i<n;i++) cin >> a[i];
sort(a, a+n);
int mn = INT_MAX;
for (in... |
#include "config.h"
#include "src/Common/debug.h"
#include "src/Common/config.h"
#include "src/Common/rtc.h"
#include "src/Common/radio_common.h"
#include "src/Common/accel.h"
#include "src/Common/rom.h"
#include "src/Common/command.h"
#include "src/Common/battery.h"
#include <SimbleeCOM.h>
#include "src/Common/Wire/W... |
#include <iostream>
int main()
{
int n;
std::cout << "Enter a number >";
std::cin >> n;
while ( n>0 )
{
std::cout << n << ","; --n;
}
std::cout << "(FIRE!)\n";
std::cin.get();
std::cin.get();
return 0;
} |
#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++)
bool isprime(ll n)
{
for(ll i=2; i*i<=n; i++)
{
if(n%i==0)return 0;
}
return 1;
}
int main()
{
ll m,n,i,j,k ,t;
while( ci... |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
struct data
{
string v1,v2;
int w1;
};
map<string,string>bap;
bool comp(data u,data u1)
{
return u.w1<u1.w1;
}
string bapke(string x)
{
if(bap[x]==x)return x;
return bap[x]=bapke(bap[x]);
}
int main()
{
int n,m,t;scanf("%d",&t);
... |
// exponential search
// _ ____ __ _ _ __
// (_/_(_(_(_)(__ / (_(_/_(_(_(_/__(/_/ (_
// /( .-/ .-/
// (_) (_/ (_/
#include "../_library_search_.h"
// Độ phức tạp:
// Time: O(logn) | Memory: O(1)
// Ưu điểm:
// - Phiên bản kết hợp giữa BS ... |
#ifndef FASTCG_OPENGL_TEXTURE_H
#define FASTCG_OPENGL_TEXTURE_H
#ifdef FASTCG_OPENGL
#include <FastCG/Graphics/OpenGL/OpenGL.h>
#include <FastCG/Graphics/BaseTexture.h>
namespace FastCG
{
class OpenGLGraphicsSystem;
class OpenGLTexture : public BaseTexture
{
public:
inline operator GLuint() ... |
//string::npos作为find函数失配后的返回值
#include<iostream>
#include<string>
using namespace std;
int main()
{
if(string::npos==-1)
cout<<"-1 is string::npos"<<endl;
if(string::npos==4294967295)//看编译器警告提示
cout<<"4294967295 is also string::npos"<<endl;
return 0;
}
|
#pragma once
#include "Ms2ScanWithSpecificMass.h"
namespace EngineLayer
{
class ScanWithIndexAndNotchInfo
{
public:
Ms2ScanWithSpecificMass *TheScan;
int Notch = 0;
int ScanIndex = 0;
virtual ~ScanWithIndexAndNotchInfo()
{
//delete TheScan;
... |
//
// Created by nickolay on 20.02.2021.
//
#include "Settings.h"
|
#ifndef TURTLENODEEDITOR_H
#define TURTLENODEEDITOR_H
#include <QLineEdit>
#include <QTableView>
#include <QWidget>
#include <Presenter/Elements/Nodes/TurtleNodePresenter.h>
constexpr float FU_GEN_PI = 3.14159265359;
#include <iostream>
class ProductionModel : public QAbstractTableModel
{
Q_OBJECT
//
signals:
... |
/*
* Copyright (c) 2015-2016 Kees Bakker. All rights reserved.
*
* This file is part of GPRSbee.
*
* GPRSbee is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, o... |
/*********************************************************************
Matt Marchant 2014 - 2016
http://trederia.blogspot.com
xygine - 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 this soft... |
#ifndef __MODULE_IMPORT_MESH_H__
#define __MODULE_IMPORT_MESH_H__
#include "Module.h"
#include <vector>
class ResourceMesh;
struct aiMesh;
class ModuleImportMesh : public Module
{
public:
ModuleImportMesh(const char * name);
ResourceMesh * ImportAssimpMesh(aiMesh *assimp_mesh, UID uid, std::vector<UID> & bones_ui... |
//
// Created by Josh on 4/25/2020.
//
#ifndef FINALPROJECT_PROJECTILE_H
#define FINALPROJECT_PROJECTILE_H
#include "location.h"
namespace space_invader {
class Projectile {
public:
explicit Projectile(const Location& location);
Location GetLocation() const;
Location SetLocation(const Location&);
... |
#ifndef Lista_Index_Indexada_Mia2
#define Lista_Index_Indexada_Mia2
#include <iostream>
class Lista_Index{
private:
struct Celda{
Celda(int);
Celda * siguiente;
~Celda();
int elemento;
};
int contador;
int primerIndex;
in... |
#pragma once
#include "Module.h"
#include "Globals.h"
#include "Box2D/Box2D/Box2D.h"
#include "p2Point.h"
#define GRAVITY_X 0.0f
#define GRAVITY_Y -7.0f
#define PIXELS_PER_METER 50.0f // if touched change METER_PER_PIXEL too
#define METER_PER_PIXEL 0.02f // this is 1 / PIXELS_PER_METER !
#define METERS_TO_PIXELS(m) ... |
#pragma once
#include <ft2build.h>
#include FT_FREETYPE_H
#include <iostream>
#include <cmath>
using namespace std;
typedef struct {
unsigned char* buffer;
unsigned int width;
unsigned int height;
float bearing_x;
float bearing_y;
} Glyph;
class FreeTypeLib {
public:
FreeTypeLib();
~FreeTypeLib();
FT_Face... |
// ==============================================================
// RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and OpenCL
// Version: 2019.2
// Copyright (C) 1986-2019 Xilinx, Inc. All Rights Reserved.
//
// ===========================================================
#ifndef _checkAxis_1_HH_
... |
/*
* SPDX-FileCopyrightText: (C) 2017 Daniel Nicoletti <dantti12@gmail.com>
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef EVENTDISPATCHER_EPOLL_H
#define EVENTDISPATCHER_EPOLL_H
#include <QtCore/QAbstractEventDispatcher>
class EventDispatcherEPollPrivate;
#if defined(cutelyst_qt_eventloop_epoll_EXPORTS)
# ... |
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
namespace p1 {
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int,int> m;
vector<int> res;
for (int i = 0; i < nums.size(); ++i) {
... |
#include "spool_helper.h"
void show_file(result_map::iterator it, uid_t p_runner){
sHelper sHelp;
std::string id = sHelp.extract_number(it->second.filename().string());
std::string time = sHelp.format_time(TIME_FORMAT, it->first);
sHelp.restore_priv();
uid_t owner = sHelp.get_file_owner(it->seco... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.