text stringlengths 8 6.88M |
|---|
#ifndef FEK_LIB_HPP_GUARD_1851308033
#define FEK_LIB_HPP_GUARD_1851308033
int get_answer_of_life();
#endif
|
//===========================================================================
//! @file collision_2D.cpp
//! @brief 2D 当たり判定
//===========================================================================
//---------------------------------------------------------------------------
//! 2D 点vs点
//------------------------... |
#include "precompiled.h"
#include "texture/jstexture.h"
#include "texture/texturecache.h"
#include "script/script.h"
REGISTER_STARTUP_FUNCTION(jstexture, jstexture::init, 10);
namespace jstexture
{
JSBool jsflush(JSContext *cx, uintN argc, jsval *vp);
}
void jstexture::init()
{
script::gScriptEngine->AddFun... |
/**
* Copyright (c) 2020, Timothy Stack
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of condi... |
#include <string>
using namespace std;
class STRING {
string s1;
public:
STRING();
STRING(string);
string getS1();
void setS1(string);
string cadenaT(string);
string Asignacion(string);
string Imprimir(string);
}; |
#pragma once
#include <vector>
#include "Global.h"
#include "Bunny.h"
class Colony
{
friend class Bunny;
public:
Colony();
Bunny* addBunny(Bunny*);
void killOld();
void listColony();
void Cull();
void giveBirth();
void convertMutants();
void growOld();
bool Continue();
private:
int TOTAL_OLD = 0;
int... |
#include "stdio.h"
#include "stdlib.h"
int main(int argc, char* argv[])
{
int d = atoi(argv[1]);
FILE* f = fopen("test.pbrt","w");
fprintf(f, "LookAt 1.0 1.0 5 1.0 1.0 1.0 0 1 0\n");
fprintf(f, "Camera \"perspective\" \"float fov\" [28]\n");
fprintf(f, "Film \"image\" \"integer xresolutio... |
#ifndef parametrecorbeilleediteur_h
#define parametrecorbeilleediteur_h
#include <QWidget>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QSettings>
#include "mainwindow.h"
/** \file parametrecorbeilleediteur.h */
/**
* @class Editeur
*
* Editeur qui fait apparaîtr... |
#include "main.hpp"
#include "Sampler.hpp"
#include "Clip.hpp"
#include "Mixer.hpp"
#include "Synth.hpp"
static int patestCallback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* timeInfo,
PaStreamCallbackFlags statusFlags,
v... |
#ifndef _SPATIAL_MATH_MATRIX_INL_
#define _SPATIAL_MATH_MATRIX_INL_
#include "sm_const.h"
#include "SM_Quaternion.h"
#include "SM_Math.h"
namespace sm
{
/************************************************************************/
/* Matrix2 */
/*************... |
#include "IPCoverTiming.hh"
#include "ISocket.hh"
#include "IInput.hh"
#include "IOutput.hh"
#include "Defines.hh"
#include "Exception.hh"
#include "Packet.hh"
#include "CUIPHeader.hh"
#include "CUTCPHeader.hh"
#include <sstream>
#include <iostream>
#include <iomanip>
#include <unistd.h>
//Initialization of the ressou... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
**
** Copyright (C) 1995-2009 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 "... |
#ifndef _CONTAINER_H
#define _CONTAINER_H
#include <iostream>
using namespace std;
template <typename T>
class container { // class template
public:
explicit container (const T &arg);
T increase ();
private:
T element;
};
/**
* The idea of C++ class template specialization is similar to
* function templat... |
// AccelerationReader.cpp : 定义应用程序的类行为。
//
#include "stdafx.h"
#include "AccelerationReader.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CAccelerationReaderApp
BEGIN_MESSAGE_MAP(CAccelerationReaderApp, CWinApp)
ON_COMMAND(ID_APP_ABOUT, &CAccelerationReaderApp::OnAppAbout)
END_MESSAGE_MAP... |
// Data type used in grid
typedef int DataType;
#include <iostream>
#include <ostream>
struct STiming {
float method1;
float method2;
};
void generateInput(std::ostream &out, size_t gridSize, size_t kernelSize);
// Forward declarations
void readGrid(
DataType* hostGrid,
std::istream &input,
size... |
//===========================================================================
//! @file gpu_shader.cpp
//! @brief シェーダー
//===========================================================================
namespace gpu::detail {
// 仮
static constexpr const char* g_filePath = "../../Application/asset/shader/";
//! カスタムインクルー... |
/*
Date: 15-06-20
Name : Aman Jain
*/
#include<bits/stdc++.h>
using namespace std;
bool odd_cycle=false;
void dfs(vector<int> V[], int start, int parent, int color,int visited[]){
visited[start]=color;
// Color : // 0: Not visited // 1: Visited and color 1 // 2: Visited and color 2
vector<int> :: ite... |
// Created on: 1997-02-21
// Created by: Alexander BRIVIN
// 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 G... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
class A{
public:
int f();
int f(int x=0);
int f(int x=0,int y=0)
{
cout << "A" << end... |
#include "stdafx.h"
#include "Gamepad.h"
// Link the 'Xinput' library - Important!
#pragma comment(lib, "Xinput.lib")
Gamepad::Gamepad(int a_iIndex)
{
m_State = GetState();
m_iGamepadIndex = a_iIndex - 1;
}
void Gamepad::Update()
{
m_State = GetState();
}
bool Gamepad::LStick_InDeadzone()
... |
#ifndef WALI_DOMAINS_DETAILS_SEM_ELEM_WRAPPER_HPP
#define WALI_DOMAINS_DETAILS_SEM_ELEM_WRAPPER_HPP
#include <algorithm>
#include <limits>
#include "wali/Common.hpp"
#include "wali/SemElem.hpp"
namespace wali {
namespace domains {
namespace details {
///////////////////////////////////////
struct ... |
/* XMRig
* Copyright (c) 2019 Spudz76 <https://github.com/Spudz76>
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it u... |
/**
* 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.
*/
#include "core/pch.h"
#include "platforms/unix/base/x11/x11_informationbroker.h"
#include "platforms/utilix/x11_all.h"
#include "platforms/uni... |
#include "SM_MinBoundingBox.h"
#include "SM_Calc.h"
#include "SM_ConvexHull.h"
#include <assert.h>
namespace sm
{
// bounding:
// 1 2
// 0 3
bool MinBoundingBox::Do(const CU_VEC<vec2>& points, vec2 bounding[4])
{
// convex hull
CU_VEC<vec2> hull;
convex_hull(points, hull);
// normal
float xmin = FLT_MAX, xma... |
#pragma once
#include "window.h"
#include <algorithm>
#include <functional>
template <typename GAME>
class MainLoop
{
public:
MainLoop(float timeStepInSeconds)
{
if (timeStepInSeconds < 0.005f) {
throw std::runtime_error("200 fps is plenty. Don't be so darn greedy! =P");
}
const long long ti... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2005 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_PATH_PARSER_H
#define SVG_PATH_PARSER_H
#ifdef SV... |
#pragma once
#include "light.h"
class PointLight : public Light
{
public:
PointLight(const Transform &t,const Point3f &pLight,const Color3f& I):Light(t),pLight(pLight),I(I){}
virtual Color3f Sample_Li(const Intersection &ref, const Point2f &xi,
Vector3f *wi, Flo... |
#include "batch2Drenderer.h"
namespace sge { namespace graphics{
using namespace math;
Batch2DRenderer::Batch2DRenderer(){
init();
}
Batch2DRenderer::~Batch2DRenderer(){
delete m_IBO;
glDeleteBuffers(1, &m_VBO);
glDeleteVertexArrays(1, &m_VAO);
}
void Batch2DRenderer::init(){
glGenVertexArrays(1,... |
#ifndef FUNKTION_H
#define FUNKTION_H
class CalculationException: public std::exception {
public:
virtual const char* what() const noexcept override = 0;
};
class Funktion
{
//1D
public:
double operator()(double x);
virtual double value(double x);
};
#endif // FUNKTION_H
|
#include "../headers/BinOpNode.hpp"
#include <string>
#include <sstream>
using namespace std;
BinOpNode::BinOpNode(Node *leftOperand, string Op, Node *rightOperand) {
this->leftOperand = leftOperand;
this->Op = Op;
if (Op == "<=" or Op == "<" or Op == "and" or Op == "=")
this->type = "bool";
e... |
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include<QPushButton>
#include<QRadioButton>
#include<QTime>
#include<cstdlib>
#include<QDebug>
#include<vector>
#include<sstream>
#include<string>
#include<QDir>
#include<QTableWidget>
#include<QTableWidgetItem>
#include<QString>
#includ... |
// Scintilla source code edit control
/** @file LexFSharp.cxx
** Lexer for F#
** Written by Zufu Liu <zufuliu@gmail.com> 2011/09
**/
// The License.txt file describes the conditions under which this software may be distributed.
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include "ILexer.... |
#include "EventSource.h"
#include "mutiplex/EventLoop.h"
#include "Debug.h"
namespace muti
{
EventSource::~EventSource()
{
disable_all();
}
void EventSource::enable_ops(uint32_t op)
{
interest_ops_ |= op;
if (interest_ops_) {
if (state_ == StateNoEvent) {
state_ = StateRegistered;
... |
#include<iostream>
using namespace std;
int main(){
// Write your code here
return 0;
} |
#ifndef LAB1_MAIN_H
#define LAB1_MAIN_H
#include <iomanip>
#include <iostream>
#include <cmath>
#include "lagrange.h"
#include "quanc8.h"
#include "splines.h"
using namespace std;
const int POINTS_NUM = 11;
const double POINTS_STEP = 0.3;
enum Mode {
FUNCTION, LAGRANGE, SPLINE
};
double x[POINTS_NUM] = {};
dou... |
#ifndef HYPERTEXT_HPP
#define HYPERTEXT_HPP
#include <string>
void printPageTop(const std::string&);
void printButton(const std::string&, const std::string&, const std::string&,
bool);
void printPageBottom();
#endif
|
#include "_pch.h"
#include "DGroupEditor.h"
#include "config.h"
using namespace wh;
using namespace wh::view;
//-----------------------------------------------------------------------------
//---------------------------------------------------------------------------
//DGroupEditor
//--------------------------------... |
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define rep(i, begin, end) \
for (__typeof(end) i = (begin) - ((begin) > (end)); \
i != (end) - ((begin) > (end)); i += 1 - 2 * ((beg... |
#ifndef STEPPER_FACTORY_HPP
#define STEPPER_FACTORY_HPP
#include "../stepper/stepperbase.hpp"
#include "../stepper/verlet.hpp"
#include <cmath>
stepperbase* integratorFactory(const simulation& sim,const atom_list& atoms,forceeval& forcer)
{
stepperbase* integrator;
if(sim.integrator == "VERLET")
{
... |
#ifndef SIMULATION_H
#define SIMULATION_H
#include "StudentQueue.h"
#include "WindowLists.h"
#include "Statistics.h"
using namespace std;
class Simulation {
public:
Simulation();
void simulate();
~Simulation();
private:
int count;
Statistics* stats; // statistics
StudentQueue* sQ; //St... |
#pragma once
#include "engine/graphics/PhysicsObject.hpp"
#include "engine/audio/AudioSource.hpp"
enum PlayerSpriteType{
HITMAN,
MAN_BLUE,
MAN_BROWN,
MAN_OLD,
ROBOT,
SOLDIER,
SURVIVOR,
WOMAN,
ZOMBIE
};
enum PlayerStanceType{
PISTOL_EQUIPPED,
EMPTY_HANDED,
RIFLE_EQUIPPED,
RELOADING,
OTHER... |
/*
Copyright (c) 2016, Los Alamos National Security, LLC
All rights reserved.
Copyright 2016. Los Alamos National Security, LLC. This software was produced under U.S. Government contract DE-AC52-06NA25396 for Los Alamos National Laboratory (LANL), which is operated by Los Alamos National Security, LLC for the ... |
/*******************************************************************************
* filename: C_RandomPatternInitialiser.hpp
* description: Derived class for ranomdly initialising an ideal pattern
* author: Moritz Beber
* created: 2010-06-10
* copyright: Jacobs University Bremen. All rights reserved.
... |
/* @author Aytaç Kahveci */
#ifndef KRLSTRUCT_H
#define KRLSTRUCT_H
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <algorithm>
template <class T>
class KRLStruct
{
public:
KRLStruct(){}
KRLStruct(std::vector<std::string> nodes)
{
nodes_ = nodes;
}
~KRLSt... |
#pragma once
#include <string>
#include "SDL_rect.h"
#include "SDL_pixels.h"
struct SDL_Texture;
class TextureManager;
class Texture
{
private:
SDL_Point size;
SDL_Texture * tex = nullptr;
public:
Texture();
Texture(SDL_Texture * tex);
~Texture();
void load(std::string filename);
vo... |
#pragma once
#include"QInt.h"
class Convert {
public :
static bool* DecToBin(QInt num);
static QInt BinToDec(bool* bin);
static QInt ToBu2(QInt num);
static string QIntToStringNumber(QInt num); //support cho ham xuat
static QInt StringNumberToQInt(string str); // support cho ham nhap
}; |
/* -*- mode: c++; indent-tabs-mode: nil; tab-width: 4; c-file-style: "stroustrup" -*- */
#ifdef ARCHITECTURE_SUPERH
class ES_CodeGenerator
{
public:
ES_CodeGenerator();
enum Condition
{
CONDITION_EQ, // equal (Z=1)
CONDITION_NE, // not equal (Z=0)
CONDITION_CS, // unsigned higher ... |
#ifndef DICTIONNAIRE_H
#define DICTIONNAIRE_H
#include <QMessageBox>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <iterator>
#include <utility>
#include "hiragana.h"
#include "katakana.h"
#include "mot.h"
using std::vector;
using std::multimap;
using std::pair;
using std::iterator... |
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<bits/stdc++.h>
#include<queue>
#define FOR0(i,n) for(i=0;i<n;i++)
#define FOR(i,j,n) for(i=j;i<n;i++)
#define FORD(i,j,k) for(i=j;i>=k;i--)
#define MAX2(a,b) (a)>(b)?(a):(b)
#defin... |
//easy way to understand sliding but use two hashmaps
class Solution {
public:
vector<int> findAnagrams(string s, string p) {
if(s.size() < p.size() || s.size() == 0 || p.size() == 0) return {};
vector<int> pdict(256);
vector<int> sdict(256);
vector<int> indices;
for... |
#include<iostream>
#include<vector>
#include<algorithm>
#include<sstream>
#include<string>
using namespace std;
class Solution {
public:
vector<int> diffWaysToCompute(string expression) {
//简化版:递归分治法
vector<int> nums;
vector<char> flag;
vector<int> res;
istringstream s(expression);
int num;
... |
// Created on: 1995-12-04
// Created by: Christian CAILLET
// Copyright (c) 1995-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 ... |
#include "core/pch.h"
#ifdef AUTO_UPDATE_SUPPORT
#ifdef AUTOUPDATE_PACKAGE_INSTALLATION
#include "adjunct/autoupdate/version_checker.h"
#include "adjunct/autoupdate/updater/audatafile_reader.h"
#include "adjunct/autoupdate/updatablefile.h"
VersionChecker::VersionChecker():
m_status(VCSNotInitialized),
m_autoupdate... |
#include "quadtree.h"
#include <iostream>
#include <algorithm>
using namespace std;
namespace sbg {
}
|
#if 0
#include "stdio.h"
#include "windows.h"
//#include "ipTypes.h"
//#include "windef.h"
#include "ipHlpapi.h"
#include "tchar.h"
#pragma comment(lib,"iphlpapi.lib")
void GetLocalMAC(char * buf);
BOOL IsLocalAdapter(char *pAdapterName);
#define NET_CARD_KEY _T("System\\CurrentControlSet\\Control\\Network\\{4D36E972... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "utilities/constants.h"
#include "moreinfocomputer.h"
#include "editcomputer.h"
#include "moreinfopioneer.h"
#include "trashbinpioneers.h"
#include "trashbincomputers.h"
#include <QDebug>
#include <QMessageBox>
MainWindow::MainWindow(QWidget *parent) :
Q... |
#include <iostream>
using namespace std;
int C;
void Soma()
{ int A, B;
A = 5;
B = 7;
C = A + B;
cout<<(C)<<endl;
}
int main()
{ int A, B;
A = 17;
B = 15;
Soma();
cout<<(A)<<endl;
cout<<(B)<<endl;
}
|
#include <string>
#include <iostream>
using namespace std;
int num_vk(const string &str)
{
int res=0;
for(unsigned int i=0; i<str.size()-1; ++i)
if(str[i]=='V' && str[i+1]=='K')
++res;
return res;
}
int main()
{
string str;
cin >> str;
int temp;
char temp_ch;
int largest=num_vk(str);
for(unsigned int ... |
// Created by: Kirill GAVRILOV
// Copyright (c) 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 version 2.1 as published
// by the Free Sof... |
#ifndef CLOGGER_H
#define CLOGGER_H
#include"cMap.h"
#include <vector>
#include <unordered_map>
#include"searchresult.h"
class cLogger
{
public:
float loglevel;
public:
cLogger();
virtual ~cLogger();
virtual bool getLog(const char* FileName) = 0;
virtual void saveLog() = 0;
v... |
#include <sdl/window>
#include <sdl/renderer>
#include <SDL2/SDL_render.h>
#define LOG(...) fprintf(stdout, __VA_ARGS__)
namespace sdl {
namespace detail {
renderer::renderer(const window &_w):
id(0), flags(0), w(_w) {
}
renderer::~renderer() {
LOG("Destroy rendere... |
#ifndef MYQGRAPHICSVIEW_H
#define MYQGRAPHICSVIEW_H
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsEllipseItem>
#include <QMouseEvent>
#define PLANE_WIDTH 10
#define PLANE_HEIGHT 10
class MyQGraphicsView : public QGraphicsView
{
Q_OBJECT
public:
explicit MyQGraphicsView(QWidget *parent ... |
constexpr size_t kNumChars = '~' - ' ' + 1;
class Solution {
public:
int lengthOfLongestSubstring(string s) {
std::array<int, kNumChars> last_seen;
for (int& x : last_seen) {
x = -1; // -1 signals unset.
}
int best = 0;
int begin = -1;
for (int... |
#ifndef HEAP_H
#define HEAP_H
#include "vertex_info.h"
#include <iostream>
#include <climits>
#include <utility>
#define INF 100000000
using namespace std;
typedef unsigned long ulong;
class gomila
{
pair<ulong,vertex_info> *elems; // first -> key; second -> value
ulong *key_mapping;
ulong max_velicina;
... |
#include "SignIn.h"
SignIn::SignIn(){
user_list=new User[Max];
count=0;
}
SignIn::SignIn(ifstream& infile){
infile.open("user_record.txt");
while(!infile){
infile.close();
cout<<"用户记录不存在!"<<endl;
string file_name;
cout<<"模拟登陆的用户记录文件路径为?";
getline(cin,file_name);
infile.open(file_name.c_st... |
#include <iberbar/Lua/LuaDevice.h>
#include <iberbar/Lua/LuaCallback.h>
#include <iberbar/Lua/LoggingHelper.h>
#include <luaconf.h>
using namespace iberbar::Lua;
namespace iberbar
{
namespace Lua
{
CLuaDevice* g_pUniqueLuaDevice = nullptr;
}
}
iberbar::CLuaDevice::CLuaDevice()
: CRef()
, m_pLuaState( nu... |
void initMQTT()
{
MQTT.setServer(BROKER_MQTT, BROKER_PORT);
MQTT.setCallback(mqtt_callback);
}
void mqtt_callback(char* topic, byte* payload, unsigned int length){
String msg;
//obtem a string do payload recebido
for(int i = 0; i < length; i++) {
char c = (char)payload[i];
msg ... |
#ifndef __REPORTMODEL_H
#define __REPORTMODEL_H
#include "globaldata.h"
#include "ReportData.h"
#include "IModelWindow.h"
namespace wh{
//-----------------------------------------------------------------------------
class ReportModel : public IModelWindow
{
wxString mRepId;
sig::scoped_connection connListItemChang... |
#pragma once
#include "Block.h"
#include "rectangularvectors.h"
namespace WinTetris
{
class Square : public Block
{
public:
Square();
void Rotate() override;
};
}
|
#include <iostream>
using namespace std;
class batsman{
public:
int runs;
void set_runs(int r){
runs = r;
}
};
class kohli:public batsman
{
public:
void get_runs(){
cout << "Kohli scored :" << runs << endl;
}
};
class Dhoni:public batsman
{
public:
void get_runs(){
cout << "... |
#include "collisiontester.h"
using namespace std;
|
#include "ImagePicker.h"
#ifdef Q_OS_ANDROID
#include <QAndroidJniEnvironment>
#include <QAndroidJniObject>
#include <QtAndroid>
#endif
namespace wpp {
namespace qt {
#ifndef Q_OS_IOS
ImagePicker::ImagePicker(QQuickItem *parent)
: QQuickItem(parent),
m_maxPick(-1),
m_delegate(0)
{
}
void ImagePicker::open()
... |
#include <iostream>
using namespace std;
int main()
{
/*Initialization*/
int quantity = 0, price = 0, total_expense = 0, discount = 0, c = 1;
/*Loop until the user don't want to continue*/
while (c != 0)
{
cout << "Please Enter the Quantity and Price per Item. \n";
cout << "Quantity: ";
cin >> quantity;
... |
#ifndef __IOREQ_H__
#define __IOREQ_H__
#include "CmnHdr.h"
#include "LSocket.hpp"
#define BUFFER_SIZE 1024 * 4
class IOReq : public OVERLAPPED
{
public:
IOReq() {
ResetOverlapped();
}
~IOReq() {}
enum ReqType {
ReqType_Send,
ReqType_Recv,
};
bool Recv(LSocket socke... |
//
// Created by 송지원 on 2020/05/29.
//
#include <iostream>
using namespace std;
int N, M;
int r, c, d;
int input[50][50];
int dx[4] = {-1, 0, +1, 0};
int dy[4] = {0, +1, 0, -1};
int ANS = 1;
void solve() {
while (true) {
bool clean = false;
//내가 틀린 부분
// if(input[r][c] == 0) {
// cle... |
#include "global.h"
ScreenResolution ScreenRes;
GLSL ColorProgram;
SDL_Window *SDLWindow;
Uint32 RunTime, Time, FrameTimeElapsed;
float PixelsPerSecond;
ResourceManager Resources;
|
#include "binary.h"
#include <cstring>
#include <sstream>
#include "stringValue.h"
#include "base64.h"
#include "utf8.h"
namespace json {
BinaryEncoding Binary::getEncoding() const {
return StringValue::getEncoding(s);
}
BinaryEncoding Binary::getEncoding(const IValue *v) {
return StringValue::getEncoding(v);... |
#include <iostream>
/* Exercise 2.41 - use this Sales_data class (struct) to rewrite the exercises in
1.5.2
and 1.6
*/
struct Sales_data {
std::string bookId;
unsigned unitsSold;
double revenue;
};
// reads several transactions and counts how many transactions occur for each ISBN
int main()
{
... |
#define WINVER 0x0502
#define _WIN32_WINNT 0x0502
#define _WIN32_WINDOWS 0x0502
// #define WIN32_LEAN_AND_MEAN
#include <cstdio>
#include <application.hpp>
#include <action.hpp>
#include <component.hpp>
using namespace curses;
class TestTexject:public component {
private:
sp_view create_vew(sp_pen p, rectangle&& r)... |
#include "pch.h"
#include "DirTreeCrawler.h"
#include "InputArgumentsParser.h"
#include "InterruptionWatcher.h"
#include "ParseResultHandler.h"
int wmain(int argc, wchar_t* argv[])
{
InputArgumentParser parser;
if (!parser.parseInputArguments(argc, argv))
{
return 1;
}
a... |
#pragma once
#ifndef __COMMONHELPER_H_
#define __COMMONHELPER_H_
#include <winsock2.h>
#include <shlwapi.h>
#include <shellapi.h>
#include <tlhelp32.h>
#include <commdlg.h>
#include <io.h>
#include <stdio.h>
#include <fcntl.h>
#include <tchar.h>
#include <sys/stat.h>
#include <map>
#include <regex>
... |
/*
* op_subtract.cpp
*
* Created on: 2 mars 2014
* Author: droper
*/
#include <iostream>
#include "op_subtract.h"
op_subtract::op_subtract() {
}
op_subtract::~op_subtract() {
}
void op_subtract::display(std::ostream &out, int mode) {
if (mode == DISPLAY_F) {
out << getValue();
return;
}
if (chil... |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Spdr3dModel.hpp"
#define SPDRMV_MAX_TAG_NAME 40
#define SPDRMV_MAX_POINT_BUFFER 80
#define SPDRMV_READ_BUFFER 512
static char *readLineFromFile( FILE *fp );
static int parseFile( Spdr3dModel& model, const char *cpFile );
static int parseFileHeade... |
class LFUCache {
private:
int capacity, size, minFreq;
unordered_map<int, pair<int, int> > keyToPair;
unordered_map<int, list<int> > freqToKeys;
unordered_map<int, list<int>::iterator > keyToIterator;
// remove all data related to given key
void remove(int key){
int freq = keyToPair[key].... |
//---------------------------------------------------------------------------
#pragma hdrstop
#include "FileSearch.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
AllFileSearch::AllFileSearch()
{
m_CurFile = new CFileMappingStream();
m_Result = new TS... |
#include <bits/stdc++.h>
using namespace std;
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 10000
#define INF 0x3f3f3f3f
#define DEVIATION 0.00000005
int N,M;
int table[MAXN+5];
bool isOdd(int k){
return abs(k)&1;
}
bool cmp(int a, int b){
if( a%M != b%M ) return a%M < b%M;
if( isOdd... |
#include "wave_point.h"
wave_point::wave_point(
std::shared_ptr<shady_engine::texture2D> pTexture,
std::shared_ptr<shady_engine::sprite_renderer> pRenderer,
const glm::vec2& pPosition,
const glm::vec2& pSize)
:
GameEntity(pPosition,pSize),
collider(pPosition,pSize),
mRenderer(pRenderer),
mTexture(pTexture)
{... |
#ifndef __FIELD_DATA_H
#define __FIELD_DATA_H
#include "filter_data.h"
namespace wh{
enum class FieldEditor
{
Normal = 0,
Type = 1
};
//-----------------------------------------------------------------------------
class Field
{
public:
class Filter
{
public:
Filter()
:mOp(foEq), mConn(fcAND), mEnable(false... |
#pragma once
#include"Game.h"
Player* Game::GetPlayer(int n)
{
return players[n];
}
bool Game::SavePlayer(Player* obj)
{
players.push_back(obj);
return 0;
}
|
#ifndef ADAPTER_H
#define ADAPTER_H
#include <fstream>
#include <iostream>
#include <iterator>
#include <string>
#include <vector>
#include "search_engine.h"
#include "utils/pstream.h"
class DLRSAdapter : public ProbabilisticSearchEngine {
public:
DLRSAdapter(std::string _name);
//=== Game Control === //
... |
#pragma once
#include "../MonsterAction.h"
class Monster;
class Act_Guardian :public MonsterAction
{
public:
Act_Guardian();
bool Action(Monster* me) override;
private:
bool m_first = true;
float m_time = 0;
float m_def = 0;
float m_Exdef = 0;
}; |
/**
* Copyright (c) 2019, Timothy Stack
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of condi... |
#include "stdafx.h"
#include "MultipleResponseQuestionViewController.h"
#include "MultipleResponseQuestionState.h"
#include "MultipleResponseQuestionView.h"
namespace qp
{
CMultipleResponseQuestionViewController::CMultipleResponseQuestionViewController(CMultipleResponseQuestionStatePtr const& questionState, C... |
#include<iostream>
using namespace std;
typedef unsigned int ui;
ui n,t,c,*a;
void nhap(){
cin>>n>>t>>c;
a=new ui[n];
for(ui i=0;i<n;i++) cin>>a[i];
}
void xuat(){
ui dem=0,i,k=0;
for(i=0;i<n;i++) if(a[i]<=t) a[i]=1;
else a[i]=0;
for(i=0;i<n;i++)
if(a[i]){
if... |
/*
* Copyright (C) 2007,2008 Alex Shulgin
*
* This file is part of png++ the C++ wrapper for libpng. PNG++ is free
* software; the exact copying conditions are as follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions a... |
#pragma once
#ifndef ssqIncH
#define ssqIncH
#define MEMSET_ std::memset
#define MEMCPY_ std::memcpy
#define STRCPY_ std::strcpy
#define Lotter_TM_STR_LEN (20)
struct TParseCmd
{
std::vector<std::string> vS;
TParseCmd() {}
TParseCmd(const std::string& s) { parse(s); }
int size() { return vS.size(); }
static ... |
#include "Light.h"
// public
Light::Light()
{
mBuffer = NULL;
mDirection = D3DXVECTOR3(0.0F, 0.0F, 0.0F);
mPosition = D3DXVECTOR3(0.0F, 0.0F, 0.0F);
mSpeed = 0.0F;
mAngle = 0.0F;
}
Light::~Light()
{
SafeReleaseCom(mBuffer);
}
void Light::Initialize()
{
mDirection = D3DXVECTOR3(0.01F, -1.0F, 0.01F);
mPosit... |
//知识点:生成树
/*
题目要求:
点有点权,边有边权
花费点权后,可以让这个点变成 "好的"
求最小花费,
使所有点都与"好的"点直接间接相连.(或者本身为 "好的")
思路:
既有点权,又有边权,
有要求一棵生成树
对原图直接操作不可.
考虑重建图,
将点权转化为边权.
算法实现:
设立一个超级源点,
并将每个点都与超级源点连边
边权值即为每个点的点权值.
然后将超级源点加入图中,
跑最小生成树即可.
*/
#include<cstdio>
#include<algorithm>
#include<ctype.h>
const int MARX = 510;
... |
//
// Created by micky on 15. 5. 22.
//
#ifndef JUDGESERVER_THREAD_H
#define JUDGESERVER_THREAD_H
#include <pthread.h>
#include <signal.h>
#include <string>
#include <exception>
#include <map>
namespace Thread{
void *thread_main(void *args);
class Thread {
private:
static std::map<pthread_t, Thr... |
/************************************************************************/
/*Given an expression string exp, write a program to examine whether the pairs and the orders of “{“,”}”,”(“,”)”,”[","]” are correct in exp. For example, the program should print true for exp = “[()]{}{[()()]()}” and false for exp = “[(])”*/
/**... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.