text stringlengths 8 6.88M |
|---|
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while (t--){
int n;
cin >> n;
string arr[n + 1];
arr[0] = "";
int size = 1, def = 1;
while (size <= n){
for (int i = 0; i < def && (size + i) <= n; i++){
arr[size + i] = "1" + arr[size - def + i];
}
for (int i = 0; i <... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*
* 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 DOM_SUPP... |
#include <iostream>
#include <vector>
using namespace std;
#define int long long
#define F first
#define S second
#define P pair<int,int>
#define pb push_back
#define endl '\n'
const int N = 2e5 + 5;
vector <P> Graph[N];
vector <int> ans[N];
int day;
int n;
void dfs(int src, int par, int no) {
int temp = 0;
//cou... |
#include "IUnityInterface.h"
typedef void (*FuncPtr) (const char *);
FuncPtr Debug = 0;
extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API SetDebugFunction(FuncPtr fp) {
Debug = fp;
}
void DebugMessage(const char * message) {
if(Debug){
Debug(message);
}
}
extern "C" void DebugMessageC(const char * me... |
#ifndef LIGNE_H
#define LIGNE_H
#include <iostream>
#include "figure.h"
/**
* Classe représentation une ligne comportant les attributs particuliers :
* - x_end (Coordonnée X de l'extrémité de la ligne)
* - y_end (Coordonnée Y de l'extrémité de la ligne)
*
*/
class Ligne : virtual public Figure {
private:
... |
#ifndef wali_domains_lh_TWEIGHT_GUARD
#define wali_domains_lh_TWEIGHT_GUARD 1
/**
* @author Nicholas Kidd
*
* Wrapper around class T that implements the semiring methods of WALi. [T] must
* be LH or PhaseLH for the moment, but TWeight will support TensorLH
* when it is implemented.
*/
#include "wali/Common.hpp"... |
// InjectDll.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include "Detours.h"
#include <stdio.h>
#include <iostream>
#pragma comment(lib,"Detours.lib")
//修改MessageBoxW 的响应函数
static int (WINAPI * OLD_MessageBoxW)(HWND hWnd,LPCWSTR lpText,LPCWSTR lpCaption,UINT u... |
#pragma once
#include <memory>
#include <glm/glm.hpp>
#include <glad/glad.h>
#include <vector>
/*
Not very efficeint! Could use a lot of work
Element Buffers should also be used!
*/
class VertexArray;
class Buffer;
/*
attachments
0 - position
1 - uv
*/
std::shared_ptr<VertexArray> generateScreenQuad();
/*
at... |
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
int candy(vector<int> &ratings){
int n = ratings.size();
int a[n];
for(int i=0;i<n;i++) a[i]=1;
int res = 0;
for(int i=0;i<ratings.size()-1;i++){
if(ratings[i] < ratings[i+1])
a[i+1] = a[i] + 1;
}
for(int j=ratings.s... |
#pragma pack(1) // use this to prevent holes
#include<iostream>
#include<conio.h>
using namespace std;
class sample
{
int a;
char c; // size of char will be treated as 4 bytes and 3 bytes will get wasted leading to holes
};
int main()
{
... |
#pragma once
#include "MoveIncludes.h"
#include "Vec2.h"
#include "MoveColors.h"
namespace Move
{
struct EyeImage
{
PBYTE data;
int w,h;
EyeImage(int w, int h);
~EyeImage(void);
void setPixel(Vec2 pos, ColorRgb rgb);
ColorRgb getPixel(Vec2 pos);
void drawCircle(Vec2 center, int r... |
#include <iostream>
#include <cstdio>
#include <unordered_map>
using namespace std;
class LRUCache{
struct Node{
int val;
Node *pre;
Node *next;
Node(int x) : val(x), pre(NULL), next(NULL){}
};
int size = 0;
int num = 0;
unordered_map<int,Node> nmap;
Node head(0);
Node tail(0);
LRUC... |
/*
* MobileDevice.cpp
*
* Created on: Jun 7, 2016
* Author: g33z
*/
#include "MobileDevice.h"
MobileDevice::MobileDevice()
{
price=0;
deviceID=0;
standbytime=0;
displaysize=0;
}
MobileDevice::MobileDevice(float p,int devID,int stime,float dsize)
{
price=p;
deviceID=devID;
standbytime=stime;
display... |
/*
Given a binary tree and an integer S, print all the pair of nodes whose sum equals S.
Note:
1. Assume the given binary tree contains all unique elements.
2. In a pair, print the smaller element first. Order of different pairs doesn't matter.
Input format :
The first line of input contains data of the nodes of the tr... |
#pragma warning(disable:4996)
#include<iostream>
#include<string>
#include<time.h>
using namespace std;
void weatherCase(string weather = "sunny")
{
time_t t = time(0);
char tmp[64];
strftime(tmp, sizeof(tmp), "%Y-%m-%d %X %A ", localtime(&t));
cout << tmp << "today is weather " << weather << endl;
}
int main()
{... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2009 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#include "core/pch_system_includes.h"
#ifdef VEGA_BACKEND_OPE... |
#include<iostream>
using namespace std;
int birthdayCakeCandles(int n, int arr[])
{
int max, count=0;
for(int i=0; i<n; i++)
{
max = arr[0];
if(max < arr[i])
max = arr[i];
cout << max;
}
for(int i=0; i<n; i++)
{
// if(arr[i]==max)
... |
#include <iostream>
#include <string>
// to use ostringstream:
#include <sstream>
// to use ofstream
#include <fstream>
using namespace std;
// INSTRUCTIONS: THE FOLLOWING ARE SOME EXAMPLES USING STRING;
// L4 students are expected to go through this content applying critical thinking
// i.e. do not expect to j... |
#include<iostream>
#include<fstream>
#include<list>
#define read(x) for(i=1;i<=x;i++)
using namespace std;
ifstream fin("robotii.in");
ofstream fout("robotii.out");
//list <int> l;
struct li{
list <int> i,j;
}l;
struct st{
int x,y;
}b[10005];
int n,m,i,k,j,s,t,a[260][260],q,to=0,curr=0;
vo... |
/*
* Copyright (c) 2014-2017 Detlef Vollmann, vollmann engineering gmbh
*
* 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 GROUP_HH_SEEN_
#define GROUP_HH_SEEN_
#include "shape.hh"
#include <vector>
... |
/*
문제번호 : 13460
문제링크 : https://www.acmicpc.net/problem/13460
문제이름 : 구슬탈출2
풀이방법 : 기울이기를 고려한 BFS
*/
#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
typedef struct stINFO {
int ry;
int rx;
int by;
int bx;
int count;
}INFO;
int N, M; // 세로, 가로 변수
INFO start;
char cMap[11][11]... |
#pragma once
#include "AI.h"
int computer::get_situation()
{
int result = this->get_combination();
if (result >= kare)
{
return nice;
}
else{
if (result >= big_streit)
{
return good;
}
else
{
if (result >= set_t)
{
return normal;
}
else
{
return bad;
}
}
}
}
int compute... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2005 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef SVGEMBEDDEDSYSTEMFONT_H
#define SVGEMBEDDEDSYSTEMFONT_H
#if de... |
/*
* File: main.cpp
* Author: Elijah De Vera
* Created on January 5, 2021, 12:36 AM
* Purpose: Average of Values
*/
//System Libraries
#include <iostream> //I/O Library
using namespace std;
//User Libraries
//Global Constants
//Math, Science, Universal, Conversion, High Dimensioned Arrays
//... |
//
// Generated file, do not edit! Created by nedtool 5.1 from EtherFrame.msg.
//
#if defined(__clang__)
# pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
#ifndef __ETHERFRAME_M_H
#define __ETHERFRAME_M_H
#include <omnetpp.h>
// nedtool version check
#define MSGC_VERSION 0x0501
#if (MSGC_VERSION!=OMNET... |
/*
* Copyright 2016 Freeman Zhang <zhanggyb@gmail.com>
*
* 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 applic... |
#pragma once
namespace SecKill_2nd {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Form1 摘要
///
/// 警告: 如果更改此类的名称,则需要更改
/// ... |
#ifndef SOCKS6MSG_HH
#define SOCKS6MSG_HH
#include "socks6.h"
#include "request.hh"
#include "authreply.hh"
#include "opreply.hh"
#include "usrpasswd.hh"
#include "exceptions.hh"
#endif // SOCKS6MSG_HH
|
/*
* File: PluginLoader.h
* Author: jay
*
* Created on August 13, 2013
*/
#ifndef CLIENTPLUGINLOADER_H
#define CLIENTPLUGINLOADER_H
#include <QQmlExtensionPlugin>
class Loader
: public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "QJson.QJsonPath" )
public:
Loader();
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
*/
#ifndef QUICK_FILE_CHOOSER_EDIT_H
#define QUICK_FILE_CHOOSER_E... |
#include <bits/stdc++.h>
using namespace std;
int main(){
string strriinng;
cin >> strriinng;
long long len;
cin >> len;
long long ans = 0;
ans = len / strriinng.size() * count(strriinng) + count(strriinng.substr(0, len % strriinng.size()));
cout << ans;
return 0;
}
long long count(strin... |
#include "CPoint.h"
CPoint::CPoint(double x, double y)
{
this->x = x;
this->y = y;
}
void CPoint::SetX(double x)
{
this->x = x;
}
void CPoint::SetY(double y)
{
this->y = y;
}
double CPoint::GetX() const
{
return x;
}
double CPoint::GetY() const
{
return y;
}
bool CPoint::operator==(CPoint const& other) cons... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2007 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef SVG_ANIMATION_LOG_H
#define SVG_ANIMATION_LOG_H
#ifde... |
#include "opencvsharkitem_plugin.h"
#include "opencvsharkitem.h"
#include <qqml.h>
void OpencvSharkItemPlugin::registerTypes(const char *uri)
{
// @uri com.robosea.opencvshark
qmlRegisterType<OpencvSharkItem>(uri, 1, 0, "OpencvSharkItem");
}
|
#include "stdafx.h"
#include "server.h"
#include <vector>
#define DRI_IS_SERVER
#include "interface.h"
using namespace boost;
class MyServerPeer : public rpc::ServerPeer<Interface>
{
shared_ptr<Interface> conn;
public:
virtual void on_connected( const shared_ptr<Interface>& conn_ )
{
conn = conn_;
... |
//
// Command.h
// SAD
//
// Created by Marquez, Richard A on 4/11/15.
// Copyright (c) 2015 Richard Marquez. All rights reserved.
//
#pragma once
class Command {
public:
char code = ' ';
int argument = 0;
};
|
#pragma once
// fps
/*
장르를 뜻할때는 1인칭 슈팅 게임 (총싸움 같은거)
frame pre second 1초당 몇 프레임이 지나갔는지
게임에 대한 성능
최소 조건 30 fps
콘솔 게임 경우 그래픽 성능 높이고 최소 프레임 맞추게 됨
평균 프레임 60 fps 일반적으로 인식하는 최대 프레임이 60fps
30 fps
1초 동안 사진 연속으로 30개 보는거
60 이상 120 240은 보는건 차이 없는데 컴퓨터 성능만 많이 잡아먹는거
animation -> frame 가지고 있음
한 동작을 1초 동안 몇장으로 보여줄 껀지
*/
class Fra... |
// Copyright 2018 Benjamin Bader
//
// 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 agree... |
#ifndef HcalAlgo_DDHCalEndcapModuleAlgo_h
#define HcalAlgo_DDHCalEndcapModuleAlgo_h
#include <map>
#include <string>
#include <vector>
#include "DetectorDescription/Core/interface/DDTypes.h"
#include "DetectorDescription/Core/interface/DDAlgorithm.h"
class DDHCalEndcapModuleAlgo : public DDAlgorithm {
public:
//Con... |
#include <iostream>
#include <vector>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
int a[N];
vector<int> index[5001];
for (int i = 0; i < N; ++i) {
cin >> a[i];
index[a[i]].push_back(i);
}
int ans[N], color = 0;
for (int k = 1; k <= 5000; ++k) {
... |
byte one = B10101000;
byte two = B10101000;
byte three = B10101000;
byte four = B10101000;
byte five = B10101000;
byte six = B10101000;
byte seven = B10101000;
byte eight = B10101000;
byte cab0 = B11101111;
byte cab1 = B11111111;
byte temp = B11111111;
void setup() {
pinMode(13, OUTPUT);
Serial.begin(11520... |
#include <iostream>
using namespace std;
/*
For every window check if Cp and Ct contents are same
*/
bool areSame(int ct[],int cp[]){
for(int i=0;i<256;i++){
if(cp[i]!=ct[i])
return false;
}
return true;
}
bool anagram(char txt[], int n, char pat[], int m)
{
int ct[256] = {0};
i... |
//return number of count inversions
// count inversion: if i<j but arr[i]>arr[j]
//idea: use insertion sort
//better idea: use merge sort
#include <iostream>
using namespace std;
int merge(int arr[],int l,int m,int r){
int res=0;
int n1=m-l+1;
int n2=r-m;
int i,j,k;
int L[n1],R[n2];
for(i=0;i<n1;i++){
L... |
#ifndef ESTOQUETENIS_HPP_
#define ESTOQUETENIS_HPP_
#include "Estoque.hpp"
class EstoqueTenis: public Estoque{
public:
//Construtor
EstoqueTenis();
//Destrutor
virtual ~EstoqueTenis();
//Funçoes para manutenção do estoque.
void registraProduto(int qntd, char nome[50], float preco); //Exemplo Polimorfismo - Chec... |
/**
* @author:divyakhetan
* @date: 10/1/2019
*/
#include<bits/stdc++.h>
using namespace std;
int product(int a, int b){
if(b == 0) return 0; // base case;
int ans = product(a, b/2);
if(b % 2 == 0) return 2 * ans;
else return 2 * ans + a;
}
int main(){
int num1, num2;
cin >> num1 >> num2;
int ans = product... |
#include <bits/stdc++.h>
using namespace std;
struct node
{
map<char,int> transitions;
bool endState;
bool startState;
};
class Automaton{
protected:
private:
vector<node> graph;
vector<char> alphabet;
int position;
bool isInAlphabet(char letter)
{
for(int i=0;i<alphabet.size();i++)
{
if(letter==alph... |
#include<stdio.h>
#include<graphics.h>
#include<conio.h>
#include<dos.h>
typedef struct edge EDGE;
void PolyFill();
void CreateActiveEdgeList(int a);
int IsAActiveEdge(int a,int b);
void SortActiveEdgeList();
struct edge
{
int ymin,ymax;
float slope,xval;
}EdgeList[10],ActiveEdgeList[10];
int x[10],y[10],nedges,Act... |
#ifndef TGJ_LASER_INCLUDED
#define TGJ_LASER_INCLUDED
#include "vec2.h"
class Laser {
vec2 origin, dir;
float angle, time;
public:
Laser(vec2, float);
Laser(vec2, vec2);
void draw();
};
#endif |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "11636"
#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 table[1... |
#ifndef PROJECT_NODEWALKINFO_H
#define PROJECT_NODEWALKINFO_H
#include <vector>
#include <cmath>
#include <map>
#include <mutex>
#include <omp.h>
/*
* Class used to keep track of the times a node has been walked onto, and to calculate the standard deviation associated
* with those return times. Each instance of t... |
#pragma once
#include <map>
#include <list>
#include <vector>
#include <string>
#include <chrono>
/**
* Fonction pour chronométrer l'exécution d'une autre fonction en millisecondes.
*
* // exemple, pour mesurer l'exécution de "r = f(true, 'A', 0);" :
* auto duration = measure_milliseconds(r, f, true, 'A', 0);
**/
t... |
#include <iostream>
#include <queue>
using namespace std;
int max_num = -987987987;
int longest = 0;
int dx[] = { 0,0,+1,-1 };
int dy[] = { +1,-1.0,0 };
// BFS 우좌하상
void possi_reset(bool** possi, int map_len) {
for (int s = 0; s < map_len; s++) {
for (int t = 0; t < map_len; t++) {
possi[s][t]=false;
}
}
r... |
#include <iostream>
#include <stdlib.h>
#include <ctype.h>
using namespace std;
//void itoa(int n, char s[]);
int n;
void itoa(int n, char s[], char d[]) {
int i, j, sign;
if((sign = n) < 0) //记录符号
n = -n; //使n成为正数
i = 0;
do {
s[i++] = n % 10 + '0';//取下一个数字
}
while((n /= 10) > 0); //删除该数字
if(sign... |
#pragma once
#include <string>
#include <sqlite\sqlite3.h>
namespace IRCOptotron
{
enum CalcResponse
{
CALC_RESPONSE_OK,
CALC_RESPONSE_NOCALC,
CALC_RESPONSE_VERSIONOK,
CALC_RESPONSE_NOSEARCHMATCHES,
CALC_RESPONSE_CALCCHANGED,
CALC_RESPONSE_CALCALREADYEXISTS,
CALC_RESPONSE_NODB,
CALC_RESPONSE_DBBUSY
};
class... |
#ifndef _GUARD_UTIL_H
#define _GUARD_UTIL_H
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstddef>
#include <limits>
#include <numeric>
#include <random>
#include <vector>
/**
* @file util.h
* @brief Defines several utility functions used throughout this project.
*
* @author Timo Nicolai
*/
... |
#include "comn.h"
#ifndef CITY_STATIS
#define CITY_STATIS
class stat_result
{
public:
int avail_days;
std::vector<int> min_t, min_t_high, min_t_low,
max_t, max_t_high, max_t_low;
std::vector<int> rain_all;
std::vector<int> rain_right, rain_empty, rain_miss;
//默认降水为4个时次 最高最低各为2个时次... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
// only gravity will pull me down
// Sorting Employees
int t, n;
cin >> t;
long long s;
string e;
while (t--) {
cin >> n;
map<long long, vector<string>> mp;
for(int i=0; i<n; i++) {
cin >> e;
... |
#include <iostream>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
#include <cstring>
using namespace std;
/*ϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕ*/
//#define int long long int
#define ld long double
#define F first
#define... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "ShooterController.h"
#include "Target.h"
#include "TargetController.h"
#include "Components/StaticMeshComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "Camera/CameraComponent.h"
#include "Kismet/GameplayStatic... |
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// Примеры строк, работы с ними, а так же элементарная арифметика
// V 1.0
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
#include<iostream>
#include<unistd.h>
using namespace std;
int main() {
cout <<... |
/***********************************************/
/*************** IPv6 Client ******************/
/***********************************************/
#include "winsock2.h"
#include "iostream.h"
#include "ws2tcpip.h"
#include "tpipv6.h"
#pragma comment(lib,"WS2_32.lib")
#include <stdlib.h>
#include <stdio.h>
#include... |
#ifndef GNANIMATIONKEY_H
#define GNANIMATIONKEY_H
#include "GnAnimationKeyMacro.h"
class GnAnimationKey : public GnMemoryObject
{
GnDeclareRootAnimationStream;
public:
enum eKeyType
{
TEGIDKEY,
MAX_KEYTYPE
};
typedef GnAnimationKey* (*LoadFunction)(GnStream*, guint32);
typedef void... |
class Blinker{
private:
const int _pin; // output pin
const unsigned long _interval; // blink interval in ms
int _state; // current state (either HIGH OR LOW)
unsigned long _lastToggledTimestamp; // last state toggle in ms
public:
// Constructor
Blink... |
#include "soldier.h"
#include "gamemanager.h"
Soldier::Soldier(XY pos, Team *team, GameManager *game) :
Shooter(pos, XY(50,50), 50, 0.5, 50, team, game)
{
_weapon = new Weapon(1, 200, this, _gun_pos, _game);
}
|
// Fill out your copyright notice in the Description page of Project Settings.
#include "TankAIController.h"
#include "Runtime/Engine/Classes/Kismet/GameplayStatics.h"
#include "TankAimingComponent.h"
// Called when the game starts or when spawned
void ATankAIController::BeginPlay()
{
Super::BeginPlay();
// Get in... |
#include <iostream>
#include "vecc.h"
int main()
{
vector<int> v(6);
v[0] = 12;
v[1] = 2;
v.push_back(10);
for(int i = 3; i <7;++i)
v.push_back(i);
for (int i=0; i<v.size(); ++i)
std::cout << "v[" << i << "]=" << v.get(i) << std::endl;
vector<double> v1(5) ;
for (int i=0;... |
#pragma once
#include <iberbar/Utility/Platform.h>
namespace iberbar
{
template < typename T >
class __iberbarUtilityApi__ TListStack
{
private:
struct Node
{
Node* prev;
T data;
};
public:
TListStack( void )
: m_pTop( nullptr )
, m_size( 0 )
{
}
TListStack( const TListStack& stack ... |
#include "LimServo.h"
LimServo::LimServo(PinName pin) : Servo(pin) {
m_range = DEFAULT_RANGE;
m_pos = 0;
m_max_pulse_ms = DEFAULT_MAX;
m_min_pulse_ms = DEFAULT_MIN;
// INIT PWM DEFAULT
m_pwm.period_us(PERIOD * 1000);
}
LimServo::LimServo(PinName pin, float range) : LimServo(pin) {
m_range = range;
}... |
#include "il2cpp-config.h"
#include "class-internals.h"
#include "codegen/il2cpp-codegen.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.TextEditor/DblClickSnapping
#include "UnityEngine_U... |
#pragma once
#include "common/event.h"
namespace eXistenZ
{
enum ButtonState
{
BS_PRESSED,
BS_RELEASED,
};
struct KeyEventArgs : eventargs
{
int key;
ButtonState state;
unsigned int flags;
KeyEventArgs(int key, ButtonState state, unsigned int flags) : key(key), state(state), flags(... |
//
// Created by ismael on 11/20/2016.
//
#include "Card.h"
const int SIZE = 7;
// 0 1 2 3 4 5 6
string Card::keyEffects[SIZE] = {"Taunt", "Divine Shield", "Battlecry", "Gain", "Summon", "Windfury", "Spell"};
// ... |
#include "accumulator.h"
#include <sstream>
void Accumulator::add(double value)
{
_sum += value;
}
double Accumulator::sum() const
{
return _sum;
}
void Accumulator::reset()
{
_sum = 0;
}
|
#include<bits/stdc++.h>
using namespace std;
class Math{
private:
int number;
public:
Math(int number){
this -> number = number;
}
Math operator+(Math const &m2) const{
int sum = this -> number + m2.number;
return sum;
}
Math operator*(Math const &m2) const{
int product = this -> number * m... |
//======================================================================
// Name: Game_Engine.h
// Author: Will Blades
// Function: Class storing the SDL video mechanics of the game. The game
// main loop is implemented here, thus all the used classes are
// evoked and combined together
//=====... |
/*
* Copyright (c) 2016-2021 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_DETAIL_COUNT_INVERSIONS_H_
#define CPPSORT_DETAIL_COUNT_INVERSIONS_H_
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <utility>
#includ... |
/**
* @copyright 2013 Christoph Woester
* @author Christoph Woester
*
* 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 ... |
//
// Primitives.h
// PLYLoader
//
// Created by JIANG, SHAN on 12-10-19.
// Copyright (c) 2012年 JIANG, SHAN. All rights reserved.
//
#ifndef PLYLoader_Primitives_h
#define PLYLoader_Primitives_h
typedef int Index3ui[3];
class Primitives {
public:
Primitives();
//Primitives(unsigned int num);
~P... |
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<stack>
#include <iostream>
#include<malloc.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
// Functions declarations
void PostFix(char * , char postfix[][20]);
int PostFixEval(char[][20]);
int isOperator(char *var, i... |
#include "PrimaryGeneratorAction.hh"
#include "DetectorConstruction.hh"
#include<G4Event.hh>
#include<G4ParticleGun.hh>
#include<G4ParticleTable.hh>
#include <G4SystemOfUnits.hh>
#include<G4ParticleDefinition.hh>
#include<globals.hh>
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* myDC)
:myDete... |
#include "hardware.h"
#include "util.h"
#include <string>
#include <unistd.h>
namespace libzinlidac {
// throws a `SysconfError` both if the implementation does not impose a limit, and in case of an error
unsigned long get_level1_instruction_cache_size() {
// https://www.gnu.org/software/libc/manual/html_node/Sys... |
/*
* Copyright (C) 2013 Tom Wong. All rights reserved.
*/
#include "gtobject.h"
#include <QtCore/QDebug>
#include <QtCore/QList>
#include <QtCore/QMutex>
#include <typeinfo>
GT_BEGIN_NAMESPACE
#ifdef GT_DEBUG
class GtObjectManager
{
public:
static GtObjectManager& instance();
public:
QMutex mutex;
QLi... |
#pragma once
#include <iberbar/RHI/D3D11/Headers.h>
#include <iberbar/RHI/D3D11/Shader.h>
#include <iberbar/RHI/D3D11/Texture.h>
#include <iberbar/RHI/D3D11/RenderState.h>
#include <iberbar/RHI/ShaderVariables.h>
#include <iberbar/Utility/Buffer.h>
#ifdef _DEBUG
#include <unordered_map>
#endif
namespace iberbar
{
... |
#pragma once
//#include "gameNode.h"
#include "player.h"
#include "enemy.h"
class mainGame : public gameNode
{
private:
int _loopX, _loopY; //루프시길 속도
player* _player; //플레이어 클래스
enemy* _enemy;
image* _main;
image* _startButton;
image* _loading;
int time;
bool _gameStart;
bool _load;
bool _loadLoop;
int alp... |
// Question => Count and Say
#include<iostream>
using namespace std;
string countAndSay(int n){
if(n==1)
return "1";
if(n==2)
return "11";
string str = "11";
for(int i=3; i<=n; i++){
str = str + '$';
int len = str.length();
int cnt = 1;
string tmp = ... |
#pragma once
class ChargerComp : public hg::IComponent
{
public:
virtual int GetTypeID() const { return s_TypeID; }
static uint32_t s_TypeID;
void Init();
void SetLunging( bool lunging ) { m_Lunging = lunging; }
void OnCollision( Hourglass::Entity* other );
hg::IComponent* MakeCopyDerived() const;
private:
... |
#include "Analysis.hh"
#include "B1EventAction.hh"
#include "B1RunAction.hh"
#include "G4Event.hh"
B1EventAction::B1EventAction(B1RunAction* runAction)
: G4UserEventAction(),
fRunAction(runAction),
fEdep(0.)
{
}
B1EventAction::~B1EventAction()
{
}
void B1EventAction::BeginOfEventAction(const G4Event*)
{ ... |
#include "VulkanInstance.h"
#include <iostream>
VulkanInstance::VulkanInstance(std::string appName, InstanceVersion appVersion, std::string engineName, InstanceVersion engineVersion, uint32_t vulkanApiVersion, bool enableValidationLayers) {
setAppName(appName);
setAppVersion(appVersion);
setEngineName(engineName);
... |
#pragma once
#include <functional>
#include <memory>
#include <string>
#include <tuple>
#include <SFML/Graphics/RenderTarget.hpp>
#include <SFML/Graphics/Sprite.hpp>
#include <SFML/Graphics/Texture.hpp>
#include <SFML/System/Vector2.hpp>
struct libvlc_instance_t;
struct libvlc_media_player_t;
struct libvlc_media_t;
... |
/*
* version.h
*
* Created on: 18 Apr 2013
* Author: TRocket
*/
#ifndef VERSION_H_
#define VERSION_H_
//#ifdef __GIT_VERSION
const std::string GIT_VERSION = __GIT_VERSION;
//#endif
#endif /* VERSION_H_ */
|
#include "OGL.h"
#include <iostream>
using namespace std;
OGL::OGL()
{
m_deviceContext = 0;
m_renderingContext = 0;
}
OGL::~OGL()
{
}
//Function: Initialize OpenGL Extensions
//PostCondition: OpenGL Extensions initialized
bool OGL::InitializeExtensions()
{
HDC deviceContext;
PIXELFORMATDESCRIPTOR pixelFormat;
i... |
#include <stdio.h>
#include <cstdlib>
#include <vector>
using namespace std;
void Combination(vector<pair<int, int>> a, int reqLen, int start, int currLen, bool check[], int len, int &diff)
{
if(currLen > reqLen){
return;
}
else if (currLen == reqLen)
{
int total_s = 1;
int total_b = 0;
for (int i = 0; ... |
#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 10e10
#define REP(i,n) for(int i=0; i<n; i++)
#define R... |
#include <stdio.h>
int main(void){
printf("My phone number is 7\a8\a7\b9");
return 0;
} |
#include <Bounce.h>
#include "typedefs.h"
#define NumKeys 4
#define DEBUG 1
//functions
bool init(); //populates k
bool keystate(); //updates keystates in k
bool asetniop(); //translates keystates in k to characters using key_char
bool sendkeys(int size, key_char keys[]); //sends proper keys to pc
//global vars
keyb... |
#include "stdafx.h"
#include <math.h>
#include "sntp.h"
int _tmain(int argc, TCHAR* argv[], TCHAR* /*envp[]*/)
{
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
_tprintf(_T("Fatal Error: MFC initialization failed"));
return 1;
}
else
{
if (argc < 2)
{
_tprintf(_T("testsntp host... |
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <pthread.h>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <cstring>
#include <iostream>
using namespace std;
... |
#pragma once
#include <SFML\Graphics.hpp>
namespace sf
{
class MouseExtra : sf::Mouse
{
public:
MouseExtra();
~MouseExtra();
static bool isButtonReleased( sf::Mouse::Button button);
private:
static bool buttonPressed[5];
};
}
|
//算法:归并排序(分治)
//思路:找逆序对,即找比每个数大的,且编号小的数的个数
//因为归并排序,
//将序列按照数组下标顺序,
//分割成了多个有序序列
//所以可以通过套归并排序模板,
//来找到比某个数编号小且值大的数的个数
//具体见注释 , 核心部分:第27行
//与此题完全一样的题目:SP6252 SP9722 SP25784
#include<cstdio>
using namespace std;
int n;
int a[500010];
int b1[500010];
long long ans;
void b(int l1,int r1,int l2,int r2)/... |
#pragma once
#include "Buffered.h"
class Sparkles : public Buffered {
public:
void setup() override;
void render() override;
private:
int _frameIdx;
int _next;
};
|
/**
* Copyright 2019, Joe Chen, Gavin Lin
* All rights reserved.
*
* Authors:
* "Joe Chen" <joejoevictor@gmail.com>
* "Gavin Lin" <gavin.lin.asd@gmail.com>
*/
#include <iostream>
#include <grpcpp/grpcpp.h>
#include "src/proto/protocached.pb.h"
#include "src/proto/protocached.grpc.pb.h"
#include "src/server/d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.