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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
262138fec1ccbc0968e17e40f5f051f50c1218e8 | C++ | peeyushy95/Project-Euler | /Project Euler #47 Distinct primes factors.cpp | UTF-8 | 2,809 | 2.625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | /*
AUTHOR : Peeyush Yadav
Problem : Project Euler #47: Distinct primes factors
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f(a,b,c) for(int a=b;a<c;a++)
#define s(x) scanf("%d",&x);
#define sl(x) scanf("%lld",&x);
#define p(x)... | true |
dc620790abb248e7968be3ea786bedf03f7f993f | C++ | beingveera/cplusplus-Programming | /Compititive/Triangle.cpp | UTF-8 | 372 | 2.953125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define Area(base,height) (.5*base*height)
/*
int main(){
pair<int,int> tri;
cin>>tri.first;
cin>>tri.second;
cout<<Area(tri.first,tri.second)<<endl;
}
*/
int main(){
int x;
std::vector<int> v;
if(v.empty()){
for (int i = 0; i < 2; ++i)
{
cin>>x;
v.push... | true |
1753436c85a55a645345327542cd748664ac4be1 | C++ | SugarSpinda/MyLib | /thread/Condition.cpp | UTF-8 | 4,209 | 2.890625 | 3 | [
"MIT"
] | permissive | #ifdef __linux__
#include <sys/time.h>
#endif
#include "Condition.hpp"
#include "common/Exception.hpp"
#include "common/Log.hpp"
#ifdef USE_FAKE_CONDITION_VARIABLE
#include <list>
typedef struct ConditionEvent
{
ConditionEvent() : wokenUp(false)
{
this->event = ::CreateEvent(nullptr, TRUE, FALSE, nullptr);
}
... | true |
e98926584d06e62276944b851caa0f022dcc09d6 | C++ | yyao93/Game-Me2D | /src/fullpath.cpp | UTF-8 | 194 | 2.546875 | 3 | [] | no_license | #include "../include/fullpath.h"
std::string full_path(const char * filename) {
char * real_path = realpath(filename, NULL);
std::string ret = real_path;
free(real_path);
return ret;
}
| true |
03ed32f90af5cb98b4e0524ff2d4e5ae10835773 | C++ | mkk96/IIIT-H-Initial-code | /SEARCHING AND SORTING/mergeSort.cpp | UTF-8 | 760 | 3.078125 | 3 | [] | no_license | #include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<queue>
using namespace std;
void merge(vector<int> &v,int l,int mid,int h)
{
queue<int> temp;
int i=l,j=mid+1;
while(i<=mid&&j<=h)
{
if(v[i]<v[j])
{
temp.push(v[i++]);
}
else
{
temp.push(v[j++]);
}
}
while(i<=mid)
{
temp.pus... | true |
d31924c7ae7f83c6ec587f45a58e57807ac5520d | C++ | danzeeeman/roxlu | /lib/include/roxlu/io/File.h | UTF-8 | 2,547 | 2.53125 | 3 | [] | no_license | #ifndef ROXLU_FILEH
#define ROXLU_FILEH
#include <string>
#include <fstream>
#include <cstdlib>
#include <roxlu/core/platform/Platform.h>
#if ROXLU_PLATFORM == ROXLU_APPLE
#include <TargetConditionals.h>
#include <mach-o/dyld.h>
#elif ROXLU_PLATFORM == ROXLU_WINDOWS
#include <windows.h>
#endif
using std::string;
... | true |
75652ad3775c6b693850bba54233d2a0a3182c02 | C++ | nidalbedyouch/PPP-greedy-tabusearch | /src/Src/proyecto.cpp | UTF-8 | 16,829 | 3.015625 | 3 | [
"MIT"
] | permissive | #include "utilidades.cpp"
/*
* Lee el archivo con formato:
* Y
* T
* K_1,C_1;K_2,C_2;...;K_Y,c_Y
*
* In: Nombre del archivo (string)
* Out: Tipo de dato PPP.
* PPP -> Y: Cantidad de Yates
* PPP -> Y: Cantidad de Yates
* PPP -> vtrK: Capacidad del Yate_i
* PPP -> vtrC: Tripulación del Yate_i
*/
PPP leer... | true |
5653057055933e2cfdb2711f5dbcc1a6c1da3738 | C++ | AdriannaCencora/sdizo-1 | /sdizo/source/controllers/testControllers/structureTestController/structureTestController.cpp | WINDOWS-1250 | 11,107 | 2.96875 | 3 | [] | no_license | #include "stdafx.h"
#include "structureTestController.h"
#include "source\structures\array\Array.h"
#include "source\structures\list\List.h"
using namespace std;
structureTestController::structureTestController(GenericStructure * structure, std::string structureName)
{
m_structure = structure;
filename = ... | true |
b88cfdbc33e0e3cc25f004289ff4bdcc763938c4 | C++ | pnutus/CAutomata | /CellularAutomata/main.cpp | UTF-8 | 3,942 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | //
// main.cpp
// CellularAutomata
//
// Created by Pontus Granström on 2015-02-13.
// Copyright (c) 2015 Pontus Granström. All rights reserved.
//
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <time.h>
#include "pcg_basic.h"
typedef uint32_t u32;
typedef int64_t s64;
ty... | true |
85a034607176a1744c7a12ca20d5b476b7af5229 | C++ | wfgsy101/CPUSPLUS | /filereader/file_read.cc | UTF-8 | 603 | 2.921875 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
//#define SEEK_END 2
//#define SEEK_SET 0
using namespace std;
//读取文件字符个数
int GetFileLength(FILE *fp)
{
int length;
fseek(fp,0,SEEK_END);
length = ftell(fp);
fseek(fp,0,SEEK_SET);
return length;
}
//把此表文件读入mem内存区,
int FileRead( FILE * fil... | true |
45547cf52ec68619137281271b71c1e4885dc21b | C++ | CristinaBaby/Demo_CC | /ml/1068/Classes/codebase/platform/android/analytics/AnalyticsJNI.cpp | UTF-8 | 6,162 | 2.53125 | 3 | [] | no_license | //
// AnalyticsJNI.cpp
// AnalyticsCenter
//
// Created by Jimmy on 15/11/2.
//
//
#include "AnalyticsJNI.h"
#include "../JNIHelper.h"
AnalyticsJNI::AnalyticsJNI()
: ClassAnalytics(0)
,_analyticsJava(0)
,_methodSendEvent(0)
,_methodSendEvents(0)
,_methodSendScreenEvent(0)
,_methodEndSession(0)
,_methodSetDebugMode... | true |
5e35d1c4fa7e8142b0e963dda6b266faf7c5dd6d | C++ | rubyist/haulbox | /haul-box.ino | UTF-8 | 5,299 | 2.828125 | 3 | [
"MIT"
] | permissive | #include "outputter.h"
#include "button.h"
#define LED_PIN 18
int ledValue = 0;
byte rows[] = {8, 7, 6, 5, 4};
const int rowCount = sizeof(rows)/sizeof(rows[0]);
byte cols[] = {9, 10, 11, 12, 13};
const int colCount = sizeof(cols)/sizeof(cols[0]);
byte keys[colCount][rowCount];
Button *buttons[colCount][rowCount] ... | true |
f38d034e450ffac049148c4eb43eccf363ee55ac | C++ | jabelai/Neverland | /Cocos2dxLib/Classes/GameNetBean.h | GB18030 | 3,118 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | #ifndef __GAMENETBEAN_H__
#define __GAMENETBEAN_H__
#include "ccnet/net.h"
#include "ccbase/base.h"
#include "GameModel.h"
#define MSG_UI_CONNECTED 1 //֪ͨUIӳɹ
#define MSG_UI_DISCONNECTED 2 //֪ͨUIж
#define MSG_UI_CONNECTERROR 3 //֪ͨUIӴ
#define MSG_UI_CONNECTTIMEOUT 4 //֪ͨUIӳʱ
///csӿϢ
#define... | true |
9cd5884ae32a2f34d6d74f902ab8a7a1f167e675 | C++ | trisuliswanto/AdRoiT | /06. Motor DC (Tanpa PID)/main.cpp | UTF-8 | 3,206 | 2.75 | 3 | [] | no_license | /***************************************************************
Project : ADROIT AVR Rev.3
Version : 1
Date : 5/29/2015
Author : Eko Henfri Binugroho
Company : ER2C
Code : Pengaturan kecepatan motor DC (motor roda) dengan PWM
*****************************************************************/
/*
Jika menggunaka... | true |
579dd509ad4060d0b20d010b3a414b240fd9e80a | C++ | 9thbit/Planet-Wars | /CaseBasedBot.cpp | UTF-8 | 1,315 | 3.03125 | 3 | [] | no_license | //
// CaseBasedBot.cpp
// planetwars_cpp1
//
// Created by Barry Hurley on 08/03/2011.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#include "CaseBasedBot.h"
#include "GameState.h"
#include "Successor.h"
#include <vector>
#include <iostream>
CaseBasedBot::CaseBasedBot(){
enemyMoves = new Success... | true |
06a06bdd19a0453299d5d612dda25e5c5a4c47ff | C++ | Moises788/Sistemas_Microcontrolados | /Exemplos/Assembly/PORTB_OUTPUT.ino | UTF-8 | 798 | 2.625 | 3 | [] | no_license | /*Sistemas microcontrolados
MCU: ATmega 328p F: 12 MHz
Autor: Alysson Lima
Pisca led
*/
//incluindo bibliotecas
#include <avr/io.h> //biblioteca para acesso aos registradores do ATmega
#include "util/delay.h" //biblioteca delay da ling C
//funcao principal do codigo
int main (void) {
//regiao ... | true |
ed6de09aef6cb9cb42a50b25723c8f2aceffaf12 | C++ | dwarfovich/TreeFlattenProxyModel | /tree_item.hpp | UTF-8 | 1,031 | 2.875 | 3 | [] | no_license | #ifndef TREE_ITEM_HPP
#define TREE_ITEM_HPP
#include "item_data.hpp"
#include <QVariant>
#include <QHash>
#include <memory>
#include <vector>
class TreeItem {
public:
using ItemUptr = std::unique_ptr<TreeItem>;
explicit TreeItem (int columns = 0, TreeItem* parent = nullptr);
TreeItem* parent ();
T... | true |
a0afc4b1061c9cbd5fb4b5707f65a3b963410759 | C++ | monman53/online_judge | /AtCoder/ARC/012/a.cpp | UTF-8 | 509 | 2.578125 | 3 | [] | no_license | // header {{{
#include <bits/stdc++.h>
using namespace std;
// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define ALPHABET (26)
#define INF INT_MAX
#define MOD (1000000007LL)
using LL = long long;
// }}}
int main() {
std::ios::sync_with_stdio(false);
map<string, int> m;
m["Sunday"] = 0;
m["Mon... | true |
c57bf739b525890872af2399cb47d60c2d48fd5e | C++ | Nitek-Singh/hacktoberfest2021 | /C++/Data Structure/Arrays.cpp | UTF-8 | 982 | 3.4375 | 3 | [
"MIT"
] | permissive | //Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
/**
* Definition for an interval.
* struct Interval {
* int start;
* int end;
* Interval() : start(0), end(0) {}
* Interval(int s, int e) : start(s), end(e) {}
* };
*/
vector<Interval> Sol... | true |
7fe797235fc01a3ee18420a4f11cf9ffc2bec15b | C++ | Pooler22/TGK | /test/main.cpp | UTF-8 | 5,095 | 2.734375 | 3 | [] | no_license | #include <GL/freeglut.h>
#include <stdio.h>
#include <ctime>
#include "System.h"
float zoom;
System particleSystem;
// texture related globals
GLfloat texture[10];
GLuint LoadTextureRAW(const char* filename, int width, int height);
void FreeTexture(GLuint texturez);
void drawParticles(void)
{
int i;
for (i = 1; i ... | true |
33e1472152e797f68da701828a537f012b7dcd2a | C++ | geoo993/LearningCpp | /BeginnersTutorials/workspace/IfStatements/src/IfStatements.cpp | UTF-8 | 1,770 | 3.90625 | 4 | [] | no_license | //============================================================================
// Name : IfStatement.cpp
// Author : George Quentin
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//======================================================================... | true |
9ad2d9d8104e95a239d49af4101a2ea57704ec45 | C++ | MichaelKirsch/SFML_2D_BLUEPRINT | /src/GUI/Widgets/SimpleText.cpp | UTF-8 | 1,533 | 2.59375 | 3 | [] | no_license |
#include "SimpleText.h"
gui::SimpleText::SimpleText(EssentialWindow &es) : Widget(es){
m_TextString = "undefined";
m_Style = m_Essential.m_GuiStyle;
m_Text.setFillColor(m_Style.textColor);
m_Text.setFont(m_Essential.m_GlobFont);
auto charsize = (m_Essential.m_Window.getSize().y/100)*m_Essential.m... | true |
a9af791de3e406ceb534014e2755e8731024ba1c | C++ | Truelch/Projet-S6 | /src/AIStat.cpp | UTF-8 | 1,291 | 2.921875 | 3 | [
"BSD-3-Clause"
] | permissive | #include "AIStat.h"
#include "Unit.h"
AIStat::AIStat()
{
//
}
AIStat::AIStat(float scout, float attack, float defense, float capture, int front_rank, int priority)
{
set_scout(scout);
set_attack(attack);
set_defense(defense);
set_capture(capture);
set_front_rank(front_rank);
set_priority(priority);
}
// --- ... | true |
8119763560bf6da755f36535b9abd0964df2c2f8 | C++ | Heutlett/Tarea1 | /TAREAQT/Servidor/Vertice.h | UTF-8 | 690 | 2.96875 | 3 | [] | no_license | /**
* @file Vertice.h
* @date 3/2/2020
* @author Carlos Adrian Araya Ramirez 2018319701
* @title Clase vertice
* @brief Estructura necesaria para la funcionalidad del grafo
*/
#ifndef VERTICE_H
#define VERTICE_H
#include <vector>
#include <iostream>
using namespace std;
struct Vertice {
public:
... | true |
8b0b8c879ff4a79b5bde0087523220d1025e9e17 | C++ | blacknax/sbtimer | /src/sbtimer/DurationTarget.h | UTF-8 | 1,434 | 3.203125 | 3 | [] | no_license | #ifndef DurationTarget_h
#define DurationTarget_h
#include <Arduino.h>
class DurationTarget {
private:
byte hours = 0;
byte minutes = 15;
byte seconds = 0;
char durationChars[32];
public:
void hoursUp() {
hours++;
if (hours > 99) {
... | true |
c48c5acd63f35481a93a67e891b8a12b63dfdd2c | C++ | lkstc112233/FlighterSerrisBertament | /FlighterSerrisBertament/FlighterSerrisBertament/Application.h | UTF-8 | 1,344 | 2.59375 | 3 | [
"MIT"
] | permissive | #pragma once
#include "DeviceIndependentResources.h"
#include "DeviceResources.h"
#include "MouseDots.h"
#include "Sprite.h"
class Application {
private:
HWND m_hwnd;
std::unique_ptr<DeviceIndependentResources> deviceIndependentResources;
std::unique_ptr<DeviceResources> deviceResources;
SpriteManager sprite... | true |
d629378003735440c4b0667a18de17509fcba60b | C++ | TheChosenHobbit/programmiersprachen-aufgabenblatt-2 | /source/circle.cpp | UTF-8 | 2,938 | 3.03125 | 3 | [
"MIT"
] | permissive | #include "circle.hpp"
#include "window.hpp"
#include "vec2.hpp"
#include "mat2.hpp"
//#include "color.hpp"
//#include "point2d.hpp"
#include <cmath>
#include <math.h>
Circle::Circle():
center_{1,1},
radius_{1.0},
color_{0,0,0}{}
Circle::Circle(Point2D const& ctr, float r, Color const& clr):
center_{ctr},
radius_{r},
... | true |
5a35631ac7fee2273139a87101e2d7ea123f76a9 | C++ | brinkqiang2cpp/cpp-validator | /include/dracosha/validator/utils/to_string.hpp | UTF-8 | 3,595 | 2.765625 | 3 | [
"BSL-1.0"
] | permissive | /**
@copyright Evgeny Sidorov 2020
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
/****************************************************************************/
/** @file validator/utils/to_string.hpp
*
* Defines helper fo... | true |
4553a030f9344d30a565a7caf311713bce7f96d5 | C++ | Interactics/cpp-primer-plus | /ch04/ch4-10/ch4-10.cpp | UTF-8 | 418 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <array> //array 사용을 위한 준비
using namespace std;
int main(){
array<float, 3> runResult;
cout << "첫번째 결과 : ";
cin >> runResult[0];
cout << "두번째 결과 : ";
cin >> runResult[1];
cout << "세번째 결과 : ";
cin >> runResult[2];
cout << "평균값 : " << (runResult[0] +... | true |
11c70c47e3645c2072c100e5ce830edd232220f1 | C++ | shalei120/CPPGM_PA3 | /300/divide.cpp | UTF-8 | 1,075 | 2.640625 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
string long2str(int n, bool issigned, int maxwidth = -1){
string res = "";
if(!issigned){
for(int a=n;a;a/=10){
res += char(a % 10 + '0');
}
reverse(res.begin(),res.end());
if(res == "") r... | true |
33cec998291c2dc827819f34f3473365481b280d | C++ | white1234567890/MyLibrary | /MyLibrary/SceneManagerClass.cpp | SHIFT_JIS | 915 | 2.5625 | 3 | [] | no_license | #include "SceneManagerClass.h"
//////////////////////////////////////////////////////////////////////////////
//ÓIϐ
//////////////////////////////////////////////////////////////////////////////
BaseSceneClass *SceneManagerClass::m_Scene;
SceneManagerClass::SceneManagerClass(void)
{
}
SceneManagerClas... | true |
7750cbe99d6190799bb6cf9e9206475f4db81cc3 | C++ | pranav245/CP2_CIPHERSCHOOLS | /189.RotateArray.cpp | UTF-8 | 358 | 3 | 3 | [] | no_license | class Solution {
public:
void reverse(vector<int>& nums,int start,int end)
{
for(int i=start,j=end-1;i<j;i++,j--)
swap(nums[i],nums[j]);
}
void rotate(vector<int>& nums, int k) {
int n=nums.size();
k=k%n;
reverse(nums,0,n);
reverse(nums,0,k);... | true |
d1f1dde3cd34fa068d87196890e3a954c19a30fb | C++ | skarrman/AdventOfCode | /2018/05/main.cpp | UTF-8 | 1,360 | 3.21875 | 3 | [] | no_license | #include "../utils/TxtReader.h"
#include <iostream>
#include <string>
using namespace std;
inline string removePolymer(string row) {
string::size_type first = 0;
char last = row[first];
string remaningRow = "";
remaningRow.push_back(last);
for (string::size_type i = 1; i < row.size(); i++) {
if (last == ... | true |
bb296047f0dd1d480d192f8aef9d50e4efde41cc | C++ | jguyet/Bomberman | /network/srcs/messages/EndOfGameMessage.cpp | UTF-8 | 600 | 2.546875 | 3 | [] | no_license | #include "messages/EndOfGameMessage.hpp"
#include "All.hpp"
#include "IMessage.hpp"
EndOfGameMessage::EndOfGameMessage (bool is_winner) : IMessage(EndOfGameMessage::ID, sizeof(IMessage) + sizeof(EndOfGameMessage))
{
this->is_winner = is_winner;
return ;
}
EndOfGameMessage::EndOfGameMessage ( EndOfGameMessage const... | true |
de53248d9466fb0337503202a751d40f2c1a5454 | C++ | MPlemmons/Trio | /main.cpp | UTF-8 | 834 | 4.1875 | 4 | [] | no_license | #include <iostream>
using std::cout;
using std::cin;
using std::endl;
//function initializations
void sortDescending(int,int,int);
void swap(int&,int&);
int main()
{
//initialize variables
int numA, numB, numC;
//ask for user input
cout<<"Enter any three numbers: ";
cin>>numA>>numB>>numC;
//sort the 3 nu... | true |
0b8ba2ac98063a1451f8acb7f89ceafcb9e9c40a | C++ | ngthvan1612/OJCore | /TestModule/HK1/Users/20133030/BAI4.CPP | UTF-8 | 627 | 2.8125 | 3 | [] | no_license | #include<stdio.h>
void inp(int &m,int &n, int a[][100])
{
scanf("%d%d",&m,&n);
for (int i=0; i<m;i++)
for (int j=0; j<n;j++)
scanf("%d",&a[i][j]);
}
int checknt(int x)
{
int tmp=0;
for(int i=1;i<=x;i++)
{
if (x%i == 0) tmp=tmp+1;
}
printf("(%d)",tmp);
return tmp;
}
int check(int m, int n, int a[][100])... | true |
9ac8665a522e91e0176075d514fdb8708aaba16e | C++ | tomfunkhouser/gaps | /pkgs/GSV/GSVImage.cpp | UTF-8 | 15,888 | 2.625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | // Source file for GSV image class
////////////////////////////////////////////////////////////////////////
// Include files
////////////////////////////////////////////////////////////////////////
#include "GSV.h"
////////////////////////////////////////////////////////////////////////
// Namespace
////////////... | true |
324f0fb047a0eeb7f0e378e5d8fe52f3b15e7f2f | C++ | wanren13/Leet_Practice | /LRU_cache.h | UTF-8 | 1,906 | 3.109375 | 3 | [] | no_license | #pragma once
#include "allhead.h"
namespace LRU_cache {
class LRUCache {
public:
LRUCache(int capacity) : _capacity(capacity) {
}
int get(int key) {
if (m.find(key) == m.end()) return -1;
int val = m[key]->v;
l.erase(m[key]);
m[key] = l.insert(l.end(), KV(key, val));
return val;
}
void s... | true |
8bc1ca3fb270f5c98074b5011aeaebc1a0cff721 | C++ | Kiranchawla09/GFG | /Last_index_of_one.cpp | UTF-8 | 363 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main() {
//code
int t;
cin>>t;
while (t--)
{
string s;
cin>> s;
int n= s.size();
int index=-1;
for (int i=0;i<n;i++)
{
if(s[i]=='1')
{
index=i;
}
}
cout<... | true |
4c7de4b9b222e14f38eee3bb69d3e95faf575425 | C++ | cppcommons/work-2017-1011 | /clang/test.cpp | UTF-8 | 454 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <utility>
#ifndef __dso_handle
//void* __dso_handle = (void*) &__dso_handle;
#endif
int main() {
try {
float age;
std::cout << "How old are you?\n";
//std::cin >> age;
//std::cout << "You are " << age << " years (or whatever) old\n"... | true |
532593caacb8473432a08a5cae9171b9f8d8aa8d | C++ | KendrickAng/competitive-programming | /kattis/permutedarithmeticsequence/permutedarithmeticsequence.cpp | UTF-8 | 1,301 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
int main() {
int n;
std::cin >> n;
for (int i = 0; i < n; i++) {
int m;
std::cin >> m;
std::vector<int> original{};
for (int j = 0; j < m; j++) {
int tmp;
std::cin >> tmp;
... | true |
9da4b0cbb3b9b6cedc7cafd4903d919a862609d8 | C++ | jdotaz/ProyectoFinalPrimero | /Actualizado/Propietario.hpp | UTF-8 | 1,219 | 2.8125 | 3 | [] | no_license | #ifndef Propietario_hpp
#define Propietario_hpp
#include <stdio.h>
#include <iostream>
#include <fstream>
#include "Animal.cpp"
using namespace std;
class Propietario {
private:
//Instancias
string nombre;
string apellido;
string telefono;
string direcccion;
int codigo;
int cantidad;
Animal *mascotas;... | true |
0657144450231d86e720dbb637246b768143b169 | C++ | Dicksonlab/MateBook | /mediawrapper/source/VideoCodec.cpp | UTF-8 | 6,246 | 2.53125 | 3 | [] | no_license | /**
* @file VideoCodec.cpp
* @author Herbert Grasberger
* @brief contains the implementation for the VideoCodec class
* @date 18.06.09
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#include <stdint.h>
#endif
#endif
#include "VideoCodec.... | true |
f5c2c9733934ea068f29e8ca837fa9cdfd1638aa | C++ | RoadToLP/lab3 | /tests.h | UTF-8 | 16,292 | 2.546875 | 3 | [] | no_license | //
// Created by Kurisu on 12/23/2020.
//
#ifndef LAB3_TESTS_H
#define LAB3_TESTS_H
#include <iostream>
#include <gtest/gtest.h>
#include "dBinarySignal.h"
#include "binarySignal.h"
#include <random>
#include <time.h>
TEST(dBinarySignal, Constructor){
dBinarySignal bs;
ASSERT_THROW(bs.getState(0)... | true |
51122075048ead8b89315012a9d0e3aa9c61a5e0 | C++ | eXceediDeaL/OI | /Problems/POJ/图论/二分图/1034.cpp | UTF-8 | 2,153 | 3.046875 | 3 | [] | no_license | /*
The dog task
题意:主人带狗去散步,主人走n个点,狗在每个点都会与主人碰头,但其余时候都是各自溜达,除此之外,狗还会去找一些有趣的地方(共m个),每次离开主人狗最多去一个有趣的地方。狗的速度最快是人的两倍,求使得狗到达最多有趣点的方法。
分析:对于人从第i个点到第i+1个点,这条路作为三角形的一边c,然后遍历其他点,若j与这两个点组成的边即为a,b如果a+b<=2*c则g[i][j]=true,然后做二分图最大匹配,就是狗最多能到的点。
注意进行匈牙利算法时,不仅记录N->M的匹配边,还要记录M->N的相对应的匹配边,因为要根据这个生成答案序列
*/
#include<iostream>
#include<... | true |
0c358767a3d84676b859e581ae16d0bd10c640bf | C++ | CodeTiger927/CodeForcesRepo | /742/carryingconundrum.cpp | UTF-8 | 438 | 2.90625 | 3 | [] | no_license | using namespace std;
#include <iostream>
#include <cstring>
string s;
void solve() {
cin >> s;
int s1 = 0;
int s2 = 0;
int pow = 1;
for(int i = s.size() - 1;i >= 0;--i) {
if(i & 1) {
s1 += (s[i] - '0') * pow;
}else{
s2 += (s[i] - '0') * pow;
}
if((s.size() - i) % 2 == 0) pow *= 10;
}
long long a... | true |
f0d1f5e0df1113df9b1e720d466fba6ae315767c | C++ | mabur/mang_lang | /src/interpreter.cpp | UTF-8 | 2,338 | 2.921875 | 3 | [] | no_license | #include <chrono>
#include <iomanip>
#include <iostream>
#include <fstream>
#include "factory.h"
#include "mang_lang.h"
namespace CommandLineArgumentIndex {
enum {PROGRAM_PATH, INPUT_PATH, OUTPUT_PATH, LOG_PATH};
}
int main(int argc, char **argv) {
using namespace std;
if (argc < CommandLineArgumentInde... | true |
1a449a09bdac4ffef1b1f35338b0e3979aea80f7 | C++ | unixjet/ktblaze | /server/talk_to_client.cpp | UTF-8 | 1,574 | 2.65625 | 3 | [] | no_license | #include <talk_to_client.h>
using namespace boost::asio;
using namespace boost::posix_time;
talk_to_client::talk_to_client(boost::asio::io_service& service)
:sock_(service), started_(false)
{}
void talk_to_client::start()
{
started_ = true;
do_read();
}
talk_to_client::ptr talk_to_client::make_client(b... | true |
6d76621deb352563979faac8365021d99817d5d1 | C++ | Redleaf23477/ojcodes | /codeforces/round634/C.cpp | UTF-8 | 1,221 | 2.515625 | 3 | [] | no_license | // by redleaf23477
#include <bits/stdc++.h>
// iostream macros
#define endl '\n'
#define var(x) "[" << #x << "=" << x << "]"
// chrono macros
#define chrono_now std::chrono::high_resolution_clock::now()
#define chrono_duration(t1, t2) std::chrono::duration<double>(t2-t1).count()
#define chrono_rand_seed chrono_now.tim... | true |
6fa69e624ad7e0bf1e2bd2644af29401c12f6c8e | C++ | Inlucker/University | /TISD/Lab_02_var25/car_list_funcs.cpp | UTF-8 | 16,033 | 3.328125 | 3 | [] | no_license | #include "car_list_funcs.h"
//no need
void print_key_list(int *key_list, int size_of_list)
{
for (int i = 0; i < size_of_list; i++)
{
cout << i + 1 << ": ";
cout << key_list[i] << endl;
}
cout << endl;
}
//Функция вывода таблицы ключей
void print_price_key_list(price_keys *key_list, in... | true |
31c4793dbc43e16f5144f02b048789d90446d9fc | C++ | HakeT2Lab/CS246-2020 | /Exams/Exam03/exam03.cpp | UTF-8 | 2,422 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <cctype>
#include "Vector.h"
#include "Node.h"
#include "Queue.h"
#include "Map.h"
#include "HashTable.h"
//write work here
//Question 1
std::string CommonSuffix(ds::Vector<std::string>& words){
if(words.Length() > 0){
ds::Vector<std::string> returnStr;
std::str... | true |
ba74a23f61398042bb50cd1b310b9f31d2619c76 | C++ | vidalarroyo/CPSC350_assign3 | /include/GenStack.cpp | UTF-8 | 1,967 | 3.796875 | 4 | [] | no_license | // GenStack.cpp
// An implemented generic class for an array-based stack of any type.
// @author Vidal M. Arroyo
// @author arroy118@mail.chapman.edu
// @version 1.0
#include "GenStack.h"
using namespace std;
// Default constructor
template <typename E> GenStack<E>::GenStack()
{
myArray = new E[128]; //128 bytes
... | true |
fc298386673760666dd9337017039a371cfb968a | C++ | xxxajk/RTClib | /examples/RTC/RTC.ino | UTF-8 | 2,028 | 3.03125 | 3 | [] | no_license | // Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include <Wire.h> // Needed for arduino IDE
#include <RTClib.h>
void setup() {
while(!Serial);
Serial.begin(115200);
}
void loop() {
DateTime now = RTCnow();
Serial.print(" ");
Serial.... | true |
366d4ac08455329f0ed14309efe04f27fc925c12 | C++ | AlViSh/segmentation | /disjointsetforest.h | UTF-8 | 1,004 | 2.703125 | 3 | [] | no_license | #ifndef DISJOINTSETFOREST_H
#define DISJOINTSETFOREST_H
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
// Система непересекающихся множеств
struct SetNode {
int rank;
int parent;
int size;
};
// Взвешенные ребра
struct Edge... | true |
8eed7a9cf2895eadd7f963d9e9b2a412ce9b0022 | C++ | ArturoGO28/SomethingVersion2.07 | /Hannah's Files/platform.cpp | UTF-8 | 1,651 | 2.953125 | 3 | [] | no_license | // Definition of the platform class. Includes basic one room map for the game
#include <SFML/Graphics.hpp>
#include <iostream>
using std::cin;
using std::cout;
int main (int argc, char **argv) {
sf::RenderWindow window(sf::VideoMode(640,480), "Basic Platform");
sf::RectangleShape rectangle(sf::Vector2f(128, 128))... | true |
e8c5bc34056a0b998c4d826c5e3d7c70c4f0b7fd | C++ | EvaCosta/DadosAbertos | /DadosAbertos/Investidor.h | UTF-8 | 1,378 | 2.59375 | 3 | [] | no_license | #ifndef INVESTIDOR_H
#define INVESTIDOR_H
#include<time.h>
#include<string>
using namespace std;
class Investidor {
public:
Investidor();
Investidor(int codigo, int idade, string dataDeAdesao, string estadoCivil, string genero,
string profissao, string cidadeInvestidor, string paisInvestidor, string uf... | true |
ddd2316b75486f92512932f24447bd133da10322 | C++ | btaripraba21/final-project | /projekalgo.cpp | UTF-8 | 3,340 | 2.78125 | 3 | [] | no_license | #include<iostream>
using namespace std;
#define pemrograman 8000
#define sastra 7000
#define novel 9000
const int denda = 1000;
int main() {
char nama[30], id_pgw[15], no_tlp[15], nama_plg[31], judul[15], a;
float banyak, status;
int kode, hasil1, hasil2, hasil3, jenis, pilih;
int array[8] = {8}, arr[7] =... | true |
7bc6829106a29475a609f56a666458d48fc5493e | C++ | sunfish-shogi/coconut | /coconut/widgets/list_view/BaseListView.cpp | UTF-8 | 8,778 | 2.71875 | 3 | [
"Zlib"
] | permissive | //
// BaseListView.cpp
// coconut
//
// Created by Kubo Ryosuke on 2013/09/17.
//
//
#include "BaseListView.h"
#include <cfloat>
USING_NS_CC;
namespace coconut {
bool BaseListView::init(ListDirection direction, const Size& viewSize,
ListType type, int cacheSize, float space, bool clipping) {
Scr... | true |
e3c4ce2ddbd25efb0c9e2f558d2387e3a1774d9e | C++ | invzhi/vtab | /disk/disk_test.cc | UTF-8 | 541 | 2.703125 | 3 | [
"MIT"
] | permissive | #include "disk/disk.h"
#include <cstring>
#include "gtest/gtest.h"
TEST(DiskTest, SampleTest) {
// create file
std::ofstream f;
f.open("disktest.db");
f.close();
Page page;
std::memset(page.GetData(), 1, PAGE_SIZE);
auto disk = new Disk("disktest.db");
disk->WritePage(0, page.GetData());
delete di... | true |
4f6e5f701249fcfcc11d5ab7979ce62417a1ff62 | C++ | ogre/flexrender | /src/worker/ray_queue.cpp | UTF-8 | 3,451 | 3.1875 | 3 | [
"MIT"
] | permissive | #include "ray_queue.hpp"
#include <cassert>
#include "types.hpp"
#include "utils.hpp"
namespace fr {
RayQueue::RayQueue(Camera* camera, RenderStats* stats) :
_camera(camera),
_stats(stats),
_intersect_front(nullptr),
_intersect_back(nullptr),
_intersect_size(0),
_illuminate_front(nullptr),
_illuminate_back(n... | true |
e4c9faae74cc383e58d0cea753fc3f7b6a6bbb15 | C++ | vitoremanuelpereirasilva/INF110 | /aula/valormedio.cpp | UTF-8 | 252 | 3.15625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int a,b, resto ;
cin>> a >> b;
resto = (a+b)%2;
if(resto== 0){
cout<< "valor medio: " << (a+b)/2 << endl;
}else{
cout<< "Nao existe valor medio inteiro!"<< endl;
}
return 0;
}
| true |
f015998087b442002eab8bbdb50bd304857e81ed | C++ | fanll4523/algorithms | /Part13算法竞赛宝典/第一部资源包/第七章 升级考核/第一天/11.cpp | UTF-8 | 214 | 3.171875 | 3 | [
"LicenseRef-scancode-mulanpsl-1.0-en",
"MulanPSL-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # include <iostream>
using namespace std;
void num()
{
int x,y;
int a=15,b=10;
x=a-b;y=a+b;
}
int x,y;
int main()
{
int a=7,b=5;
x=a+b;y=a-b;
num();
cout<<x<<","<<y<<endl;
getchar();
}
| true |
18a34a52a5bc49757444a65e8c6a54f65a481b27 | C++ | tyoma/micro-profiler | /frontend/tests/HierarchyAlgorithmsTests.cpp | UTF-8 | 9,184 | 2.84375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include <frontend/hierarchy.h>
#include <functional>
#include <test-helpers/helpers.h>
#include <ut/assert.h>
#include <ut/test.h>
using namespace std;
namespace micro_profiler
{
namespace tests
{
namespace
{
struct node
{
unsigned id, parent;
};
struct hierarchy_access_node
{
hierarch... | true |
494fb016512eee615410e2e993ff8b634c80a79a | C++ | wyy998/PAT-practise | /1009.cpp | GB18030 | 800 | 3.203125 | 3 | [] | no_license | /*Created in 2017-5-21 14:44 UTC+8
*/
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str;
int i=0,j=0;
getline(cin,str);//ʹgetlineȡһдոַ
int space[81] = { 0 };//ոλ
while(str[i]!='\0')
{
if (str[i] == ' ')
{
//if (str[i++] == ' ')
//return 0;
space[j++]... | true |
67d7feadab0e641aedf44455a4fb04e12805d112 | C++ | CodyHarsh/Project-Euler-Solutions | /0017/number_letter_counts.cpp | UTF-8 | 3,208 | 3.96875 | 4 | [] | no_license | /*
Problem 17
If the numbers 1 to 5 are written out in words: one, two, three, four, five,then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?
NOTE: Do not count spaces or hyphens. For exampl... | true |
f9335122a1c77fcf4e4ddb6e92d96e0e7b0e40d5 | C++ | yRezaei/spatial-partitioning | /include/aabb.hpp | UTF-8 | 1,695 | 3.46875 | 3 | [
"MIT"
] | permissive | #ifndef AABB_HPP
#define AABB_HPP
#include <glm/glm.hpp>
#include "point.hpp"
/**
* @brief Axis-Aligned Bounding Box for representing the boundery/rect.
*
*/
struct AABB
{
AABB() : cx(0.0),
cy(0.0),
hw(1.0),
hh(1.0)
{
}
AABB(double center_x, double center_y,... | true |
393958cbac84d9fe1850bfb6b7d6742545a7ab72 | C++ | acorg/acmacs-chart-2 | /cc/point-index-list.hh | UTF-8 | 5,872 | 2.71875 | 3 | [
"MIT"
] | permissive | #pragma once
#include "acmacs-base/named-type.hh"
#include "acmacs-base/rjson-v2.hh"
#include "acmacs-base/indexes.hh"
#include "acmacs-base/algorithm.hh"
// ----------------------------------------------------------------------
namespace acmacs::chart
{
// sorted list of indexes
class PointIndexList : publi... | true |
6373a3548203946baee5e208c60369d37e94b5a6 | C++ | showstarpro/experiment | /pcenter/uscp.h | GB18030 | 1,565 | 2.59375 | 3 | [] | no_license | #include <fstream>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <vector>
using namespace std;
struct node
{
int w = 0;
int flag = 0; //Ƿ
};
struct set
{
int chide[5000];
int length = 0;
int d = 0;
int fp = 0;
};
struct sp
{
int p = 0; //Ҫȷĵĸ
i... | true |
4a0d26d34670f183ad3af60f356527a6f3b0a938 | C++ | shubhamguptaji/CPP | /bank.cpp | UTF-8 | 1,403 | 3.78125 | 4 | [] | no_license | #include<iostream>
using namespace std;
class account
{
public:
char name[50];
int acc,type;
float balance;
void getdata()
{
cout<<"Enter your name"<<endl;
cin>>name;
cout<<"Enter account number"<<endl;
cin>>acc;
cout<<"Enter account type(1 for savings, 2 for current)"<<endl;
cin>>type;
cout<<"Enter balance"<<endl;
cin... | true |
48db8affa8eeae038db5497b0a60fba7b623cb27 | C++ | upwinds/homework-bins | /sLinkList.h | UTF-8 | 3,511 | 3.890625 | 4 | [] | no_license | //数据结构-第2章-链表-seqList类
//519021911028 金毅诚
#ifndef SEQLIST_H
#define SEQLIST_H
#include<iostream>
template<class elemType> //基本父类,由虚函数构成,无法定义对象
class list
{
public:
virtual void clear() = 0; //清除所有内容
virtual int length() const = 0 ; //... | true |
3f10fdf922c1b4dfeee9d3f5ca78c8c02a9e1b34 | C++ | bioinroboticsuottawa/dextrus_ws | /src/remap/src/leitor.cpp | UTF-8 | 2,107 | 2.796875 | 3 | [] | no_license | //
// Created by rafaelpaiva on 09/12/15.
//
#include <ros/ros.h>
#include <std_msgs/Float64.h>
#include <sensor_msgs/JointState.h>
#include <yaml-cpp/yaml.h>
#include <fstream>
#include <algorithm>
class Leitor {
public:
Leitor();
~Leitor();
void run();
void receive(const sensor_msgs::JointStateConstPtr &ptr);... | true |
917c8bbcb903d9ff3d0428286043b19d11f968e8 | C++ | fadliarfans/MyCpp | /C++/c++ 6/coba 26.cpp | UTF-8 | 609 | 3.046875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int arr2[5],arr3[5];
void proc1(int x)
{
long long int arr[x];
for(int i=0;i<x;i++)
{
cin>>arr[i];
if(arr[i]==1)
{
arr2[0]++;
}
if(arr[i]==2)
{
arr2[1]++;
}
if(arr[i]==3)
{
arr2[2]++;
}
if(arr[i]==4)
{
arr2... | true |
3aaae8dc560181d18ecafe362cf16f6ee417876e | C++ | MichaelTiernan/qvge | /src/3rdParty/ogdf-2020/test/include/bandit/reporters/crash_reporter.h | UTF-8 | 2,474 | 2.859375 | 3 | [
"MIT",
"GPL-2.0-only",
"LicenseRef-scancode-unknown-license-reference",
"GPL-3.0-only",
"LGPL-2.1-or-later",
"LGPL-2.0-or-later",
"EPL-1.0",
"LicenseRef-scancode-generic-exception",
"GPL-1.0-or-later",
"BSL-1.0",
"LGPL-2.0-only",
"BSD-2-Clause"
] | permissive | #ifndef BANDIT_CRASH_REPORTER_H
#define BANDIT_CRASH_REPORTER_H
#include <iostream>
#include <vector>
#include <bandit/reporters/progress_reporter.h>
namespace bandit {
namespace detail {
struct crash_reporter : public progress_reporter {
crash_reporter(std::ostream& stm, const failure_formatter& failure_... | true |
c609597b2a602547dab73c2749307562746b36a2 | C++ | Ali1849/SDS_fall2018 | /SDS392/ch12_ex1.cxx | UTF-8 | 1,846 | 3.828125 | 4 | [] | no_license | #include <iostream>
#include <cmath>
using std::cin;
using std::cout;
using std::endl;
class Point {
private:
float x,y;
public:
Point () {};
Point ( float x, float y ) : x(x), y(y){};
float px() { return x; };
float py() { return y; };
void setp (float newx, float newy) {x = newx; y = newy;};
};
class R... | true |
3cc1ed16f5d0dd009cb75817491e04ef1ea9b55e | C++ | DeagleGross/C-Algo-Structures | /Algorithms/KDZ/AlgoHelper.h | UTF-8 | 3,330 | 3.171875 | 3 | [] | no_license | //
// Created by DG Coach on 29.03.2019.
//
#ifndef KDZ_BORDERMAKER_H
#define KDZ_BORDERMAKER_H
#include <vector>
#include <iostream>
using namespace std;
class AlgoHelper
{
public:
int getIstok(vector<vector<int>>& matrix)
{
vector<int> istoks = vector<int>();
for (int i = 0; i < matrix.si... | true |
1d15eb010057f012ef2abb9cb09ae57be0f705eb | C++ | synchronized/gtd | /lang/c-cpp/practice/src/simple-encode.cpp | UTF-8 | 330 | 2.984375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
char c[5]={'C','h','i','n','a'};
int i;
for (i=0;i<5;i++) {
int x = c[i];
if ((x>='a' && x<='z') || (x>='A' && x<='Z')) {
if( x > 'w') c[i] += 4-26;
else if (x > 'W' && x <= 'Z') c[i] += 4-26;
else c[i] += 4;
}
cout << c[i];
}
cout <<endl;
re... | true |
346acd618302cedd08f25fdeeebdbdca195d44df | C++ | lavumi/DX11_Portfolio | /Model/ModelBoneWeights.h | UHC | 2,118 | 2.890625 | 3 | [] | no_license | #pragma once
#include "../Utility/BinaryInputOutputHandler.h"
/********************************************************************************
Vertex ġ Bone Index ġ Wieght ϴ Class
Vertex ִ 4 BoneWeight ,
Bone Index Bone Weight vector4 · Vertex Data ȴ.
Vertex Weights Blending Ǿ ȴ.
***********************... | true |
4440b2d04f341c2c10b1951c8ce221cd85f0690f | C++ | sherlockwilson/simple_trace | /third_party/zipkin-cpp-opentracing/zipkin_opentracing/src/sampling.h | UTF-8 | 497 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <algorithm>
#include <memory>
namespace zipkin {
class Sampler {
public:
virtual ~Sampler() = default;
virtual bool ShouldSample() = 0;
};
class ProbabilisticSampler : public Sampler {
public:
explicit ProbabilisticSampler(double sample_rate)
: sample_rate_(std::max(0.0... | true |
d0261366a14948e15f532bb9e2f803bd4ca12e59 | C++ | thomaswpp/problems-solutions | /URI/1457_Oraculo_de_Alexandria.cpp | UTF-8 | 454 | 3.1875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <stdlib.h>
#include <string.h>
using namespace std;
long long int fatorial(int n, int k)
{
long long int result = n, i = 1, r = k;
if(n == 0) return 1;
while((n-r) > 1)
{
result *= (n-r);
r = ++i*k;
}
return result;
}
int main()
{
char c[25];
int n, t, k;
... | true |
d9140f54c99e3e62806a5d8ec4b00cfdfeeed913 | C++ | JulioMelo-Classes/lista-2-pablodamascenoo | /sort/include/sort.h | UTF-8 | 1,488 | 3.078125 | 3 | [] | no_license | #ifndef GRAAL_H
#define GRAAL_H
#include <utility>
using std::pair;
#include <iterator>
using std::distance;
#include <algorithm>
using std::sort;
namespace graal {
/*!
* TODO: documentação no estilo doxygen
* {7,5,8,4,2,3,9} menor = 7;
* {5,7,8,4,2,3,9} menor = 5;
* {}
*
*/
/*
80%
*/
template<class Forwa... | true |
32679d045b5293d40a9219aa833bebb15919fb41 | C++ | shashankch/DataStructures-Algorithms | /cnstack.cpp | UTF-8 | 1,670 | 3.71875 | 4 | [] | no_license |
#include <bits/stdc++.h>
using namespace std;
template <typename T>
class stackusingarray
{
T *data;
int nextIndex;
int capacity;
public:
stackusingarray(int totalsize)
{
capacity = totalsize;
data = new T[totalsize];
nextIndex = 0;
}
int size()
{
retur... | true |
b6c7b1f50e8d0876dd3b61b398b23f6af156a90e | C++ | JorgeRojo/Polytte | /ESP32/Polytt/Storage.h | UTF-8 | 2,794 | 2.890625 | 3 | [] | no_license | #include <EEPROM.h>
typedef struct
{
// orientation
bool calibration_saved;
int ax_offset;
int ay_offset;
int az_offset;
int gx_offset;
int gy_offset;
int gz_offset;
// wifi
char *wifi_ssid;
char *wifi_password;
} Storage_t;
int EEPROM_writeAnything(int ee, const Stora... | true |
fdc07664ddd7518666a844764db0c7ce52ef9633 | C++ | timopulkkinen/BubbleFish | /chrome/browser/chromeos/drive/search_metadata.h | UTF-8 | 2,875 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_DRIVE_SEARCH_METADATA_H_
#define CHROME_BROWSER_CHROMEOS_DRIVE_SEARCH_METADATA_H_
#include <string>
#include <vector>... | true |
d2fa4a1a2f9373807e48339dc433f956700efe95 | C++ | MISAKIGA/hm_car | /cpp/day01/02_variable/main.cpp | GB18030 | 859 | 4 | 4 | [] | no_license | #include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
// = ֵ;
//1. ͬʱʼ
int age = 18;
double price = 20.5;
//2. ֵ
int score;
score = 100;
//3. ʾ ûֱʹ
//number = "10086";
//4. ijʼд֣
int a = 3; //CԽģ
int b (4); //ù췽ʽ
int c {5}; ... | true |
272919ea568a96d56f7980aa1e95267038c2822a | C++ | AnatolyKorablyov/Game_develop_for_android | /Classes/Player.h | UTF-8 | 1,676 | 2.5625 | 3 | [] | no_license | #pragma once
#include "cocos2d.h"
#include "Joystick.h"
#include "Entity.h"
#include <vector>
#include <map>
#include "CollisionMap.h"
class Player : public CEntity
{
public:
static Player *create(Joystick *moveJoy, Joystick *rotateJoy);
void Update(float dt) override;
void Shoot(cocos2d::Layer *layer);
void Choo... | true |
763b7b046960664150788293408403b5f24035d3 | C++ | MusicGameCreate/Music_Game | /ベースプログラム/ベースプログラム/MusicSelect_BackGround.cpp | SHIFT_JIS | 3,458 | 2.53125 | 3 | [] | no_license | //*************************************************************************
//
// ɃIuWFNg̐
//
//*************************************************************************
//*************************************************************************
// CN[h
//***************************************************************... | true |
867dd8c57cd35226ce996e0034b780b7ffb407e8 | C++ | Smoglyk/BSUIR-Labs | /1-term(C++)/3/2-2.cpp | UTF-8 | 514 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <math.h>
#define endl "\n"
#define sqr(a) (a)*(a)
#define cub(a) (a)*(a)*(a)
#define M_PI acos(-1)
using namespace std;
int main() {
int k;
cout << "K = ";
cin >> k;
double ans = 1e8, ansx;
for (int i = 0; i <= k; i++) {
double x = -2 + i * 4./k;
d... | true |
4a6dd7730e6618162232df49ef492841423ad830 | C++ | kiranm000/Random | /Vectors and Sets.cpp | UTF-8 | 694 | 3.3125 | 3 | [] | no_license | Vectors and Sets
// Trying out various operations in vectors and sets.
#include <bits/stdc++.h>
using namespace std;
int main() {
set<int> s;
s.insert(1);
s.insert(4);
s.insert(2);
s.insert(3);
s.insert(5);
s.insert(2);
bool b=binary_search(s.begin(),s.end(),3);
cout<<b<<endl;
for(int x : s)
{
cout<<x<<... | true |
35f604dce08633753b47347badb4da83cdc5c281 | C++ | bryzikm/Kalkulator_macierzy | /exercises.cpp | UTF-8 | 6,769 | 3.15625 | 3 | [] | no_license | #include "exercises.h"
#include "ui_exercises.h"
#include "matrix.h"
#include "equation.h"
#include "resultmatrix.h"
#include <QGlobal.h>
#include <QTime>
#include <QStringList>
#include <QMessageBox>
Exercises::Exercises(QWidget *parent) :
QDialog(parent),
ui(new Ui::Exercises)
{
ui->setupUi(this);
t... | true |
1fb0f319a1f693157bf07d3704ed067580b869d8 | C++ | HaozhiQi/Trace | /src/SceneObjects/CSG.cpp | UTF-8 | 3,500 | 2.625 | 3 | [] | no_license | #include <cmath>
#include <assert.h>
#include <cfloat>
#include "CSG.h"
typedef vector<SegmentPoint>::iterator SegIter;
Segments& Segments::Merge(const Segments& pSegments, int relation){
vector<SegmentPoint> interval;
for (SegIter it = mPoints.begin(); it != mPoints.end(); ++it)
{
it->contri = 1;
interval.p... | true |
3a2aeaa9caec7499ee20b916449f63d0fea23e7c | C++ | Annihilater/Cpp-Primer-Plus-Source-Code-And-Exercise | /Chapter 12/12_10_1/cow.cpp | UTF-8 | 865 | 3.203125 | 3 | [] | no_license | //
// Created by klause on 2020/8/6.
//
#include "cow.h"
#include <string>
#include <iostream>
Cow::Cow() {
strcpy(name, "name");
hobby = new char[6];
strcpy(hobby, "hobby");
weight = 0;
}
Cow::Cow(const char *nm, const char *ho, double wt) {
strcpy(name, nm);
hobby = new char[strlen(ho) + 1]... | true |
a9defb7a1083e2684ab9da210110255bd9c5ade5 | C++ | LRY1994/Battery-QT | /battery/current.cpp | UTF-8 | 1,431 | 2.78125 | 3 | [] | no_license | #include "current.h"
#include "struct.h"
#include <fstream>
#include <cstring>
#include "stdio.h"
#include "var.h"
#include "assert.h"
using namespace std;
vector<string> split(const string& str, const string& delim) {
vector<string> res;
if("" == str) return res;
//先将要切割的字符串从string类型转换为char*类... | true |
51a47adcd556db8cf33c3c27dfd8de8a799b2574 | C++ | zaqwsx1277/prS63BruteForce | /server/prS63BruteForceServer/TConnectionServer.cpp | UTF-8 | 1,693 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "TConnectionServer.hpp"
#include "TException.hpp"
using namespace connection ;
//---------------------------------------------------
/*!
* \brief connection::TConnectionServer::TConnectionServer Конструктор
*/
TConnectionServer::TConnectionServer(const qint32& inPortNumber) : TConnection ()
{
fPtrServ... | true |
c5510760f302986f92554da09338576115771592 | C++ | Stvad/LabirintEditor | /box.cpp | UTF-8 | 11,373 | 2.625 | 3 | [] | no_license | #include "box.h"
/*
float Object::x = 0;
float Object::y = 0;
float Object::z = 0;
std::vector <Vertex> Object::points;
std::vector <unsigned short> Object::indexes;
*/
Box::Box()
: Position()
{
this->Angle = 0;
}
Box::Box(const std::vector<Vertex> &points, const std::vector<unsigned short> &indexes, float Ang... | true |
9f4d0480d46f4d381cd1b62f204492f85c9d6cd8 | C++ | tj3407/CS413 | /quicksort.cpp | UTF-8 | 1,837 | 3.71875 | 4 | [] | no_license | #include <iostream>
using namespace std;
int counter;
int partition( int a [], int low , int high ) {
int x = a [ low ];
bool highTurn = true ;
while ( low < high ) {
counter++; // to count item comparisons highlighted in green
if (highTurn)
if ( a [ ... | true |
ecfc07b2bb59935236e945486115c7394d80349e | C++ | JanTry/GameOf1000 | /card.h | UTF-8 | 837 | 3.09375 | 3 | [] | no_license | #ifndef CARD
#define CARD
#include "imports.h"
class Card{
public:
//Both suit and value are publicly known to all players who can see the card
//No point in writing getters to them
int suit; //card color
int value; //card value
bool trump; //Not Donald though
bool... | true |
8dfcf00111bd3944493e6369e66228636c378e3e | C++ | vdae2304/Contest-archive | /UVA Online Judge/3. Problem Solving Paradigms/416 - LED Test.cpp | UTF-8 | 1,593 | 3.140625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false); cin.tie();
int N;
string leds[10];
string digits[10] = {"YYYYYYN", "NYYNNNN", "YYNYYNY", "YYYYNNY", "NYYNNYY",
"YNYYNYY", "YNYYYYY", "YYYNNNN", "YYYYYYY", "YYYYNYY"};
while (cin >> N, N ... | true |
1da5b4124c76d47ed7a4a2e94348bda50c888773 | C++ | shinhaha/Fall_2017_Algorithm | /AllSourceShortestPath/DynamicAllSourceShortestPath.cpp | UHC | 3,111 | 3.015625 | 3 | [] | no_license | #include <stdio.h>
#include <algorithm>
#include <stdlib.h>
using namespace std;
#define INF 2000000000
int Edgesize = 0;//
int Versize = 0;//
int** arr;
int** ExtendShortestPaths(int** A,int** B);
int** newArr();
void SlowAllPairsShortestPaths();
void print(int** A,int i);
void SlowAllPairsShortestPaths() {
printf... | true |
4471a3196c9b1ea05c0dfd6fa4c2fb619ffe043c | C++ | snousias/avatree | /src/AVATreeExtensionGUI/bbox.h | UTF-8 | 651 | 2.9375 | 3 | [
"CC-BY-4.0"
] | permissive | #ifndef _BBox_H_
#define _BBox_H_
#include <QVector3D>
/*******************************************************************************
BBox
******************************************************************************/
class BBox
{
public:
// Ctor
BBox() : m_center(), m_max(){}
BBox(QVector3D center, QVector3D ... | true |
0c40269ffcf8895468fd2de007cecda06aec948a | C++ | lingchensanwen/CPP-course-projects | /week7/week7-1.cpp | UTF-8 | 743 | 2.8125 | 3 | [] | no_license | #if 0
20分かかりました。木について復習しました。
最初は何を出力すればいいか迷ったことがあります。
そのあとはすらすら解決できて、よかったです。
#endif 0
#include <iostream>
using namespace std;
int P[10010];
void init(int N) {
for (int i=0; i<=N; ++i) P[i] = i;
}
int root(int a) {
if (P[a] == a) return a;
return (P[a] = root(P[a]));
}
bool is_same_set(int a, int b) {
return root(a) ==... | true |