blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 117 | path stringlengths 3 268 | src_encoding stringclasses 34
values | length_bytes int64 6 4.23M | score float64 2.52 5.19 | int_score int64 3 5 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | text stringlengths 13 4.23M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
edbdceceda5060a18edd6d7f7d3258433ee96191 | C++ | pdicerbo/P1.5 | /D2-codes/oop_fundamentals/rectangle.cpp | UTF-8 | 396 | 3.21875 | 3 | [] | no_license | /* Created by G.P. Brandino for the Course P1.5 - Object Oriented Programming @ MHPC
* Last Revision: October 2015
*/
#include <iostream>
using namespace std;
class rectangle
{
public:
float width, height;
float area();
};
float rectangle::area()
{
return width*height;
}
int main() {
rect... | true |
2be13deb53855299bb07f0173e9a1f89c80ebc5c | C++ | jbreitbart/OpenSteer | /TRY-JB-cmake-build-system/unittests/tests/omp_stop_watch_test.cpp | UTF-8 | 5,688 | 2.5625 | 3 | [
"MIT"
] | permissive | /**
* Kapaga: Kassel Parallel Games
*
* Copyright (c) 2006-2007, Kapaga Development Group
* All rights reserved.
*
* This file is part of the Kapaga project.
* For conditions of distribution and use, see copyright notice in kapaga_license.txt.
*/
/**
* @file
*
* Unit test for @c omp_stop_watch.
*/
#includ... | true |
bf5fecb6d74e3e3c232054081658b30cb1009357 | C++ | rjcostales/school | /cs177_c++/SwampRunner/SCell.h | UTF-8 | 432 | 3.28125 | 3 | [] | no_license | /* Raphael J. S. Costale
* SCell.h - Abstract Base Class
* 5/5/93
*/
#ifndef SCELL_H
#define SCELL_H
#include <iostream>
using namespace std;
#include <stdbool.h>
class SCell {
public:
// Constructor
SCell(const char image, const bool safe)
{
mImage = image;
isSafe = safe;
}
bool safe() { return isSafe; ... | true |
802ea3abbcbf9552d8722de9c1ffd2181cb96111 | C++ | sagar-barapatre/Data-Structures-and-Algorithms | /Graphs/knight_moves.cpp | UTF-8 | 1,263 | 3.5 | 4 | [] | no_license | #include<bits/stdc++.h>
#define M 8
#define N 8
using namespace std;
// The time complexity of above solution will be O(m*n), where m and n are size
// of 2D matrix given;
/*
The solution will be same for the shortest path in a
binary maze, we just need to update dx[] = { -1, 0, 0, 1 };
and dy[] ={ 0, -1, 1, 0 };
and r... | true |
7acf80fdb5df03bb8952dfbbb75ab5c90bdb6bfb | C++ | Crispelinho/RobotAutomata | /Prueba_motores1.ino | UTF-8 | 2,516 | 2.78125 | 3 | [] | no_license |
int izqA = 2;
int izqB = 3;
int derA = 4;
int derB = 5;
int vel = 255; // Velocidad de los motores (0-255)
int estado = 'g'; // inicia detenido
int pecho=10;
int ptrig=9;
int duracion,distancia;
void setup() {
Serial.begin(9600); // inicia el puerto serial para comunicacion con el Bluetooth
pinMod... | true |
329e515644c331b2a7e89f76a2cdedba99749e1c | C++ | SeungWookJung/Cpp_Study | /6_26/6_26/Calulator.cpp | WINDOWS-1252 | 424 | 3.4375 | 3 | [] | no_license | #include "Add.h"
#include "Min.h"
#include "Mul.h"
#include "Div.h"
int Add(int num1, int num2) //
{
int result = num1 + num2;
return result;
}
int Min(int num1, int num2) //
{
int result = num1 - num2;
return result;
}
int Mul(int num1, int num2) //
{
int result = num1 * num2;
return result;
}
int Div(in... | true |
beb60d5d4e89224dea9f8b5b0259567862606c61 | C++ | NDU-CSC413/c-review | /51inclass2/51inclass2.cpp | UTF-8 | 1,541 | 3.921875 | 4 | [] | no_license |
#include <iostream>
/* Make the Container class
* moveable but not copyable
*
*/
class Container {
int _size;
int* _data=nullptr;
public:
Container(int size) :_size(size), _data(new int[size] {}) {}
int& operator[](int idx) {
return _data[idx];
}
void resize(int newsize) {
if (newsize <= _size)return;
int... | true |
64631a6c411c0b9eddc1d089a50e4d485ed9bdf8 | C++ | Jake-Baum/Vulkan | /Vulkan/RenderPass.cpp | UTF-8 | 1,919 | 2.921875 | 3 | [] | no_license | #include "RenderPass.h"
RenderPass::RenderPass(VkDevice device, VkFormat swapChainImageFormat) : device(device), swapChainImageFormat(swapChainImageFormat)
{}
void RenderPass::createRenderPass()
{
VkAttachmentDescription colourAttachment{};
colourAttachment.format = swapChainImageFormat;
colourAttachment.samples =... | true |
84e74071a870c6c9db8b5144329c8ccbbaf6ca36 | C++ | dothithuy/ElastosRDK5_0 | /Sources/Elastos/Frameworks/Droid/Base/Core/src/graphics/drawable/shapes/ArcShape.cpp | UTF-8 | 1,179 | 2.6875 | 3 | [] | no_license |
#include "graphics/drawable/shapes/ArcShape.h"
namespace Elastos {
namespace Droid {
namespace Graphics {
namespace Drawable {
namespace Shapes {
ArcShape::ArcShape()
: mStart(0)
, mSweep(0)
{}
/**
* ArcShape constructor.
*
* @param startAngle the angle (in degrees) where the arc begins
* @param sweepAn... | true |
902d003cae5bd8b68f4b54d3404f82b898f4df10 | C++ | sandexp/Pat-Algorithm | /Example/DataStrunct.cpp | UTF-8 | 4,101 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
struct MyStack{
// top最顶层元素
int top;
int* arr;
MyStack(){
this->top=-1;
this->arr=NULL;
}
void clear(){
this->top=-1;
}
int size(){
return t... | true |
e03b64368f8e9ff23ecacbd7e2010484cd904863 | C++ | NamanKhurana/PEP_DS_ALGO | /PEP_DS_ADV/Recursion/l002.cpp | UTF-8 | 10,479 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int queenCombination1D(vector<bool> &boxes, int qpsf, int tnq, int idx, string ans)
{
if (tnq == 0)
{
cout << ans << endl;
return 1;
}
int count = 0;
for (int i = idx; i < boxes.size(); i++)
{
count += queenComb... | true |
6abe7020dfbac42f233ebe30d8520b8dc9cfac5c | C++ | IceCube-22/darkreign2 | /coregame/damage.cpp | UTF-8 | 2,320 | 2.65625 | 3 | [] | no_license | ///////////////////////////////////////////////////////////////////////////////
//
// Copyright 1997-1999 Pandemic Studios, Dark Reign II
//
// Firing system
//
///////////////////////////////////////////////////////////////////////////////
//
// Includes
//
#include "damage.h"
/////////////////////////////////////... | true |
fc2dadccb6dc015d342b71ef1a4dac8436eaa7e4 | C++ | chenghu17/Algorithm | /Leetcode/c_104_Maximum_Depth_of_Binary_Tree.cpp | UTF-8 | 1,936 | 3.71875 | 4 | [] | no_license | //
// Created by Mr.Hu on 2018/12/8.
//
// leetcode 104 maximum depth of binary tree
//
// 题目要求求出给定二叉的树的深度,即二叉树所有路径中最长的路径。
//
// 可以使用DFS的思想,每次计算一条路径的长度,判断当前路径长度与当前最长路径的大小,取最大值保存在为最长路径,
// 直到最终遍历完所有路径,循环结束,输出此时最长路径即为二叉树深度
//
// DFS的思想需要记住stack来存储之前的节点
//
#include <iostream>
#include <stack>
using namespace std;
struct... | true |
5358631ef2209572712a84022d975f4f450672eb | C++ | ZeroLRS/EGP-405-Project-3 | /Plugin/include/egp-net/fw/egpNetSerializableData.h | UTF-8 | 851 | 2.59375 | 3 | [] | no_license | /*
egpNetSerializableData.h
By Dan Buckstein
(c) 2017-2018
Base class for some pure data or component that can serialize its data to
a RakNet bitstream.
Additional contributions by (and date):
*/
#ifndef __EGP_NET_SERIALIZABLEDATA_H_
#define __EGP_NET_SERIALIZABLEDATA_H_
#include "RakNet/BitStream.h"
/... | true |
fdec1c3ab7ce7ec226f54623157ec8ebe9822a01 | C++ | pbysu/BOJ | /~2017/1890.cpp | UTF-8 | 840 | 2.84375 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
vector<vector<long long>> dp;
int t;
long long func(int r, int c, vector<vector<long long>>& count) {
long long& ret = dp[r][c];
//dp 는 &ret 으로 배열 가져오기 : 정형화
if (ret != -1)
return ret;
//기저 조건 정형화
ret = 0;
if (r == t - 1 && c == t - 1)return ret = ... | true |
6ee52d015a74b4e1f1e181472a9e78be08fc9699 | C++ | MrKarimiD/Shape-Detector-based-on-colors | /src/shape.cpp | UTF-8 | 273 | 2.640625 | 3 | [] | no_license | #include "shape.h"
Shape::Shape()
{
}
void Shape::set(float x, float y, double roundedRadios, std::string color, std::string type)
{
this->position_x = x;
this->position_y = y;
this->roundedRadios=roundedRadios;
this->color=color;
this->type=type;
}
| true |
41ef4c86ef28e7f9088553b399b03cc1d7e8215d | C++ | afcarl/Stock-Performance-Evaluation-Based-on-EPS | /StockGroup.h | UTF-8 | 2,411 | 2.578125 | 3 | [] | no_license | #pragma once
#include "stdafx.h"
#include <string>
#include <iostream>
#include <vector>
#include <map>
#include "Stock.h"
#include <process.h>
#include <Windows.h>
#include <time.h>
//#include <algorithm>
class StockGroup
{
private:
struct node
{
StockGroup* object;
int num;
};
HAND... | true |
46185520a5e696d867810b63ae35e07ba998b288 | C++ | dearinjani/Tugas-Algoritma-Pemrograman | /Pertemuan Ke 3,4,5/tanpaclass.cpp | UTF-8 | 748 | 3.796875 | 4 | [] | no_license | #include <iostream>
// Program Perhitungan Tanpa Class
// I.S Program Mengolah Data
// F.S Program Menampilkan Data
using namespace std;
// Prototype
void print(int i);
void print(double f);
void print(string c);
// Fungsi int menampilkan angka bilangan bulat
void print(int i) {
cout << "Printing int... | true |
cafc87d44b14481abe99c0f64f8f1443571b0101 | C++ | oclero/luna | /include/luna/controls/Vector3dEditorTemplate.hpp | UTF-8 | 1,870 | 2.875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <QQuickItem>
#include <QVector3D>
namespace luna::controls {
/**
* @brief Allows to edit the 3 values of a QVector3D.
*/
class Vector3dEditorTemplate : public QQuickItem {
Q_OBJECT
Q_PROPERTY(QVector3D value READ value WRITE setValue NOTIFY valueChanged)
Q_PROPERTY(float x READ x WRITE set... | true |
f7cbc38702695e9f754e75b61eb0fa015690bf29 | C++ | jjfsq1985/Algorithm | /Coding/rbTree.hpp | WINDOWS-1252 | 8,002 | 3 | 3 | [] | no_license | //RB_Tree.hpp
//The code of red black trees
//2011/12/31 by Adoo
// The foundation :http://www.roading.org/?p=691
#ifndef RB_TREES_HPP
#define RB_TREES_HPP
#include<iterator>
#include<iomanip>
#include<deque>
enum RB_Color{
red,
black
};
template<typename Type>
class RB_Tree{
private:
struct rb_... | true |
edc25f9c78e71b3d0f3cf0110c7e245a1f6a7537 | C++ | AmonShokhinAhmed/KDTree | /KDTree/KDTree/ControlledCamera.cpp | UTF-8 | 1,229 | 2.53125 | 3 | [
"MIT"
] | permissive | #include "ControlledCamera.h"
#include "InputManager.h"
#include "Entity.h"
ControlledCamera::ControlledCamera()
{
SystemManager::CameraSystem.AddComponent(this);
}
ControlledCamera::~ControlledCamera()
{
SystemManager::CameraSystem.RemoveComponent(this);
}
void ControlledCamera::Update()
{
float velocit... | true |
6763a3dde27da9cb2dded7197d4b0d2b14ff9a1d | C++ | Shaharafat/My-C-plus-plus-Codes | /new and delete2.cpp | UTF-8 | 264 | 2.875 | 3 | [] | no_license | #include<iostream>
using namespace std;
struct Courseinfo
{
char *id;
int credit;
float gpa;
Courseinfo *next;
};
int main()
{
Courseinfo *course;
course=new Courseinfo;
course->credit=3;
cout<<course->credit;
delete course;
}
| true |
546c81bb1d0d6005f9f205450676af37937ce7bc | C++ | faterer/cpm | /cpp/DesignPatterns/CreationalPatterns/Singleton00.cpp | UTF-8 | 436 | 3.296875 | 3 | [] | no_license | #include <iostream>
class Singleton
{
public:
static Singleton * getInstance() {
if (instance == nullptr) {
instance = new Singleton();
}
return instance;
}
void print() {
std::cout << "singleton" << std::endl;
}
private:
Singleton() {}
static Singl... | true |
6205306e97526fdf8e6404006f98e9ded921c1ca | C++ | bashirtamim/C- | /Typing game/abdullah2.cpp | UTF-8 | 4,142 | 3.1875 | 3 | [] | no_license | //Bashir Abdullah
//typing game
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#include<math.h>
#include<chrono>
#include<ctime>
typedef struct str{
char string[100];
};
str generateString()
{
srand(time(NULL));
str string;
//strcpy_s(string.string, "Hi");
static co... | true |
e2de9732f3eb3505d0d7a6852dce64dbc63d66aa | C++ | soapunny/Strikers1945 | /210317_WinAPI/Timer.cpp | UHC | 1,252 | 2.96875 | 3 | [] | no_license | #include "Timer.h"
HRESULT Timer::init()
{
isHardware = false;
timeScale = 0.0f;
timeElapsed = 0.0f;
currTime = 0.0;
lastTime = 0.0;
periodFrequency = 0.0;
fpsTimeElapsed = 0.0f;
fpsFrameCount = 0;
gameSecond = 0;
if (QueryPerformanceFrequency((LARGE_INTEGER*)&periodFrequency)) // cpu ʴ ִ
... | true |
9553417ea6c7074018e5fec42f9021e701cad1ef | C++ | adrian-stanciu/adventofcode | /2015/23/main.cpp | UTF-8 | 3,597 | 2.796875 | 3 | [
"MIT"
] | permissive | #include <array>
#include <iostream>
#include <optional>
#include <regex>
#include <string>
#include <variant>
#include <vector>
using Regs = std::array<long, 2>;
struct Computer;
struct Hlf {
long r;
void exec(Computer& c) const;
};
struct Tpl {
long r;
void exec(Computer& c) const;
};
struct Inc ... | true |
f448c05e158664706af7359561cbcadbe0acfd19 | C++ | jackthgu/K-AR_HYU_Deform_Simulation | /src/taesooLib/BaseLib/math/optimize.h | UTF-8 | 9,751 | 2.890625 | 3 | [
"MIT"
] | permissive | #ifndef _OPTIMIZE_H_
#define _OPTIMIZE_H_
#if _MSC_VER>1000
#pragma once
#endif
#include "OperatorStitch.h"
class Optimize
{
public:
struct Opt_dimension
{
TString title;
double curval;
double max_step;
double grad_step;
};
class Method
{
public:
vectorn _opos;
Method();
virtual ~Method();
... | true |
feffeb2660bf40d9bdb393ca3c25513d50200338 | C++ | a-kashirin-official/spbspu-labs-2018 | /dudina.anna/A2/main.cpp | UTF-8 | 2,214 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include "circle.hpp"
#include "rectangle.hpp"
#include "triangle.hpp"
void testOfShape(dudina::Shape & cObject)
{
std::cout << "Shape test:" << std::endl;
cObject.printInformation();
std::cout << "Area of figure:" << cObject.getArea() << std::endl;
std::cout << "Rectangle frame:" << std:... | true |
add60c7a40ffd8adcd3c4eb331d51f600750958f | C++ | shehryarnaeem/SamplePrograms | /HackerRank/SaveThePrisoner.cpp | UTF-8 | 688 | 2.890625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
/*int saveThePrisoner(int n, int m, int s){
// Complete this functions
if(m>s)
{
int diff=n-s;
++diff;
int r=m-diff;
return r;
}
else{
int diff=(m-1)+s;
if(diff>5)
{
diff=diff-5;
... | true |
8da87ff7b3336528d8b0bb264ea29afd79555c65 | C++ | Dindaaprlia/Ini_Contoh_UAS | /main.cpp | UTF-8 | 724 | 3.609375 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int array1[2], array2[2], array3[2];
int a;
for (a=0; a<2; a++)
{
cout << "\nMasukkan array 1 indeks ke-" << a << ": ";
cin >> array1[a];
}
for (a=0; a<2; a++)
{
cout << "\nMasukkan array 2 indeks ke-" <... | true |
b009c4a95b8307df194f33d6fe3446b8cc3011e0 | C++ | jhonber/Programming-Contest | /codeforces/VK Cup 2016 - Round 1/A.cpp | UTF-8 | 765 | 2.59375 | 3 | [] | no_license | // http://codeforces.com/contest/639/problem/A
#include<bits/stdc++.h>
using namespace std;
#define D(x) cout << #x << " = " << (x) << endl;
int main() {
int n, k, q;
cin >> n >> k >> q;
map<int, int> all;
for (int i = 0 ; i < n; ++i) {
int a;
cin >> a;
all[i + 1] = a;
}
set<int> online;
... | true |
1da2b0b973f850439d9e70dea3f4ea54cd1d1a37 | C++ | RabbitThief/SerialPortMon | /Common/MultimediaTimer.h | UHC | 533 | 2.546875 | 3 | [] | no_license |
// Multimedia timer ϱ Լ
#pragma once
#pragma comment (lib,"winmm.lib")
typedef unsigned long DWORD;
typedef unsigned int UINT;
class CMultimediaTimer {
private:
UINT _timerRes;
DWORD _timerId;
public:
CMultimediaTimer ();
~CMultimediaTimer ();
virtual void OnTimer (UINT timerId, UINT msg) { }
void Sta... | true |
a40613b0cabb3fd46be976f6d564882397a8e23b | C++ | evan-carey/raytracer | /Raytracer/Material.cpp | UTF-8 | 723 | 2.8125 | 3 | [] | no_license | #include "Material.h"
Material::Material()
{
m_diffuse = Vector3(1.0f);
m_specular = Vector3(0.0f);
m_transparency = Vector3(0.0f);
m_shininess = 0.0f;
m_refractionIndex = 1.0f;
m_texture = NULL;
}
Material::~Material()
{
delete m_texture;
}
bool Material::isDiffuse() const {
return m_diffuse.x > 0.0f || m_... | true |
16b95f13acf84afa94faa1e6e239eb72f5d4b217 | C++ | mjannat/Online-Judge-Problems-Solution-in-Cpp | /Cook a Dish.cpp | UTF-8 | 730 | 2.625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int result[1000] = {0};
void fact_dp()
{
result[0] = 1;
for (int i = 1; i <= 11; ++i)
{
result[i] = i * result[i - 1];
}
}
int main()
{
int test;
cin >> test;
fact_dp();
while(test--)
{
... | true |
9d739c49e7904d0f9c9f742484caed30b3d0fab7 | C++ | obikata/Space_Partitioning_Octree_BVH | /CppSpacePartitioning/src/include/OctreeBuilder.hpp | UTF-8 | 9,400 | 2.640625 | 3 | [] | no_license | #include "Octree.hpp"
#include "OctreeNode.hpp"
#include "OBJ_File.hpp"
#include "Vec3.hpp"
#include <iostream>
#include <chrono>
#include <string>
namespace Octree
{
class OctreeBuilder
{
// public static float OCTANT_POS[][] =
// {
// //i&4, i&2, i&1
// { 0, 0, 0 }, // [0] - 000
... | true |
3e975dee117776a76b46a3e036564380365f5fcb | C++ | balrog-kun/ApolloVentilator | /Firmware/aire_apollo/src/ApolloConfiguration.h | UTF-8 | 2,479 | 2.75 | 3 | [] | no_license | #ifndef _APOLLO_CONFIGURATION_H
#define _APOLLO_CONFIGURATION_H
#include "../include/defaults.h"
#include "Arduino.h"
#include "Display.h"
class ApolloConfiguration
{
public:
ApolloConfiguration();
int getMlTidalVolumen() { return this->mlTidalVolume; };
int getPressionPeep() { return this->pressionPeep; }... | true |
babd6004c1e3e3fcdf1738d637353b63e9bd0b13 | C++ | mke01/BasicC- | /Day 03/03 Returning exit code from main/Source01.cpp | UTF-8 | 346 | 2.84375 | 3 | [] | no_license | int main()
{
return 0;
}
/*
A value returned from main function is known as
exit code.
This code is reported to operating system.
If an application exits with exit code 0, it implies
application was terminated successfully.
If it exits with number other than zero, then
refer its user manual to learn the reason beh... | true |
1328272f74644d869ffca081d10072df2a3eb2fe | C++ | JackEdwards/Pazuzu | /GLEngine/ShaderAttribute.cpp | UTF-8 | 359 | 2.90625 | 3 | [] | no_license | #include "ShaderAttribute.hpp"
/**
* @brief Sets the location of the attribute and
* enables the vertex attribute array
*/
ShaderAttribute::ShaderAttribute(GLint location)
{
m_location = location;
Enable();
}
/**
* @brief Enables the vertex attribute array
*/
void ShaderAttribute::Enable()
{
g... | true |
29f69133c51682adf210f06d7eca987a52046825 | C++ | Serasvatie/GearsOfKMU | /GearsOfKMU/Classes/College.h | UTF-8 | 1,062 | 2.609375 | 3 | [
"MIT"
] | permissive | #ifndef __COLLEGE_H__
#define __COLLEGE_H__
#include <string>
#include "Major.h"
#include "cocos2d.h"
#define TXT_POPUP "Not enough "
class College : public cocos2d::Sprite
{
private:
Major *one;
Major *two;
std::string name;
bool unlock;
int MoneyToUnlock;
int KnowledgeToUnlock;
cocos2d::M... | true |
559ae0aa512e2bda2545d5a592596ea355cb50a3 | C++ | JimEli/maze_solver | /main.cpp | UTF-8 | 528 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include "vector.h"
#include "maze.h"
int main()
{
myVector::Vector<std::string> puzzle;
puzzle.push_back(" #######");
puzzle.push_back("# # ##");
puzzle.push_back("# #### #");
puzzle.push_back("# ##");
puzzle.push_back("# ### ###");
puzzle.push_bac... | true |
0033e08d4284e2f8c6ba3b25969f229a2fd45f93 | C++ | zhaishuai/ERASuffixTree | /utils/Combinations.hpp | UTF-8 | 865 | 3.15625 | 3 | [] | no_license | #pragma once
#include <vector>
#include <tuple>
#include "Types.hpp"
template<typename T>
class Combinations {
public:
using Result = std::vector<std::tuple<T, T>>;
Combinations(const std::vector<T>& values) : values(values), generated(false) {
}
const Result& getResult() {
if (!generated)... | true |
d04fa114180550f2a323905865825936858d282a | C++ | yutateno/RPGproject | /RPGproject/RPGproject/GameOver.cpp | SHIFT_JIS | 2,313 | 3.03125 | 3 | [] | no_license | #include "Manager.h"
GameOver::GameOver() {
this->endFlag = false;
this->nextScene = eScene::S_End;
this->step = eStep::Start;
this->startCount = 0;
this->endCount = 0;
}
GameOver::~GameOver() {
}
void GameOver::UpDate() {
switch (this->step) {
case eStep::Start: // Jn
this->UpDate_Start();
break;
case ... | true |
c5bdd1206094376e1cdcdc8e1f4110bbd18f0b64 | C++ | LafeLabs/geometron | /arduino/trash2/trash2.ino | UTF-8 | 2,400 | 3.546875 | 4 | [] | no_license | /*
Reading a serial ASCII-encoded string.
This sketch demonstrates the Serial parseInt() function.
It looks for an ASCII string of comma-separated values.
It parses them into ints, and uses those to fade an RGB LED.
Circuit: Common-Cathode RGB LED wired like so:
* Red anode: digital pin 3
* Green anode: digit... | true |
9eb90286433e30edf63fe74ab3c187458ec62461 | C++ | oscoder/QDataServer | /utils/uniqueid.cpp | UTF-8 | 3,390 | 2.71875 | 3 | [] | no_license | #include "uniqueid.h"
#if defined(QT_DEBUG)
#include <QtCore/QRegExp>
#endif
using namespace Utils;
/*!
* \class Utils::UniqueId
* \brief Fast manipulation with human-readable unique identifiers
*/
/*!
\var UniqueId::m_idMap
id map
*/
QHash<QString, int> UniqueId::m_idMap;
/*!
* \fn Utils::UniqueId::Uniq... | true |
6c0308460391e533d0a4a8b2cd72ac86a449fe13 | C++ | PoundKey/Algorithms | /LintCode/383. Container With Most Water.cpp | UTF-8 | 981 | 3.4375 | 3 | [] | no_license | class Solution {
public:
/**
* @param heights: a vector of integers
* @return: an integer
*/
int maxArea(vector<int> &heights) {
if (heights.empty()) return 0;
int n = heights.size(), maxArea = 0;
int start = 0, end = n - 1;
while (start < end) {
int cu... | true |
8751030818decaf7bc2be589e24096d941c5df32 | C++ | sanjusss/leetcode-cpp | /C/C200/C280/C289/3.cpp | UTF-8 | 2,603 | 2.875 | 3 | [] | no_license | /*
* @Author: sanjusss
* @Date: 2022-04-17 10:28:09
* @LastEditors: sanjusss
* @LastEditTime: 2022-04-17 11:15:37
* @FilePath: \C\C200\C280\C289\3.cpp
*/
#include "leetcode.h"
class Solution {
public:
int maxTrailingZeros(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size... | true |
7476bbe3d7fbcdf0c52f54f0a2be5298ffedd6ef | C++ | jongtae0509/codeup | /1000/1618_1.cpp | UTF-8 | 547 | 2.875 | 3 | [] | no_license | /**************************************************************
1618번
jongtae0509
C++
정확한 풀이코드 길이:334 byte(s)
수행 시간:0 ms
메모리 :1120 kb
****************************************************************/
#include<stdio.h>
#include<algorithm>
using namespace std;
struct weight{
int a;
};
bool cmp(const weight &u, con... | true |
fbe41bd0c38ace97685da0ea06f4bbdb0e72e3ae | C++ | josemalone/Poulailler | /Context.h | UTF-8 | 4,649 | 2.96875 | 3 | [] | no_license | /* Persisting context b/w runs
*
* 30/10/2017 First version
* 20/12/2017 Full redesign
*/
#ifndef CONTEXT_H
#define CONTEXT_H
/* 1-wire */
#include <OWBus.h>
class Network;
class Context {
bool RTCvalid; // Is stored memory valid ?
class Network *net;
uint32_t offset; // Offset in memory for next data
OneW... | true |
d714d39d6793258f1303434774e0d334d160cb3b | C++ | prajogotio/upsolving | /CF:526:C/a.cpp | UTF-8 | 1,162 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
/**
Cool!
given xWa + yWb <= C,
maximize xHa + yHb.
1. if either Wa or Wb > sqrt C, iterate through those sqrt C choices
2. otherwise Wa & Wb < sqrt C.
WLOG Ha/Wa < Hb/Wb.
suppose x > Wb.
then xWa + yWb <= C
=> (x-Wb)Wa + Wb... | true |
72de1d36680dc768a41e5f6460d13d7459b1050e | C++ | AleksandarDincic/Zinda-OS | /ThreadList.cpp | UTF-8 | 1,248 | 3.09375 | 3 | [] | no_license | /*
* ThreadList.cpp
*
* Created on: Apr 9, 2020
* Author: OS1
*/
#include "PCB.h"
ThreadList::Node* ThreadList::add(PCB *t, Time waitTime){
Node *newNode = new Node(t, 0, 0, waitTime);
if(!head){
head = tail = newNode;
}
else{
newNode->prev=tail;
tail=tail->next=newNode;
}
return newNode;
}
PC... | true |
64c1da8cb7ea9bf286da50211554227624c3b5a0 | C++ | MoneyKicks/Codechef | /LONGSEQ.cpp | UTF-8 | 1,260 | 2.75 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int t;
char a[100001];
cin>>t;
cin.get();
while(t>0)
{
cin>>a;
if(a[0]=='\0')
{cout<<"Yes"<<endl;t--;continue;}
if(a[1]=='\0')
{cout<<"Yes"<<endl;t--;continue;}
... | true |
507dc1a86fd9aaaabd66679c64bbed8c9fa593ea | C++ | HelgeID/SnakeConsoleAPP | /build4_Snake, the final build/SnakeConsoleApp/SnakeConsoleApp/main.cpp | UTF-8 | 2,944 | 2.703125 | 3 | [] | no_license | #include <Windows.h>
#include <tchar.h>
#include "interface.h"
#include "engine.h"
#include "colors.h"
#define MAX_WIDTH 82 //width of the console
#define MAX_HIGHT 42 //height of the console
//flags
CHAR bKey;
BOOL gameOver;
BOOL closeConsole;
HANDLE hOut;
//function of the console
void SetWind... | true |
e2eee59a5cb8f3731e3f608f7a34d5893befa14b | C++ | petr-konovalov/c-projects | /cdb proj/timus/Паутина Ананси/main.cpp | UTF-8 | 1,413 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
int parent[100000];
int rankSet[100000];
int ccomp = 0;
int findSet(int v)
{
return parent[v] == v ? v : parent[v] = findSet(parent[v]);
}
void makeSet(int v)
{
parent[v] = v;
rankSet[v] = 0;
++ccomp;
}... | true |
77232feb76b9a361261694921fb987418afa1d04 | C++ | chinudev/program_cpp | /coding_interview/list/test_list.cpp | UTF-8 | 1,630 | 3.515625 | 4 | [] | no_license |
#include "list.hpp"
void test_makeList()
{
{
// We need to explicitly provide template type in absence of any arguments
auto head = makeList<int>({});
printList(head);
}
{
auto head = makeList({1,3,4});
printList(head);
}
{
auto head = makeList({"... | true |
5e6792b7537c6c4ce6b7b29ee232efa16ae3b647 | C++ | Ernesuma/replacerMpv | /ReplacerMPV/tagmapmodel.h | UTF-8 | 2,193 | 2.8125 | 3 | [
"MIT"
] | permissive | #ifndef TAGMAPMODEL_H
#define TAGMAPMODEL_H
#include <QDebug>
#include <QAbstractTableModel>
#include <QObject>
#include <QMap>
#include <QRegularExpression>
class TagMapModel : public QAbstractTableModel
{
Q_OBJECT
public:
// define types of the tag map
typedef QString tagMapKey;
typedef QString tag... | true |
1f8fad54e2ff7e84434220911acf2fdb535b4e27 | C++ | PavelErsh/C- | /s.cpp | UTF-8 | 282 | 2.6875 | 3 | [] | no_license | #include<iostream>
#include <cctype>
using namespace std;
int main (){
cout << "Enter doukv\n";
char word;
int kolvo = 0;
int kn = 0;
while (word != '@'){
if (isalnum(word))
kolvo++;
if (isdigit(word))
kn++;
cin.get(word);
}
cout <<"boukv " << kolvo << "nambers "<< kn << endl;
}
| true |
f63ae6807ac22469ece73778d93fa8a14c710a26 | C++ | wangxb96/PAT-Notes | /chapter1/21Boys vs Girls.cpp | GB18030 | 822 | 3.234375 | 3 | [] | no_license | //Boys vs Girls
#include<cstdio>
struct person{
char name[15];
char id[15];
int score;
}M,F,temp; //MΪͷϢFΪŮ߷Ϣ
void Init(){
M.score=10;
F.score=-1;
}
int main()
{
Init();
int n;
char gender;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%s %c %s %d",temp.name,&gender,temp.id,&temp.sc... | true |
f4dc6226f6425d5dbb0bd09b875eb081c263819d | C++ | verstecken/trampolin_final | /taste.cpp | UTF-8 | 1,682 | 2.71875 | 3 | [] | no_license | #include "taste.h" //include the declaration for this class
#include <MIDI.h>
MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDI); // using TX1 for sending MIDI signal
int Taste::globalVelo = 0;
static void Taste::overrideVelo(int velo) {
globalVelo = velo;
}
static void Taste::midibegin() {
MIDI.begin(MIDI_CHAN... | true |
b263841821dbb1fea7ba7497adc536cb87d8a75b | C++ | MiohitoKiri5474/CodesBackUp | /C++/TIOJ/1055.cpp | UTF-8 | 324 | 2.78125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
long long a, b;
cin >> a >> b;
if ( a > b )
for ( int i = a ; i >= b ; i-- ){
for ( int j = 0 ; j < i ; j++ )
cout << '*';
cout << endl;
}
else
for ( int i = a ; i <= b ; i++ ){
for ( int j = 0 ; j < i ; j++ )
cout << '*';
cout << endl;
... | true |
e7d5d61618b45d5284303d71f6c24677a735941e | C++ | Kiranchawla09/GFG | /Diameter_of_a_binary_tree.cpp | UTF-8 | 786 | 3.703125 | 4 | [] | no_license | /* Tree node structure used in the program
struct Node
{
int data;
struct Node* left;
struct Node* right;
Node(int x){
data = x;
left = right = NULL;
}
}; */
int height(struct Node* node)
{
if(node == NULL)
return 0;
return (1 + max(height(node->l... | true |
3661e81725f9e81a8320d91b376dbd79bdc13e0b | C++ | google-code/2013taller1c | /TpTaller/src/Menu.cpp | UTF-8 | 3,458 | 2.5625 | 3 | [] | no_license | /*
* Menu.cpp
*
* Created on: 23/03/2013
* Author: tomas
*/
#include <stdlib.h>
#include <iostream>
#include <Menu.h>
#include <view/Button.h>
#include <SDL/SDL_events.h>
const char* buttons_released[NUM_BUTTONS] = { "resources/menu/buttons/SP.png",
"resources/menu/buttons/MP.png",
"resources/menu/butt... | true |
c3e4033b62403de83ade1de26fca1f231f30574d | C++ | nikcherr/QTcpConnection | /QClient/client.cpp | UTF-8 | 1,480 | 3 | 3 | [] | no_license | #include "client.h"
Client::Client(QObject *parent)
{
socket = new QTcpSocket(this);
}
PortValid Client::setPortNumber(const std::__cxx11::string &port)
{
int socketPort = 0;
for(auto item : port){
if(isdigit(item)){
socketPort *= 10;
socketPort += item - '0';
}
... | true |
ed5040eea47478db4cdc7be0cd930639e24dddf7 | C++ | backupbrain/arduino-projects | /Nick/MOM_GET_THE_CAMRA/MOM_GET_THE_CAMRA.ino | UTF-8 | 1,364 | 2.765625 | 3 | [] | no_license | #include <Adafruit_NeoPixel.h>
const byte neopixelPin = 6;
const byte micPin = A5;
const uint8_t numPixels = 12;
const uint8_t numMicReadings = 255;
const uint8_t micReadDelay_ms = 200;
const uint8_t micRangeCutoff = 20;
uint8_t colors[numPixels] = { 0 };
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(numPixels, neo... | true |
e80bc850459835186d275e76205e1823af40444a | C++ | ANUPPRAMANIK/CS-ASSIGNMENT-3 | /Lab3_question21.cpp | UTF-8 | 315 | 2.796875 | 3 | [] | no_license | #include<iostream>
using namespace std;
main() {
float a,b;
cout<<" enter electric units used: ";
cin>>a;
if(a<=50)
b=a*0.5;
else
if(a>50 & a<=150)
b=(50*0.5)+(0.75*(a-50));
else
if(a>150 & a<=250)
b=100+(1.20*(a-150));
else
b=220+(1.5*(a-250));
b+=0.2*b;
cout<<" total electricity bill: "<<b;
}
| true |
2c7e9c44261def9eb9745f795bd4577fd915e2fc | C++ | jesus-barrera/process-scheduler | /src/main.cpp | UTF-8 | 1,313 | 2.6875 | 3 | [] | no_license | #include <cstdlib>
#include <ctime>
#include "ui/screen.h"
#include "ui/scheduler/MemoryView.h"
#include "ProcessScheduler.h"
#include "util.h"
void initialize();
void finalize();
void pause(std::string message);
ProcessScheduler *scheduler;
int main(void) {
int num_of_processes;
int quantum;
initializ... | true |
78782cd77e917f4021c24c10a68b07dc58bef828 | C++ | openhome/ohNetGenerated | /OpenHome/Net/Bindings/Cpp/Device/Providers/DvAvOpenhomeOrgTime1.h | UTF-8 | 3,505 | 2.515625 | 3 | [
"MIT"
] | permissive | #ifndef HEADER_DVAVOPENHOMEORGTIME1CPP
#define HEADER_DVAVOPENHOMEORGTIME1CPP
#include <OpenHome/Types.h>
#include <OpenHome/Buffer.h>
#include <OpenHome/Net/Cpp/DvDevice.h>
#include <OpenHome/Net/Core/DvProvider.h>
#include <OpenHome/Net/Cpp/DvInvocation.h>
#include <string>
namespace OpenHome {
namespace Net {
cl... | true |
4b90f78bd7b1b491ce3e5f83461be0129299d8a2 | C++ | write2maka/2021-Algo-1-Coursera-Princeton | /week-1-union-find/src/quickUnion.cpp | UTF-8 | 1,496 | 3.5625 | 4 | [] | no_license | /*
* quickUnion.cpp
*
* Created on: Aug 29, 2021
* Author: write2maka
*/
#include <quickUnion.h>
#include <iostream>
using namespace std;
//
// Constructor
//
QuickUnion::QuickUnion(int N) {
cout << "QuickUnion initialized with N=" << N << endl;
// Needed to print array
arraySize ... | true |
939df3942c87f86256b01669d3c432d9c481ff5f | C++ | dariadryha/Piscine_CPlusPlus | /GitDay01++/ex00/Pony.cpp | UTF-8 | 1,520 | 2.65625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Pony.cpp :+: :+: :+: ... | true |
2ffc934cfcc1f7c0ae210c3845f9b607b9d9bce8 | C++ | codingNonGuru/PlanetSimulator | /Source/Transform.cpp | UTF-8 | 1,495 | 2.671875 | 3 | [] | no_license | /*
* Transform.cpp
*
* Created on: Sep 25, 2016
* Author: andrei
*/
#include <math.h>
#include <gtc/matrix_transform.hpp>
#include "Transform.hpp"
#include "Scene.hpp"
Transform::Transform(Position position, Rotation rotation, Scale scale)
{
position_ = position;
rotation_ = rotation;
scale_ = scale;
}... | true |
6721ba98ffaba50fdbb09dc4bea2199bf8e7910a | C++ | Yunena/Solution-to-PTA | /1001 A+B Format.cpp | UTF-8 | 653 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main(int argc, char** argv)
{
int a, b;
cin>>a>>b;
int c = a+b;
string sign="", res="";
if(c==0) {cout<<"0"<<endl;return 0;}
//cout<<a<<" "<<b<<" "<<c<<endl;
if(c<0){
sign = "-";
c = -c;
}
int cnt = 0, mo... | true |
1d7e144d3298b2053dc54e2ff5217950d28e9c58 | C++ | mojtabaahn/simple-swagger | /app/Http/Livewire/Display.php.cp | UTF-8 | 1,161 | 2.75 | 3 | [] | no_license | <?php
namespace App\Http\Livewire;
use App\Support\SpecFactory;
use Livewire\Component;
use Symfony\Component\Yaml\Exception\ParseException;
class Display extends Component
{
protected $listeners = ['update' => 'setValue'];
public $value = '';
public function setValue($value)
{
$this->value... | true |
9b100778c76b8def729ab4b864e240a2937f05ec | C++ | sml0399/implementation_of_algorithms | /BOJ/code/018258_queue2.cpp | UTF-8 | 837 | 3 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <string>
using namespace std;
int main(void){
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int num_operations,number;
string oper="";
queue<int> q;
cin>>num_operations;
for(int i=0;i<num_operations;i++){
cin>>oper;
if(oper=="push"){
cin>>numb... | true |
31b4e9ecb2bf7d6ac2cad856eef581c0e5785029 | C++ | royks07/plankesorteringsanlegg-simulator-styringssystem | /PlankesorteringsAnlegg/Testbed/Tests/PlankesorteringsAnlegg/BaneSynkronisator.h | UTF-8 | 3,256 | 2.8125 | 3 | [
"Zlib"
] | permissive | /*
* BaneSynkronisator.h
*
* Created on: 17. nov. 2012
* Author: roy
*/
#ifndef BANESYNKRONISATOR_H_
#define BANESYNKRONISATOR_H_
#include <list>
#include <algorithm>
class BaneSensorPar{
public:
BaneSensorPar(Bane* bane,FaseSensor* sensor){
m_bane=bane;
m_sensor=sensor;
}
Bane * m_bane;
... | true |
d1c0051954b50f384a8125ccb45f67a78ffcee8a | C++ | AmiraliMohayaee/HMLite3D-Clone | /Handmade/Text.cpp | UTF-8 | 5,608 | 3.15625 | 3 | [] | no_license | #include <glew.h>
#include "ScreenManager.h"
#include "PipelineManager.h"
#include "Text.h"
//------------------------------------------------------------------------------------------------------
//constructor that assigns all default values
//-------------------------------------------------------------------... | true |
05dba6220190eaaf6d96cea2fe5af0af98d2a334 | C++ | Morcki/DataStructureTest | /MySTD/LinkHeap.h | UTF-8 | 1,131 | 3.296875 | 3 | [] | no_license | #pragma once
#ifndef LINKHEAP_H
#define LINKHEAP_H
template<class T,typename Tw>
class HNode {
T value;
Tw weight;
HNode<T,Tw>* left;
HNode<T,Tw>* right;
HNode() :value(0),weight(0) left(0), right(0) {};
HNode(T data.Tw w) :value(data), weight(w), left(0), right(0) {};
~HNode() { delete left; delete right; };
};... | true |
1a8269047d6a009686e716ca5eb10b044237fc80 | C++ | HowLeeHi/Reciter | /worditem.cpp | UTF-8 | 1,786 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include "worditem.h"
using namespace std;
WordItem::WordItem()
{
}
WordItem::~WordItem()
{
}
ofstream & operator <<(ofstream & ofs, WordItem & wl)
{
ofs << wl.word << endl << wl.part_of_speech << endl << wl.meaning << endl << wl.example << endl << wl.e... | true |
e05b328b9fe4c9f352211c75c8701822e4d3f40c | C++ | chillpert/matrix | /matrix/src/platform/gui/editor/Editor_Console.cpp | UTF-8 | 4,548 | 2.59375 | 3 | [] | no_license | #include "Editor_Console.h"
#include "Logger.h"
namespace MX
{
Editor_Console::Editor_Console(const char* name, ImGuiWindowFlags flags)
{
initialize(name, flags);
}
bool Editor_Console::initialize(const char* name, ImGuiWindowFlags flags)
{
m_clear_popup.initialize("Warning##Clear Console", ImGuiWin... | true |
53aeb6537581d56b2b30fb5e670b575ca7020241 | C++ | arunsiddharth/ESPHA | /ESP8266_BASE/setup_ESP.ino | UTF-8 | 3,330 | 2.578125 | 3 | [] | no_license | boolean setup_ESP(){
//Send AT to check it
ESP8266.print("AT\r\n");
if(read_until_ESP(keyword_OK,sizeof(keyword_OK),5000,0))//go look for keyword "OK" with a 5sec timeout
Serial.println("ESP CHECK OK");
else
Serial.println("ESP CHECK FAILED");
serial_dump_ESP();//this just reads everything in the ... | true |
c3ce7e290fe872ce845a90de50ae21307ef740ce | C++ | vaniugata/OnTargetEGT2017 | /04.xml-Student/src/Student.cpp | UTF-8 | 2,731 | 3.21875 | 3 | [] | no_license | #include "Student.h"
#include <sstream>
Student::Student(const std::string& firstName, const std::string& lastName,
const std::string& gender, const std::string& birthday,
const std::string& phoneNumber, const std::string& email, int course,
const std::string& speciality, long int facultyNumber,
const std::vec... | true |
43b470b3fd19b98b9d266b3759166bf72091ac4f | C++ | KhandokerEbrahim/OOP | /lab 2.cpp | UTF-8 | 904 | 2.875 | 3 | [] | no_license | // singlelab 2.cpp
#include<iostream>
using namespace std;
int n,i;
struct roo
{
double length;
double width;
} room[1000];
struct dis {
double ft;
double inch;
char dumycah;
} distance[1000];
void input() {
for(i=1; i<=n; i++)
{
cout <<"ENTER " <<i<<"th room length" <<... | true |
f01a9cf75ff4af2e5c5bc3106632328d28170a96 | C++ | JesusPacheco19/Programaci-n-II | /Sars.h | WINDOWS-1250 | 1,346 | 2.65625 | 3 | [] | no_license | #pragma once
#include"Virus.h"
class Sars:public Virus
{
public:
Sars(bool fiebre = 0,
bool tos = 0,
bool disnea = 0, bool escalofrios = 0,
bool dolorMuscular = 0,
bool dolorCabeza = 0,
bool diarrea = 0) :Virus(fiebre, tos, disnea) {
this->escalofrios = escalofrios;
this->dolorMuscular = dolo... | true |
10999673b34f76c9ecafa97af8a7c2fa0f82a9c2 | C++ | chelseali2001/CS162-Introduction-to-Computer-Science-II | /Labs/Lab 7/shape.cpp | UTF-8 | 411 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <cmath>
#include <stdexcept>
#include <exception>
#include "./shape.h"
using namespace std;
Shape::Shape(string n, string c) {
this->name = n;
this->color = c;
}
void Shape::print_shape_info(Shape &shape) {
cout << "Shape name: " << shape.name <<endl;
co... | true |
6791283f7987a3ebcee90baee7322def58b1e973 | C++ | snogglethorpe/compiler-algo | /fun-text-reader.cc | UTF-8 | 3,561 | 2.890625 | 3 | [] | no_license | // fun-text-reader.cc -- Text-format input of an IR function
//
// Copyright © 2019 Miles Bader
//
// Author: Miles Bader <snogglethorpe@gmail.com>
// Created: 2019-11-03
//
#include <stdexcept>
#include "fun.h"
#include "reg.h"
#include "value.h"
#include "cond-branch-insn.h"
#include "nop-insn.h"
#include "calc-i... | true |
a96f4c9ad299066b4df53f8242cc00de56dd124b | C++ | lazymonday/PS | /atcoder/abc_155/main.cpp | UTF-8 | 1,345 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
const int MAX = 2e5;
int a[MAX + 1];
ll n, k;
bool lessThanK(ll x, ll k) {
ll skip = 0;
for (int i = 0; i < n; ++i) {
if (a[i] < 0) {
int l = -1, h = n;
while (l + 1 < h) {
int ... | true |
eaa1121147c0209e1ebe8f537122b962f5c5a15b | C++ | Jmiceli17/ASEN5519 | /Homework1/src/rect_obstacle.hpp | UTF-8 | 648 | 2.5625 | 3 | [] | no_license | /*
* rect_obstacle.hpp
*
* Created on: Sep 18, 2020
* Author: Joe
*/
#ifndef RECT_OBSTACLE_HPP_
#define RECT_OBSTACLE_HPP_
#include <vector>
#include <cmath>
#include <iostream>
#include <windows.h>
class rect_obstacle
{
public:
// Member variables to store the locations of the obstacles vertices
std::v... | true |
2c1dfa79b2aa89fd12826bbfcc362ecd37fa25d7 | C++ | ibasanta69/C-programming-all-problems-solved-codes-Beignners- | /Enter 10 num in array.cxx | UTF-8 | 349 | 3.203125 | 3 | [] | no_license | //The program is Coded By Basanta Chaudhary
/* wap to enter in array and display */
#include <stdio.h>
#include <conio.h>
int main()
{
int a[10], i;
printf("Enter any Ten numbers:");
for (i = 0; i < 5; i++)
{
scanf("%d", &a[i]);
}
printf("You have entered 5 numbers!!");
for (i = 0; i < 5; i++)
{
print... | true |
8ed18d3c0df2d7368be2e6da4f41365fb72ba025 | C++ | elbaum/phys | /data/schunk_canopen_driver/src/icl_hardware_canopen/src/icl_hardware_canopen/PDO.h | UTF-8 | 10,583 | 2.890625 | 3 | [
"MIT",
"BSD-2-Clause"
] | permissive | // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
// -- BEGIN LICENSE BLOCK ----------------------------------------------
// This file is part of the SCHUNK Canopen Driver suite.
//
// This program is free software licensed under the LGPL
// (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
// ... | true |
95c82a4ca09c7b42b49d1718d243d829a941501b | C++ | naccuracy/3d-maze-shooter | /game_engine_cdb/src/3D/point3f.h | UTF-8 | 787 | 3.078125 | 3 | [] | no_license | #ifndef POINT3F_H
#define POINT3F_H
class Point3f
{
public:
Point3f(const Point3f &p);//copy constructor
Point3f(float x = 0.0, float y = 0.0, float z = 0.0);//constructor
~Point3f();
float data[4];//data data[0] = x data[1]= y data[2] = z data[3] = w;
void operator=(const Point3f& p);
Point3f operator+(const ... | true |
f96da2c4d3761bc26001be4106be450b2b46eb94 | C++ | xuguocong/LeetCodeAnswer | /leetCodemianshi/140.cpp | UTF-8 | 2,711 | 3.265625 | 3 | [] | no_license | // 140. 单词拆分 II
// 给定一个非空字符串 s 和一个包含非空单词列表的字典 wordDict,在字符串中增加空格来构建一个句子,使得句子中所有的单词都在词典中。返回所有这些可能的句子。
// 说明:
// 分隔时可以重复使用字典中的单词。
// 你可以假设字典中没有重复的单词。
// 示例 1:
// 输入:
// s = "catsanddog"
// wordDict = ["cat", "cats", "and", "sand", "dog"]
// 输出:
// [
// "cats and dog",
// "cat sand dog"
// ]
// 示例 2:
// 输入:
// s =... | true |
12d9645c4a5cbd66e85e262d69b22f35ea29a110 | C++ | jeffcore/intro-self-driving-cars-udacity | /Exercises/robot-localization/main.cpp | UTF-8 | 1,861 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include<numeric>
using namespace std;
vector<float> sense(vector<float> p, string Z, vector<string> world, float pHit, float pMiss) ;
vector<float> move(vector<float> p, int U);
int main() {
vector<float> p (5, 0.2);
vector<string> world (5);
world[0] = "green";
... | true |
5788ff10f287e5036da69739df659b42bc175831 | C++ | JacobMillward/opencl_fluids | /nclgl/Mesh.h | UTF-8 | 2,312 | 2.984375 | 3 | [] | no_license | /******************************************************************************
Class:Mesh
Implements:
Author:Rich Davison <richard.davison4@newcastle.ac.uk>
Description:Wrapper around OpenGL primitives, geometry and related
OGL functions.
There's a couple of extra functions in here that you didn't get in the tutoria... | true |
150e31f080cf8c295c178a5ed7ea8d2795ba50a7 | C++ | GOOOL-UFMS/Algoritmos-e-Programacao-II | /1 - Introdução à linguagem C e C++/Questionário 1 sobre a linguagem C e C++/Thiago Dias/somadigitos.cpp | UTF-8 | 259 | 2.90625 | 3 | [
"MIT"
] | permissive | #include<stdio.h>
int main() {
int intNum, umDigito, doisDigito, soma;
scanf("%d", &intNum);
umDigito = intNum % 10;
doisDigito = (intNum / 10) % 10;
soma = umDigito + doisDigito;
printf("%d\n", soma);
return 0;
}
| true |
80ed43d57cea58ce401bce9b14dc4f983de44d82 | C++ | dh00n/Algorithm | /code/pg12901.cpp | UTF-8 | 484 | 3.265625 | 3 | [] | no_license | #include <string>
#include <vector>
#include <iostream>
using namespace std;
string day[] = {"FRI", "SAT", "SUN", "MON", "TUE", "WED", "THU"};
int month[] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
string solution(int a, int b) {
int total = 0;
string answer = "";
for (int i = 0; i < a - 1; i++)... | true |
2d25ea2ac1fd8e75275625e1a4521a23a9ac4803 | C++ | shenyan0712/PDS | /src/ArcZeeMath/cldev.cpp | GB18030 | 12,517 | 2.5625 | 3 | [] | no_license |
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include "cldev.h"
#include "clBufferEx.h"
using namespace std;
//ʼCL豸, ҼϵopenCLƽ̨豸
int cldev::init(bool dispInfo)
{
cl::Platform::get(&platforms);
if (platforms.size() == 0)
{
std::cout << "Platform size 0\n";
r... | true |
26779f37c8c5efb33c5664c4dd36aded0d91b83d | C++ | romux09/SOA | /Proyecto1/NodeMCU Code/SOAMkII.ino | UTF-8 | 4,676 | 2.5625 | 3 | [] | no_license | #include <PubSubClient.h>
#include <NTPClient.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
// defines pins numbers
const int trigPin = D1; //D8
const int echoPin = D0; //D3
const int trigPin2 = D3;
const int echoPin2 = D2;
const char* ssid = "AndroidAPFAC7";
const char* password = "iwau2541";
const char* mqttSe... | true |
c242eb14a5bf737b89252ee038181fbc1b3feb2f | C++ | hisyamsk/tlx-toki | /pemrogaman-dasar/12 Rekursi/12_b.cpp | UTF-8 | 298 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
int f(int x) {
if (x == 1) {
return 1;
}
if (x % 2 == 0) {
return (x/2) * f(x-1);
} else {
return x * f(x-1);
}
}
int main() {
int n;
cin >> n;
int res = f(n);
cout << res << endl;
} | true |
f0683699acbd1257fe77aa16891bcf59e598725e | C++ | vikrant911998/C-Morning | /29Aug2019/first.cpp | UTF-8 | 371 | 3.390625 | 3 | [] | no_license | #include<iostream>
using namespace std;
// private,protected,public --> access specifiers
class A{
protected:
void play(){
cout<<"I am play of Class A in protected"<<endl;
}
};
class B:public A{
public:
void play1(){
play();
}
};
int main(){
A obj1... | true |
cea4cfcd5ce8f917f12ebaa6572e1be6b570e22f | C++ | EnesALTUN/c-dungeon-game | /c-dungeon-game/Equipment.h | UTF-8 | 641 | 3.28125 | 3 | [] | no_license | #pragma once
class Equipment
{
int _effect;
int _count;
int _cost;
public:
Equipment(int effect, int count, int cost)
{
this->_effect = effect;
this->_count = count;
this->_cost = cost;
}
#pragma region Getter Setter
void setFullVariable(int effect, int count)
{
this->_effect = effect;
this->_count... | true |
36c2ed1b0a76f0b9ceaed400c084bffc8ae48aac | C++ | Yura52/teaching | /2018_hse_cpp_seminars/seminar_6/std_vector.cpp | UTF-8 | 875 | 3.421875 | 3 | [] | no_license | #include <algorithm>
#include <initializer_list>
#include <iostream>
#include <iterator>
#include <utility>
class Vector {
public:
Vector() = default;
~Vector() {
delete[] data_;
}
const int* data() const {
return data_;
}
int* data() {
return const_cast<int*>(const_c... | true |
ae3cb44564c284a7bc05898f7136ef91605ecc9c | C++ | kedebug/AlgoTraining | /poj/3613/11533566_AC_250MS_1048K.cpp | UTF-8 | 1,492 | 2.734375 | 3 | [] | no_license |
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;
const int MAXN = 210;
class Matrix {
public:
int e[MAXN][MAXN], n;
void setn(int n) { this->n = n; }
void initvalue() { memset(e, 0x3F, sizeof(e)); }
Matrix operator = (const Matrix& o) {
for (int i = 1; i <= n; i+... | true |