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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0a9301789a18d0eeea1a3a3844e0c78a5c30c61d | C++ | jezhiggins/stiX | /c++/chapter_3/6_archive/archive_file.cpp | UTF-8 | 1,722 | 2.921875 | 3 | [
"MIT"
] | permissive | #include "archive_file.hpp"
#include <iostream>
#include <stdexcept>
#include <algorithm>
std::string const HEADER_TAG = "-h- ";
stiX::archive_file stiX::parse_header(std::string const& header) {
if (header.find(HEADER_TAG) != 0)
throw std::logic_error("Not a header line");
auto lastspace = header.find_last_... | true |
e5dd5a0922c34d62025d787e7daf4137fd1d7254 | C++ | ji-one/algorithm-study | /baekjoon_study_wook/bfs,dfs ํ์/13549_dw.cpp | UTF-8 | 953 | 2.9375 | 3 | [] | no_license | // 13549 ์จ๋ฐ๊ผญ์ง 3
#include <iostream>
#include <queue>
using namespace std;
int n,k;
int visit[100001];
int pos[100001];
bool isInside(int x) {
return x>=0 && x<=100000;
}
int bfs() {
priority_queue<pair<int, int> > pq;
pq.push({0,n});
visit[n] = 1;
while(!pq.empty()) {
int ct = -pq... | true |
42dba5154616c5b5ae6a796ec9346c4cc9a04ac3 | C++ | aminnezarat/build | /Hardwrae_Architecture.h | UTF-8 | 659 | 2.515625 | 3 | [] | no_license | /** @file Hardware_Architecture.h
* Definition of enum for Hardware and architecture type of kernel arguments.
*/
#pragma once
namespace ktt
{
/** @enum ArgumentDataType
* Enum for hardware type and architecture model for DLNezarat searcher
*/
//enum class Hardware_Architecture
//{
enum HARDWARE {
Vega56 = 1,... | true |
075eb5aeedbfd63284865b3139533729a5f7207a | C++ | hallgeirl/cse272-raytracer | /Texture.h | UTF-8 | 5,788 | 3.015625 | 3 | [] | no_license | #ifndef _TEXTURE_H_
#define _TEXTURE_H_
#define NO_FREEIMAGE
#include "Phong.h"
#include <Perlin.h>
#include <string>
#include <iostream>
#include <vector>
#include <list>
#include <stdlib.h>
#ifndef NO_FREEIMAGE
#include <FreeImage.h>
#endif
#include <Worley.h>
#include <cstdlib>
#include <cmath>
#include "Utility.h"... | true |
0dfbc7f8e2a0dfe51461915ec6d19b1514dce5c0 | C++ | moreclassy/algospot | /rep2/ROUTING.cpp | UTF-8 | 1,124 | 2.8125 | 3 | [] | no_license | #include <vector>
#include <iostream>
#include <unordered_map>
#include <queue>
#include <climits>
using namespace std;
void solve() {
int n; cin>>n;
vector<vector<pair<int, double>>> edge(n);
vector<double> cost(n, 1);
int m; cin>>m;
for (int i = 0; i < m; i++) {
int s; cin>>s;
... | true |
a53865b74aa4ba5185c24e759973972e0be233c4 | C++ | congthanh97/LTNC | /bai tap C/c++codeblock/point.cpp | UTF-8 | 1,067 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
#include <stdio.h>
using namespace std;
class point
{
private:
int x, y;
public:
void InputPoint()
{
cout<<"\nNhap toa do A (x,y) "<<endl;
cout<<"\nInput the value of x = ";
cin>>x;
cout<<"\nInput the value of y = ";
cin>>y;
... | true |
94305fd1e4c12855bfb12df8ae56744844073d37 | C++ | ZhuoerFeng/2019-OOP | /Final/01reload/bracket.cpp | UTF-8 | 422 | 3.5 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Test {
public:
int operator() (int a, int b) {
cout << "operator() called. " << a << ' ' << b << endl;
return a + b;
}
};
int main() {
Test sum;
int s = sum(3, 4); /// sum๔๔๔๔๔๔๔๔๔๔
๔๔๔๔๔๔๔
๔๔๔๔
cout << "a + b = " << ... | true |
c17a0e8ad860e4936a1ddadd26ca0cc011fcf632 | C++ | MyGUI/mygui | /MyGUIEngine/src/MyGUI_UString.cpp | UTF-8 | 54,864 | 2.703125 | 3 | [
"MIT"
] | permissive | /*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#include "MyGUI_Precompiled.h"
#include "MyGUI_UString.h"
namespace MyGUI
{
//---------------------------... | true |
7c5d08a7102cdcb527e43f0271bfdde9ffaa11bb | C++ | CSUF-CPSC121-2021S01/siligame-05-Alexlychee | /player.cc | UTF-8 | 792 | 2.71875 | 3 | [] | no_license | #include "player.h"
void Player::Draw(graphics::Image &my_player) {
graphics::Image NINJA;
NINJA.Load("player.bmp");
for (int i = 0; i < NINJA.GetHeight(); i++) {
for (int j = 0; j < NINJA.GetWidth(); j++) {
my_player.SetColor(GetX() + j, GetY() + i, NINJA.GetColor(j, i));
}
}
}
void Player::Move... | true |
04cf485a8e0ddb394a4d9a4bf009696cb545a97b | C++ | 974steph/WLED | /wled00/wled09_button.ino | UTF-8 | 1,320 | 2.65625 | 3 | [
"MIT"
] | permissive | /*
* Physical IO
*/
void handleButton()
{
if (buttonEnabled)
{
if (digitalRead(buttonPin) == LOW && !buttonPressedBefore)
{
buttonPressedBefore = true;
if (bri == 0)
{
bri = bri_last;
} else
{
bri_last = bri;
bri = 0;
}
colorUpdated(2);
... | true |
6f5169905c4825720168a4ba44d4e56b5a6467df | C++ | Arelaxe/practicasED | /Prรกctica_3/cola_max/src/Cola_max_pila.cpp | UTF-8 | 2,022 | 3.40625 | 3 | [] | no_license | #include "Cola_max_pila.h"
////////////////////////////////////////
// MรTODOS PรBLICOS
////////////////////////////////////////
template <class T>
Cola_max<T> :: Cola_max(){
}
template <class T>
void Cola_max<T> :: poner (T elemento){
Pareja<T> a_insertar;
a_insertar.dato = elemento;
a_insertar.max = elemento;
... | true |
1fef3c4cbb0040e457984cef2305e369e7f713e7 | C++ | brokenlanceorg/owlsong | /code/cc/Genetic/Chromosome.cpp | UTF-8 | 7,583 | 2.71875 | 3 | [] | no_license | //***********************************************************************************************
// File : Chromosome.cpp
// Purpose :
// :
// Author : Brandon Benham
// Date : 9/16/01
//***********************************************************************************************
#include"Chr... | true |
24bd98d2efa934c8e937893e6800de44073918bf | C++ | StarWix/ClickHouse | /libs/libcommon/src/DateLUT.cpp | UTF-8 | 972 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | #include <common/DateLUT.h>
#include <Poco/Exception.h>
#pragma GCC diagnostic push
#ifdef __APPLE__
#pragma GCC diagnostic ignored "-Wold-style-cast"
#endif
#include <unicode/timezone.h>
#include <unicode/unistr.h>
#pragma GCC diagnostic pop
DateLUT::DateLUT()
{
/// Initialize the pointer to the default DateLUTIm... | true |
9df0e6e19fc76eb477532c8c48123357dff58c09 | C++ | yuangu-google/arcs | /src/wasm/cpp/tests/entity-class-test.cc | UTF-8 | 15,714 | 2.65625 | 3 | [
"BSD-3-Clause",
"WTFPL",
"Apache-2.0"
] | permissive | #include <vector>
#include <set>
#include <unordered_set>
#include "src/wasm/cpp/tests/test-base.h"
using arcs::internal::Accessor;
template<typename T>
static size_t hash(const T& d) {
return std::hash<T>()(d);
}
static arcs::Ref<arcs::Foo> make_ref(const std::string& id, const std::string& key) {
return Access... | true |
f976c73a04676c0b2d04abce75878e5a8391595b | C++ | Dugy/lightweight_containers | /circular_buffer.cpp | UTF-8 | 1,857 | 3.109375 | 3 | [
"MIT"
] | permissive | #include "circular_buffer.hpp"
#include <cstring>
CircularBufferImpl::CircularBufferImpl(uint8_t* data, short int capacity, short int elementSize) :
_data(data),
_capacity(capacity),
_elementSize(elementSize) {
}
void CircularBufferImpl::pushBack(const void* data) {
if (_lastInserted >= 0)
_lastInserted = (_las... | true |
9e9a6baf8f2ebce273288dd4cd947cc7dbf7acae | C++ | mauroFH/OptiDAR_DEV | /Dev/Modulo-Opti/src/sort.cpp | UTF-8 | 3,760 | 3.0625 | 3 | [] | no_license | /** \file sort.cpp
* Sorting utilities.
* Version 1.0.0
* --------------------------------------------------------------------------
* Licensed Materials - Property of
*---------------------------------------------------------------------------
*/
#include "../../Modulo-Main/DARH.h"
/**-----------------------... | true |
12190d234e82133a7b67c763cd060384daffec0b | C++ | Char1sk/AlgorithmContestBook | /Book/Unit7/Extra7.5/BoolArraySubset.cpp | UTF-8 | 595 | 3.125 | 3 | [] | no_license | #include <iostream>
const int maxN = 3;
void printSubset(int arr[maxN], bool judge[maxN], int index)
{
if (index == maxN)
{
for (int i = 0; i < index; ++i)
{
if (judge[i])
{
printf("%d ", arr[i]);
}
}
printf("\n");
}
e... | true |
366b0276445cb33566802a3e8d78b39306761d02 | C++ | keivanzavari/polygon | /test/line_test.cc | UTF-8 | 4,590 | 3.03125 | 3 | [] | no_license | #include "line.h"
#include <gtest/gtest.h>
namespace geopoly {
TEST(Line, ConstructTest1) {
Line line({4, -2}, {3, 4});
ASSERT_DOUBLE_EQ(line.a, -6);
ASSERT_DOUBLE_EQ(line.b, -1);
ASSERT_DOUBLE_EQ(line.c, 22);
}
TEST(Line, ConstructTest2) {
Line line({4, 5}, {0, 5});
ASSERT_DOUBLE_EQ(line.a, 0);
ASSE... | true |
c2d65649ac9f4bd27331c94d52386459092ba35b | C++ | 3x1l3/gladiators-rpg-game | /Gladiators/Weapon.cc | UTF-8 | 1,972 | 3.140625 | 3 | [] | no_license | /*********************************************************
/// \file
/// \brief Implimentation file for the Weapon Class
///
/// The implimentation for the functions defined in Weapon.h
///
/// A class that defines a weapon.
/// Currently, weapons differentiate by attackvalue only.
/// Inside the parent, Item, ... | true |
ab8800160baeaef6d22afffb41575d7b053761d4 | C++ | ohwada/MAC_cpp_Samples | /SDL/example_image/RenderThread.h | UTF-8 | 1,362 | 2.65625 | 3 | [] | no_license | /**
* SDL Sample
* 2020-03-01 K.OHWADA
*/
// original : https://www.hiroom2.com/2015/05/14/sdl2%E3%81%AEbmp%E7%94%BB%E5%83%8F%E3%81%A8png%E7%94%BB%E5%83%8F%E3%81%AE%E6%8F%8F%E7%94%BB%E5%87%A6%E7%90%86/#sec-2
#ifndef __MYSDL_RENDER_THREAD_H
#define __MYSDL_RENDER_THREAD_H
#include <SDL.h>
#include "Renderer.h"
... | true |
db581253d6fae25312a3e6df434804430e35ea03 | C++ | MohamedDarkaoui/Computer-Graphics | /ZBuffering_Lines/ZBuffering_lines.cpp | UTF-8 | 6,050 | 2.703125 | 3 | [] | no_license | #include "ZBuffering_lines.h"
#include <limits>
using namespace std;
#include "../easy_image/easy_image.h"
#include <fstream>
#include <stdexcept>
#include <string>
#include <list>
#include <tuple>
#include <cmath>
#include <cctype>
#include "../parser/l_parser.h"
#include "../Surface.h"
#include <limi... | true |
f70538bfd564d6a0594641fe22c09c8b20612549 | C++ | Huioqy/JianZhi_Offer | /15.ๅ่ฝฌ้พ่กจ.cpp | UTF-8 | 1,767 | 3.859375 | 4 | [] | no_license | ๏ปฟ/*ๅ่ฝฌ้พ่กจ*/
/*
่พๅ
ฅไธไธช้พ่กจ๏ผๅ่ฝฌ้พ่กจๅ๏ผ่พๅบๆฐ้พ่กจ็่กจๅคดใ
*/
/*
struct ListNode {
int val;
struct ListNode *next;
ListNode(int x) :
val(x), next(NULL) {
}
};*/
/*
้ๅฝ็ๆนๆณๅ
ถๅฎๆฏ้ๅธธๅทง็๏ผๅฎๅฉ็จ้ๅฝ่ตฐๅฐ้พ่กจ็ๆซ็ซฏ๏ผ
็ถๅๅๆดๆฐๆฏไธไธชnode็next ๅผ ๏ผๅฎ็ฐ้พ่กจ็ๅ่ฝฌใ
่newhead ็ๅผๆฒกๆๅ็ๆนๅ๏ผไธบ่ฏฅ้พ่กจ็ๆๅไธไธช็ป็น๏ผ
ๆไปฅ๏ผๅ่ฝฌๅ๏ผๆไปฌๅฏไปฅๅพๅฐๆฐ้พ่กจ็headใ
*/
class Solution {
public:
ListNode* ReverseList(List... | true |
f4619bade04ddea7cf4627a8ccaa87044d9e7541 | C++ | TianhangSun/MapleJuice | /scheduler.cpp | UTF-8 | 2,594 | 3.28125 | 3 | [] | no_license | #include <queue>
#include <map>
#include <string>
#include <mutex>
#include <set>
using namespace std;
// a scheduler class
class scheduler{
private:
// multiple queues for incoming maple, juice jobs
mutex mtx;
queue<map<string,string>> maple_queue;
queue<map<string,string>> juice_queue;
map<string,int> wor... | true |
7eb12734040326dbd2c3a9b5a4ce237719f6533e | C++ | tanht-lavamyth/Algorithm | /Competitive Programming Exercises/Codeforces/George and Accommodation.cpp | UTF-8 | 459 | 2.625 | 3 | [] | no_license | /*
* @Author: tanht
* @Date: 2020-09-20 08:36:39
* @Last Modified by: tanht
* @Last Modified time: 2020-09-20 08:37:26
* @Email: tanht.lavamyth@gmail.com
*/
#include <iostream>
using namespace std;
const int AMAX = 100;
int p[AMAX], q[AMAX];
int main() {
int n; cin >> n;
for (int i = 0; i < n; ++i) {
cin >>... | true |
ba4d2404aeb7a9c559d660d61b1b1a2de2fd0a88 | C++ | g-akash/spoj_codes | /range_hamster.cpp | UTF-8 | 853 | 2.890625 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<math.h>
#include<iomanip>
using namespace std;
#define PI 3.14159265
int main()
{
int t;
cin>>t;
for(int i=0;i<t;i++)
{
double u,k1,k2;
cin>>u>>k1>>k2;
//cout<<k1<<" "<<k2<<endl;
if(k1==0)
{
cout<<fixed<<setprecision(3)<<1.571<<" "<<(k2*u*u)/(2.0*10.0)<<e... | true |
1602db1ea1a6abfb61c4eca1b52d2178cf2234e5 | C++ | xxsds/sdsl-lite | /include/sdsl/suffix_tree_algorithm.hpp | UTF-8 | 9,846 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright (c) 2016, the SDSL Project Authors. All rights reserved.
// Please see the AUTHORS file for details. Use of this source code is governed
// by a BSD license that can be found in the LICENSE file.
/*!\file suffix_tree_algorithm.hpp
* \brief suffix_tree_algorithm.hpp contains algorithms on CSTs
* \author... | true |
edc91b42305f42f4ab5dcfb7966c901fa0d0f04f | C++ | itsyash009/Interview_DS_Algo | /Arrays/Two Pointer/Container With Most Water.cpp | UTF-8 | 2,184 | 3.609375 | 4 | [] | no_license | /*
Company Tags : Bloomberg, Facebook, Google, Amazon, Adobe
Leetcode Link : https://leetcode.com/problems/container-with-most-water/
*/
//Why does my solution given below works ?
/*
Idea / Proof (Gathered from Discussion Section of Leetcode from some intelligent programmers) :
The widest container (usin... | true |
d543d614dd5d5d4f6e7f1ed393edbaf592e73514 | C++ | AliAkberAakash/_CONTESTS_ | /DCC practice contest 18/D.cpp | UTF-8 | 717 | 2.515625 | 3 | [] | no_license | #include<cstdio>
#include<iostream>
#define X 1000001
using namespace std;
typedef long long int LLD;
bool flag[X];
LLD NOD(LLD num)
{
LLD c=0;
for(LLD i=1; i<=num; i++)
if(num%i==0)
c++;
return c;
}
void theSeries()
{
LLD n,m;
m=1;
flag [1]=1;
for(LLD i=1; i<=X; i... | true |
b3a25823b9118c8cfff7be2ce660b3ae9dd42ade | C++ | carameldrizzle/intro_mechatronics_final | /motorTest/motorTest.ino | UTF-8 | 2,358 | 2.625 | 3 | [] | no_license | //#include <Keypad.h>
//#include <NewPing.h>
const byte ROWS = 4;
const byte COLS = 3;
char hexaKeys[ROWS][COLS] = {
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'}
};
byte rowPins[ROWS] = {9, 8, 7, 6};
byte colPins[COLS] = {5, 4, 3};
//Keypad customKeypad = Keypad(makeKeymap(hexaKeys... | true |
01e059aa47e83404917b87f1bf444765ea2e1115 | C++ | SherstiukAndrii/Prata | /Chapter 5/Exercise 2/Source.cpp | UTF-8 | 358 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <array>
const int ArSize = 101;
int main ()
{
std::array<long double, ArSize> factorials;
factorials [1] = factorials [0] = 1LL;
for (int i {2}; i < ArSize; ++i)
factorials [i] = i * factorials [i - 1];
for (int i {}; i < ArSize; ++i)
std::cout << i << " !... | true |
2a0235f5149ed5be20c8659ebfe3fff97ff85847 | C++ | shamozhishu/VayoEngine | /main/2d/inc/Vayo2dColor.h | WINDOWS-1252 | 2,386 | 2.875 | 3 | [] | no_license | /*************************************************************************\
* 1.0
* Copyright (c) 2018-2019 authored by ำบ
* ษซ
\*************************************************************************/
#ifndef __VAYO2D_COLOR_H__
#define __VAYO2D_COLOR_H__
#include "Vayo2dSupport.h"
NS_VAYO2D_BEGIN
inline void colorCl... | true |
83b7a5c713cd2eb04f46fe1c5cb64e6f34434d42 | C++ | GabeOchieng/ggnn.tensorflow | /program_data/PKU_raw/7/1236.c | UTF-8 | 694 | 2.609375 | 3 | [] | no_license | int main()
{
char str[1000], sub[500], rep[500];
int n, m, cut, i = 0, flag = 0;
cin >> str >> sub >> rep;
n = strlen(str);
m = strlen(sub);
cut = strlen(rep);
while(str[i] != '\0')
{
if(str[i] == sub[0])
{
int j = 0;
int k = i;
while(sub[j] != '\0')
{
if(sub[j] == str[k])
... | true |
6959fb720678f3bd55d2436efd0a7287a5827246 | C++ | bayareaviking/CIS25 | /cisFraction.h | UTF-8 | 1,241 | 3.09375 | 3 | [] | no_license | /*** FILE #1: Header file or Fraction Class
* Program Name cisFraction.h
* Written By: Marcus Larsson
* Date Written: 11/09/2011
*/
#ifndef CISFRACTION_H
#define CISFRACTION_H
#include <iostream>
using namespace std;
class Fraction {
public:
// Constructors
Fraction();
Fraction(const Fraction & arg);
Fract... | true |
04e5906e5bb3ed159a883fc607c94a3782cf2a36 | C++ | githubcai/leetcode | /29.cpp | UTF-8 | 378 | 2.734375 | 3 | [] | no_license | class Solution {
public:
int divide(int dividend, int divisor) {
if(divisor == 0) return INT_MAX;
if(dividend == 0) return 0;
long long res = exp(log(fabs(dividend)) - log(fabs(divisor)));
if(divisor < 0) res = -res;
if(dividend < 0) res = -res;
if(res > INT_MAX || re... | true |
60031193c0d7a4373389d8415bb686d44de2db4e | C++ | kieraw/cse471-project1 | /Synthie/AmpFilter.cpp | UTF-8 | 805 | 2.75 | 3 | [] | no_license | /**
* \file AmpFilter.cpp
*
* \author Kiera Wheatley
*
* \brief changes amplitude of source wave
*/
#include "stdafx.h"
#include "AmpFilter.h"
#include "Envelope.h"
CAmpFilter::CAmpFilter()
{
}
CAmpFilter::~CAmpFilter()
{
}
void CAmpFilter::Start()
{
m_time = 0;
// set the duration, sample rate of the envelop... | true |
74d3a5bf9288fa04bac2d4a1f8293910a337577e | C++ | yrpang/oop-Homework | /User.hpp | UTF-8 | 2,984 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <ctime>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/vector.hpp>
#ifndef USER_H
#define USER_H
#include "Hotel.hpp"
class User
{
protected:
int No;
std::string userName;
std::string passwd;... | true |
07e627a024ff4ea89fe09ec9a3704a228ada70ff | C++ | telugubhavya/DS | /singlelink.cpp | UTF-8 | 2,968 | 3.90625 | 4 | [] | no_license | #include<stdio.h>
#include<iostream>
#include<stdlib.h>
using namespace std;
class s11
{
struct list
{
int data;
struct list*next;
}*head;
public :
typedef struct list node;
s11();
void create();
void insert();
void display();
int count();
int deletepos();
void insertatbeg();
void insertatmid();
void insertatend();
voi... | true |
e99a712580b9bd804f39589bab3853d39ed9a3ef | C++ | AnupamaRajkumar/AutomaticImageAnalysis_SoSe2020 | /Assignment1/src/main.cpp | UTF-8 | 1,904 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include "given.hpp"
#include "yours.hpp"
using namespace std;
using namespace cv;
// TODO(student):
// Loads a test image and saves and shows the results of image processing
// Read the docs for OpenCV!
// https://docs.opencv.org/4.2.0/
int main(int argc, char** argv) {
// ... | true |
ff85ebd3bacee90108055be416614dddd3ba9417 | C++ | SayaUrobuchi/uvachan | /TIOJ/1054.cpp | UTF-8 | 348 | 2.828125 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
char str[7][20] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
char s[100];
int main()
{
int n, i;
while(scanf("%s%d", s, &n) == 2)
{
for(i=0; ; i++)
{
if(!strcmp(str[i], s))
{
break;
}
}
i += n;
i %= 7;
printf("%s\n... | true |
9f4b2d77500fa3932ff4d4f10d991788a81f8d33 | C++ | anthonywgao/Jug_Problem | /Jug.h | UTF-8 | 1,098 | 3.203125 | 3 | [] | no_license | #ifndef __JUG_H__
#define __JUG_H__
#include <iostream>
#include <string>
#include <vector>
#include <limits>
using namespace std;
struct Vertex {
Vertex(){
dist = numeric_limits<int>::max();
prev = 0;
act = "";
}
int dist;
Vertex* prev;
string act;
};
class Jug {
public:
Jug(int, i... | true |
167c3d38ae6fef3fb06e8347c2f3db4fef837019 | C++ | tventura97/AccMgmt-Console-App | /stockAccount.cpp | UTF-8 | 12,671 | 3.375 | 3 | [] | no_license | //#include "stdafx.h"
#include <iostream>
#include <fstream>
#include "Account.h"
#include "stockAccount.h"
#include <string>
#include <cstdlib>
#include "time.h"
#include <stdio.h>
#include <codecvt>
#include <vector>
#include <locale>
#include <math.h>
#include <ctime>
#include <iomanip>
using namespace std;
vector <... | true |
b1121ceffc97b1f2d6bf19e1c674d2bde76705ab | C++ | Simon-chevolleau/cppLearning | /zesteDeSavoir/containerFunction/cutStringCorrection.cpp | UTF-8 | 1,012 | 3.625 | 4 | [] | no_license | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
int main()
{
std::string texte { "Voici une phrase que je vais couper." };
char const delimiteur { ' ' };
std::vector<std::string> parties {};
auto debut = std::begin(texte);
auto fin = std::end(texte);
auto iterateur... | true |
744cc92c84d9db0f95eb85de09bedd94f785088e | C++ | andyprowl/ape | /Ape/World/Scene/src/PerspectiveProjection.cpp | UTF-8 | 1,959 | 2.71875 | 3 | [] | no_license | #include <Ape/World/Scene/PerspectiveProjection.hpp>
#include <Ape/World/Scene/Camera.hpp>
#include <glm/gtc/matrix_transform.hpp>
namespace ape
{
PerspectiveProjection::PerspectiveProjection(Frustum const & frustum, Camera & parent)
: frustum{frustum}
, transformation{makeProjection()}
, parent{&parent... | true |
24acaf8a0f63e761729f7e1b80bfa25583ce4e2a | C++ | vaishakp9/BillingSystem | /Billing/Comp/resource_file.cpp | UTF-8 | 2,786 | 2.71875 | 3 | [] | no_license | #include<iostream.h>
struct object_detail
{
char name[100];
int rate;
int qty;
int amt;
};
/*
0. Burgers
1. Add-Ons
2. Beverages
3. Desserts
*/
void res()
{
object_detail item[4][8];
strcpy(item[0][0].name,"McSpicy Paneer");
item[0][0].rate=50;
item... | true |
dab49ffebb8cfdb98829bd2406a07fdcf861acf4 | C++ | errata-c/pathfinder_cpp | /gpu/Enums.hpp | UTF-8 | 4,298 | 2.515625 | 3 | [
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #pragma once
#include <cinttypes>
#include <iosfwd>
#include <string_view>
namespace pf {
enum class TextureFormat {
R8,
R16F,
RGBA8,
RGBA16F,
RGBA32F,
};
std::size_t channels(TextureFormat format) noexcept;
std::size_t bytesPerPixel(TextureFormat format) noexcept;
enum class ProgramKind {
Raster,
... | true |
381607ba51c55aa915a3866fb28c5995754882fb | C++ | yakataN/arihon_practice | /ch02_1/11_next_permutation.cpp | UTF-8 | 701 | 2.703125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define REP(i,m,n) for(ll i = (m); i < (n); i++)
#define rep(i,n) REP(i, 0, n)
#define rrep(i,n) REP(i,1,n+1)
// void print(const std::vector<int>& v)
// {
// std::for_each(v.b... | true |
0a55b8edb366d3cd34b8c25782c738eb4b009b41 | C++ | blickens/flie | /Header/Formula.h | ISO-8859-3 | 6,386 | 2.5625 | 3 | [
"MIT"
] | permissive | /*
MIT License
Copyright (c) [2019] [Joshua Blickensdrfer]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modif... | true |
183e948569f7e3550a24232ee943f79b37bf34fe | C++ | MeiRenxing/ShotStick | /ShotStick/ShotStick.cpp | UTF-8 | 4,003 | 2.90625 | 3 | [] | no_license | #include "ShotStick.h"
#include "Game.h"
#include "TextureManager.h"
ShotStick::ShotStick()
:m_fingerId(-1)//ๅฝๅๆ ๆๆ็ปๅฎ
{
m_relativePoint.x = 0;
m_relativePoint.y = 0;
}
ShotStick::~ShotStick()
{
}
bool ShotStick::init(const std::string& rockerID, const std::string& backgroundID)
{
m_rockerID = rockerID;
m_backgro... | true |
7ff76a7756f0549f7391af5046d84904664284d5 | C++ | orangezeit/leetcode | /CPP/0601-0700/0684-Redundant-Connection.cpp | UTF-8 | 991 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | template<typename T>
struct DynamicUnion {
unordered_map<T, T> parents;
unordered_map<T, int> ranks;
constexpr T find(const T& x) {
if (x != parents[x])
parents[x] = find(parents[x]);
return parents[x];
}
constexpr void unite(const T& x, const T& y) {
const T px... | true |
2ee7d9066126e5cf47ac1b8fc3d2896841cbd91a | C++ | labanau/HackerRank_30_DaysOfCode | /Day 8_ Dictionaries and Maps.cpp | UTF-8 | 728 | 3.0625 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
#include <string>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int i, n;
cin>>n;
string name, number, key;
map<string, string>... | true |
6f5390045dbebb5c3e9c1348b2af6359dd470183 | C++ | SadMathLovergo/LeetCodeSolution | /130Solve/130Solve.cpp | GB18030 | 2,068 | 3.609375 | 4 | [] | no_license | #include <vector>
#include <iostream>
using namespace std;
/************************************
หผยท
ึปะฑ฿ฝฯต'O'ิผ฿ฝฯต'O''O'แฑป'X'ฮง
หฃาณะฒฺฑ฿ฝฯฃาฒ฿ฝฯต'O''O'
floodfillใทจิฑ฿ฝฯต'O'ะฑาต฿ฝฯต'O''O'สฃยต'O'ฮชฦต'O'
************************************/
class Solution {
private:
int RowSize;//
int ColumnSize;//
vector<vector<bool>> isSurrounded;//ๆปทฯขฦต'O'ฮชt... | true |
8722f81b3b8e238f1b244f4f5a4f1b4977bd12d1 | C++ | Ungerfall/VS-Solutions | /OOP_labrab2/OOP_labrab2/CEllipse.cpp | WINDOWS-1251 | 1,640 | 3.5 | 4 | [] | no_license | #include "CEllipse.h"
using namespace std;
const double pi = 3.14;
CEllipse::CEllipse()
:a(CPoint(0, 3)), b(CPoint(0, 0)), c(CPoint(3, 0)) {}
//
CEllipse::CEllipse(CPoint& a, CPoint& b, CPoint& c)
:a(a), b(b), c(c) {}
std::string CEllipse::Name()
{
return "";
}
void CEllipse::About()
{
cou... | true |
ce1fa472313de6c2959f504596de1a6f967963e2 | C++ | YanOlerinskiy/Complex | /complex.h | UTF-8 | 1,315 | 2.9375 | 3 | [] | no_license | #ifndef COMPLEX_H
#define COMPLEX_H
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
const double EPS = 0.0000001;
class Complex
{
public:
Complex();
Complex(double real, double imag = 0.0);
double c_real() const { return real; }
double c_imag() const { return imag; }
... | true |
84e9afc48f48c7bbd10c89bc5b393ef82f9573fe | C++ | jontoto/autoplanter | /src/moisture_sensor.cpp | UTF-8 | 696 | 2.734375 | 3 | [] | no_license | #include <chrono>
#include <memory>
#include <thread>
#include "adc_mcp3008.hpp"
#include "digital_pin.hpp"
#include "moisture_sensor.hpp"
MoistureSensor::MoistureSensor(int power_pin, int analog_channel) : m_analog_channel{analog_channel} {
m_power = std::make_shared<DigitalPin>(power_pin);
m_reader = std::... | true |
5d6545d5a1fee60228661af63f8976a02763fdf8 | C++ | kashifjumani115/HacktoberFest21 | /Factorial.cpp | UTF-8 | 205 | 2.703125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int f=1,n,i;
cout<<"Enter the value of n:";
cin>>n;
for(i=1;i<=n;i++)
{
f=f*i;
}
cout<<"Factorial of n is: "<<f<<endl;
}
| true |
35366124aad7f17b9f8c8b77b5cf138da884092a | C++ | mohsin0176/C-Plus-Plus-Notes | /Basic Programme/armstrong-2-interval.cpp | UTF-8 | 377 | 2.890625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int num1,num2,i,num,digit,sum;
cin>>num1>>num2;
for(i=num1;i<=num2;i++)
{
sum=0;
num=i;
for(;num>0;num=num/10)
{
digit=num%10;
sum=sum+digit*digit*digit;
}
if(sum==i)
{
... | true |
b02f6ac8cd74f398ea234944782e969f57fc645e | C++ | yuanrongxi/leveldb | /mutexlock.h | WINDOWS-1252 | 449 | 2.734375 | 3 | [] | no_license | #ifndef __LEVEL_DB_MUTEXLOCK_H_
#define __LEVEL_DB_MUTEXLOCK_H_
namespace leveldb{
class SCOPED_LOCKABLE MutexLock
{
public:
explicit MutexLock(port::Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu) : mu_(mu)
{
this->mu_->Lock();
}
~MutexLock() UNLOCK_FUNCTION()
{
this->mu_->Unlock();
}
private:
//ุฟอธึต
MutexLoc... | true |
19418fbfd234920b6da512592ab2da93341845c8 | C++ | maryana-la/cpp_modules | /cpp05/ex03/PresidentialPardonForm.cpp | UTF-8 | 878 | 2.890625 | 3 | [] | no_license | #include "PresidentialPardonForm.hpp"
PresidentialPardonForm::PresidentialPardonForm() {}
PresidentialPardonForm::PresidentialPardonForm(const std::string tar)
: Form("PresidentialPardon", 25, 5), _target(tar) {}
PresidentialPardonForm::PresidentialPardonForm(const PresidentialPardonForm &other)
: Form(other), _targ... | true |
e12a7d0479e5bf899b3f852c3a8ea62d2c3be97c | C++ | kristiantorres/acoustic_isotropic_operators | /acoustic_iso_lib/seis_utils/seis_utils_float/src/interpBSpline2d.cpp | UTF-8 | 34,806 | 2.6875 | 3 | [] | no_license | #include <string>
#include <iostream>
#include "interpBSpline2d.h"
#include <omp.h>
#include <vector>
// Contructor
interpBSpline2d::interpBSpline2d(int zOrder, int xOrder, std::shared_ptr<float1DReg> zControlPoints, std::shared_ptr<float1DReg> xControlPoints, axis zDataAxis, axis xDataAxis, int nzParamVector, int nxP... | true |
91ad6e698ab14016d0b55ee72d85861d41701429 | C++ | awp4211/LearningOpenCV | /5Morphology/5Morphology/morpho2.cpp | UTF-8 | 935 | 2.546875 | 3 | [] | no_license | #include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "morphoFeature.h"
/*
int main()
{
cv::Mat image = cv::imread("car.jpg");
cv::namedWindow("Image");
cv::imshow("Image", image);
MorphoFeatures morpho;
morpho.setThreshold(40);
// Get the e... | true |
b3ccd0c138d2d3eb81d78bfeca2e45b71c93260f | C++ | Gael21ruiz/practica_03_Tarea | /Ejercicio_09 switch.cpp | UTF-8 | 718 | 3.1875 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
int main(){
char val;
printf("Introduzca un caracter: ");
scanf("%s",&val);
switch(val){
case '0':
printf("El caracter es numero");
break;
case '1':
printf("El caracter es numero");
break;
case '2':
printf("El caracter es numero");
break;
case '3':
printf("El cara... | true |
0fb54a38b3c4bea805a5fc04450cf6356e81ddc1 | C++ | Pranta-Saha/codeforces-solved | /714B.cpp | UTF-8 | 476 | 2.59375 | 3 | [] | no_license |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,i,tmp;
set<int >st;
set<int >::iterator it,it2,it3;
cin>>n;
while(n--)
{
cin>>tmp;
st.insert(tmp);
}
it=st.begin();
if(st.size()<=2)
{cout<<"YES"; return 0;}
else if(st.size()==3)
... | true |
cc9792fc18627ba3555bba0e64fc0a339ea8082e | C++ | jenniferexong/bunny-game | /src/engine/Camera.cpp | UTF-8 | 454 | 2.984375 | 3 | [] | no_license | #include "Camera.h"
/* Moves camera under water, then inverts the pitch */
void Camera::positionForReflection(float water_height)
{
float distance = position_.y - water_height;
position_.y -= 2 * distance;
rotation_.y *= -1;
}
/* Moves camera back to original position above water */
void Camera::positionForRefract... | true |
4be61a3c4ebb2aa3fd8974303b91e1715b19f7bf | C++ | sagor2364/Cpp-Course | /URI/1021.cpp | UTF-8 | 273 | 3.078125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int A, B, C, D;
cin>> A>> B>> C>> D;
if(B>C && D>A && C+D > A+B && C > 0 && D > 0 && A % 2 == 0){
cout << "Valores aceitos";
}else{
cout << "Valores nao aceitos";
}
return 0;
} | true |
cf0a4bd4ac9ace790aa0bbc581fc629de3be346e | C++ | zoveale/CSE461 | /Filesys.cpp | UTF-8 | 6,264 | 3.3125 | 3 | [] | no_license | /**
* Name: Joseph Lord
* Program: Filesys.cpp
* Class: CSE 461 Adv Operating Systems
* Date: 2019-11-18
* Purpose: Implementation of the Filesys class
**/
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <stdio.h>
#include "Sdisk.h"
#include "Filesys.h"
using namespace std;
F... | true |
92fbed06270d9a8b764c74271fee69bcea8799c8 | C++ | CodingInterview2018Gazua/coding_interview | /coding_interview/b/hanoi.cpp | UTF-8 | 823 | 3.140625 | 3 | [] | no_license | //
// main.cpp
// hanoi_tower
//
// Created by ๊น์ธํ on 2018. 8. 18..
// Copyright ยฉ 2018๋
๊น์ธํ. All rights reserved.
//
#include <iostream>
#include <stack>
using namespace std;
void hanoi(int n, stack<int> &src, stack<int> &dest, stack<int> &aux) {
if (n == 1) {
dest.push(src.top());
src.pop()... | true |
677e878513a119bcadd09ddabcbf3cb4a6ed695a | C++ | cnbluesky/esp | /src/Mqtt.cpp | UTF-8 | 6,310 | 2.671875 | 3 | [] | no_license |
#include "Config.h"
#include "Debug.h"
#include "Mqtt.h"
#include "Wifi.h"
#include <PubSubClient.h>
bool Mqtt::mqttConnect()
{
if (WiFi.status() != WL_CONNECTED)
{
Debug.AddLog(LOG_LEVEL_INFO, PSTR("wifi disconnected"));
return false;
}
if (config.mqtt.port == 0)
{
return false;
}
if (mqttClient.connect... | true |
8f5f544c5d9f2f33c534e770ede64e820cfe64d9 | C++ | MARCGRAUUdG/EDA_S9 | /Candidats.h | UTF-8 | 700 | 2.671875 | 3 | [] | no_license | //
// Created by Marc Grau on 09/12/2018.
//
#ifndef EDA_S9_CANDIDATS_H
#define EDA_S9_CANDIDATS_H
#include <vector>
class Candidats {
public:
Candidats(int vertex, int total_vertex);
// Pre: n>0
// Post: Sโha inicialitzat el candidat amb la posicio anterior i el nombre de salts
bool esFi() const... | true |
ba27a0c891a60129367e194f90a00f546952498c | C++ | JoergWarthemann/ringbuffer | /RingBuffer/include/RingBuffer.h | UTF-8 | 19,728 | 3.640625 | 4 | [
"BSL-1.0"
] | permissive | #pragma once
#include <algorithm>
#include <assert.h>
#include <atomic>
#include <functional>
#include <memory>
#include <type_traits>
namespace Buffer
{
/** Does not cast into move iterator. Simply return the passed iterator.
Iterator ... The type of iterator. std::is_lvalue_reference<Type&&>::value returns true.
... | true |
e74b804aee6b2440231646a3f200b267250fe641 | C++ | utexas-bwi/scavenger_hunt | /bwi_scavenger/src/path_planning.cpp | UTF-8 | 5,952 | 2.90625 | 3 | [] | no_license | #include <algorithm>
#include <limits>
#include <iostream>
#include <math.h>
#include <random>
#include "bwi_scavenger/path_planning.h"
#include "bwi_scavenger/world_mapping.h"
LocationEvaluator::LocationEvaluator(World w) {
if (w == SIM)
world_waypoints = &WORLD_WAYPOINTS_SIM;
else if (w == IRL)
world_wa... | true |
9a080cb6f26e2667ca713dce5c5bbc2d9b02b261 | C++ | adhuliya/ws-misc | /cpp/namespace-lookup.cc | UTF-8 | 472 | 3.078125 | 3 | [] | no_license |
#include <iostream>
using namespace std;
int max = 12;
namespace {
int max = 10;
void print() {
std::cout << max; // current namespace' max
std::cout << ::max; // global namespace' max
}
}
namespace {
void printt() {
std::cout << max; // current namespace' max
std... | true |
a5d2064959338451de7e85c14bf23ec3601fe280 | C++ | Pliskeviski/GameEngine | /Classes/Texture.h | UTF-8 | 757 | 2.578125 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <GL\glew.h>
#include <SOIL2\SOIL2.h>
enum TextureType {
TYPE_CUBEMAP,
TYPE_DIFFUSE,
TYPE_METALLIC,
TYPE_ROUGHNESS,
TYPE_NORMAL,
TYPE_AO
};
struct m_Texture {
GLuint id;
TextureType type;... | true |
08c6971475e44e173ef54b22def8bbda320bf16a | C++ | arkadiusz-er/PersonalBudget | /DataOfBalance.h | UTF-8 | 449 | 2.53125 | 3 | [] | no_license | #ifndef DATAOFBALANCE_H
#define DATAOFBALANCE_H
#include <iostream>
using namespace std;
class DataOfBalance {
protected:
int userId;
string date;
string item;
double amount;
public:
void setUserId(int newUserId);
void setDate (string newDate);
void setItem (string newItem);
void set... | true |
b0ae5b109a1a2779ea78efd9f0bea8b5ad9226c0 | C++ | yuanyuewandou/DesignPatternsCppDemo | /src/responsibilitychain.cpp | UTF-8 | 3,431 | 3.640625 | 4 | [] | no_license | /* ๅฐ้ฑผๅท็ไปฃ็ ๆฅๅฟ
* ่ฎพ่ฎกๆจกๅผ
* ่่ดฃ้พๆจกๅผ
* ไฝฟ็จๅคไธชๅฏน่ฑก้ฝๆๆบไผๅค็่ฏทๆฑ
* ไป่้ฟๅ
่ฏทๆฑ็ๅ้ๅๆฅๅไน้ด็่ฆๅๅ
ณ็ณป
* ๅฐ่ฟไธชๅฏน่ฑก่ฟๆไธๆก้พ๏ผๅนถๆฒฟ็่ฟๆก้พไผ ้่ฏฅ่ฏทๆฑ
* ็ฅ้ๆไธไธชๅฏน่ฑกๅค็ๅฎไธบๆญข
* ๅฎไพ๏ผ
* ๅญฆๆ ก้่ดญ้้ขๅฎกๆนๆต็จ
* < 3000 ็ณปไธปไปปๅฎกๆน
* 3000 - 5000 ๅญฆ้ขไธปไปปๅฎกๆน
* 5000 - 30000 ๅฏๆ ก้ฟๅฎกๆน
* 30000 - 30000000 ๆ ก้ฟๅฎกๆน
* > 30000000 ้ฝๆฒกๅๆณๅฎกๆน
*/
#include<iostream>
#include<string>
using namespace std;
///่ฏทๆฑ็ฑป
class ... | true |
c0176f081310d104122bc3d2665970e471c4cb89 | C++ | WrongSandwich/programProjects | /projects2/Lab05/Trout-2839780-Lab-05/MapReader.h | UTF-8 | 1,147 | 3.15625 | 3 | [] | no_license | /*******************************************************************************
*@author Evan Trout
*@file MapReader.h
*@date 10/04/2018
*@brief Header file for the MapReader class. Reads input from input file and
* creates a 2D char array and associated integers. Also contains getters
* for a... | true |
951572ddd6016f6192d19ec775e1746c536072aa | C++ | mgb/nullspace | /src/render/TextureMap.cpp | UTF-8 | 2,018 | 3.0625 | 3 | [
"MIT"
] | permissive | #include "TextureMap.h"
#include <cassert>
#include <cstring>
#include "../Memory.h"
namespace null {
u32 Hash(const char* str) {
u32 hash = 5381;
char c;
while ((c = *str++)) {
hash = hash * 33 ^ c;
}
return hash;
}
TextureMap::TextureMap(MemoryArena& arena) : arena(arena), free(nullptr) {
for (... | true |
9324bd249cf64e73bfb29bc86e673430426ae1f1 | C++ | marwan-abdellah/ServerClient | /client.cpp | UTF-8 | 2,958 | 2.875 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdlib.h>
#include <stdio.h>
#incl... | true |
b4e805b32f24e6103dd48bd3c3dcc2cfe4796b42 | C++ | shugo256/AtCoder | /others/CPSCO2019_S4_C_Make_a_Team.cpp | UTF-8 | 522 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
long c2(long n) {
if (n < 2) return 0;
else return n*(n-1) / 2;
}
int main() {
long n;
long d;
cin >> n >> d;
long r[n];
for (auto i=0; i<n; i++) cin >> r[i];
sort(r, r+n);
long j=0, sum=0;
for (auto i=0; i<n; i++) ... | true |
e23060a82fac45e1ae399b0abeadc82940bf2628 | C++ | ChialeKuan/algorithm | /dp/bool_backpack.cc | UTF-8 | 2,144 | 3.234375 | 3 | [] | no_license | #include <iostream>
#define N 100
#define M 1000
using namespace std;
// index <= N + 1
// volume <= M + 1
int dp[N + 1][M + 1];
int dp_[M + 1];
int weight[N + 1];
int value[N + 1];
int total_w, total_n;
void dim_2() {
int tmp;
for (int i = 0; i != total_w + 1; ++i) {
dp[0][i] = 0;
}
for ... | true |
b84b0e8b1f0c2b26fa0688ce442af77ae38c4123 | C++ | mgalang229/Hackerrank-Possible-Path | /sol.cpp | UTF-8 | 409 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
long long __gcd(long long a, long long b) {
if (b == 0) {
return a;
}
return __gcd(b, a % b);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while (t--) {
long long a, b, x, y;
cin >> a >> b >> x >> y;
if (__gcd(a, b) == __gcd(x,... | true |
c839da77405377f062a0a09d293e0d7e7aa6a386 | C++ | Gilsmeister/ChessInHex | /ChessInHex/move.h | UTF-8 | 100 | 2.609375 | 3 | [] | no_license |
class Move {
public:
int pos; // position in board array;
int m; // move
Move(int p, int M);
};
| true |
e4591862eff39dc4e2e9d87d82d520dcb1f94055 | C++ | CS246-CS247-Quadris/tangsaidi-tetris | /levelFour.cc | UTF-8 | 1,001 | 2.890625 | 3 | [
"MIT"
] | permissive | #include "levelFour.h"
#include <cstdlib>
#include <utility>
using namespace std;
LevelFour::LevelFour(Board* board): LevelThree(board){
srand(Level::seed);
}
// Check if we have removable rows
bool LevelFour::hasRemovable() {
for (auto &r: *(getBoard())) {
if (r.isRemovable()) {
return true;
}
... | true |
beecac9ca94fd3be1549b55533b36a2001d8b407 | C++ | aluo/LoanBrick | /LAB 3 Loan Calculator GUI/CalculatorBU.h | UTF-8 | 827 | 2.890625 | 3 | [] | no_license | /* LAB 3: Loan Calculator GUI
* Amy Luo
* CSC 330 - Object Oriented Programming
* 2013-10-07
*/
#ifndef CALCULATORBU_H
#define CALCULATORBU_H
#include <math.h>
#include <string>
#using <Microsoft.VisualBasic.dll>
using namespace std;
class LoanCalc{
private:
// VARIABLES
//
// C - Loa... | true |
d6232992ce4adaa6c1f2c3b3bb57b67a5a2a48d8 | C++ | Lykos/Olaf | /protocols/event/setdepthevent.h | UTF-8 | 455 | 2.625 | 3 | [] | no_license | #ifndef SETDEPTHEVENT_H
#define SETDEPTHEVENT_H
#include "protocols/event/engineevent.h"
#include <chrono>
namespace olaf
{
/**
* @brief The SetDepthEvent class represents an event that the maximum
* depth for the engine has changed.
*/
class SetDepthEvent : public EngineEvent
{
public:
SetDepthEvent(int... | true |
24ad5ac4eddc99f20edab360f706d47a935faa77 | C++ | Cyber-SiKu/nowcoder | /35/35-2.cpp | UTF-8 | 1,122 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
class Solution {
private:
int max_length;
public:
Solution(string str1, string str2);
~Solution();
friend ostream& operator<<(ostream& os, const Solution& s);
};
Solution::Solution(string str1, string str2)
{
if (str1.length() < str2.len... | true |
3ec082e96ce63e81c8c89ca2bfbc57a4bfdb5612 | C++ | patrickpclee/codfs | /branch/0.2/src/osd/codingmodule.hh | UTF-8 | 2,616 | 2.8125 | 3 | [] | no_license | /**
* codingmodule.hh
*/
#ifndef __CODINGMODULE_HH__
#define __CODINGMODULE_HH__
#include <map>
#include <vector>
#include <stdint.h>
#include "../coding/coding.hh"
#include "../common/segmentdata.hh"
#include "../common/objectdata.hh"
#include "../common/enums.hh"
struct CodingSetting {
CodingScheme codingScheme;... | true |
605c4749d91190f7fd09af81865ed89bc9bfd54c | C++ | marinofranusic/CodeEval | /Hard/GridWalk/GridWalk.cpp | UTF-8 | 3,728 | 3.515625 | 4 | [] | no_license | /*
GRID WALK
SPONSORING COMPANY:
AVANOO
CHALLENGE DESCRIPTION:
There is a monkey which can walk around on a planar grid. The monkey
can move one space at a time left, right, up or down. That is, from
x, y) the monkey can go to (x+1, y), (x-1, y), (x, y+1), and (x, y-1).
Points where the sum of the digits of the abs... | true |
e95762c0543916d0a12d101165e5094460e4569f | C++ | hayate891/carpg | /source/game/Gui2.h | WINDOWS-1250 | 8,901 | 2.671875 | 3 | [
"MIT"
] | permissive | #pragma once
#include "VertexDeclaration.h"
//-----------------------------------------------------------------------------
// Opis znaku czcionki
struct Glyph
{
BOX2D uv;
int width;
bool ok;
};
//-----------------------------------------------------------------------------
// Przechowuje string lub cstring
struc... | true |
8b8eb890e7e91fff7440bc9056d1d7c99b293cba | C++ | GutoHere/Maratona-ICPC | /Project_Euler/0001.cpp | UTF-8 | 735 | 2.8125 | 3 | [] | no_license | // ============================================================================
//
// Filename: 0001.cpp
//
// Description: Project Euler 1 - Multiples of 3 and 5
// projecteuler.net/problem=1
//
// Version: 1.0
// Created: 08/15/2012 08:02:51 PM
// Revision: none
// ... | true |
86b7ff2ee93cecb7205544b6baa07b4119d2a98c | C++ | Rooster13/Star-Guardian-Ahri-Glittering-Tails-Lights | /SG_Ahri_Tails.ino | UTF-8 | 3,481 | 2.71875 | 3 | [] | no_license | #include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define SINGLE_PIN 15
#define FULL_PIN 1
#define selectorPin 2
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 K... | true |
818f00ae9c67e433bf167e6871901816338bcbb3 | C++ | flytigerw/Computer | /DataStructure/Dictionary/skiplist.h | UTF-8 | 6,244 | 3.34375 | 3 | [] | no_license |
#pragma once
#include "dictioary.h"
#include "myExceptions.h"
#include <sstream>
#include <math.h>
//ๅจ่ทณ่กจไธญๅญๅจ้ฎๅผๅฏน
//่็นไปฅKๆฅๆๅบ
template<class K,class V>
struct SkipNode{
typedef std::pair<const K,V> KV;
KV m_kv;
//่ทณ่กจ่็น็nextๅ
ทๆๅฑ็บงๅฑๆง
SkipNode** next; //ๆฐ็ป
SkipNode(const KV& kv,int size):m_kv(kv){
next = new ... | true |
b0c48fd72faf19753c06cffa4ccf563c97abe7a5 | C++ | sandywang/oobicpl | /src/mniBaseVolume.h | UTF-8 | 4,795 | 2.6875 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive | #ifndef __MNIBASEVOLUME__
#define __MNIBASEVOLUME__
extern "C" {
#include "bicpl.h"
#include "volume_io.h"
}
#include <iostream>
using namespace std;
// static value used as default for volume loading
static STRING ZXYdimOrder[] = {(char *) MIzspace, (char *) MIxspace, (char *) MIyspace};
static STRING ZYXdimOrde... | true |
8a1a06fbc86c1ffd6195fd4fe0f3c9cdfaf639bd | C++ | venkatesh7199/LongAssignment | /BinaryTree.cpp | UTF-8 | 4,311 | 3.140625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define MP make_pair
#define PB push_back
#define N 100001
#define HOLE 1000000007
ll power(ll x,ll y)
{
ll res = 1; // Initialize result
while (y > 0) {
// If y is odd, multiply x with result
... | true |
ae6a9be1ea67f3f39d8581dcd79cc00209d24e18 | C++ | natezzz/leeeet | /c++/guess-number-higher-or-lower/guess-number-higher-or-lower.cpp | UTF-8 | 566 | 3.796875 | 4 | [] | no_license | // Forward declaration of guess API.
// @param num, your guess
// @return -1 if my number is lower, 1 if my number is higher, otherwise return 0
int guess(int num);
class Solution {
public:
int guessNumber(int n) {
int low = 1;
int high = n;
while (true) {
int m = low + (high -... | true |
9259c1f471102e0db954912a4a7019c195a7e8bb | C++ | stavalfi/stavalfi_cpp_ex2 | /include/ConfigurationReader.h | UTF-8 | 1,270 | 2.671875 | 3 | [] | no_license | #ifndef STAVALFI_CPP_EX2_CONFIGURATION_READER_H
#define STAVALFI_CPP_EX2_CONFIGURATION_READER_H
#include "Player.h"
#include <string.h>
class ConfigurationReader {
const std::string fileGameConfigurationLocation;
const std::string fileSoldierDirectionsLocation;
protected:
const std::string &getFileGame... | true |
f7a9ff7b429357e8c161a6e3fd6fb0512ad0ed26 | C++ | yuancheng314/PAT | /Advanced/1008.cpp | UTF-8 | 301 | 2.5625 | 3 | [] | no_license | #include<iostream>
using namespace std;
const int stop=5,up=6,down=4;
int main()
{ int N,sum=0,from=0,to;
cin>>N;
sum+=N*stop;
for(int i=0;i<N;i++)
{ scanf("%d",&to);
sum+= to-from>0 ? (to-from)*up : (to-from)*down*-1;
from=to;
}
cout<<sum;
return 0;
}
| true |
fd9dcffb0edac6f956bcc709bfdcbdb22247bdd2 | C++ | shunpeizhang/Graph-Store | /Graph Store/Graph Store/Hash/Hash Function/HashFunctionStringSpecialization.h | UTF-8 | 770 | 2.859375 | 3 | [] | no_license | /*
This class specialization implements the FNV hash algorithm:
http://www.isthe.com/chongo/tech/comp/fnv/#top
*/
#ifndef __HASH_FUNCTION_STRING_SPECIALIZATION_HEADER_INCLUDED__
#define __HASH_FUNCTION_STRING_SPECIALIZATION_HEADER_INCLUDED__
#include "HashFunction.h"
#include "../../String/String.h"
template <>
cl... | true |
97f6641f20c336c29c82e0db08d6af5e0af252f6 | C++ | CodeeChallenge/GetIntoRocket | /s.cpp | UTF-8 | 385 | 3.09375 | 3 | [] | no_license | //divide the array into 2 equal half such that absolute diff is minimum.
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
float f[5] = {1.0,1.2,1.3,1.4,1.5};
float* f1 = &f[0];
float* f2 = f1 + 3;
cout<<f2 - f1;
/*vector<int> v1;
int n,item;
cin>>n;
while(n--){
cin>>item;... | true |
671c0dc93a5b4dc90120d45d66e93ab353b0b377 | C++ | nathansmith11170/Delver | /MazeGenerate.cpp | UTF-8 | 3,454 | 2.953125 | 3 | [] | no_license | /*
Author: Nathan Smith
Here is code taken from the Mazes with SFML project. A recurisve
backtracker that relies upon the MatrixGraph type, and a maze-generate
function that simply calls teh backtracker repeatedly until the maze is
complete.
*/
#include "MatrixGraph.h"
#include "prototypes.h"
#include <stack>
#i... | true |
2856b4275081de68368900f30cce1db5b1360d5d | C++ | K20shores/OSProject | /kernel/arch/i386/utils.cpp | UTF-8 | 823 | 2.75 | 3 | [] | no_license | #include <kernel/utils.h>
/* http://www.osdever.net/bkerndev/Docs/creatingmain.htm */
/* We will use this later on for reading from the I/O ports to get data
* from devices such as the keyboard. We are using what is called
* 'inline assembly' in these routines to actually do the work */
unsigned char inportb (unsign... | true |