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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6b00d62b38615d2474b97d225710f3362b56b222 | C++ | SeanCarlson91/Portfolio | /C++ Examples/Paycheck Calculator/Paycheck Calculator/Paycheck Calculator.cpp | UTF-8 | 6,450 | 3.59375 | 4 | [] | no_license | /*
This program is meant give me a rough estimate of what my monthly income will be after taxes and pre-tax deductions for a range of potential salaries.
*/
#include "pch.h"
#include <iostream>
#include <string>
#include <cstdlib>
//Containers
#include <list>
//Just in case there's a use for multithreading here.
#... | true |
0507215298f73e4775614eef639a3bbdf8dcec49 | C++ | B4c0nStr1ps/error-handling | /main.cpp | UTF-8 | 2,725 | 4 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <string>
#include "result.h"
/*
* When a function needs to return a value or an error you can use the
* bs::Result<T, E> type. Interally Result<T, E> use as storage a
* std::variant<Ok<T>, Err<E>>. Ok<T> and Err<E> are two wrapper objects used to
* mock rust Ok, Err syntax and to simpy... | true |
d8791cbbf6e4f42b5b5f6b8492ae4a595b98c36b | C++ | peterzcc/PGE | /pge/source/pge/constructs/Quaternion.h | UTF-8 | 3,657 | 3.25 | 3 | [
"Zlib"
] | permissive | #pragma once
#include <pge/constructs/Vec3f.h>
#include <pge/constructs/Vec4f.h>
#include <pge/constructs/Matrix3x3f.h>
#include <pge/constructs/Matrix4x4f.h>
namespace pge {
class Quaternion {
public:
static const float _quaternionNormalizationTolerance;
static const float _quaternionDotTolerance;
float w, ... | true |
99ce38d20e1f5625a9df2730f2be898168b38be2 | C++ | z397318716/C-Plus-Plus | /10_10_class_practice/10_10_class_practice/review_c.cpp | GB18030 | 974 | 2.9375 | 3 | [] | no_license | //#define _CRT_SECURE_NO_WARNINGS
//#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
//
//
//int check_sys1()
//{
// int i = 1;
// char *tmp = (char *)&i;
// return *tmp;
//}
//
//int check_sys2()
//{
// union
// {
// int i;
// char c;
// }un;
// un.i = 1;
//
// return un.c;
//}
//
//void GetMemory(char... | true |
4b469b2d3a2258b37c5860f228db5f41e83fe151 | C++ | CodeInSleep/Autonomous_Watering_System | /ButtonPair.h | UTF-8 | 537 | 2.734375 | 3 | [] | no_license | #ifndef BUTTONPAIR_H
#define BUTTONPAIR_H
#include "Arduino.h"
#include "Button.h"
class ButtonPair {
public:
ButtonPair(int p1, int p2, String b1Name, String b2Name, String buttonPairName);
int button_pressed(bool op);
void setVals(const int val, const int minVal, const int maxVal);
int getVal();
private:
int in... | true |
e5d4fa32f3649886f3bdd006ccf7463a762cfe5d | C++ | koryakinp/AutoYahtzee.Arduino | /StateManager.cpp | UTF-8 | 663 | 2.640625 | 3 | [] | no_license | #include "StateManager.h"
#include "States.h"
StateManager::StateManager() {
_currentState = 0;
_states[0] = States::THROW;
_states[1] = States::PRE_LOWER;
_states[2] = States::LOWER;
_states[3] = States::PRE_UNLOAD;
_states[4] = States::UNLOAD;
_states[5] = States::PRE_LIFT;
_states[6] = States::LIF... | true |
16b7b95141c3c500ba3ed1bd7594ce0d4cfd36fd | C++ | lyr19950720/data-structure | /assignment5/1144Tree Recovery/main.cpp | GB18030 | 722 | 3.03125 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<cstdio>
using namespace std;
char post[30]; //
int t = 0;
void solve(string pre, string in)
{
if (pre.length() == 0) return;
else if (pre.length() == 1)
{
post[t++] = pre[0];
return;
}
else {
int tt = in.find(pre[0]);//еλ
solve(pre.substr(1, tt), in.substr(0,... | true |
25da659912d2261b8bad22f7ccfd8b6c7e3d2f6f | C++ | Timoniche/Graphics | /Delaunay/main.cpp | UTF-8 | 35,411 | 2.875 | 3 | [] | no_license | /**#include <SFML/Graphics.hpp>*/
#include <SFML/Graphics.hpp>
#include <iostream>
#include <cassert>
#include <unordered_map>
#include <set>
#include <iomanip>
#include <vector>
#include <float.h>
#include <cmath>
#include <algorithm>
#include <functional>
#include <random>
using namespace std;
typedef pair<long do... | true |
78fc576d8a67f274d2e432129e1b63a8562530d5 | C++ | zhouchao0924/RTX_Render | /Source/ajdr/Cabinet/base/common.cpp | UTF-8 | 10,014 | 2.53125 | 3 | [] | no_license |
#include "common.h"
#include "../Building/BuildingSystem.h"
#include "../CabinetGlobal.h"
float Point2LineSeg(const FVector2D& point_A, const FVector2D& point_B, const FVector2D& point_P, float &fDot, FVector2D &point_C)
{
FVector2D AP = point_P - point_A;
FVector2D AB = point_B - point_A;
fDot = (AP | AB) / (AB |... | true |
04ba6b83c9805c7af32d8d1e2db45bfbe986e056 | C++ | foiki/spbu-Homeworks | /sem1/homework2/task3/main.cpp | UTF-8 | 902 | 3.828125 | 4 | [] | no_license | #include <iostream>
using namespace std;
void fareyAlorithm(int number)
{
int nominatorFirst = 0;
int denominatorFirst = 1;
int nominatorSecond = 1;
int denominatorSecond = number;
cout << nominatorFirst << "/" << denominatorFirst << endl;
while (nominatorSecond <= number)
{
int k ... | true |
86e191c82d346d9f277265dbfd245b60ae25efed | C++ | young1928/Cpp | /下降路径最小和.cpp | GB18030 | 1,355 | 3.265625 | 3 | [] | no_license | һ?AҪõͨ A ½·С͡
½·ԴӵһеκԪؿʼÿһѡһԪءһѡԪغ͵ǰѡԪһС
?
ʾ
룺[[1,2,3],[4,5,6],[7,8,9]]
12
ͣ
ܵ½·У
[1,4,7], [1,4,8], [1,5,7], [1,5,8], [1,5,9]
[2,4,7], [2,4,8], [2,5,7], [2,5,8], [2,5,9], [2,6,8], [2,6,9]
[3,5,7], [3,5,8], [3,5,9], [3,6,8], [3,6,9]
С½·?[1,4,7]Դ?12
?
ʾ
1 <= A.length == A[0].length <= 100
-100 <= A[i][j] <= 100
... | true |
76e6fe4cf48125fa3c35dca090f71af8104af4e8 | C++ | NikitaKhlopin/laboratory-work-2-semester | /lab18_8/person.cpp | UTF-8 | 821 | 4 | 4 | [] | no_license | #include <iostream>
#include "person.h"
Person::Person()
{
name = "";
age = 0;
}
Person::Person(std::string n, int a)
{
name = n;
age = a;
}
Person::~Person(){}
void Person::show()
{
std::cout << "Имя: " << name << std::endl << "Возраст: " << age << std::endl;
}
void Perso... | true |
9419b910fab5f70901cb76c61bc41faebce78c3c | C++ | ronenabr/backstage | /inwords_model/inwords_model_light/inwords_model_light.ino | UTF-8 | 5,212 | 3.078125 | 3 | [] | no_license | //use version 3001000 of `FastLed` librery.
#include "FastLED.h"
#include "math.h"
#include "led_setup.h"
//This is a crappy program that fades an array of led from a given color to a different color
// in given number of steps and given delay.
//I'm using crappy static varibles for the program. Deal with it.
// Will ... | true |
d7ea8c3ce2a2cd17ee9425771eae1506833e1db6 | C++ | rafapaz/megamanportal | /src/scenarium.cpp | UTF-8 | 2,866 | 2.765625 | 3 | [] | no_license | #include <allegro5/allegro5.h>
#include <vector>
#include <sstream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include "commom.h"
#include "scenarium.h"
Scenarium::Scenarium(Player *p)
{
player = p;
level = 1;
cameraPos[0] = cameraPos[1] = 0;
}
Scenarium::~Scenarium()
{
cleanLevel();
... | true |
a684c0c8e4eadfab8ead7bea5bc186b99d9e06e5 | C++ | flanggut/smvs | /tests/gtest_matrix_vector.cc | UTF-8 | 8,181 | 2.640625 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* Copyright (C) 2016, Fabian Langguth
* TU Darmstadt - Graphics, Capture and Massively Parallel Computing
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD 3-Clause license. See the LICENSE.txt file for details.
*/
#include <gtest/gtest.h>
#include "sse_ve... | true |
272732f9d6f1b6affdac5dc772fa9c0a205d64ed | C++ | AStoimenovGit/Median | /Demo/Demo/Map.h | UTF-8 | 2,185 | 3.375 | 3 | [] | no_license | #ifndef _Map_h_
#define _Map_h_
#include <map>
#include "Median.h"
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Map of values and number of their occurances
*/
template <class T, class Compare = std::less<T>>
class Map
: pu... | true |
38fafd4969b9324f5d830d5d4851457266ec9a69 | C++ | ebagli/ECHARM_CXX | /phi/src/ECHARM_lattice.cpp | UTF-8 | 8,091 | 2.765625 | 3 | [] | no_license | //
// ECHARM_lattice.cpp
//
//
// Created by Enrico Bagli on 04/06/12.
// Copyright 2012 Enrico Bagli. All rights reserved.
//
ECHARM_lattice::ECHARM_lattice()
{
InitializePointersLattice();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ECHARM_lattice::ECHARM_lattice(std... | true |
b019dbeb52d73d1f009ef704b2d8e880cb26f0c4 | C++ | RyanFluck/ECE0302 | /limited_size_bag_tests.cpp | UTF-8 | 774 | 3.125 | 3 | [] | no_license | #define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include "limited_size_bag.tpp"
// force template expansion for ints
template class LimitedSizeBag<int>;
TEST_CASE("Test 1", "[LimitedSizeBag]") {
LimitedSizeBag<int> limitbag;
REQUIRE(limitbag.getCurrentSize() == 10);
REQUIRE(limitbag.fillNum() == 0);
//placing in val... | true |
02461d62dc630ce14c95a3ccb65a9a99c3fad5e7 | C++ | DoobleD/Air | /Air/include/FingersListener.hpp | UTF-8 | 4,157 | 2.65625 | 3 | [] | no_license | #ifndef _FINGERS_LISTENER_HPP_
#define _FINGERS_LISTENER_HPP_
#include "XnFingersGenerator.hpp"
#include "MouseControl.hpp"
#include "OS/Screen.hpp"
namespace air
{
/**
* Handle the fingers related callbacks, which are called by xn::FingersGenerator.
* Transmitt fingers data to a MouseControl object, si... | true |
1876a1f5ff08ec8cc107798b2634daf906668d12 | C++ | ArfreeX/TravelingSalesmanProblem-PEA_1 | /tests/DataGenerator.h | UTF-8 | 907 | 2.953125 | 3 | [] | no_license | #ifndef DATAGENERATOR_H
#define DATAGENERATOR_H
#include <limits.h>
#include "helpers/FileStream.h"
#include "helpers/RandomNumberGenerator.h"
namespace tests {
class DataGenerator
{
public:
static std::vector<std::vector<int>> drawData(unsigned dataSize, unsigned dataRange)
{
helpers::FileStream fil... | true |
823c08b737042d6b92388fe5c85420d9639234d0 | C++ | tccmobile/Fall2017 | /PersonData.cpp | UTF-8 | 762 | 3.484375 | 3 | [] | no_license | //
// Created by Will Smith on 11/9/17.
//
#include "PersonData.h"
#include <iostream>
using namespace std;
void PersonData::SetAge(int ageYears) {
PersonData::ageYears = ageYears;
}
void PersonData::SetName(const string &lastName) {
PersonData::lastName = lastName;
}
void PersonData::PrintAll(){
cout ... | true |
6d1e34d8e5bdbc90a1330d71ebaedcaa10456e14 | C++ | sialiuk/TaskDispatcher | /TestSingleton/TestSingleton.cpp | UTF-8 | 2,301 | 2.859375 | 3 | [] | no_license | // TestSingleton.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <WinBase.h>
using namespace mtd;
namespace
{
struct Count
{
Count()
{
++m_count;
}
~Count()
{
}
static size_t m_count;
};
size_t Count::m_count = 0;
typedef ... | true |
d5846c91599c8861187460c6af53151daada3d0a | C++ | MeeSong/hvpp | /src/hvpp/hvpp/lib/mp.h | UTF-8 | 1,414 | 2.984375 | 3 | [
"MIT",
"LicenseRef-scancode-free-unknown",
"BSD-2-Clause"
] | permissive | #pragma once
#include <cstdint>
//
// Multi-Processor functions.
//
namespace mp
{
namespace detail
{
uint32_t cpu_count() noexcept;
uint32_t cpu_index() noexcept;
void sleep(uint32_t milliseconds) noexcept;
void ipi_call(void(*callback)(void*), void* context) noexcept;
}
inline uint3... | true |
30a3e97bf83913c424822bfa8a62058739adf65d | C++ | raynardbrown/graphics | /inc/graphics/Point2D.h | UTF-8 | 2,412 | 3.3125 | 3 | [] | no_license | ////////////////////////////////////////////////////////////////////////////////
//
// File: Point2D.h
//
// Author: Raynard Brown
//
// Copyright (c) 2020 Raynard Brown
//
// All rights reserved.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef GRAPHICS_POINT_H_
... | true |
c336f6367cddbdf473f2c0131923ce8a8cd14717 | C++ | xxxFilosoFxxx/TIMP | /task2_2/task2-2_main.cpp | UTF-8 | 2,045 | 2.640625 | 3 | [] | no_license | #include <iostream>
#include <time.h>
#include "vector"
#include <algorithm>
#include "sstream"
#include "../DDZ/OstTree.h"
using namespace std;
int main()
{
/* int **mas = new int*[20];
for(int i = 0; i < 20; i++)
{
mas[i] = new int(i);
cout << mas[i] << ' ';
}
for (int i = 0; i < ... | true |
197517934a59f055e68eec1df0256d1ab4fc00a9 | C++ | PersonalPete/MicroscopeController | /AutoFocus/afCentroidImages.cpp | UTF-8 | 4,457 | 2.546875 | 3 | [] | no_license | /* afCentroidImages.cpp
*
* RETURNS double imageCentroid
*
* ARGS INT hCam, INT mPtr,
* INT roiHMin, INT roiHMax,
* INT roiVMin, INT roiVMax,
* INT nFrames < 1000
*
* Computes the centroid within the ROI of the last nFrames images acquired
*/
#include "mex.h"
#include <iostre... | true |
160da17d1b061ee964c0689d4a14a83267bb251c | C++ | takikhasan/codebase | /Number Theory/nCr without mod (n is fixed).cpp | UTF-8 | 711 | 2.8125 | 3 | [] | no_license | ///*... nCr without mod ...*/
class nCrCalc
{
/// Time & space complexity: O(k), where k is
/// the maximum value of r in all nCr queries
private:
ULL n;
ULL* C;
int last;
gen(int st, int en)
{
for (int i = st; i <= en; i++) {
C[i] = C[i-1] * (n - i + 1);
... | true |
ea335d39998f90cf5a6006cd548583f8628ac7ed | C++ | tanvieer/ProblemSolving | /URI PROBS/1174.cpp | UTF-8 | 242 | 2.53125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int n = -1;
float i;
while (1){
n++;
if(n>99)
break;
cin>>i;
if(i<=10){
cout<<"A["<<n<<"] = " <<i<<endl;
}
}
}
| true |
ec4c998dfab513cca8af67059392ede65e53b16b | C++ | BipinKalra/CPP_Basics_2 | /textfiles/all codes.cpp | UTF-8 | 4,513 | 3.1875 | 3 | [] | no_license | #include<iostream>
#include<conio.h>
#include<fstream>
#include<ctype.h>
#include<string.h>
using namespace std;
void para()
{
ofstream fout;
fout.open("writing.txt",ios::app);
char para[100];
cout<<"ENTER CONTENT:";
cin.getline(para,100,'$');
fout<<para;
fout.close();
}
void line()
{
ofstre... | true |
dcad07d13d02581bcb487af1d53f30d5dfba7dbb | C++ | plaice/Williams | /07/lf_stack.h | UTF-8 | 2,188 | 3.46875 | 3 | [
"BSL-1.0"
] | permissive | // Listings 7.3-5, pp.187-190, Williams.
// Lock-free stack.
#include <atomic>
#include <memory>
template<typename T>
class lock_free_stack
{
private:
struct node
{
std::shared_ptr<T> data;
node* next;
node(T const& data_):
data(std::make_shared<T>(data_))
{}
};... | true |
51de31a9918d9348b769d3ed7fdd9932dfaa352a | C++ | raviswan/Elixir | /MiscProjects/Blackjack/dealer.h | UTF-8 | 1,083 | 2.796875 | 3 | [] | no_license | #ifndef _DEALER_H_
#define _DEALER_H_
#include <iostream>
#include <array>
#include <vector>
#include <map>
#include "player.h"
using namespace std;
using uint = unsigned int;
class Player;
enum class PlayerAction: int{
No_op =0,
Hit = 1,
Stand
};
class Dealer{
public:
Dealer();
~Dealer();
void initi... | true |
4ec61301df4eb355c8cbb1c9c4beb30e13d8a99d | C++ | gered/MonsterDefense | /src/framework/graphics/sprite3dshader.h | UTF-8 | 612 | 2.578125 | 3 | [] | no_license | #ifndef __FRAMEWORK_GRAPHICS_SPRITE3DSHADER_H_INCLUDED__
#define __FRAMEWORK_GRAPHICS_SPRITE3DSHADER_H_INCLUDED__
#include "spriteshader.h"
/**
* Shader for rendering 3D billboard sprites with vertex color modulation.
* Includes special support for color modulation using RGB, RGBA, and
* alpha-only texture forma... | true |
acf9c9e28838bcc1d92377539ad97d718fa663db | C++ | ziegfeld/leetcode | /LinkedListCycle/LinkedListCycle.cpp | UTF-8 | 998 | 3.6875 | 4 | [] | no_license | //============================================================================
// Linked List Cycle
// Given a linked list, determine if it has a cycle in it.
//
// Follow up:
// Can you solve it without using extra space?
//
// Complexity
// O(n)
//=====================================================================... | true |
2e130bd8f3c844472de716fcf6d5fdd584e1b189 | C++ | Pojemnik/game-of-life | /JJK/src/cell.cpp | UTF-8 | 1,450 | 3.0625 | 3 | [] | no_license | #include "cell.h"
const std::array<sf::Color, 12> Cell::colors = { sf::Color(255,0,0,255), sf::Color(255,128,0,255), sf::Color(255,255,0,255),
sf::Color(128,255,0,255), sf::Color(0,255,0,255), sf::Color(0, 255, 128,255), sf::Color(0,255,255,255),
sf::Color(0, 128, 255,255), sf::Color(0, 0, 255,255), sf::Color(128, 0... | true |
8e141b9ad049d3ac9ea00754d39e8bf4ba38359c | C++ | FinancialEngineerLab/Financial_Computing-cpp | /cfl/Function.hpp | UTF-8 | 16,571 | 3.1875 | 3 | [] | no_license | //Copyright (c) Dmitry Kramkov, 2000-2006. All rights reserved.
#ifndef __cflFunction_hpp__
#define __cflFunction_hpp__
#include <functional>
#include <limits>
#include <memory>
#include <valarray>
#include "cfl/Macros.hpp"
/**
* \file Function.hpp
* \author Dmitry Kramkov
* \date 2000-2006
*
* \brief O... | true |
857ff9b04b9c008453f4eb7242e1a2cec9301186 | C++ | ricetuan/Tetrominos | /Classes/Tetromino.cpp | UTF-8 | 4,210 | 2.796875 | 3 | [] | no_license |
//
// Tetromino.cpp
// Tetrominos
//
// Created by Liang Fan on 7/2/15.
//
//
#include "Tetromino.h"
#include "JSONPacker.h"
#include <unordered_set>
using namespace cocos2d;
Tetromino* Tetromino::createWithType(TetrominoType type)
{
Tetromino* tetromino = new (std::nothrow) Tetromino();
if (tetromino &&... | true |
d43c99f28937d1b478fc9dd4244d9b004243a9d9 | C++ | respu/ice | /include/ice/error.h | UTF-8 | 2,271 | 3 | 3 | [
"LicenseRef-scancode-gary-s-brown",
"BSD-3-Clause",
"MIT",
"Zlib",
"BSL-1.0",
"BSD-2-Clause"
] | permissive | #pragma once
#include <ice/exception.h>
#include <ice/optional.h>
#include <ostream>
#include <sstream>
#include <stdexcept>
#include <string>
#include <system_error>
#include <utility>
namespace ice {
template <typename T>
class error : public exception, public T {
public:
using manipulator = std::o... | true |
46df2d81ad3746c8ceb752ac40f986b3542831fd | C++ | sidorovis/cpp_craft_1013 | /solutions/ivan_sidarau/trade_processor_project/sources/market_data_receiver/main.cpp | UTF-8 | 642 | 2.640625 | 3 | [] | no_license | #include <config_reader.h>
#include <mediator.h>
boost::mutex wait_ctrl_c_protector;
boost::condition_variable pressed;
void ctrl_c_handler( int )
{
boost::mutex::scoped_lock lock( wait_ctrl_c_protector );
pressed.notify_one();
}
int main()
{
try
{
multicast_communication::mediator m( "." );
boost::mutex::... | true |
9f749548deef9d14f486a41058c01d43caa9413d | C++ | rjzupkoii/PSU-CIDD-Malaria-Simulation | /src/Reporters/Specialist/MovementReporter.cpp | UTF-8 | 5,225 | 2.8125 | 3 | [] | no_license | /*
* MovementReporter.cpp
*
* Implementation of the MovementReporter class.
*
* NOTE Since we assume this class will mostly be used for testing purposes, there
* is an assumed dependency on DbReporter having already initialized the database.
*
* NOTE This code could be significantly optimized; however, ... | true |
af602b307c25624284304c21dfb4cdcb471bebaa | C++ | Songsonge/First | /10.쿠키_작년문제비슷_더어려움.cpp | UHC | 3,843 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <random>
#include <string>
#include <fstream>
#include <algorithm>
using namespace std;
enum Tier { common, rare, epic, legend };
string NameofTier[4]{ "Ŀ", "", "","" }; //3. ߰
uniform_int_distribution<> nameuid(30, 80);
uniform_int_distribution<> hpuid(-50, 200);
uni... | true |
ab74c1eda0d97463cd57b99daf29c81843f7e2d4 | C++ | goodgodgd/DesignPatternCpp | /강사/20160330/6_일반적프로그래밍.cpp | UHC | 1,717 | 3.796875 | 4 | [] | no_license | #include <iostream>
using namespace std;
// Ϲ α
// C++ ̺귯 ϱ ؼ Ϲȭ ؾ մϴ.
// C++ - OOP + Ϲȭ(Generic)
// C ڿ Լ
char* xstrchr(char *s, char c)
{
while (*s != '\0' && *s != c)
++s;
return *s == c ? s : NULL;
}
// 1. ˻ Ϲȭ : κ ڿ ˻ ϰ .
// [first, last) - ݰ
char* xstrchr(char* first, char* last, char value)
{
w... | true |
d8dd3a4c861ecef1b73e5a085078d0680a0b1d7f | C++ | noahmasur/CPSC350_Assignment4 | /Window.cpp | UTF-8 | 552 | 3.03125 | 3 | [] | no_license | #include "Window.h"
//default
Window::Window(){
m_timeFree = 0;
m_timeArrived = 0;
}
//destructor
Window::~Window(){
}
//function to get the free times of the window
int Window::getTimeFree(){
return m_timeFree;
}
//set free time
void Window::setTimeFree(int timeFree){
m_timeFree = timeFree;
}
//get the time t... | true |
d1a6a411ed16e3905abb20a9e71ce80441326be3 | C++ | MarcoBetance0327/C_plus_plus | /2. Expresiones/Ejercicio3.cpp | UTF-8 | 424 | 3.296875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
float a, b, c, d, resul;
cout << "Ingrese el valor de a: "; cin >> a;
cout << "Ingrese el valor de b: "; cin >> b;
cout << "Ingrese el valor de c: "; cin >> c;
cout << "Ingrese el valor de d: "; cin >> d;
resul = a + (b / (c ... | true |
3433bcf0ef037a59127eb2d7a3a44c84d279d4a4 | C++ | Manhisme09/OOP | /kethuab2.cpp | UTF-8 | 1,290 | 3.046875 | 3 | [] | no_license | #include<iostream>
#include<iomanip>
using namespace std;
class vehicle{
private:
string nhanHieu;
int namsx;
string hang;
public:
void nhap();
void xuat();
};
class oto : public vehicle{
private:
int soChoNgoi;
double dungTich;
public:
void nhap();
void xuat();
void sua();
};
class moto : pu... | true |
a60e9c56401a0074feb0a2e788d412a0fa81b59c | C++ | leonefrain86/AyEdeD | /src/Lección 1/Leccion 112/ejercicio_1128/ejercicio1128.cpp | UTF-8 | 1,757 | 3.15625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int d = 1, dMyr, p, contP = 0, contPersonas, contTP;
double i, sumP = 0, sumTP = 0, sumPMyr = 0;
char continuar;
while(d != 0)
{
cout << "Ingrese DNI: ";
cin >> d;
if(d != 0)
{
continuar = 'S';
... | true |
3f063d238b53dfc849bdb8dac6248d97b9650049 | C++ | jasminedayinta/cplusplus2 | /Assignment 3/a3p5/WindGauge.h | UTF-8 | 483 | 2.640625 | 3 | [] | no_license | //
// WindGauge.hpp
// a3p5
//
// Created by Jasmine Juwono on 08.04.18.
// Copyright © 2018 Jasmine Juwono. All rights reserved.
//
/*CH08-320143
a3_p5.cpp
Jasmine Dayinta
j.dayinta@jacobs-university.de*/
#include <stdio.h>
#include <deque>
using namespace std;
class WindGauge{
public:
WindGauge(int per... | true |
e74a2edb22dc27cc0b9e80ddd294bb5ee0105b8a | C++ | nathanaelFixx/Array-List-and-Sorting | /List and Sorting/arrayList.cpp | UTF-8 | 3,620 | 3.71875 | 4 | [] | no_license | #include "arrayList.h"
using namespace std;
template <class TYPE>
ArrayList<TYPE>::ArrayList(int initialSize)
{
maxLength = initialSize;
currentLength = 0;
items = new TYPE[initialSize];
originalLength = initialSize;
}
template<class TYPE>
ArrayList<TYPE>::ArrayList(const ArrayList & rhs)
{
items = NULL;
*thi... | true |
bd559f9ba3951ba710b5f1e53739fce5ab6d8e3f | C++ | Sharayu1071/Daily-Coding-DS-ALGO-Practice | /Codeforces/C++/Q1_Lucky_sum_of_digits.cpp | UTF-8 | 1,563 | 3.71875 | 4 | [
"MIT"
] | permissive | //------Lucky Sum of Digits Explanation------//
// Problem link is:
// https://codeforces.com/contest/110/problem/C
/*
Problem Statement:
Petya loves lucky numbers. We all know that lucky numbers are the positive
integers whose decimal representations contain only the lucky digits 4 and 7.
For example, numbers 47, 74... | true |
7060ed4fe8da135ed0f8ce7454e8d8c6895f45ed | C++ | adiravishankara/arduino_tutorials | /Code/tutorial5/motor_drive_us/rc_control.ino | UTF-8 | 909 | 2.53125 | 3 | [] | no_license | void remote_vals(decode_results *results){
if(results->value == 0xFF629D){
Serial.print("VOL + PRESSED, motor speed: ");
motor_speed += 20;
motor_speed = constrain(motor_speed,100,255);
Serial.println(motor_speed);
}
else if (results->value == 0xFFA857){
Serial.print("VOL - PRESSED, motor spee... | true |
3b0b8c0eeb114b02e7e55873de59c3e38123ad32 | C++ | abhisheksaxena1998/SortingAlgorithms.cpp | /insertion-sort.cpp | UTF-8 | 2,033 | 4.1875 | 4 | [
"MIT"
] | permissive | # include "includeAll.h"
using namespace std;
// "Insertion Sort" Sorting Algorithm Time Complexity O(N^2).
void sort (int *listOfElements, int size) {
// This sorting method works by doing inplace comparison between it's
// elements, basically the algorithm Assumes that from index 0 to the hole
// all ele... | true |
d4d5b3b3c6bd25cbd6fa4d7a4e3d61d9bcbf53b1 | C++ | micro-pi/MaixduinoAutonomousDriveESP32 | /src/modules/Module.cpp | UTF-8 | 358 | 2.578125 | 3 | [] | no_license | #include "Module.h"
Module::Module(const char *name) : moduleName(name) {
this->errorCode = E_NOK;
}
ErrorCode Module::init(void) {
this->errorCode = initModule();
return this->errorCode;
}
const char *Module::getName(void) {
return this->moduleName;
}
ErrorCode Module::getErrorCode(void) {
return this->e... | true |
f7e2b965a775b7ce355ccdc11602ad824f26a4f4 | C++ | Xzzzh/cpplearn | /20170413/src/String.cc | UTF-8 | 1,079 | 3.265625 | 3 | [] | no_license | ///
/// @file String.cc
/// @author lemon(haohb13@gmail.com)
/// @date 2017-04-13 09:44:53
///
#include <stdio.h>
#include <string.h>
#include <iostream>
using std::cout;
using std::endl;
class String
{
public:
String()
: _pstr(new char[1])
{
}
String(const char* pstr)
: _pstr(new char[strlen(pstr... | true |
645ea65bfe56226a282d0f7dbfb4cf5c70090963 | C++ | lonteray/tetris | /gamefield.cpp | UTF-8 | 3,165 | 3.03125 | 3 | [] | no_license | #include "gamefield.h"
#include "tile.h"
#include "drawingsystem.h"
#include <iostream>
GameField::GameField(int w, int h) : width(w), height(h)
{
field = new FieldCell*[height];
for (int row = 0; row < height; row++)
field[row] = new FieldCell[width];
fieldBorder = sf::RectangleShape(sf::Vector... | true |
8435f923a2de1fb8064b66286b6a293de505050e | C++ | dinesh5583/Data-Structure-and-Algorithm-using-c- | /Data Structure and algorithm/Queue/dynamic_queue_array.cpp | UTF-8 | 2,458 | 3.609375 | 4 | [] | no_license | #include<iostream>
#include<conio.h>
#include<stdlib.h>
using namespace std;
class dyqueue
{
public:
int capacity;
int front,rear;
int *array;
};
class queue{
public:
dyqueue *q=new dyqueue;
queue()
{
q->front=q->rear=-1;
q->capacity=1;
q->array=new int[q->capacity];
}
void enqueue(in... | true |
8c14a8d4b49ccb7958e81de6dc48e708c702e8e7 | C++ | paksas/Tamy | /Code/Include/core/FilesystemSection.h | UTF-8 | 3,161 | 2.84375 | 3 | [] | no_license | /// @file core/FilesystemSection.h
/// @brief a section of the filesystem that filters out all directories except for the selected few
#pragma once
#include <vector>
#include "core\Filesystem.h"
#include "core\MemoryRouter.h"
///////////////////////////////////////////////////////////////////////////////
class F... | true |
73f3a1a11749a4ea61517a6e91fa89de6e6550dc | C++ | nagyist/ParaView | /Examples/Catalyst/TemporalCacheExample/FEDataStructures.h | UTF-8 | 1,620 | 2.734375 | 3 | [
"BSD-3-Clause"
] | permissive | // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
// SPDX-License-Identifier: BSD-3-Clause
/**
The code for the toy simulation itself is here. In this example we
make a configurable number of random sized spheres, and make them
bounce around in a cube. At each timestep we move the spheres, and then
sample them onto... | true |
cfb27cb3e3ecb3348206345fbf1b9921267b5119 | C++ | sam-slate/day-in-the-life | /event.cpp | UTF-8 | 3,038 | 3.109375 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
#include <string>
#include <stdlib.h>
#include <time.h>
#include "event.h"
#include "game.h"
#include <unistd.h>
Event :: Event(){
}
Event :: Event(int id, bool random, string name,
string message){
this->id = id;
this->random = random;
this->name = name;
this->... | true |
39235b615c1c5dba4cbfb87f3d014f4e8acbaec9 | C++ | nschantz21/Accelerated_C- | /chap14/grading.cpp | UTF-8 | 1,565 | 3.53125 | 4 | [] | no_license | #include<vector>
#include<algorithm>
#include<iostream>
#include<string>
#include"Handle.h"
#include"Core.h"
#include<iomanip>
#include<stdexcept>
using namespace std;
// exercise 14-1
bool compare_Core_pointers(const Ptr<Core>& hc1, const Ptr<Core>& hc2){
return hc1->name() < hc2->name();
}
int main(){
ve... | true |
3d3580664831820c183165fde8232599f3f6cd0d | C++ | tetat/Codeforces-Problems-Sol | /Difficulty800/1077A.cpp | UTF-8 | 565 | 2.984375 | 3 | [] | no_license | /// Problem Name: Frog Jumping
/// Problem Link: https://codeforces.com/problemset/problem/1077/A
#include <iostream>
#include <cstdio>
using namespace std;
#define lol long long int
int main()
{
int t;scanf("%d", &t);
while (t--){
lol a, b, k;
cin >> a >> b >> k;
if (k==... | true |
422e4f4e00d2cf0be4650ecfb2bd9214aae68ee9 | C++ | Wahed08/ACM-Problem-Solving | /Getting An A.cpp | UTF-8 | 990 | 2.6875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int myf(int a,int b)
{
return a>b;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
int n,sum=0,cnt=0;
cin>>n;
int arr[n];
for(int i=0; i<n; i++)
{
cin>>arr[i];
sum+=arr[i];
}
sort(arr,arr+n)... | true |
dedbcf92340ed69111ba173565c75785c12f6c63 | C++ | EricDDK/leetcode_brush | /algorithms/047_PermutationsII/main_set_2000+ms.cpp | UTF-8 | 1,321 | 3.265625 | 3 | [] | no_license | //Given a collection of numbers that might contain duplicates, return all possible unique permutations.
#include<sstream>
#include "iostream"
#include <cstdint>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include "algorithm"
#include <stack>
#include <string>
#include <queue>
using names... | true |
00042a92bf7ab25a3301a1b251acd486940ec26a | C++ | alinaseri25/Qt_jalalidate | /qdatejalali.cpp | UTF-8 | 6,752 | 2.734375 | 3 | [] | no_license | #include "qdatejalali.h"
QDATEJALALI::QDATEJALALI(QObject *parent) : QObject(parent)
{
this->setParent(parent);
shmdate.day = shmdate.month = 0; shmdate.year = 0 - 1300;
mildate.day = mildate.month = 0;mildate.year = 0 - 2000;
}
bool QDATEJALALI::SetMiladiDate(int _year, int _month, int _day, int _dayOfWe... | true |
9d84d0b9ad966186cfc8c3fdd5f6386b782ef3a1 | C++ | maxrake/CppCourse | /Instructor Solutions/TypeExamplesAndHelloWorld!/constexpr/Source.cpp | UTF-8 | 1,192 | 3.421875 | 3 | [] | no_license | #include <iostream>
#include <limits>
namespace cppcourse //needed as the global namespace gets poluted when limits includes cmath which includes math.h
{
constexpr int square(int x)
{
return x*x;
}
constexpr long long_max()
{
return std::numeric_limits<long>::max();
... | true |
1c9e6df9e4c79c165236ebc1f5a81c451f4fc07b | C++ | kylchien/Prac | /Bit/PowerSet.h | UTF-8 | 1,022 | 3.46875 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <map>
using namespace std;
/*
given {x, y ,z} return {} {x} {y} {z} {xy} {xz} {yz} {xyz}
For the whole power set of S we get:
{ } = 000 (Binary) = 0 (Decimal)
{x} = 100 = 4
{y} = 010 = 2
{z} = 001 = 1
{x,... | true |
7419c29c490797df6f38cf3261f1b96b8a8807ba | C++ | alexandraback/datacollection | /solutions_5766201229705216_0/C++/entri/main.cpp | UTF-8 | 1,980 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
using namespace std;
int T;
const int maxN = 1005;
const int INF = 1000000;
//bool mark[maxN][maxN];
int N;
vector<pair<int,int> > Edge;
vector<int> AdjOf[maxN];
int DegreeOf[maxN];
... | true |
8c0d4ed73c1c1dfafa6e8ad84c60e6e6908a1276 | C++ | kevinMkY/CPP_ALGO | /testC++++/题库14合并k个已升序链表.cpp | UTF-8 | 1,429 | 3.03125 | 3 | [] | no_license | //
// 题库14合并k个已升序链表.cpp
// testC++++
//
// Created by yekaihua on 2021/3/7.
//
#include "题库14合并k个已升序链表.hpp"
#include "common.h"
ListNode *_tk_14_test_merge2Lists(ListNode *l1,ListNode *l2){
if(!l1)return l2;
if(!l2)return l1;
if(l1->val <= l2->val){
l1->next = _tk_14_test_merge2Lists(l1->n... | true |
7c28a474dce86555952fc920cad8f38bb358f039 | C++ | kks227/BOJ | /3400/3473.cpp | UTF-8 | 2,038 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <stack>
#include <vector>
#include <utility>
#include <cctype>
using namespace std;
typedef pair<char, string> Node;
int main(){
int T;
cin >> T;
for(int t = 0; t < T; ++t){
string E;
cin >> E;
stack<char> S1;
vector<char> P;
for(char c: E){
if(c == '('){
... | true |
03b71c3b2a5d0ea06cfe9461531d1bb085497b4b | C++ | mtoutai/fastq_index | /fastq_index.cpp | UTF-8 | 5,079 | 2.5625 | 3 | [
"LicenseRef-scancode-public-domain",
"CC0-1.0"
] | permissive | // fastq_index.c
//
// THIS SOFTWARE IS DISTRIBUTED UNDER
// CC0 1.0 Universal
// Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
//
// Developed by:
// TOTAI MITSUYAMA, PhD.
// Biotechnology Research Institute for Drug Discovery
// National Institute of Advanced Industrial Science and Te... | true |
e09b1b1503e6b4ed3ca89586ca8eb17e21295867 | C++ | gverhelp/19_CPP | /cpp07/ex02/Array.hpp | UTF-8 | 1,837 | 3.625 | 4 | [] | no_license | #ifndef ARRAY_HPP
# define ARRAY_HPP
# include <iostream>
template<typename T>
class Array
{
public:
Array();
Array(unsigned int n);
Array(const Array ©);
Array& operator=(const Array ©);
T& operator[](unsigned int const a);
~Array();
unsigned int s... | true |
1cac3bdd724a4456ec27ac830ed34666b7dc8f57 | C++ | grimtraveller/voice2midi | /source/voice2midi/fft.cpp | UTF-8 | 3,881 | 2.515625 | 3 | [] | no_license | // fft.cpp : Defines the entry point for the console application.
//
#include "math.h"
#define DDC_PI 3.1415926;
int IsPowerOfTwo ( int x )
{
if ( x < 2 )
return 0;
if ( x & (x-1) ) // Thanks to 'byang' for this cute trick!
return 0;
return 1;
}
int NumberOfB... | true |
12cddd29350cd3fe906b1856c95924680e7cd377 | C++ | wangxianghust/leetcode | /52NQueens.cpp | UTF-8 | 1,447 | 3.640625 | 4 | [
"MIT"
] | permissive | /*求出NQueens的解
* 经典的回溯法就可以解决,稍微tricky的地方是,matrix不是用二维矩阵保存的,一维就可以
*/
#include <vector>
#include <string>
#include <iostream>
using namespace std;
class Solution {
public:
int totalNQueens(int n) {
vector<int> matrix(n, -1);//every row have one queen, the value is the column index.
int ret = 0;
... | true |
817205cd46f3dfd704d5c03ada53b9357f8e30f5 | C++ | jDellsperger/tafl | /src/Board.h | UTF-8 | 1,791 | 2.921875 | 3 | [
"BSD-2-Clause-Views"
] | permissive | #ifndef BOARD_H
const uint8_t DIM = 7;
const Vector2 DIRECTIONS[4] = {
{0, 1},
{0, -1},
{1, 0},
{-1, 0}
};
#include "Gamestate.h"
class ZobristNode
{
public:
ZobristNode* next = nullptr;
GameState state;
};
class ZobristEntryNode
{
public:
ZobristNode* firstNode = nullptr;
};
cl... | true |
b9497da6de94dbbe5f8760272394206060d11799 | C++ | Taekleee/Algoritmos-num-ricos | /Lab2/Integracion/test/escribir.h | UTF-8 | 2,709 | 3.0625 | 3 | [] | no_license | #include <fstream>
#include <iostream>
#include <vector>
using namespace std;
void escribirErrores(long double );
void escribirIntegrales(long double ec1Trapecio, long double ec2Trapecio);
void escribirErrores(long double errores[24]){
ofstream archivo("errores.txt");
if(archivo.is_open()){
archivo <<"DifD_A1_E... | true |
8265b7b6ff9f1ce95a7f981f1c221faeb14d4744 | C++ | alexandraback/datacollection | /solutions_2449486_1/C++/paladin8/B.cc | UTF-8 | 709 | 2.546875 | 3 | [] | no_license | #include <iostream>
#include <memory.h>
using namespace std;
int a[110][110], maxr[110], maxc[110];
int main() {
int t; cin >> t;
for (int c = 1; c <= t; c++) {
int n, m; cin >> n >> m;
memset(maxr, 0, sizeof(maxr));
memset(maxc, 0, sizeof(maxc));
for (int i = 0; i < n; i++)
for... | true |
fe03e946cf87fdf4f2df763cff7e216bf53f5bd9 | C++ | jpaterso/fire-engine | /src/FPSCalculator.cpp | UTF-8 | 1,025 | 2.78125 | 3 | [] | no_license | /**
* FILE: FPSCalculator.cpp
* AUTHOR: Joseph Paterson ( joseph dot paterson at gmail dot com )
* RCS ID: $Id: FPSCalculator.cpp 110 2007-09-23 15:57:55Z jpaterso $
* PURPOSE: A simple class to calculate the number of frames per second.
**/
#include "FPSCalculator.h"
#include "Timer.h"
namespace fire_engine
{
... | true |
5ac6730615b252d511ae6250c9dd0d2a35d40f1e | C++ | RTCSD2016/notes | /grp_cpp/PWM3/PWMTASK2.CPP | UTF-8 | 1,035 | 2.78125 | 3 | [] | no_license | // Inherited classes for PWM -- the only substantive
// material here is the PWMOn and PWMOff functions
// File: pwmtask2.cpp
// created 12/25/95, DM Auslander
#include <iostream.h>
#include <string.h>
#include "tasks.hpp"
PWMTask2::PWMTask2(char *aName) : PWMBaseTask (aName)
{
// Nothing to initialize here -- it... | true |
dee48e70dfa20db8e1d817c704284bc2ebc770b1 | C++ | bldbld/cpp-common | /poj.cpp/prob1003.cpp | UTF-8 | 1,878 | 3.40625 | 3 | [] | no_license | // POJ 1003 Hangover
//
// Description
// How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular to the table.) With two cards you can make the top card overhang the bottom one by half a... | true |
254c11edcbdf6effd438c1fba68b8ea5d0b3993f | C++ | mtriston/ft_containers | /list.hpp | UTF-8 | 15,117 | 3.234375 | 3 | [] | no_license | //
// Created by mtriston on 09.02.2021.
//
#ifndef FT_CONTAINERS_LIST_HPP
#define FT_CONTAINERS_LIST_HPP
#include "utils.hpp"
namespace ft {
template<typename T>
struct ListNode;
template<typename T>
class list_iterator {
private:
typedef list_iterator<T> Self;
typedef ListNode<T> Node;
Node *_node;
pub... | true |
692ff60dfe608a57a1ccba0b989a0f8045fd6790 | C++ | codeserfer/2-term | /forum4/forum4/TheMatrix.h | UTF-8 | 424 | 2.796875 | 3 | [] | no_license | #pragma once
class TheMatrix {
int** array;
int N, M;
public:
TheMatrix(void);
TheMatrix(int N, int M);
~TheMatrix(void);
void show();
void fillMatrix();
void getMemory(int, int);
TheMatrix& operator*(const int num);
friend TheMatrix& operator*(const TheMatrix& A, const TheMatrix& B);
friend The... | true |
0a70ac56403176a1e750382c13899f98dcccc789 | C++ | marco-c/gecko-dev-comments-removed | /gfx/harfbuzz/src/hb-object.hh | UTF-8 | 6,867 | 2.75 | 3 | [
"LicenseRef-scancode-other-permissive",
"MIT-Modern-Variant",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
#ifndef HB_OBJECT_HH
#define HB_OBJECT_HH
#include "hb.hh"
#include "hb-atomic.hh"
#include "hb-mutex.hh"
#include "hb-vector.hh"
template <typename item_t, typename lock_t>
struct hb_lockable_set_t
{
hb_vector_t<item_t> items;
void init () { items.init (); }
template <type... | true |
fec68c1afe09f7b2b1aa433e4a297ef250211dc5 | C++ | fenix0111/Algorithm | /Leetcode/646. Maximum Length of Pair Chain/maximum_length_of_pair_chain_dp.cpp | UTF-8 | 832 | 3.15625 | 3 | [] | no_license | // Leetcode 646. Maximum Length of Pair Chain
// https://leetcode.com/problems/maximum-length-of-pair-chain/
// time complexity: O(N^2)
// space complexity: O(N)
class Solution
{
public:
int findLongestChain(vector<vector<int>>& pairs)
{
sort(pairs.begin(), pairs.end(), [](vector<int>& x, vector<int>& ... | true |
e3e5faeb7c0680353856775a79a5864fbd3f805a | C++ | namanworld/Codechef-Solutions-Competitive-Programming | /Penalty Shoot-Out || (PSHOT).cpp | UTF-8 | 697 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
#define int long long
#define MOD 1000000007
#define INF 100000000000000
using namespace std;
int time(string s, int n){
int A_goals = 0, B_goals = 0;
int rem_A = n/2, rem_B = n/2;
for(int i=0; i<n; i++){
if((i&1) == 0) {
A_goals+=s[i]-'0';
r... | true |
32e39095db4f3da8c233d40f81f50cea25a82d85 | C++ | overnew/CodeSaving | /Dynamic Programming(동적 계획법)/[BaekJoon]_2494_숫자 맞추기.cpp | UTF-8 | 1,801 | 3.171875 | 3 | [] | no_license | //https://www.acmicpc.net/problem/2494
#include<iostream>
#include<string.h>
#include<string>
using namespace std;
typedef struct state {
int total_turn = -1; //전체 회전횟수
int turn = 0; //이번 나사에서의 회전
}State;
State dp[10000][10]; //[숫자나사][현재의 수]
char init[10000], dest[10000];
int screw_num;
const int MOD = 10;
int T... | true |
8bf8bb62fa451e232b94e22bfd89178eb997e288 | C++ | denis-gubar/Leetcode | /Array/2552. Count Increasing Quadruplets.cpp | UTF-8 | 826 | 2.609375 | 3 | [] | no_license | class Solution {
public:
long long countQuadruplets(vector<int>& nums) {
long long result = 0;
for (int& x : nums)
--x;
int N = nums.size();
vector<vector<int>> A(N + 1, vector<int>(N + 1));
vector<vector<int>> B(N + 1, vector<int>(N + 1));
for (int i = 0;... | true |
cfb312332e846b1b6f83709e604aacfb19c11896 | C++ | Woooosz/AlgorithmTrainSet | /PAT-Advanced/1051. Pop Sequence (25).cpp | UTF-8 | 682 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
int main() {
int n, m, k;
scanf("%d %d %d", &m, &n, &k);
for(int i = 0; i < k; ++i) {
stack<int> s;
vector<int> d(n);
for(int j = 0; j < n; ++j)
scanf("%d", &d[j]);
bool ans = false;
... | true |
fee4d9014facf7a76c94d1b7920ce47795241198 | C++ | rohitopal23/SDE-sheet | /Heap/Reorganize String.cpp | UTF-8 | 1,366 | 2.8125 | 3 | [] | no_license | class Solution {
public:
string reorganizeString(string S) {
string ans;
priority_queue<pair<int,int>> pq;
map<char,int>mp;
for(char ch:S){
mp[ch]++;
}
for(char ch='a'; ch<='z'; ch++){
if(mp[ch]>0){
pq.push(mak... | true |
1ec41b9c8384e4322b67ef4d26ad6086f3a34392 | C++ | wonny-Jo/algorithm | /알고리즘 정리/그래프/문제풀이/가장 먼 노드.cpp | UTF-8 | 1,200 | 2.71875 | 3 | [] | no_license | #include<iostream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
int maxNum = 0;
int dist_num[20001] = { 0 };
bool visited[20001] = { 0 };
void bfs(vector<int> vertex[20001])
{
queue<pair<int,int>> q;
q.push({ 1,0 });
while(!q.empty())
{
i... | true |
f78bb57e3d9b3d1e23d50fa11749674a3e884b94 | C++ | DSPNerd/m-nebula | /code/src/misc/noctree_collect.cc | UTF-8 | 19,021 | 2.515625 | 3 | [] | no_license | #define N_IMPLEMENTS nOctree
//-------------------------------------------------------------------
// noctree_collect.cc
// (C) 1999 A.Weissflog
//-------------------------------------------------------------------
#include "kernel/nkernelserver.h"
#include "kernel/nenv.h"
#include "misc/noctree.h"
#include "... | true |
963bb62e9b0188f3e6d9e26f60649f69742ad8d3 | C++ | jasonrohrer/Transcend | /game/MusicPart.h | UTF-8 | 2,844 | 2.6875 | 3 | [] | no_license | /*
* Modification History
*
* 2004-August-22 Jason Rohrer
* Created.
*
* 2004-August-26 Jason Rohrer
* Added parameter to control character of part.
*/
#ifndef MUSIC_PART_INCLUDED
#define MUSIC_PART_INCLUDED
#include "MusicNoteWaveTable.h"
#include "minorGems/util/SimpleVector.h"
#include "minorGems/... | true |
a02514c31b59a82628b48fdcf4dcd3bef327a1ce | C++ | ahmedelsaie/AlgorithmsProblems | /UVA/825 - Walking on the Safe Side.cpp | UTF-8 | 2,525 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <cctype>
#include <cstdlib>
#include <sstream>
#include <string>
using namespace std;
bool check(string in);
void reset();
long long min(int row, int col);
long long ways(int row, int col);
string str;
long long dp[105][105];
int map[105][105];
int main_row;
int main_col;
int main()
{
... | true |
463e32d05335c59e3cbce500cbf03dccb37d59d4 | C++ | kamaroyl/data-structures-2421 | /final-project/test/PictureComparatorTest.cpp | UTF-8 | 2,804 | 3.59375 | 4 | [] | no_license | #include "../src/Data/Comparators/PictureComparator.hpp"
#include "../src/Data/Picture.hpp"
#include <iostream>
#include <string>
std::string humanReadableResult(char value) {
if(value < 0) return "less than";
if(value > 0) return "greater than";
return "equal to";
}
void testPictureComparatorConstructor(... | true |
66d3dcee0619ec0eadf1941b112a15f5e9cdac4f | C++ | sivm205/cpp-development | /function/f16.cpp | UTF-8 | 776 | 3.515625 | 4 | [] | no_license | // greatest tof three number using pointer
#include<iostream>
using namespace std;
int find_max(int *x,int *y,int *z)
{
if(*x >*y && *x>*z)
{
return *x;
}
else if(*y>*x && *y>*z)
{
return *y;
}
else
{
return *z;
}
}
int find_fact(int *num)
{
if(*num==0 ... | true |
94366d922e6a1fcb719fec3a14839876a674a345 | C++ | vsignor/CandiVal | /progettoP2 /ProgettoPasticceria/Modello/user.cpp | UTF-8 | 1,438 | 2.953125 | 3 | [] | no_license | //user.cpp
#include "user.h"
User::User(const QString &name, const QString &pw) : username(name), password(pw){
setNomeDb("User");
} // costruttore
bool User::isConnected() const
{
return !(username.isEmpty() && password.isEmpty());
}
QString User::getUsername() const
{
return username;
}
QString User:... | true |
c7f7a9dbe1ffda0cd158619745c720bae537c10a | C++ | bdumitriu/playground | /university-work/before/c/backtrak/1_uri.cpp | UTF-8 | 1,176 | 2.703125 | 3 | [] | no_license | #include <stdio.h>
#include <conio.h>
int a[101][101], m, n, k;
int x[5]= {0, -1, 0, 1, 0};
int y[5]= {0, 0, -1, 0, 1};
Back(int i, int ii, int jj)
{
int j, iii, jjj;
for (j= 1; j <= 4; j++)
{
iii= ii+x[j];
jjj= jj+y[j];
if ((i >= 1) || (i <= m) || (j >= 1) || (j <= n))
i... | true |
c5b3a71a2affbf0ffbdf42eeb3b4c53b0dcd93d7 | C++ | breno550/Competitive-Programming | /Contest/contest/cf round #470 div.2/sheep.cpp | UTF-8 | 996 | 3 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
int r, c;
bool flag=false;
cin >> r >> c;
vector<vector <char>> board(r);
for(int i = 0; i < r; i++){
char ent[505];
cin >> ent;
for(int j = 0; j < c; j++){
board[i].push_back(ent[j]);
}
}
for(int i = 0; i < r; i++){
for(int j = 0; ... | true |
f9aa11152b770fec00e1b9442340b08f921d2ca7 | C++ | hyh2010/reverseParentheses | /reverseParentheses.cpp | UTF-8 | 2,239 | 3.40625 | 3 | [] | no_license | #include "reverseParentheses.h"
#include <utility>
#include <string>
#include <stack>
#include "OutputStrategyInterface.hpp"
#include "topDownParser.hpp"
class ReverseParenthesesStrategy : public OutputStrategyInterface
{
public:
virtual ~ReverseParenthesesStrategy() = default;
ReverseParenthesesStrategy():
... | true |
a053f2362028b6c3a80d36ec7a01cb97082c5347 | C++ | masa-k0101/Self-Study_Cpp | /Cp1/1-6-1_overload.cpp | UTF-8 | 850 | 3.828125 | 4 | [] | no_license | // Ovload1.cpp
#include <iostream>
// 絶対値を求める
int Abs(int a)
{
return a < 0 ? -a : a;
}
double Abs(double a)
{
return a < 0 ? -a : a;
}
// 入力
int Input(int& nInt, double& nDouble)
{
std::cout << "Please imput by integer > " << std::flush;
std::cin >> nInt;
if(nInt == 1)
... | true |
2bd044fd9a8aae432b66252aa25c0657ce6595e3 | C++ | knetikmedia/knetikcloud-cpprest-client | /model/PasswordResetRequest.h | UTF-8 | 2,414 | 2.53125 | 3 | [] | no_license | /**
* Knetik Platform API Documentation latest
* This is the spec for the Knetik API. Use this in conjunction with the documentation found at https://knetikcloud.com.
*
* OpenAPI spec version: latest
* Contact: support@knetik.com
*
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPS... | true |
8a3243075b93310603fe3d319b62ef84a70a6b58 | C++ | yvomenezes/cpp_polytech | /td6/piletableau/rectangle.hpp | UTF-8 | 437 | 3.265625 | 3 | [] | no_license | #ifndef _PILE_HPP_
#define _PILE_HPP_
#include <iostream>
class Rectangle {
private:
double largeur;
double longuer;
public:
Rectangle(double largeur = 1, double longuer = 1) : largeur(largeur), longuer(longuer){}
double surface() const;
bool operator<(const Rectangle &r) const{
return this->surface() < r... | true |
d37a5fa857f8cac367c98a09872de010ec27e235 | C++ | luis-3000/OnlineStore | /mainmenu.cpp | UTF-8 | 1,866 | 3.046875 | 3 | [] | no_license | //
// mainmenu.cpp
// eBookStore
//
// Created by Jose Luis Castillo on 10/7/15.
// Copyright © 2015 Jose Luis Castillo. All rights reserved.
//
#include <stdio.h>
#include "cashier.cpp"
#include "bookinfo.cpp"
#include "invmenu.cpp"
#include "reports.cpp"
#include <iostream>
using namespace std;
int main(int arg... | true |