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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
903d28f9057c5d3c9e99223f45e0fe7df8ce59a2 | C++ | zgbzsu2008/boost_asio_for_linux | /handler_work.hpp | UTF-8 | 1,397 | 2.546875 | 3 | [] | no_license | #ifndef BOOST_ASIO_DETAIL_HANDLER_WORK_HP
#define BOOST_ASIO_DETAIL_HANDLER_WORK_HPP
#include "associated_executor.hpp"
#include "noncopyable.hpp"
#include "system_executor.hpp"
#include "handler_invoke_helpers.hpp"
namespace boost::asio::detail {
template <typename Handler, typename Executor = typename associated_e... | true |
ddf7ef0234ffe3c164aeb9601103d23a53afb24b | C++ | cotitan/httpd | /src/router.cpp | UTF-8 | 2,023 | 2.609375 | 3 | [] | no_license | #include "controller.h"
#include "my_io.h"
#include <cstring>
#include <cstdio>
#include <unistd.h>
#define DEBUG_MODE
#ifdef DEBUG_MODE
#define DEBUG printf
#else
#define DEBUG
#endif
#ifndef SEGSIZE
#define SEGSIZE 10240
#endif
struct thread_params {
int connfd;
char *header;
int len;
};
int route(int connfd... | true |
b507f6a338a5a0abec3e00f0ad7eadf446101b6b | C++ | AbhishekPratik1810/my_cpp_dsa_practice | /9.31 Trees - Transit Tree Path.cpp | UTF-8 | 768 | 2.625 | 3 | [] | no_license | //https://atcoder.jp/contests/abc070/tasks/abc070_d
#include<iostream>
#include<vector>
#include<map>
using namespace std;
#define ll long long
int v;
ll depth[100001]={};
bool vis[100001] = {};
map<int,vector<pair<int,int>>> adjList;
void dfs(int root){
vis[root]=1;
for(auto i : adjList[root]){
i... | true |
3bb9fcff3133046f30b0394441e00fb11c1111c0 | C++ | rheehot/Algorithm-53 | /2164.cpp | UTF-8 | 302 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
int main() {
int N;
cin >> N;
queue <int> queue;
for (int i = 1; i <= N; i++) {
queue.push(i);
}
while (queue.size() > 1) {
queue.pop();
queue.push(queue.front());
queue.pop();
}
cout << queue.front() << endl;
return 0;
} | true |
262b48b5a3fab5b1b7136cea05f0b6b4609856bc | C++ | guiRodrigues/BinaryCalculator | /main.cpp | UTF-8 | 2,526 | 3.859375 | 4 | [] | no_license | /*
* ~> Problemas com o tipo de dado { long long ~ int }
*/
#include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
int Power(int base, int exponent){
int response=1;
for(int i=1; i<=exponent; i++) response*=base;
return response;
}
void BinaryToDecimal(){
int counter=0,... | true |
5754909c009d476df5b430de2a76ce64644a80ed | C++ | yuting-zhang/UVa | /10179 - Irreducable Basic Fractions/fractions.cpp | UTF-8 | 894 | 2.875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define UPPERBOUND 32000
vector<int> primes;
void sieve() {
bitset<UPPERBOUND> bs;
bs.set();
bs[0] = bs[1] = false;
for (long long i = 2; i < UPPERBOUND; i++)
if (bs[i]) {
for (long long j = i * i; j < UPPERBOUND; j += i)
... | true |
ea9c05698ef6045c7cdd961a133066fe60e25cd7 | C++ | y2kiah/icarus | /Icarus/source/Application/Impl/Timer_win32.cpp | UTF-8 | 3,340 | 2.671875 | 3 | [] | no_license | /* Timer_win32.cpp
Author: Jeff Kiah
Orig.Date: 5/21/12
*/
#include "Application/Timer.h"
#if defined(WIN32)
#include "Utility/Debug.h"
#include <cmath>
// Static Variables
int64_t Timer::sTimerFreq = 0;
double Timer::sSecondsPerCount = 0;
double Timer::sMillisecondsPerCount = 0;
#ifdef _DEBUG
bool Timer::sInitiali... | true |
0d0dca6dafd57fa17e0af0b6b1269781d8579831 | C++ | janmejay/medida | /src/medida/counter.cc | UTF-8 | 2,226 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | //
// Copyright (c) 2012 Daniel Lundin
//
#include "medida/counter.h"
#include <atomic>
#include <sstream>
namespace medida {
class Counter::Impl {
public:
Impl(std::int64_t init = 0);
~Impl();
void process(MetricProcessor& processor);
std::int64_t ... | true |
26d88862477fc13274e1dfc25ee85b282be22583 | C++ | mhcrnl/1000ProgrameCpp | /cpp/exo63-1.cc | UTF-8 | 2,751 | 3.5625 | 4 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
// ----------------------------------------------------------------------
class Animal {
public:
Animal(string, string);
~Animal();
void affiche() const;
protected:
string nom;
string continent;
};
void Animal::affiche() const {
cout<<"Je suis un " << nom << " et ... | true |
6415a55068cc3054756fa36e42177a6a20a009a6 | C++ | mwerlberger/imp | /deprecated/imageutilities/src/iucore/linearmemory.h | UTF-8 | 1,646 | 2.53125 | 3 | [
"MIT"
] | permissive | /*
* Copyright (c) ICG. All rights reserved.
*
* Institute for Computer Graphics and Vision
* Graz University of Technology / Austria
*
*
* This software is distributed WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the above copyright n... | true |
5585825bdbc4d68851636152065f7878a5008e97 | C++ | iLovebugs/Arduino | /I2C working/SNEP.cpp | UTF-8 | 5,311 | 2.71875 | 3 | [] | no_license | #include "SNEP.h"
SNEP::SNEP(NFCLinkLayer *linkLayer) :
_linkLayer(linkLayer){
}
SNEP::~SNEP(){
}
// Receives a SNEP request from the client.
// Arguments: data will be set to point to the received NDEF message
// request[0] will be set the the SNEP request type and request[1] will be set to acceptabl... | true |
2de5defe31c4263c00c2ef0b9067b58b5bb4a191 | C++ | rmiya56/TakeALook | /areaselectpixmap/areaselectpixmapitem.cpp | UTF-8 | 2,289 | 2.515625 | 3 | [
"MIT"
] | permissive | #include "areaselectpixmapitem.h"
#include "../utility/mouseeventutil.h"
#include <QGraphicsSceneMouseEvent>
#include <QDebug>
AreaSelectPixmapItem::AreaSelectPixmapItem()
: QGraphicsPixmapItem()
{
}
AreaSelectPixmapItem::AreaSelectPixmapItem(QImage image)
: AreaSelectPixmapItem::AreaSelectPixmapItem()
{
... | true |
cd80d2e8974009cd6764b9ba1a85f4b6e75c55ad | C++ | martonantoni/pixie | /include/pixie/system/FormatThousands.h | UTF-8 | 982 | 3 | 3 | [
"MIT"
] | permissive | #pragma once
inline std::string FormatThousands(int Value)
{
if(Value>=0)
return Value<1000?fmt::sprintf("%d",Value):Value<1000000?fmt::sprintf("%d,%.03d",Value/1000,Value%1000):fmt::sprintf("%d,%.03d,%.03d",Value/1000000,(Value/1000)%1000,Value%1000);
else
{
int AbsValue=std::abs(Value);
return AbsValue<1000... | true |
b98e9061d8df9b8072d0fc33778e8ab596037b7a | C++ | green-fox-academy/GerBer1234 | /week-01/day-2/coding_hours/main.cpp | UTF-8 | 269 | 2.703125 | 3 | [] | no_license | #include <iostream>
int main(int argc, char* args[]) {
std::cout << "A Green Fox attendee codes about " << 17*5*6 << " hours in a semester." << std::endl;
std::cout << ((17.*5*6)/(17*52))*100 << "% coding hours in the semester." << std::endl;
return 0;
} | true |
0a20aff5c82832ad7c3143138eb04c089687b48a | C++ | Anirgb00/gfg-Covid-codes | /gfgtesting.cpp | UTF-8 | 430 | 2.734375 | 3 | [] | no_license | int a[1001];
int cnt=0;
int check(int a[],int cnt){
int flag = 0;
for(int i=0;i<cnt-1;i++){
if(a[i] >= a[i+1]){
flag = 1;
break; }
}
if(flag == 0) return 1;
else if(flag == 1) return 0;
}
int cnt = 0;
bool isBST(Node* root) {
// Your code here
isBST(root->left);
... | true |
1a3f93751886d9adc10f78b32d4cdea8f7d07fd6 | C++ | JackZhouSz/ebpd_vs2015 | /PCM/qt_gui/toolbars/animesh_enum.hpp | UTF-8 | 4,409 | 2.640625 | 3 | [] | no_license | #ifndef ANIMATED_MESH_ENUM_HPP__
#define ANIMATED_MESH_ENUM_HPP__
/// @brief Enumerants used by Animesh
// =============================================================================
namespace EAnimesh {
// =============================================================================
/// Define some flags correspon... | true |
be23de9458669b2455c4416cbd4b0779349e4506 | C++ | cwlseu/Algorithm | /leetcode/leetCode_power_of_three.cpp | UTF-8 | 388 | 2.953125 | 3 | [] | no_license | #include <climits>
#include <cassert>
#include <cmath>
#include <iostream>
using namespace std;
class Solution {
public:
bool isPowerOfThree(int n) {
return n > 0 && ((int)pow(3, (int)(log(INT_MAX)/log(3))) % n == 0);
}
};
int main(int argc, char const *argv[])
{
Solution solve;
std::cout << solve.i... | true |
29244c8cd0345c57818b929b83e08128aff0d67f | C++ | NetBurner/MobileControlledLedStrip | /ledStrip.cpp | UTF-8 | 21,305 | 2.578125 | 3 | [] | no_license | #include "ledStrip.h"
#include <constants.h>
#include <HiResTimer.h>
#include <stdio.h>
#include <stdlib.h>
#include "spiInterface.h"
extern SpiInterface *gSpi;
HiResTimer* hrTimer = nullptr;
LedStrip::LedStrip()
{
}
bool LedStrip::InitializeLedStrip()
{
if( gSpi == nullptr )
{
iprintf( "Unable to... | true |
15fe70505718a4091511a6b4820f30dc20217675 | C++ | wspeed0711/cfile | /P/1288.cpp | UTF-8 | 568 | 2.765625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main()
{
int n, a[ 50 ];
scanf( "%d", &n );
for( int i = 0; i < n; i ++ )
{
scanf( "%d", &a[ i ] );
}
int step1 = 0;
for( int i = 0; i < n; i ++ )
{
if( a[ i ] == 0 )
{
break;
}
step1 ++;
}
i... | true |
25cc2a772a1d6c2fc977b03501f10270e739cab7 | C++ | pal-0123/Competitive-Database | /CodeChef/ANWCC02.cpp | UTF-8 | 671 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input.txt", "r", stdin);
// for writing output to output.txt
freopen("output.txt", "w", stdout);
#endif
int n,m;
cin >> n >> m;
int i,j;
int c[n];
int km[m];
for (i=0;i... | true |
2a14ca120cbec73201ddd63fd9a73110e382bfa9 | C++ | jcarvajal288/RLEngine | /src/Party.hpp | UTF-8 | 1,830 | 3.390625 | 3 | [] | no_license | #ifndef RLNS_PARTY_HPP
#define RLNS_PARTY_HPP
#include "Actor.hpp"
#include <vector>
namespace rlns
{
/*--------------------------------------------------------------------------------
Class : Party
Description : Groups Actors together into a unit that fights together. The
... | true |
0fbf77e7491fa76ab93e1707492d923b39d17948 | C++ | anujinpurevdorj/gitlearn | /2019/1sar/1-8-hexademical.cpp | UTF-8 | 743 | 2.8125 | 3 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
inline char hexchar(int x) {
if (x < 10) return '0' + x;
return 'A' + x - 10;
}
int main(){
int n,m=2,i=1;
cin >> n;
while(n > m){
m = pow(2,i);
i ++;
}
i -=2;
int l = (i+1)/4;
if((i+1) % 2 != 0){
l ++;
}
int a[i+1],k=0;
char b[l];
for(int j =... | true |
2a66fbe922fbd600823a9164697932920e732650 | C++ | NikkiR97/Data-Structures-Code | /lib/lab05/src/queue.cpp | UTF-8 | 3,294 | 3.90625 | 4 | [] | no_license | //
// Created by Bryan on 9/30/2017.
//
#include "queue.h"
#include <iostream>
namespace lab5{
queue::queue() :head(nullptr),tail(nullptr),size(0){}
queue::queue(std::string &data) {
head=tail=new node(data);
size=1;
}
queue::queue(const queue &original) {
if (original.head!= nullptr) {
node *o... | true |
ac46db298cf4964ed9b21daff912f7c762d8195b | C++ | lehuubao1810/CTDLGT | /Tree/main.cpp | UTF-8 | 3,687 | 3.5625 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct Node{
int key;
Node *left;
Node *right;
Node *parent;
};
struct Tree{
Node * root;
int NumberNode;
};
Node* createNode(int);
void InitTree(Tree &);
bool put(Node*,Tree &);
void TravelNLR(Node*);
void TravelLNR(Node*);
void TravelLRN(Node*);
Node * Se... | true |
6aa138d95f8279e79cbdc823f04f389b0ca92472 | C++ | cassLaffan/CPP_ARAIG | /Final Project/Exoskeleton.cpp | UTF-8 | 616 | 3.0625 | 3 | [] | no_license | #include "Exoskeleton.h"
namespace finalProject{
Exoskeleton::Exoskeleton(std::string name, float intense, float timeVar){
//can't have intensity greater than 100%
if(intense <= 100.00 && intense >= 0 && timeVar >= 0){
stimulationName = name;
intensity = intense;
duration = timeVar;
}
... | true |
36a2dcdbc4390bfc2cd9df6d714682777c000ada | C++ | amirzhad/Awesomely-Complex-Machines-ACM- | /ACM1.cpp | UTF-8 | 3,053 | 3.1875 | 3 | [] | no_license | /*
Author:
Amir Zhad
2018-02-21
Description:
The director of Awesomely Complex Machines (ACM) whose task is to maximize the amount of money that ACM makes during the restructuring.
Source:
https://github.com/amirzhad/Awesomely-Complex-Machines-ACM-.git
Compile: (Ubuntu)
g++ -std=gnu++11 ACM1.cpp -o ... | true |
905eda948c914a9e912e5dd1c3f9db4d4ea940fb | C++ | razzie/PotatoGame | /source/Potato.cpp | ISO-8859-2 | 1,766 | 2.53125 | 3 | [] | no_license | /*
* Copyright (C) Gbor Grzsny <gabor@gorzsony.com> - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
*/
#include <Windows.h>
#include "Potato.hpp"
#include "Demo.hpp"
using namespace raz::literal;
static raz::MemoryPool<100_MB> render... | true |
8454f85e0a9ed85d69bcaead11e28f65c87a6c70 | C++ | MaryRybalka/library | /main.cpp | UTF-8 | 4,766 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <exception>
#include <fstream>
using namespace std;
class Autor;
class Book {
string name;
string author;
public:
Book(const string name, const string author) {
this->name = name;
this->author = author;
}
const stri... | true |
444dcc0627dea53100437233d90b236bfbd0681d | C++ | 120189471/CPP | /Exercise/Main/Main_4_11.cpp | GB18030 | 1,103 | 2.78125 | 3 | [] | no_license | int main_4_11(){
bool flag;
char cval;
short sval;
unsigned short usval;
int ival;
unsigned int uival;
long lval;
unsigned long ulval;
float fval;
double dval=0... | true |
6ef4cbf03d59666e71b7655c94f58b51124aa57f | C++ | ukibs/GameEngine | /GameEngine/GameEngine/ActionManager.cpp | UTF-8 | 2,264 | 3.046875 | 3 | [] | no_license | #include "ActionManager.h"
ActionManager::ActionManager()
{
}
ActionManager::~ActionManager()
{
actions.clear();
}
void ActionManager::addAction(Action action)
{
actions.push_back(action);
}
void ActionManager::addAction(string name, string keyName)
{
Action newAction(name);
newAction.addKey(keyName);
acti... | true |
3526c0958bf771a97dd1d23c8f1c49a50c80b6d1 | C++ | JasonFevang/ticTacToe | /ticTacToe/Player.cpp | UTF-8 | 605 | 3.28125 | 3 | [] | no_license | #include "All.h"
Player::Player(Board *board, marker symbol, bool isAI){
pboard = board; //dependancy injection
this->symbol = symbol;
this->isAI = isAI; //Sets the player to be an AI or human
}
// Player destructor, deletes memory allocation to pboard
Player::~Player()
{
delete pboard;
}
//Plays a symbol on t... | true |
b639f62afbf43c1e9d77ff7cd20516de392d2239 | C++ | yuliy/sport_programming | /codeforces/001/A/main.cpp | UTF-8 | 256 | 2.59375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
long long n, m, a;
cin >> n >> m >> a;
long long x = n / a;
long long y = m / a;
if (a*x < n)
++x;
if (a*y < m)
++y;
cout << x * y << endl;
return 0;
}
| true |
51d1450a78e612680ff74b8f1b18034b59c24568 | C++ | sousablde/CPP | /Arrays/main.cpp | UTF-8 | 1,401 | 3.84375 | 4 | [] | no_license |
#include <iostream>
using namespace std;
// Could declare variables here! string numbers[] = {"one", "two", "three"};
void show1(const int nElements, string texts[]) {
// cout << sizeof(texts) << endl; returns sizeof pointer!
//to go around this and not have just the size of the pointer
//we pass the ... | true |
a4fc11b99bad14306bddd84619480d90ef2fcbcc | C++ | rodolfo15625/algorithms | /tc/testprograms/BombMan.cpp | UTF-8 | 8,143 | 2.5625 | 3 | [] | no_license | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define REP(i,n) for (int i = 0; i < (int)n; i++)
#define FOR(i, a, b) for (int i = a; i <= b; i++)
typedef long long... | true |
5dcf39868982a8f1139aae35c36ffed3aa183ffc | C++ | MiloSi/algorithm_study | /manage_leb/ml.cpp | UTF-8 | 997 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <memory.h>
using namespace std;
const long long MOD = 1000000007;
long long table[10001][16];
//Using bitmask
// a = 0, b = 1, c = 2, d = 3;
long long solution(string& str) {
int len = str.length() -1;
memset(table, 0, sizeof(table));
int shift = str[0] - 'A';
int adm... | true |
4c14e21ac70fe8aa67bf3ac958d49a5d1166793e | C++ | DaliaEl-Sayed/Security | /At&t.cpp | UTF-8 | 2,238 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include "stdio.h"
#include <string>
#include <math.h>
using namespace std ;
int main(){
string txt_init , key_init ;
vector <int> txt2num, key2num , result ;
vector <char> txt,key ;
vector <char> ch = {'A','B','C','D','E','F','G','H','I','J','K','... | true |
e13477b0f312fa85f14b5d06d1b31a9a8257f7db | C++ | jsewalton/PHYSCI-70 | /assets/Edwards_final_project_final.ino | UTF-8 | 12,329 | 2.53125 | 3 | [] | no_license | // Jessica Edwards, PS70 Final Project Code, Spring 2021
#include <FastLED.h>
#include <WiFi.h> // esp32 library
#include <FirebaseESP32.h> // firebase library
#define FIREBASE_HOST "" // the project name address from firebase id
#define ... | true |
f29814acabe53cf84bf4372e296ce06bbbe68271 | C++ | Spritutu/hiquotion_cpp | /AdvancedLib/PokerLib/IPokerArea.h | GB18030 | 1,352 | 2.5625 | 3 | [] | no_license | // IPokerArea.h: interface for the IPokerArea class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_IPOKERAREA_H__3FD1517B_61DD_4A93_8113_D017449E5004__INCLUDED_)
#define AFX_IPOKERAREA_H__3FD1517B_61DD_4A93_8113_D017449E5004__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#end... | true |
4b741f4835b23993218d2a46f2813335e2335945 | C++ | vslavik/poedit | /deps/boost/libs/spirit/classic/phoenix/test/stl_tests.cpp | UTF-8 | 2,780 | 2.75 | 3 | [
"GPL-1.0-or-later",
"MIT",
"BSL-1.0"
] | permissive | /*=============================================================================
Phoenix V1.2.1
Copyright (c) 2001-2003 Joel de Guzman
Use, modification and distribution is subject to the Boost Software
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICE... | true |
317cee910f503acf48da2052a216d9e097dff30d | C++ | chenxp-github/SmallToolsV2 | /common/sharedmemory.cpp | UTF-8 | 2,541 | 2.640625 | 3 | [] | no_license | #include "sharedmemory.h"
#include "sys_log.h"
#include "mem_tool.h"
#include <sys/ipc.h>
#include <sys/shm.h>
CSharedMemory::CSharedMemory()
{
this->InitBasic();
}
CSharedMemory::~CSharedMemory()
{
this->Destroy();
}
status_t CSharedMemory::InitBasic()
{
WEAK_REF_CLEAR();
this->m_ShmI... | true |
2889d38c4a7675dd12693ccb24186c0ec25994aa | C++ | XzoRit/C--Playground | /rvalue_references/rvalue_references.cpp | UTF-8 | 8,734 | 3.1875 | 3 | [
"BSL-1.0"
] | permissive | // rvalue_references.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <boost/move/move.hpp>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <iterator>
#include <utility>
#include <memory>
using namespace std;
namespace... | true |
7fce5732d74ef0df81d4c8fade244453281621f4 | C++ | j-aquib/Load-Balancer | /loadbalancer.cpp | UTF-8 | 515 | 2.609375 | 3 | [] | no_license | //loadbalancer.cpp
#ifndef LOADBALANCER_H
#include "loadbalancer.h"
#endif
int loadbalancer::getTime()
{
return systemTime;
}
void loadbalancer::incTime()
{
systemTime++;
}
void loadbalancer::addRequest(request r)
{
requestQueue.enqueue(r);
incTime();
}
request loadbalancer::getRequest()
{
incT... | true |
683db5c9e25f128116fe2b073e727ed8e8c88811 | C++ | nelk/cs349 | /helicopter_game/aabullet.h | UTF-8 | 370 | 2.625 | 3 | [] | no_license |
#ifndef AABULLET_H
#define AABULLET_H
#include "entity.h"
class AABullet : public Entity {
public:
AABullet(float x, float y, float vx, float vy);
virtual ~AABullet() {}
void paint(XInfo &xinfo);
void update(float delta);
const static int SPEED = 50000.0f; //SQUARED VALUE!!
private:
const static int WIDT... | true |
ee8a13c36ab2446bf374c5d34a2bb0cdd920911e | C++ | hemant-45/Coding-Interview-Questions | /ModOfBigNumer.cpp | UTF-8 | 292 | 2.78125 | 3 | [] | no_license | // Program to Compute Mod a Big Number Represented as String
#include<bits/stdc++.h>
using namespace std;
int main(){
string str="1263514634434085740385345";
int n=10;
int res=0;
for(int i=0;i<str.length();i++)
res=(res*10+str[i]-'0')%10;
cout<<res;
return 0;
}
| true |
af5e6cf1df305c1341e554fa996e2ab0dec23b61 | C++ | lvke-neu/Leetcode | /9-回文数.cpp | UTF-8 | 503 | 3.265625 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<math.h>
using namespace std;
bool isPalindrome(int x)
{
if(x<0)
return 0;
vector<int> v;
while(x!=0)
{
v.push_back(x%10);
x/=10;
}
bool flag=true;
int i=0;
int j=v.size()-1;
while(i<j&&i!=j)
{
if(v[i]!=... | true |
b4e71134999282119b3e0c20cd44cac606ae2fb2 | C++ | sankeerth/Heap | /MaxHeap.cpp | UTF-8 | 2,912 | 3.515625 | 4 | [] | no_license | #include "MaxHeap.h"
#include "log.h"
#include <limits.h>
template <typename T>
void MaxHeap<T>::insert(T key)
{
if (Heap<T>::isHeapFull()) {
Heap<T>::reallocate();
}
Heap<T>::heap_size++;
int index = Heap<T>::getCurrentIndex();
Heap<T>::heap_array[index] = key;
while (index > 0 && (Heap<T>::heap_array[index... | true |
d609eb14d130b58d2f28bacfc5762d7598c765d4 | C++ | MoonlightEngEnt/ChatWindowGui | /ChatControlWindowQTProject/model/framepacket.cpp | UTF-8 | 420 | 2.59375 | 3 | [] | no_license | #include "framepacket.h"
#include <QDebug>
FramePacket::FramePacket(QObject *parent) :
QObject(parent)
{
}
QStringList FramePacket::packetData() const
{
return _packetData;
}
void FramePacket::setPacketData(QStringList data)
{
_packetData = data;
qDebug() << "Got Frame Packet";
for (int i =0; i < ... | true |
033977f1d962443cb2cbdaa31acc925f6b09acb7 | C++ | Lodour/ACM-ICPC | /codes/UVa/401.cpp | UTF-8 | 778 | 2.640625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define fastin ios_base::sync_with_stdio(0);cin.tie(0);
const string ss = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789";
const string tt = "A 3 HIL JM O 2TUVWXY51SE Z 8 ";
char f(char c) {
int p = ss.find(c);
if (p == (int)string::npos) return ' ';
return tt[p];
}
int so... | true |
673dc30bb5ff742deb13c7b00bb782587b1d8bf5 | C++ | blashu/LogicalCircuit | /CellProcessStrategy.h | UTF-8 | 3,617 | 3.046875 | 3 | [] | no_license | #ifndef CELLPROCESSSTRATEGY_H
#define CELLPROCESSSTRATEGY_H
#include "Bus.h"
#include <string>
class CellProcessStrategy
{
public:
CellProcessStrategy();
// Поскольку стратегия может содержать поля, которые могут изменяться
// в зависимости от расчетов и типа ячейки, то был введен этот интерфейс
// (по мот... | true |
b1f212a2d0591243b689bdb36d4391d614d5e337 | C++ | mannu2411/CPP-Codes | /lisa_workbook.cpp | UTF-8 | 766 | 2.859375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
int l=m;
int page_num=1;
int arr[n];
int special=0;;
int start=1;
for(int i=0;i<n;i++){
cin>>arr[i];
}
for(int k=0;k<n;k++){
for(int j=1;j<=arr[k];j++){
cout<<"j="<<j... | true |
8fe942d53b380901817390a9bb81b963cd4b1ce4 | C++ | LayerDE/CppProgramming | /loesungen/blatt-01/ApproximateEulersNumberMain.cpp | UTF-8 | 675 | 2.984375 | 3 | [] | no_license | // Copyright 2018, University of Freiburg,
// Chair of Algorithms and Data Structures.
// Author: Axel Lehmann <lehmann@cs.uni-freiburg.de>.
#include <stdio.h>
#include <math.h>
#include "./ApproximateEulersNumber.cpp"
int main(int argc, char** argv) {
// Store n for both algorithms.
int a1 = 15;
int a2 = 10000... | true |
9bac709ae0f8fedc33d9ef48c52fb360d97a8559 | C++ | DanShai/Genetic-Programming | /src/SubExpression.cpp | UTF-8 | 409 | 2.546875 | 3 | [] | no_license | /*
* File: SubExpression.cpp
* Author: dan
*
* Created on April 11, 2015, 6:35 PM
*/
#include "SubExpression.h"
SubExpression::SubExpression(std::string expre, std::string op){
this->_mexp = expre;
this->_mop = op;
}
std::string SubExpression::getExp(){
return this->_mexp;
}
std::string Sub... | true |
469911be69d56ae26dedb8f1afa06b0f445d11ed | C++ | Quadroue4/Algorithm | /1761-1.cpp | UTF-8 | 2,247 | 3 | 3 | [] | no_license | //1761-1.cpp
//1761.cpp
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int N,M;
int parent[40001];
int depth[40001];
int cost[40001];
int dp[40001][17]; //2^0 부터 2^16 까지 필요하므로. (1~40000)
int cost_dp[40001][17];
vector<pair<int,int>> informations[40001];
bool used[40001];
void initia... | true |
64854134337a8286bb9eedbd6e0acb9c65425531 | C++ | FoxerLee/Leetcode | /submission/cpp/0001.cpp | UTF-8 | 452 | 3.0625 | 3 | [] | no_license | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
vector<int>obj;
for (int i = 0; i < nums.size(); i++) {
for (int j = 0; j < nums.size(); j++) {
if (nums[i] + nums[j] == target && i != j) {
obj.push_back(i);
... | true |
7041211b93058cda83dbf6a7f49eade20b24f300 | C++ | pra11chit/competitive | /spoj/ONP.cpp | UTF-8 | 943 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <stack>
using namespace std;
void transform(stack<char> str, stack<char> str1) {
int size = str.size();
for (int a = 0; a < size; ++a) {
cout << str.top();
str.pop();
}
int size1 = str1.size();
for (int b = 0; b < size1; ++b) {
cout << str1.top()... | true |
c3b7b36c83d46a316e38835991d90761d39f749b | C++ | FallenRecruit/Led-Strip-Controller | /Led-Strip-Controller/Arduinocode/Arduinocode.ino | UTF-8 | 828 | 3.0625 | 3 | [] | no_license | String inputString = ""; // a string to hold incoming data
boolean stringComplete = false; // whether the string is complete
String commandString = "";
int led1Pin = 9;
int led2Pin = 10;
int led3Pin = 11;
boolean isConnected = false;
void setup() {
Serial.begin(57600);
pinMode(led1Pin,OUTPUT);
pinM... | true |
0000800e42a1b9aa8211cc192bd986859fbc8e59 | C++ | FRENSIE/FRENSIE | /packages/monte_carlo/collision/photon/test/tstAbsorptionPhotoatomicReaction.cpp | UTF-8 | 6,869 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | //---------------------------------------------------------------------------//
//!
//! \file tstAbsorptionPhotoatomicReaction.cpp
//! \author Alex Robinson
//! \brief Absorption photoatomic reaction unit tests
//!
//---------------------------------------------------------------------------//
// Std Lib Includes
#... | true |
f7a3d2b66164d940bb69cfcc263140de42c34108 | C++ | peter88037/LeetCode | /129. Sum Root to Leaf Numbers.cpp | UTF-8 | 734 | 3.796875 | 4 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int sumNumbers(TreeNode *root) {
int sum = 0;
sumRootToLeafNum(r... | true |
bb188b28794329cdee130f794f91fb62d90fd352 | C++ | pokerfaceSad/algorithm | /刷题/leetcode-66.cpp | UTF-8 | 912 | 3.421875 | 3 | [] | no_license | # include <iostream>
# include <vector>
using namespace std;
class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
int length = digits.size();
for (int index = length-1 ; index >= 0 ; index--) {
if(digits[index] != 9) {
digits[index]++;
retu... | true |
23273eca9a3681dd7308122d0d268a12322eba7f | C++ | rylo5688/DropBucket-Client | /fileexplorerscene.cpp | UTF-8 | 13,252 | 2.703125 | 3 | [] | no_license | #include "fileexplorerscene.h"
/**
* @brief FileExplorerScene::FileExplorerScene
* Constructor for File Explorer
*/
FileExplorerScene::FileExplorerScene()
{
Q_INIT_RESOURCE(resources);
allowClicks_ = true;
curr_x_ = 0;
curr_y_ = 0;
factory_ = new SimpleDirectoryFactory();
DirectoryToJson... | true |
29b7138fe2628c42b24f61103cb9049f735bbbac | C++ | TheTryton/gnoise | /gnoise/include/modules/non_generator_modules/modifiers/exponent/noise_exponent_module.hpp | UTF-8 | 852 | 2.703125 | 3 | [] | no_license | #pragma once
#include "../noise_modifier_module.hpp"
GNOISE_NAMESPACE_BEGIN
inline constexpr float default_exponent = 2.0f;
class noise_exponent_module;
struct exponent
{
inline static float apply(const noise_exponent_module* module, float x);
};
class noise_exponent_module : public noise_modifier_module_base... | true |
d6803387164ccd578d8a4fccd7e5fcca31810f8d | C++ | mayankamencherla/cracking-the-coding-interview-solutions | /sorting-and-searching/binary-search.cpp | UTF-8 | 1,315 | 4.09375 | 4 | [
"MIT"
] | permissive | /**
* Implementation of binary search
*/
#include <vector>
#include <iostream>
using namespace std;
int binarySearchIter(vector<int>& v, int search)
{
int low = 0; int high = v.size()-1;
while (low <= high)
{
int mid = (low + high) / 2;
if (v[mid] == search) return mid;
else ... | true |
292bbf66f01a1417efbefeaff9cf0583faaff3f0 | C++ | Guykor/CPP_Projects | /cpp_ex3/HashMap.hpp | UTF-8 | 18,545 | 3.546875 | 4 | [] | no_license | /**
* @file HashMap.hpp
* @author Guy Kornblit
*
* @brief HashMap generic container.
*
*/
// ------------------------------ includes ------------------------------
#include "iostream"
#include <array>
#include <vector>
#include <stdexcept>
// -------------------------- const definitions ---------... | true |
b32079925f13555e0f2b05f8d2fd13c4f7b733d6 | C++ | Taylor-Reid/CatPicture | /src/CatPictureApp.cpp | UTF-8 | 1,194 | 2.546875 | 3 | [] | no_license | #include "cinder/app/AppBasic.h"
#include "cinder/gl/gl.h"
using namespace ci;
using namespace ci::app;
using namespace std;
const int SURFACE_WIDTH = 1024;
const int SURFACE_HEIGHT = 1024;
class CatPictureApp : public AppBasic {
public:
void setup();
void mouseDown( MouseEvent event );
void update();
void dr... | true |
8ac8b8119b6082493938c1f187760aba6f7d755f | C++ | LIMTAECHEON/Study | /enemyManager.h | UHC | 3,214 | 2.65625 | 3 | [] | no_license | #pragma once
#include "gameNode.h"
#include "enemy.h"
#include "minion.h"
#include "minion2.h"
#include "minion3.h"
class bullet;
class rockman;
class stageMap;
class enemyManager: public gameNode
{
private:
typedef vector<enemy*> vEnemy; // ʹ vector
typedef vector<enemy*>::iterator viEnemy;
private:
vEnem... | true |
1e0fbf8a37e5961768a68d3160d33e2bb35b18a0 | C++ | adibyte95/codechef_problems | /chef and chain.cpp | UTF-8 | 629 | 2.9375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t>0)
{
string s;
cin>>s;
int count1=0,count2=0;
int flag1=0,flag2=0;
for(int i=0;i<s.length();i++)
{
if(flag1==1)
{
if(s[i]!='+')
count1++;
flag1=0;
}
else if(flag1==0)
... | true |
a596df0d3b63b53bb49347e88568661b5c82a3ed | C++ | ShereenKhoja/TicTacToeMVP | /ModelViewPresenter_TicTacToe/TicTacToePresenter.h | UTF-8 | 1,090 | 2.625 | 3 | [] | no_license | //***************************************************************************
// File name: TicTacToePresenter.h
// Author: Chadd Williams
// Date: 3/22/2017
// Class: CS485
// Assignment: Model View Presenter Example
// Purpose: Demonstrate how the Model View Presenter is used
// This pr... | true |
322f0886dea53a6db91ef065d7c512090799e0e9 | C++ | aaafwd/Online-Judge | /Volume 002 (200-299)/244.cpp | UTF-8 | 4,136 | 2.984375 | 3 | [] | no_license | /* @JUDGE_ID: 19899RK 244 C++ "By Anadan" */
// Train Time
// Accepted (0.000 seconds with low memory spent)
#ifdef ONLINE_JUDGE
#define NDEBUG
#endif
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <vector>
constexpr double eps = 1e-7;
constexpr int kFeetsInMile = 5280;
double max_speed, acceler... | true |
26e2af989cd3c986102c5bd5673004c939350202 | C++ | mndarren/Code-Lib | /c_cpp_lib/sorting/Sort.cpp | UTF-8 | 4,742 | 3.703125 | 4 | [
"Apache-2.0"
] | permissive | /*@author Zhao Xie <11/02/2013>
**@file Sort.cpp*/
/*quickSort
Quick Sort sorts in place. Its time is O(n^2) in the worst case but O(NlogN) when each pivot is near the median of its segment.
This section shows two versions of qs_partition(). quicksort() itself sorts the values in the array a[] from index low through i... | true |
9623c9eb838009ab9746f2d8572e8dd956ef6c4e | C++ | oooooverflow/MyPainting | /161220126_系统工程/二维图元项目/项目文件/polygon.cpp | UTF-8 | 1,995 | 3.015625 | 3 | [] | no_license | #include "polygon.h"
#include <qmath.h>
#include <QDebug>
MyPolygon::MyPolygon(double angle)
{
this->angle = angle;
}
void MyPolygon::drawMyself(QImage *image, QColor* color) {
MyLine *tmp = new MyLine();
if(isdone) // 如果完成闭合,则连接最后一个点与第一个点
tmp->setPoint(lines[lines.size()-1], lines[0]);
else ... | true |
ead6d521da49e6c9174db048d99e61d2f6d560ab | C++ | yannik-schmitzer/hrw | /Gartenplaner/graphicsscene.h | UTF-8 | 1,792 | 2.5625 | 3 | [] | no_license | #ifndef GRAPHICSSCENE_H
#define GRAPHICSSCENE_H
#include <QGraphicsScene>
#include <QGraphicsSceneMouseEvent>
#include <QDebug>
#include <QDropEvent>
#include <QLabel>
#include <QPixmap>
#include <QMimeData>
#include <QGraphicsRectItem>
#include <QGraphicsProxyWidget>
class GraphicsScene : public QGraphicsScene
{
... | true |
b05b399e0565db6a5183a74b04763f93bfa946be | C++ | xFlowDev/2D-RPG-Game | /SfmlTest/SfmlTest/Game.hpp | ISO-8859-1 | 1,284 | 2.65625 | 3 | [] | no_license | #pragma once
#ifndef GAME_H
#define GAME_H
#include <chrono>
#include <iostream>
#include "Variables.hpp"
#include "GameScreen.hpp"
#include "MenuScreen.hpp"
class Game {
public:
Game();
~Game();
void GameLoop();
private:
sf::RenderWindow GameWindow;
sf::View view;
GameState GameState;
MenuScreen menuScreen;
... | true |
282f57ce481c74f94538dc5f2577f91f596ab903 | C++ | Lepidora/Xylena | /Texture.h | UTF-8 | 1,834 | 2.96875 | 3 | [] | no_license | #pragma once
//System includes
#include <vector>
#include <memory>
//OpenGL include
#include "OpenGL.h"
//Local includes
#include "GLTypes.h"
namespace Xylena {
//Structs
/*struct TextureImage {
std::vector<char> data;
int width;
int height;
};*/
//Typedefs
//typedef GLuint Textur... | true |
af85a0a49be064b4cbb271b9f414968138afa196 | C++ | bednikova/SDP | /LinkedQueue/main.cpp | UTF-8 | 298 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include "LinkedQueue.h"
using namespace std;
int main()
{
LinkedQueue<int> queue;
queue.enqueue(3);
queue.enqueue(55);
queue.enqueue(455);
while(!queue.isEmpty())
{
cout << queue.first() << " ";
queue.dequeue();
}
return 0;
}
| true |
5f6f78208ad2a4de0e6defdd608d1429fb8ca025 | C++ | thedm/esp-mqtt-nodes | /template/template.ino | UTF-8 | 3,439 | 2.6875 | 3 | [] | no_license | /**
* ESP MQTT sensornode example.
*
* Example ESP node that reads sensors and publishes the data to
* MQTT.
*
* Usage:
*
* 1. Update all <------------> parts with your sensor specific code.
* 2. Update/extend settings.h
* 3. Create a credentials.h with all passwords. See settings.h for
* corresponding co... | true |
57955d83f77dce165e356fe2bfb561ee139e26a5 | C++ | pnorbert/adiosvm | /Tutorial/gs-mpiio/simulation/writer.cpp | UTF-8 | 4,274 | 2.609375 | 3 | [
"MIT"
] | permissive | #include "writer.h"
#include <iostream>
#define CHECK_ERR(func) \
{ \
if (err != MPI_SUCCESS) \
{ ... | true |
1b5dabb69b20c0503b9ea0749b986848a2cdd008 | C++ | rustushki/asgard | /distro/src/graphicsEngine/Animation.h | UTF-8 | 1,941 | 3.03125 | 3 | [] | no_license | #ifndef ANIMATION_H
#define ANIMATION_H
#include "externals.h"
#include "AnimationState.h"
#include "RectBlitter.h"
class Animation
{
private:
// Helper for Constructors. Initialize Animation members.
void init(uint width, uint height, uint sps, uint ssRows, uint ssCols);
// Status of animation... | true |
188774c70ced8b6c1fbdf7459eea3cc3c4179ae3 | C++ | LargeDumpling/Programming-Contest | /OnlineJudges/UVa(29)/10003 Cutting Sticks/code.cpp | UTF-8 | 815 | 2.65625 | 3 | [] | no_license | /*
Author: LargeDumpling
Email: LargeDumpling@qq.com
Edit History:
2015-11-30 File created.
*/
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int L,n,num[55],f[55][55];
int min(int a,int b)
{
return ((a)<(b)?(a):(b));
}
int dp(int l... | true |
2ace0649dc14754e7b2aa407108051a9744e51ea | C++ | adityaXXX/Spoj | /ABCPATH.cpp | UTF-8 | 2,184 | 2.734375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int X[8] = {1, 1, 1, 0, 0, -1, -1, -1};
int Y[8] = {0, 1, -1, 1, -1, 0, -1, 1};
int a[51][51];
bool visited[51][51];
int moves[51][51];
int h, w, Max = 0;
void dfs(int x, int y){
visited[x][y] = true;
int Tx, Ty;
for(int i = 0; i < 8; i++){
// std::cout << "P... | true |
117918bdf83a55b5ebdbf041cbd8921ede7f7f93 | C++ | supercamel/EmbeddedToolKit | /examples/sigslot/main.cpp | UTF-8 | 1,000 | 3.484375 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <etk/etk.h>
using namespace std;
/**
Signals and slots are very useful in event-driven programming because they
provide an easy way of de-coupling event sources from event handlers.
Here's an example
You have a temperature controller beer brewer. You have a temperature sensor
a... | true |
065361fd6798f286c8804b6e2752ef4a87244964 | C++ | NazarPonochevnyi/Programming-Labs | /Programming/Sem1/Lab8/lab8_with_templates/module.h | UTF-8 | 1,711 | 3.515625 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <fstream>
#include <string>
using namespace std;
/*
14. Використовувати (лінійні) односпрямовані списки без заголовної
ланки (мал. а) або з заголовною ланкою (мал. б) при наступному їхньому
описі
Параметр L позначає список, а параметри Е, Е1 — дані типу ТЕ, до яких
можна застосовувати опе... | true |
b58034b7ef31399cfdc18cb576fe8204f87b79e5 | C++ | vmware/concord-bft | /storage/include/memorydb/client.h | UTF-8 | 5,463 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | // Copyright 2018-2019 VMware, all rights reserved
// Objects of ClientIterator contain an iterator for the in memory
// object store (implemented as a map) along with a pointer to the map.
//
// Objects of Client are implementations of an in memory database
// (implemented as a map).
//
// The map contains key value ... | true |
1a49cb16b9a8ef5b90cd7724ab5de06b084b9f21 | C++ | guitar0322/MegamanX4-mod | /Projectile.cpp | UTF-8 | 1,587 | 2.578125 | 3 | [] | no_license | #include "stdafx.h"
#include "Projectile.h"
void Projectile::Init(string targetTag, string hitEffectName, int damage, float activeLimit)
{
_targetTag = TAGMANAGER->GetTag(targetTag);
_hitEffectName = hitEffectName;
_damage = damage;
_activeLimit = activeLimit;
_activeTime = 0;
_isNeedEffectDir = false;
}
void P... | true |
8e38b5d1fae719d55175420b858dbb5021493d6a | C++ | KillerOfFriend/PersonalTests | /TreeModel/Models/TableModel.h | UTF-8 | 3,287 | 2.890625 | 3 | [] | no_license | #ifndef TABLEMODEL_H
#define TABLEMODEL_H
#include <memory>
#include <map>
#include <QAbstractTableModel>
#include <QDateTime>
#include <QObject>
namespace Models
{
//-----------------------------------------------------------------------------
class TTableItem : public QObject
{
Q_OBJECT
pub... | true |
d6e9b6fd394f438448be06df57b5bb1b35b3d3a0 | C++ | flyingtoaster0/CS4471TREE | /PredatorAndPrey/PredatorAndPrey/PushButton.cpp | UTF-8 | 937 | 2.859375 | 3 | [] | no_license | #include "PushButton.h"
#include <iostream>
PushButton::PushButton() : Clickable()
{
}
PushButton::PushButton(float x, float y, float width, float height, std::string label) : Clickable(x, y, width, height, label)
{
// Hardcoded color. Change this later maybe
this->upColor = vec3(0.5, 0.0, 0.8);
this->downColor ... | true |
7b04f86bb9662fc6bf4c9da02ac4e58af4ebba0e | C++ | zakidane/Huffman-Text-File-Compression | /huffman.cpp | UTF-8 | 3,156 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <string.h>
#include <typeinfo>
#include <queue>
#include <vector>
#include <bits/stdc++.h>
#include "huffman.hpp"
using namespace std;
int main() {
string line, file, compressedString, decompressedLine;
int sizeArray, index;
vector<MinHeapNode>CharArray;
cout << "INp... | true |
357f506f46904aaa6ca29e3271a1cf63a62a93e6 | C++ | changkk/ckrobotics | /Coding Practice/36. Lowest Common Ancestor of a Binary Tree.cpp | UTF-8 | 2,541 | 3.671875 | 4 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
/*
Goal: Find lowest common ancester
Find the first meeting node = common ancester
ex)
3 - 5 - 2 - 4
3... | true |
0031a154b619b48c08c38659a081360ca08b54ea | C++ | naturalistic/CodeJamPractice | /Africa2010/reversewords.cpp | UTF-8 | 695 | 3 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
int main() {
ifstream input("B-large-practice.in");
ofstream output("B-large-practice.out");
int cases;
input >> cases;
input.get();
string line;
for(int c=1; c<=cases; c++) {
getline(input, li... | true |
c15a914fd8fdcb7ba8f3d8a2ad67e7f8437f9abf | C++ | ColWalterEKurtz/cppgen | /SrcMainCpp.cpp | UTF-8 | 7,531 | 2.921875 | 3 | [] | no_license | // -----------------------------------------------------------------------------
// SrcMainCpp.cpp SrcMainCpp.cpp
// -----------------------------------------------------------------------------
/**
* @file
* @brief This file holds the implementation of the SrcMain... | true |
be82f040d9568c1662c8b437c1a1017e298b8ed2 | C++ | timatlee/ACNH-AutoPusher | /src/main.cpp | UTF-8 | 4,921 | 2.921875 | 3 | [] | no_license | #include <LiquidCrystal.h>
#include <Arduino.h>
#include <Keypad.h>
#include <Servo.h>
#include <arduino-timer.h>
const int LCD_TIMER=2500;
// Various variables.
int iDeflection = 48;
int iDelay = 500;
int iHoldDelay = 500;
bool bRunning = false;
// LCD setup
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
int iDisplayCycl... | true |
5317328f7b009bfa80b720ca7b4c01fed0416bc9 | C++ | Teamforalgorithm/study_codes | /rokwon/6-1_최단_경로_알고리즘/1238_파티.cpp | UTF-8 | 1,298 | 2.734375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<queue>
using namespace std;
int sum_distan[1001];
int N,M,X;
void dijkstra( vector< pair<int,int> > arr[]) {
priority_queue< pair<int,int> > q;
q.push({0, X});
int min_distan[1001];
for (int i = 1; i < N; i++)
... | true |
b6264c95a0338335e1348f9cb8cd64f48fd2d63e | C++ | kompanpawel/PROI | /Heroes/include/save_error.h | UTF-8 | 289 | 2.671875 | 3 | [] | no_license | #ifndef SAVE_ERROR_H
#define SAVE_ERROR_H
#include <string>
class save_error
{
std::string except;
public:
save_error(): except{"error while saving"} {}
save_error(std::string except_): except{except_} {}
std::string what() {return except;}
};
#endif // SAVE_ERROR_H
| true |
b5e9ec0a460509fc6e37b5afc707ae4d8df91ce3 | C++ | lamloei/GitHub | /AT.LAMLOEI/Node32pico/node32pico_at_lamloei/node32pico_at_lamloei.ino | UTF-8 | 827 | 2.546875 | 3 | [] | no_license | #include <Wire.h>
#define _CC_C10 (c[i]==char(10))
#define _CC_C13 (c[i-1]==char(13))
#define _CC0 (c[0]=='a'||c[0]=='A')
#define _CC1 (c[1]=='t'||c[1]=='T')
#define _CC2 (c[2]=='.')
int i=0;
char c[8192];
char d;
void clearChar() {
memset(c, (char)0, sizeof c);
}
void setup() {
Serial.begin(115200);
}
void lo... | true |
9ea21a536eb908a05be46c75019bdf152dde4617 | C++ | gawbi/ch09 | /twodarray.cpp | UHC | 641 | 3.890625 | 4 | [] | no_license | // file: twodarray.c
#include<stdio.h>
#define ROWSIZE 2
#define COLSIZE 3
int main(void)
{
// 2 迭
int td[ROWSIZE][COLSIZE];
// 2 迭ҿ
td[0][0] = 1; td[0][1] = 2; td[0][2] = 3;
td[1][0] = 4; td[1][1] = 5; td[1][2] = 6;
printf("ݺ for ̿Ͽ \n");
for (int i = 0; i < ROWSIZE; i++)
{
for (int j... | true |
657fc680efa2e7255af7c5cd702f83fd184b52ec | C++ | arrows-1011/CPro | /AOJ/Volume10/1046.cpp | UTF-8 | 1,814 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <cstring>
using namespace std;
#define MAX 20
#define INF 1e9
int H,W,ax,ay,bx,by;
char field[MAX][MAX];
string str;
const int dx[] = {-1,0,0,1,0};
const int dy[] = {0,-1,1,0,0};
struct State{
int sx,sy,gx,gy;
State(int sx,int sy,int gx,int gy) : sx(sx),sy(s... | true |
501a4b005d4f40d4dab38ecff0835cfa7091bcdd | C++ | msherve16/Assignment4 | /Assignment4E/Assignment4E/Source.cpp | UTF-8 | 1,007 | 3.765625 | 4 | [] | no_license | ////////////////////////
//Morgan Sherve
//Assignment 4 Exercise 11.13
///////////////////////////////
#include <iostream>
using namespace std;
Course::Course(const string& courseName, int capacity)
{
numberOfStudents = 0;
this -> courseName = coursename;
this-> capacity = capacity;
students = new string[capacity... | true |
6dcd099be91abd3b39a7273f48c279d77f122c3c | C++ | Assylzhan-Izbassar/Algorithms-and-Data-Structures | /week_13/graph-thory:dfs/№111540.cpp | UTF-8 | 1,395 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int g[100001][100001];
bool used[100001];
int n;
vector<int> ans;
int counter = 0;
void dfs(int u)
{
used[u] = true;
counter++;
ans.push_back(u);
for(size_t i=0; i < n; ++i)
{
if(g[i][u] == 1 && !used[i])
{
d... | true |
a62ad4b8e98c3812aa8c9874a974f5dd570d8df2 | C++ | caj07/437_Assignment2 | /437_Assignment2/TAAssignmentStatement.cpp | UTF-8 | 1,017 | 2.921875 | 3 | [] | no_license | #include "TAAssignmentStatement.h"
#include "TAType.h"
#include "TATerm.h"
TAAssignmentStatement::TAAssignmentStatement() :
TAAtomicStatement(), m_target(), m_expression(), m_concurrentTemp()
{
}
TAAssignmentStatement::TAAssignmentStatement(TATerm * target, TATerm * expression) :
TAAtomicStatement(), m_target(targ... | true |
90f47deed875777e31c5ad3d3689803f1554c33b | C++ | WindowsNT/tu | /rest.h | UTF-8 | 12,796 | 2.84375 | 3 | [] | no_license | #ifndef _REST_H
#define _REST_H
#include <functional>
#include <utility>
#include <memory>
#pragma once
namespace RESTAPI {
using namespace std;
typedef vector<char> DATA;
inline std::vector<std::wstring> &split(const std::wstring &s, wchar_t delim, std::vector<std::wstring> &elems) {
std::wstringstream ss(s)... | true |
ab040ffd8cf1724b7d75276666b0715278acd384 | C++ | alex-77/Estructuras | /Tarea 3/Ejercicio2/main.cpp | UTF-8 | 2,773 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include "LinkedList.h"
using namespace std;
using namespace vcn;
int main()
{
int tamN,tamM;
int n, m;
LinkedList<int> * M = new LinkedList<int>();
LinkedList<int> * N = new LinkedList<int>();
LinkedList<int> * P = new LinkedList<int>();
cout << "Dame el total de numeros de la lista N" <<... | true |