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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f2f466d447f0d5ff37af2023d0cc9370ecc4651c | C++ | shamanthMuroor/coding | /CodeForces/CppCodeForces/1183b-EqualizePrices.cpp | UTF-8 | 644 | 2.609375 | 3 | [] | no_license | // 130026419 Sep/27/2021 22:42UTC+5.5 shamanthmuroor 1183B - Equalize Prices GNU C++17 Accepted 46 ms 3800 KB
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int q;
cin >> q;
while(q--) {
int n, k;
cin >> n >> k;
vector<int> a(n);
... | true |
d4f19c8a5bb52039b7fb54c0560c7e673f41df0b | C++ | ash1247/DocumentsWindows | /CodeBlocks/Codeforces/Solved/Codeforces236A.cpp | UTF-8 | 423 | 2.765625 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
int main ( void )
{
string word;
int i = 0, j = 0;
cin >> word;
sort( word.begin(), word.end() );
word.erase( unique(word.begin(), word.end()), word.end() );
size_t length = word.length();
if( length % 2 == 0)
{
cout << "CHAT ... | true |
bea18ca54a354e9523bf45a3945e11d54d1a21f6 | C++ | ckymn/cpp | /Methods/sizeof.cpp | UTF-8 | 845 | 3.59375 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct byteNumber
{
int id;
char letter;
string name;
float idd;
double iddd;
};
int main()
{
cout << "Char : " << sizeof(char) << endl; //1-8bit
cout << "Integer : " << sizeof(int) << endl; //4-32bit
cout << "Float : " << sizeof(float) <<... | true |
c7d5301a2a67fb585e5b86e4cf956353dbbb45d2 | C++ | JeastonCS/FlightPlanner_IterativeBacktracking | /tester.cpp | UTF-8 | 15,991 | 3.578125 | 4 | [] | no_license | //
// Created by Jack Easton on 3/25/2020.
//
#include "catch.hpp"
#include "DSString.h"
#include "ListNode.h"
#include "LinkList.h"
#include "LinkListIterator.h"
TEST_CASE ("ListNode class") {
SECTION ("constructor (int)") {
ListNode<int> node1(1);
REQUIRE( node1.getData() == 1 );
REQUI... | true |
6d221d45bce3d1047995b591c2a7b2ae627ef432 | C++ | zeyec/CUDA-RSA | /src/shifts.cpp | WINDOWS-1251 | 1,478 | 3.375 | 3 | [] | no_license | #include "shifts.h"
#include "Constants.h"
// 32- 1 carry flag
int shr (unsigned int &input, int leftBit){
int CF;
CF = input & 0x1 ;
input >>= 1;
if ( leftBit == 1 ) {
input |= 0x80000000;
} else {
input &= 0x7FFFFFFF;
}
return CF;
}
// 32- 1 carry flag
int shl (unsigned int &i... | true |
93b90d2f7851878e2ca1b65d797ba32ed56524d8 | C++ | onealabdulrahim/Programming-Design-Concepts-CSCE121 | /Homework/Homework 5/hw5pr3.cpp | UTF-8 | 2,473 | 3.25 | 3 | [] | no_license | //Oneal Abdulrahim
//CSCE 121-504
//Due: March 23, 2016
//hw5pr3.cpp
#include "std_lib_facilities_4.h"
#include "Simple_window.h"
#include "Graph.h"
void draw_board(int x, int y) {
Simple_window window(Point(200,200), x, y,"HW5PR3: Checkerboard");
//checkerboard is reliant on window size,
//will do its best to f... | true |
7d78dea386dbc2f877bef739ef5f17ed8e86cff0 | C++ | he44/Practice | /codeforces/339/a.cpp | UTF-8 | 639 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include <vector>
int main()
{
std::string input;
std::cin >> input;
std::vector<int> counts(3, 0);
for (int i = 0; i < input.size(); ++i)
{
if (input[i] == '+')
{
continue;
} else
{
counts[input[i] - '1'] += 1;
}
... | true |
be801aa3e192f8ce2f57448ad40434e7a08ba491 | C++ | vallis/EMRI_Kludge_Suite | /src/numrec/NRsplint.cc | UTF-8 | 1,034 | 2.828125 | 3 | [] | no_license | #include "Globals.h"
#include "NRUtil.h"
void splint(Real xa[], Real ya[], Real y2a[], int n, Real x, Real *y)
{
int klo, khi, k;
Real h, b, a;
klo = 1; khi = n;
while (khi - klo > 1) {
k = (khi + klo) >> 1;
if (xa[k] > x) khi = k;
else klo = k;
}
h = xa[khi] - xa[klo];
if (h == 0.0) Die("... | true |
1f9ecc5bcc520eeec28b79364521aa272a44a1ac | C++ | Ralphson/CRC_detector | /src/creator.cc | UTF-8 | 4,717 | 2.546875 | 3 | [] | no_license | #include<iostream>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include "creator.h"
using namespace std;
int Creator::genData(int dataLength, int * p)
{
if (! p)
{
if (crcLength) len = dataLength + crcLength - 1;
else if (hammingLength) len = dataLength + hammingLength;
else
... | true |
cd539e5255dde7c353393384f119492c8e624ac3 | C++ | WildBoarGonnaGo/42-Piscine-CPP | /day05/ex03/main.cpp | UTF-8 | 916 | 2.671875 | 3 | [] | no_license | #include "ShrubberyCreationForm.hpp"
#include "PresidentialPardonForm.hpp"
#include "RobotomyRequestForm.hpp"
#include "Bureaucrat.hpp"
#include "Intern.hpp"
#include <cstdlib>
#include <ctime>
int main(void)
{
srand(time(NULL));
Intern someRandomIntern;
Form *rrf;
Bureaucrat donald("Donald Trump", 1);
rrf = ... | true |
a91fdf2246a9fb2173fed1f63b58d6949fcf8ae0 | C++ | Zingam/PureCpp | /delete-this/src/main.cpp | UTF-8 | 1,764 | 4.125 | 4 | [] | no_license | // Example program
#include <cassert>
#include <iostream>
#include <string>
class TheClass
{
public:
TheClass(std::string name)
: name(name)
{
std::cout << "\tObject \"" << this->name << "\" of class TheClass was constructed" << std::endl;
}
virtual ~TheClass()
{
std::cout... | true |
0a864db382dbbd4508d3c5ce16d94c00ac0b91d8 | C++ | mtbtaiyyab/Placement-Program | /oddocc.cpp | UTF-8 | 369 | 3.53125 | 4 | [] | no_license | #include<iostream>
using namespace std;
int findres(int arr[],int size){
int res=arr[0];
for(int i=1;i<size;i++){
res=res^arr[i];
}
return res;
}
int main(){
int size;
cout<<"Enter size\t";
cin>>size;
cout<<"Enter Array\n";
int arr[size];
for(int i=0;i<size;i++){
cin>>arr[i];
}
int res= findres(arr,size... | true |
3cd4a99838119ea7c255a33877ddc06b20fb456c | C++ | ExitStatus-1/hanoi | /stack.cpp | UTF-8 | 925 | 3.40625 | 3 | [] | no_license | #include<stdio.h>
#include<iostream>
#include<math.h>
#include "stack.h"
#include "disc.h"
using namespace std;
Stack::Stack()
{
pTop = NULL;
}
void Stack::push(void* inData)
{
Node* newnode = (Node*) malloc(sizeof(Node));
newnode->data = inData;
if(pTop == NULL){
pTop = newnode;
newno... | true |
622821875c1e75ad8a2b1ddbeeef6b813a5a90a5 | C++ | PYChih/CppPrimer | /ch14_Overloaded_Operations_and_Conversions/exercise_14_38.cc | UTF-8 | 989 | 3.546875 | 4 | [] | no_license | // Exercise 14.38
// Write a class that tests whether the length
// of a given string matches a given bound.
// Use that object to write a program
// to report how many words in an input
// file are of sizes 1 through 10 inclusive.
#include <cstddef>
#include <iostream>
#include <string>
#include <fstream>
#include... | true |
60734d1f96262f7806992252b7322364083a49a3 | C++ | gowthamv441/interview | /arrays/print_sub_set.cpp | UTF-8 | 605 | 3.34375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
void print_subset(vector<int> arr)
{
int n=arr.size();
n=1<<n;
for(int i=0;i<n;i++)
{
int j=1;
int index=0;
cout<<"Set :: "<< i+1<<endl;
cout<<"{ ";
while(j<=i)
{
if(j&i)
{
cout<<arr[index]<<" ";
}
j=j<<1;
... | true |
7faac71d23765721689fe21d1af8c2d4eeb81272 | C++ | s-nandi/contest-problems | /computational-geometry/convex-hull/rotating-calipers/playing_the_slots.cpp | UTF-8 | 1,435 | 3.171875 | 3 | [] | no_license | // convex polygon width (rotating calipers)
// https://open.kattis.com/problems/playingtheslots
// 2018 Mid-Atlantic Regional
#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9;
const long double INF = 1e20;
typedef long double ptT;
struct pt
{
ptT x, y;
pt operator - (const pt &o) ... | true |
1ff7d894e5744fcdca9ae3db7abe3adc6b92d91e | C++ | CompPhysics/ComputationalPhysics | /doc/Programs/LecturePrograms/programs/NumericalIntegration/cpp/program1.cpp | UTF-8 | 1,371 | 3.296875 | 3 | [
"CC0-1.0"
] | permissive | #include <iostream>
#include "lib.h"
using namespace std;
// Here we define various functions called by the main program
double int_function(double x);
// Main function begins here
int main()
{
int n;
double a, b;
cout << "Read in the number of integration points" << endl;
cin >> n;
cout... | true |
4c24d198df32feb210b0fb7b08fde7e7b38b60a9 | C++ | Cordylidae/BlackJack | /BlackJack/BlackJack/Deck.cpp | UTF-8 | 2,099 | 3.203125 | 3 | [] | no_license | #include"Deck.h"
#include"TextureManager.h"
#include<algorithm>
#include<thread>
Deck::Deck(double x,double y):xpos(x),ypos(y)
{
std::shared_ptr<Card> card;
for (int i = 0; i < 4; i++) {
for (int j = 1; j < 14; j++)
{
std::string part = ""; int score = 10; bool isAce = false;
switch (i)
{
case 0:... | true |
380a8828cd82b2737fb3946f2143939569df165a | C++ | ReiMatsuzaki/cbasis2 | /src_cpp/time_check/timer.hpp | UTF-8 | 822 | 3.09375 | 3 | [] | no_license | #ifndef TIMER_HPP
#define TIMER_HPP
#include <map>
#include <string>
namespace
{
using std::map;
using std::string;
using std::cout;
using std::endl;
}
class Timer {
enum Status {
kNone,
kStart,
kEnd,
};
struct TimeData {
int id;
clock_t t0;
clock_t t1;
Status status;
... | true |
d55a95fe0d825dd04743c76c6449a6abdd39d5ad | C++ | metaphysis/Code | /UVa Online Judge/volume123/12300 Smallest Regular Polygon/program.cpp | UTF-8 | 788 | 2.765625 | 3 | [] | no_license | // Smallest Regular Polygon
// UVa ID: 12300
// Verdict: Accepted
// Submission Date: 2018-05-08
// UVa Run Time: 0.000s
//
// 版权所有(C)2018,邱秋。metaphysis # yeah dot net
#include <bits/stdc++.h>
using namespace std;
const double PI = 2 * acos(0);
int main(int argc, char *argv[])
{
cin.tie(0), cout.tie(0), ios::s... | true |
bae805b9d7e4af3de6497bc69f14280271008581 | C++ | pinam45/MagicPlayer | /src/utils/path_utils.cpp | UTF-8 | 6,730 | 2.796875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | //
// Copyright (c) 2018 Maxime Pinard
//
// Distributed under the MIT license
// See accompanying file LICENSE or copy at
// https://opensource.org/licenses/MIT
//
#include "utils/path_utils.hpp"
#include <utf8.h>
utf8_path::utf8_path() noexcept: m_valid_encoding(true), m_utf8_str(), m_path()
{
}
utf8_path::utf8_pa... | true |
8edc2b764cb6f34629bc70b2aa616726f86caae7 | C++ | plescaevelyn/oop-simple-program | /oop-simple-program/oop-simple-program/Motherboard.h | UTF-8 | 660 | 2.671875 | 3 | [] | no_license | #pragma once
#include "pcUnit.h"
#include <iostream>
#include <string>
class Motherboard :
public PcUnit
{
public:
void setChipsetModel(std::string chipsetModel);
std::string getChipsetModel();
void setFormat(std::string format);
std::string getFormat();
void setGamingRecommended(bool gamingRecom... | true |
fa224bdbdfc7127dd87b5792703873e5b1a1ca35 | C++ | egorodet/CML | /tests/mathlib/quaternion_rotation1.cpp | UTF-8 | 6,819 | 2.671875 | 3 | [
"BSL-1.0"
] | permissive | /* -*- C++ -*- ------------------------------------------------------------
@@COPYRIGHT@@
*-----------------------------------------------------------------------*/
/** @file
*/
// Make sure the main header compiles cleanly:
#include <cml/mathlib/quaternion/rotation.h>
#include <cml/vector.h>
#include <cml/matrix.... | true |
64c7ea7c821b29938d0dc928a0a5800a989cdcb8 | C++ | awarirahul365/CSE-2003-Data-Structures-and-Algorithms | /Leetcode 30 Days Solution/Convert BST to Greater Tree.cpp | UTF-8 | 1,752 | 3.40625 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | true |
23dfd879ea058f0f73818e7b64bcb7a2fe4fcb73 | C++ | SebastianMestre/Competitive-Programming | /Codeforces/GlobalRound7/b.cpp | UTF-8 | 535 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <cstdint>
#include <vector>
#define forn(i,n) for(int i = 0; i < int(n); ++i)
#define forsn(i,s,n) for(int i = s; i < int(n); ++i)
using namespace std;
constexpr int INF = 1<<25; // 33e6
constexpr int MOD = 1000000007; // 1e9+7
int main () {
int n ;
cin >> n;
vector<int> b(n);
f... | true |
ca9eb9f6a835b58edd5d950e49cf528b6195f2be | C++ | slacker247/3dGameEngine | /Source/Engine/PlayState.cpp | UTF-8 | 449 | 2.6875 | 3 | [] | no_license | #include "PlayState.h"
namespace States
{
PlayState::PlayState(void)
{
}
PlayState::PlayState(const PlayState &inPlayState)
: BaseState(inPlayState)
{
copy(inPlayState);
}
PlayState& PlayState::operator=( const PlayState& rhs )
{
copy(rhs);
return *this;
}
PlayState* PlayState::clone() const
{
... | true |
249e1a18148fbabf6f37de97b99ff06c8180d596 | C++ | Gianluhub/Learning-Arduino | /Arduinonano/Arduinonano.ino | UTF-8 | 3,374 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <Nextion.h>
#include "Leds.h"
char buffer[20] = {0};
char trama[18] = {0};
int temperatura[2] = {0};
const unsigned long intervalo = 1000;
unsigned long tiempoprevio = 0;
NexButton b0=NexButton(2,10,"b0");
NexButton bNext=NexButton(2,7,"bNext");
Ne... | true |
bee652f3eca419c24b380861ba2fcb66b1fa6b89 | C++ | SubhamPanigrahi/MyCodechefCodes | /dec1.cpp | UTF-8 | 700 | 2.640625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int m,n;
cin>>m>>n;
int a[m][n];
int i,j;
int ca = 0,cb = 0,b[m][n],c[m][n];
char d[n];
for(i =0 ;i<m;i++){
scanf("\n%s",&d);
for(j =0 ;j<n;j++){
a[i][j] = 0;
if(d[j] == 'R'){
a[i][j] = ... | true |
5956b669bfaa06441557e76066727cd2b897ee53 | C++ | ubiratansoares/bira-bachelor-files | /courses/POO/Curso Mello (2009)/Archives/COMP07 Files/exemplos/ex02/ex02.cc | UTF-8 | 209 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
using namespace std;
void funcao(int x, int y = 5) {
cout << "x = " << x << " y = " << y << endl;
return;
}
int main(int argc, char *argv[]) {
funcao(3);
funcao(5,7);
return 0;
}
| true |
4aed4c8d571fa8562bc4d21876a6568a1252ec6a | C++ | annsshadow/fakepractice | /c-cpp/sort/select.cpp | GB18030 | 520 | 3.4375 | 3 | [] | no_license | void Selectsort(int a[], int n)
{
int i, j, nMinIndex;
for(i = 0; i < n; i++)
{
nMinIndex = i; //СԪصλ
for(j = i + 1; j < n; j++)
if(a[j] < a[nMinIndex])
nMinIndex = j;
Swap(a[i], a[nMinIndex]); //ԪطŵĿͷ
}
}
inline void Swap(int &a, int &b)
{
int... | true |
de3dd9aa1835fb93c268c9e1783b3d8d1990bba5 | C++ | alicchm892/programowanie | /funkcje.cpp | UTF-8 | 9,512 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <Windows.h>
#include <fstream>
#include <random>
#include "deklaracje.h"
using namespace std;
void wypelnij_1(Pole plansza[9][9]) //wypelnienie pustej planszy liczba -1 (by pozniej moc sprawdzic czy wszystkie komorki zostaly uzupelnione przy przepisywaniu)
{
... | true |
a642372d3a40def55425d4a00fbe0fb607342c07 | C++ | mihailitu/bookexercise | /interviews/intervalmap/main.cpp | UTF-8 | 9,884 | 3.5625 | 4 | [] | no_license | #include <iostream>
#include <cstdio>
#include <map>
#include <limits>
template<typename K, typename V>
class interval_map {
std::map<K,V> m_map;
public:
// constructor associates whole range of K with val by inserting (K_min, val)
// into the map
interval_map( V const& val) {
m_map.insert(m_m... | true |
3a9d101f3e804a60366612dd40cdc148d4bad175 | C++ | Treekay/Learn-CG | /final/Final-CG-Project/object/Object.cpp | GB18030 | 3,918 | 2.921875 | 3 | [] | no_license | #include "Object.h"
//Object::Object(vector<float> _vertices, vector<unsigned int> _textures): textures(_textures) {
// vertices_num = _vertices.size();
//
// //
// glGenVertexArrays(1, &VAO);
// glGenBuffers(1, &VBO);
// // VAO, VBO
// glBindVertexArray(VAO);
// glBindBuffer(GL_ARRAY_BUFFER, VBO);
// glBuffer... | true |
d9f440c55d2530417abe524218416f96fdc6951d | C++ | narubond007/datastructure | /c-concept/types_of_casting_in_cplusplus.cc | UTF-8 | 186 | 2.734375 | 3 | [] | no_license | #include <stdio.h>
int main(){
const int c=3;
// c is a const and you want to remove the constness
int &i = const_cast<int &>(c);
//int &i = c;
i = 5;
printf("%d \n",i);
return 0;
}
| true |
3fa6562eec7c8bcb80ab5d5549257027512a2c34 | C++ | MarvinS26/MiyukiRenderer | /src/cameras/camera.h | UTF-8 | 3,401 | 2.609375 | 3 | [
"MIT"
] | permissive | //
// Created by Shiina Miyuki on 2019/3/3.
//
#ifndef MIYUKI_CAMERA_H
#define MIYUKI_CAMERA_H
#include "miyuki.h"
#include "core/geometry.h"
#include "core/ray.h"
#include "math/transform.h"
#include "core/parameter.h"
namespace Miyuki {
class Scene;
class Sampler;
struct ScatteringEvent;
struct V... | true |
9de40d75c7c3c1aad78fd2e810a2a0d8c94b680b | C++ | karolinaWu/leetcode-lintcode | /leetcode/Cpp/859.BuddyStrings.cpp | UTF-8 | 592 | 2.96875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | #include"AllInclude.h"
//https://leetcode.com/problems/buddy-strings/
class Solution {
public:
bool buddyStrings(string A, string B) {
string tmpa = "", tmpb = "";
if (A.length() != B.length()) return false;
if (A == B && set<char>(A.begin(), A.end()).size() < A.size()) return true;
vector<int> diff;
for (... | true |
3c5879fb3f7a558a9cd29229e84a0d9792d4c5ec | C++ | jazz4rabbit/problem-solving | /OnlineJudges/BOJ/15059/main.cc | UTF-8 | 288 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false), cin.tie(NULL);
int ca, ba, pa, cr, br, pr;
cin >> ca >> ba >> pa >> cr >> br >> pr;
cout << max(cr-ca,0) + max(br-ba,0) + max(pr-pa,0) << endl;
return 0;
}
| true |
48ed5ccda79fad62e54807ce16c8159859cd6fc3 | C++ | nattee/data2020 | /07/custom-1.cpp | UTF-8 | 1,295 | 3.421875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <queue>
using namespace std;
class Student {
public:
Student(float score, string a, string b) {
name = a;
surname = b;
gpax = score;
}
bool is1stHornor() { return gpax >= 3.6; }
//not good, now our data is public
string name,surname;
float gpax;... | true |
d929bbc420186913fc827e969c8d2ed95bfe3998 | C++ | chermaine/CPP-Projects | /Final Project/Lobby.cpp | UTF-8 | 4,903 | 2.9375 | 3 | [] | no_license | /*******************************************************************************
* Name: Chermaine Cheang
* Date: Jun 1, 2016
* Description: Lobby class implementation file
* ****************************************************************************/
#include "Lobby.hpp"
/***************************************... | true |
e7c37ab6b640c270e7f5e048b1437e6a563b1144 | C++ | Mengbabity/Longest-Substring-Without-Repeating-Characters | /my.cpp | UTF-8 | 751 | 2.796875 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
class Solution {
public:
int lengthOfLongestSubstring(string s) {
int n = s.size();
if (n == 0)
return 0;
int res = 1;
int mid = 0;
int vn = 0;
map<char, int> m;
map<char, vector<int>> mtmp;
int i = 0;
w... | true |
e6695610fb935f235094f9abbd7bc970e0899016 | C++ | zhouchuyi/WebServer | /Chat/ChatServer.cpp | UTF-8 | 3,677 | 2.921875 | 3 | [] | no_license | #include"codec.h"
#include"../TcpServer.h"
#include"../base/ThreadLocalSingleton.h"
#include"../EventLoop.h"
#include<set>
using namespace std::placeholders;
class ChatServer:noncopyable
{
public:
ChatServer(EventLoop* loop,const InetAddress& listenAddr)
: server_(loop,listenAddr,"ChatServer"),
codec... | true |
8c8522c7726c62ffd28c307f224dc3dd189be029 | C++ | mohsinabbas14/CPlusPlus | /vector.cpp | UTF-8 | 482 | 2.671875 | 3 | [] | no_license | # include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
vector<string> shoppingList;
shoppingList.push_back("eggs") ;
shoppingList.push_back("milk");
shoppingList.push_back("sugar");
shoppingList.push_back("choclate");
shoppingList.push_back("flour");
shoppingList.... | true |
fcfa542fc71a4a029ccc90d42097a34833e8570c | C++ | 3DHome/3DHome | /3DHomeEngine/src/main/jni/src/SE_Layer.h | UTF-8 | 810 | 2.71875 | 3 | [] | no_license | #ifndef SE_LAYER_H
#define SE_LAYER_H
#include "SE_Common.h"
class SE_ENTRY SE_Layer
{
public:
SE_Layer();
SE_Layer(int layer);
~SE_Layer();
SE_Layer(const SE_Layer& layer);
SE_Layer& operator=(const SE_Layer& layer);
friend bool operator==(const SE_Layer& left, const SE_Layer& right)... | true |
5c0af7445a797acbe527106c02a5b7ff0ec6f4fd | C++ | juansala/6.08-Poker | /poker.cpp | UTF-8 | 12,355 | 2.65625 | 3 | [] | no_license | #include "Arduino.h"
#include "Poker.h"
Poker::Poker(char* user_id, TFT_eSPI tft){
sprintf(USER_ID,user_id);
sprintf(host, "608dev-2.net");
initialized = 0; //whether user's been initialized in game
sprintf(GAME_STATE, "DEAL"); //initialize to DEAL to generate
sprintf(PREV_STATE, "DEAL");
hand_index = 0;
... | true |
625615bf26537ca530debb181d3076e8bd9cdb4a | C++ | wenmingxing1/leetcode_for_github | /169_majorityElement.cpp | GB18030 | 1,641 | 3.671875 | 4 | [] | no_license | //ָoffer29
class Solution {
public:
/*
//ȫʽ
int majorityElement(vector<int>& nums) {
sort(nums.begin(), nums.end());
int middle = nums.size()/2;
return nums[middle];
}
*/
//partation
int majorityElement(vector<int>& nums) {
int length = nums.size();
i... | true |
41fe933da313c658c247b0333247e06b345c93c8 | C++ | John-Fenge/Exercise | /EssentialC++/ch2/ch2.cpp | UTF-8 | 2,701 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include<vector>
#include <fstream>
using namespace std;
bool is_pos_ok(int pos){
if(pos<1||pos>1024){
cout<<"Illegel Position!"<<endl;
return false;
}
return true;
}
const vector<int>* fibon_seq(int pos){
static vector<int> elem;
if(!is_pos_ok(pos))
ret... | true |
9848756259a4fab52d8cb2030492640db2c8b518 | C++ | wallaceowen/VentDriver | /VentDriver.ino | UTF-8 | 929 | 2.734375 | 3 | [] | no_license | // VentDriver.ino
// -*- mode: C++ -*-
//
// Drive a stepper motor to move a piston/diaphragm/bellows
//
#include <Arduino.h>
#include "constants.h"
#include "ports.h"
#include "ventilator.h"
#include "commander.h"
// The ventilator
Ventilator *ventilator;
char v_buffer[sizeof(Ventilator)];
// Comms interface to t... | true |
c1d5e610f831fdd238ca4056daaa514284ef76e6 | C++ | mtgeoma/geomamt | /progsProcMT/mtlab/src/lib/udouble/measure.hpp | UTF-8 | 711 | 3.171875 | 3 | [] | no_license | #ifndef MEASURE_HPP
#define MEASURE_HPP
#include <cmath> // sqrt
//!
/*! \brief Representação de uma medida (valor +/- incerteza)
*/
struct measurement
{
long double value; /*!< valor da medida */
long double variance; /*!< variança da medida */
//! @name Construtor
/*@{*/
//!
/*! \brief Construtor de... | true |
25560157a56a4c5d71f0ecf0b0b197572258d703 | C++ | Du0ngkylan/C-Cpp | /TKDGTT/Tuan 6/BT6.Nhom2/Code/Bai 1/Daycondondieutang.cpp | UTF-8 | 1,596 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <conio.h>
#include <stdlib.h>
void input(int *a, int n)
{
int i;
printf("Nhap vao day so:\n");
for(i=1; i<=n; i++)
{
printf("a[%d] = ", i); scanf("%d", &a[i]);
}
}
void output(int *a, int n)
{
int i;
printf("\nIn ra day so vua nhap la\n");
for(i=1; i<=n; i++)
{
printf("%5d", a[i... | true |
dd1a4231732c8489c6e6e74a15a7185d23ff042b | C++ | ppnnh/OAP-1-sem | /лаба 9/доп9.1/доп9.1/доп9.1.cpp | UTF-8 | 2,882 | 2.625 | 3 | [] | no_license | // доп9.1.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include <ctime>
int main()
{
using namespace std;
setlocale(LC_ALL, "rus");
const int N = 100;
int i, sz, A[N], k = 0, m1 = 0, m2 = 0, m3 = 0, m4 = 0;
int rmx = 99;
c... | true |
7ba359379fde6338e453cb11e9dbd0a3d7c8bb4e | C++ | strangeTany/pss_assignments | /Assignment2/Rooms/Room.h | UTF-8 | 1,149 | 2.796875 | 3 | [] | no_license | //
// Created by strangetany on 05.03.2021.
//
#ifndef ASSIGNMENT2_ROOM_H
#define ASSIGNMENT2_ROOM_H
#ifndef CONDITION
#define CONDITION
enum Condition {
on, off, broken
};
#endif
#include "../AccessLevel.cpp"
#include "../Users/User.h"
#include <string>
#include <vector>
class User;
class Room {
protected:
... | true |
375dc5d2b2226446c96841875e3c0532f3c97885 | C++ | SoltiHo/LeetRepository | /Single_Number_II/Single_Number_II/Single_Number_II.h | UTF-8 | 2,416 | 3.703125 | 4 | [] | no_license | // Given an array of integers, every element appears three times except for one.Find that single one.
//
// Note:
// Your algorithm should have a linear runtime complexity.Could you implement it without using extra memory ?
#include <unordered_map>
using namespace std;
class Solution_LatestTrial {
public:
int si... | true |
921e99fe561f741f4b64ff7d0e1b826b09868153 | C++ | ramssrez/InicioProgramacionC | /ejerciciosconC/EjerciciosPrevios/TiposDeDatosC.cpp | UTF-8 | 535 | 3.0625 | 3 | [] | no_license | //Declaracion de librerias ya de defult o que se pueden construir
#include <iostream>
#include <stdio.h>
#include <complex.h>
#include <stdlib.h
using namespace std;
int main (){
//Salida de datos, para ambos lenguajes de programción
cout <<"Hola mundo"; // Esto es para C++
printf("\nAdios") ; //Esto es p... | true |
182d50051df201d7a0d4d1cb5278ab099a20adc4 | C++ | eddast/T-528-HLUT | /Assignments/Assignment solutions/Assignment1 - Matrix/include/matrix.h | UTF-8 | 2,830 | 3.84375 | 4 | [] | no_license | #ifndef MATRIX_H
#define MATRIX_H
#include <iostream>
#include <vector>
namespace matrix {
typedef int Element;
class matrix_dimensions_wrong: public std::exception {
virtual const char* what() const throw() {
return "Wrong matrix dimensions for operation";
}
};
class Mat... | true |
dd180c6a521a00b06d9a524f850bf265eb37b081 | C++ | a60504a60504/OnlineJudge_Solution | /Leetcode/leetcode36.cpp | UTF-8 | 921 | 2.9375 | 3 | [] | no_license | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
class Solution {
public:
bool isValidSudoku(vector<vector<char>>& board) {
for (vector<vector<char>>::iterator col=board.begin();col!=board.end();++col) {
for (vector<char>::iterator row=col->begin();row!=col->end();++row){
... | true |
9b33a294691cad0077446f884ec20583a4094e85 | C++ | Khaled-Issa/Data-Encryption-Standard | /DESDecrypt.cpp | UTF-8 | 9,730 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
//[8][8]
vector <int> InitialPermutation = {
58, 50, 42, 34, 26, 18, 10, 2 ,
60, 52, 44, 36, 28, 20, 12, 4 ,
62, 54, 46, 38, 30, 22, 14, 6 ,
64, 56, 48, 40, 32, 24, 16, 8 ,
57, 49, 41, 33, 25, 17, 9, 1 ,
59, 51, 43, 35, 27... | true |
56f7f02e6b7cd3652e76a0d6f1828e43a45b0a12 | C++ | greenfox-zerda-sparta/Ak0s | /Week-08/day-4/08/08.cpp | UTF-8 | 746 | 3.484375 | 3 | [] | no_license | //============================================================================
// Name : 08.cpp
// Author : Ak0s
//============================================================================
// Given a string, compute recursively a new string where all the 'x' chars have been removed.
#include <iostream>... | true |
baa06019c27649c80d7767a8bf953655fa7ecd89 | C++ | jungsagacity/functionCombination_ | /xmill/FileParser.hpp | UTF-8 | 11,623 | 2.703125 | 3 | [] | no_license | /*
This product contains certain software code or other information
("AT&T Software") proprietary to AT&T Corp. ("AT&T"). The AT&T
Software is provided to you "AS IS". YOU ASSUME TOTAL RESPONSIBILITY
AND RISK FOR USE OF THE AT&T SOFTWARE. AT&T DOES NOT MAKE, AND
EXPRESSLY DISCLAIMS, ANY EXPRESS OR IMPLIED WARRANTIES... | true |
e854b547a7d0faacaa7134e61affcc5b832e85e7 | C++ | hqsun2017/Fourier | /Fourier/Color.cpp | UTF-8 | 1,731 | 2.578125 | 3 | [] | no_license | #include "Color.h"
CColor::CColor()
{
m_bGamma=false; m_fGamma=0.6;
m_Colors[0]=RGB(0,0,0);
m_Colors[1]=RGB(0,0,255);
m_Colors[2]=RGB(102,102,102);
m_Colors[3]=RGB(0,255,0);
m_Colors[4]=RGB(153,153,153);
m_Colors[5]=RGB(255,0,0);
m_Colors[6]=RGB(204,204,204);
m_Colors[7]=RGB(0,255,255);
m_Colors... | true |
b9e3052ae7cfc8ba4a414311f344c27eac894133 | C++ | jack23912/Selfimage-plus | /prev/gtkSelfimage/src/sort.cpp | UTF-8 | 276 | 2.640625 | 3 | [] | no_license | #include "sort.h"
bool WideStringSorter(const wchar_t *a, const wchar_t *b)
{
int l1, l2;
l1 = wcslen (a);
l2 = wcslen (b);
if (l1 > l2){
if (wmemcmp(a,b,l1) > 0)
return false;
return true;
}else{
if (wmemcmp(a,b,l2) > 0)
return false;
return true;
}
}
| true |
96fc45de4f25c79432efc25354e00edf7a9edc63 | C++ | andreyrehv/PA | /Atividades C/Exercicio 14.cpp | WINDOWS-1252 | 343 | 2.765625 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<locale.h>
#include<math.h>
#define PI 3.14
int main(){
setlocale(LC_ALL,"Portuguese");
float R, V;
printf("Calcule a esfera \n");
puts("Digite o raio da esfera");
scanf("%f", &R);
V=((4*PI)*(R*R*R))/3;
printf("O volume da esfera : %.2f \n", V);
system("PAUS... | true |
a244e6e92eec4905b3b78d7f4d4ea1bb7006c982 | C++ | azell003/Algorithms | /Data Structures/FenwickTree2D.cpp | UTF-8 | 781 | 3.34375 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
const int N = 105;
int max_x, max_y;
int tree[N][N];
void update(int x, int y, int val)
{
for(int i = x; i <= max_x; i += i & (-i))
for(int j = y; j <= max_y; j += j & (-j))
tree[i][j] += val;
}
int get(int x, int y)
{
int res = 0;
for(int i = x; i > ... | true |
e0558e323ba33eb406a5f752522a39e6d60e78be | C++ | Clemon-R/Arcade | /games/pacman/Player.cpp | UTF-8 | 1,920 | 2.828125 | 3 | [] | no_license | //
// EPITECH PROJECT, 2018
// Player.cpp
// File description:
// Payer Class functions
//
#include "game/pacman/Player.hpp"
#include "Control.hpp"
Player::Player(std::size_t x, std::size_t y, std::vector<std::string> *map) :
_x(x),
_y(y),
_map(map),
_dead(false),
_score(0),
_killer(false)
{
}
int Player::chec... | true |
d4da18cca53c5d8ebcc434ed7669380bae502aa3 | C++ | fedesassone/tp2SO | /tiempos.cpp | UTF-8 | 8,334 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include "ConcurrentHashMap.hpp"
#include <fstream>
#include <sstream>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <queue>
#include <tuple>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <functional... | true |
dad0c0ead7711df82d4d8cc47c33b37a5277045e | C++ | Ratstail91/Emblem-of-the-Lions | /Emblem of the Lions/region.cpp | UTF-8 | 3,318 | 3.34375 | 3 | [
"Zlib"
] | permissive | #include "region.h"
#include <stdexcept>
#include <fstream>
Region::Region() {
indexX = indexY = 0;
width = height = depth = size = 0;
data = NULL;
}
Region::~Region() {
Unload();
}
void Region::Load(const char* fname) {
if (data != NULL)
Unload();
std::ifstream is(fname);
if (!is.is_open())
throw(std:... | true |
8a035fc467e482704a24c24e876a00ca0d3150b1 | C++ | MikeNkunku/Student-Recorder | /Student_Recorder/CursusManager.cpp | UTF-8 | 2,175 | 3.21875 | 3 | [] | no_license | /**
* \file CursusManager.cpp
* \brief Définition des méthodes non-inline de la classe CursusManager
* \author Hugo ROBINE-LANGLOIS
* \author Olympio BARTHELEMY
* \author Mickaël NKUNKU
* \version 1.0
* \date 10 juin 2014
*/
#include "CursusManager.h"
#include "UTProfiler.h"
/**
* @brief Constructeur... | true |
a61d31e89628d94e1854c9058e5fa998116366c3 | C++ | ashishc534/Codeforces | /The New Year Meeting Friends.cpp | UTF-8 | 327 | 2.5625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a[3]={0};
cin>>a[0]>>a[1]>>a[2];
sort(a,a+3);
int min1 = max(a[1],a[2]);
int point = min(max(a[0],a[1]),min1);
int totalDistance = (abs(a[0]-point)+abs(a[1]-point)+abs(a[2]-point));
cout<<totalDistance<<endl;
return ... | true |
b2ab3f59cab7b8565dc528187f820061c955293f | C++ | salaj/MG | /Motyl/TreeItem.h | UTF-8 | 685 | 2.609375 | 3 | [] | no_license | #pragma once
#include <windows.h>
#include <string>
enum ItemType{
ItemPoint,
ItemCurve,
ItemC2Curve,
ItemC2Interpolated,
ItemTorus,
ItemRoot,
ItemPatch,
ItemBSplinePatch,
ItemBezierSurface,
ItemBSplineSurface,
ItemGregorySurface,
ItemGregoryPatch,
ItemIntersectionCurve
};
enum Origin{
Genuine,
Copy... | true |
a71e08b7cc7b0df4ea61ef4ac0e63a9d07ffd543 | C++ | dongdong-2009/uukit | /learnLibev/test.cpp | UTF-8 | 662 | 2.71875 | 3 | [] | no_license | #include <stdio.h>
#include <ev.h>
ev_io stdin_watcher;
ev_timer timeout_watcher;
static void
stdin_cb(EV_P_ ev_io *w, int revents)
{
puts("stdin ready");
ev_io_stop(EV_A_ w);
ev_break(EV_A_ EVBREAK_ALL);
}
static void
timeout_cb(EV_P_ ev_timer *w, int revnts)
{
puts("time out");
... | true |
4f5f93ed4204f6b08ec48adc39d18b9709aab95d | C++ | luisito1295/CPP | /P6_05.cpp | UTF-8 | 1,385 | 3.40625 | 3 | [] | no_license | /*Nombre: Lopez Mendoza Luis Fernando
Grupo: 1 D ISC
Fecha: 03/10/15
Descripcion: solicitar un numero del 1 al 10 y mostrarlo en letra
*/
#include <stdio.h>
#include <conio.h>
#include <string>
using namespace std;
int num;
void letra(int numero);
main()
{
//clrscr();
printf("se mos... | true |
5609510ce2526c2ffece3bae0e9627d8e0146168 | C++ | rbmauric/Triple-X | /Triple X/main.cpp | UTF-8 | 1,798 | 3.53125 | 4 | [] | no_license | //Ryan Mauricio
//Triple X
//11/23/19
#include <iostream>
#include <ctime>
const int MAX = 9;
const int TRIES = 3;
bool CheckArr(int* Arr, int N) {
int Guess;
int GuessNum = N + 1;
std::cout << "\n Enter guess " << ": ";
std::cin >> Guess;
if (N == 2) {
std::cout << " Correct. Lock has been picked.\n";
s... | true |
7f1c72bb2a186fbce70d29b8ce3564a5f01b7367 | C++ | peterprokop/Allocators | /Allocators/allocators.cpp | UTF-8 | 853 | 2.953125 | 3 | [] | no_license | //
// allocators.cpp
// Allocators
//
// Created by Peter Prokop on 22/10/15.
// Copyright © 2015 Peter Prokop. All rights reserved.
//
#include "allocators.hpp"
template <class P, class F>
AllocatorBlock FallbackAllocator<P, F>::allocate(size_t n) {
AllocatorBlock r = P::allocate(n);
if (!r.ptr) {
... | true |
9dd85ea17f0451bf360dc41af46fd84b8e99047b | C++ | zjsxzy/algo | /Hdoj/WHU/1003.cpp | UTF-8 | 1,719 | 2.515625 | 3 | [] | no_license | /*
* Author : Yang Zhang
*/
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <bitset>
#include <vector>
#include <cstdio>
#include <string>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#d... | true |
d1b7592457b0e460cd48357c3ac14bfa9c4c7d8d | C++ | LITturtlee/Programming-Practice | /PAT/乙级/1027.cpp | UTF-8 | 625 | 2.890625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
char sign;
int N,biggest=1,i=1,level=1;
cin >> N >> sign;
while(biggest<=N){
i += 2;
level++;
biggest += i*2;
}
biggest = biggest - i*2;
i -= 2;
level --;
int emp;
for(int j=0;j<level*2-1;j++){
... | true |
9562df7bac961256672a53c1f517b2738a7e87af | C++ | NicholasArnaud/Intro_To_Programming | /Operator Overloading Exercise/Operator Overloading Exercise/Source.cpp | WINDOWS-1252 | 1,169 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include "PositionClass.h"
/*
Create a Position class. This should have a definition in a .h file and function bodies in a .cpp
file. It should contain the following:
a. Floats for x and y (they should be private)
b. Default constructor and a constructor which allows x and y to be initialize... | true |
a06d775eef45c554cbd4b2389fc376087ba58e4c | C++ | WhiZTiM/coliru | /Archive2/ce/0310e457326b8b/main.cpp | UTF-8 | 668 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <boost/bind.hpp>
#include <boost/ref.hpp>
// If you want to insert in the front instead, use std::deque
typedef std::vector<unsigned char> BytesContainer;
static void InsertMaskedBytes(BytesContainer& bytes, unsigned digest_value)
{
for (unsigned... | true |
ca84fffe3171db1bf77130c0459b19fb474ce28f | C++ | FahimCC/Problem-Solving | /Codeforces/A. Anton and Polyhedrons.cpp | UTF-8 | 382 | 3.21875 | 3 | [] | no_license | #include<iostream>
#include<map>
using namespace std;
int main()
{
map<string, int> m;
m["Tetrahedron"] = 4;
m["Cube"] = 6;
m["Octahedron"] = 8;
m["Dodecahedron"] = 12;
m["Icosahedron"] = 20;
string x;
int test, sum = 0;
cin>>test;
while(test--)
{
cin>>x;
... | true |
5c483979ec6698c4a8b011741a531bc79b50ebbc | C++ | xchrdw/voxellancer | /src/display/rendering/rendermetadata.h | UTF-8 | 321 | 2.53125 | 3 | [] | no_license | #pragma once
#include "display/eyeside.h"
class Camera;
// metadata that is passed to a renderpass
class RenderMetaData {
public:
RenderMetaData(const Camera& camera, EyeSide eyeside);
const Camera& camera() const;
EyeSide eyeside() const;
private:
const Camera& m_camera;
EyeSide m_eyeside;
};... | true |
8a564b18ac85bd1cbb1faae39b39283b272c8d7a | C++ | RunOnceEx/Athena | /Athena/Injector.cpp | UTF-8 | 1,815 | 2.78125 | 3 | [] | no_license | #include "Injector.h"
void Injector::MapLocalSection(HANDLE& sectionHandle, ntdll* nt, PVOID& localSectionAddress, SIZE_T size) {
LARGE_INTEGER sectionSize = { size };
// create a memory section
nt->fNtCreateSection(§ionHandle, SECTION_MAP_READ | SECTION_MAP_WRITE | SECTION_MAP_EXECUTE, NULL, (PLARGE_INTEG... | true |
fb6f83f31927e861995d5486dcaab6f2c38e473f | C++ | evrenkaya/CrazyEights | /CrazyEights/Player.h | UTF-8 | 683 | 2.96875 | 3 | [
"MIT"
] | permissive | #ifndef PLAYER_H
#define PLAYER_H
#include "Deck.h"
#include "IOManager.h"
class Player
{
public:
Player(IOManager*, std::string);
virtual ~Player();
explicit Player(const Player&);
void addCard(Card*);
Card* removeCard(int);
Card* getCard(int) const;
int getNumCard... | true |
b3ce00457c2b6f5e64fe416aca5926603adff750 | C++ | mountither/vscode-remote-cpp | /iai-tute-tasks/t2-agent-program/vacuum-env.cpp | UTF-8 | 674 | 2.75 | 3 | [] | no_license | #include "coordinates.cpp"
#include <iostream>
using namespace std;
class VacuumEnv
{
private:
Coordinates fLocation;
string fFloor[4][6];
public:
VacuumEnv(string aFloor[4][6], Coordinates aLocation){
fLocation = aLocation;
fFloor = aFloor;
}
... | true |
3ac23965222e63d018f250b0a8b71693b8ec4344 | C++ | joycodex/listparser | /libs/lexer/src/char_stream.cpp | UTF-8 | 407 | 2.96875 | 3 | [] | no_license | #include "lexer/char_stream.h"
#include <cassert>
CharStream::CharStream(const std::string &input)
: input_(input)
{
if (input_.size() > 0) {
p_ = 0;
ch_ = input[0];
}
}
char CharStream::peak()
{
return ch_;
}
void CharStream::consume()
{
assert(ch_ != EOF);
p_++;
if (p_... | true |
9cef9baf4c9402c2c529918f22bcdd434eaf2118 | C++ | nanami809/TobaccoLeafStudio | /TobaccoLeafStudio/GetImages.cpp | GB18030 | 18,117 | 2.765625 | 3 | [] | no_license | #include"Header.h"
//ͼԤ
/*
//ͼƽ
Mat img_blur_R,img_blur_T;
//img_R.copyTo(img_blur_R); img_T.copyTo(img_blur_T);
BlurImage(img_R, img_T, img_blur_R, img_blur_T);
//ɫУ
Mat img_cor_R, img_cor_T;
//img_blur_R.copyTo(img_cor_R); img_blur_T.copyTo(img_cor_T);
Rect recwindow(680, 415, 130, 100);//Ԥװֵλ
ColorCorect(recwindo... | true |
73f6fd4e480687b2e1636dddeba99a3b2e47cd32 | C++ | evanchang2399/UtPod | /Song.cpp | UTF-8 | 1,799 | 3.671875 | 4 | [] | no_license | //
// Created by Evan Chang on 2019-03-28.
//
#include "Song.h"
using namespace std;
//Default constructor
Song::Song() {
title = "";
artist = "";
size = 0;
}
//Constructor with all variables
Song::Song(string artist, string title, int size) {
this->title = title;
this->artist = artist;
this->... | true |
ef59b5fa24166ae40106cb44c8746d81451d42d6 | C++ | sourgrape253/Cloth-Simulator | /Summative2/main.cpp | UTF-8 | 7,922 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include "GameScene.h"
#define BUTTON_UP 0
#define BUTTON_DOWN 1
#define MOUSE_DOWN 0
#define MOUSE_UP 1
// Mouse
#define MOUSE_LEFT 0
#define MOUSE_MIDDLE 1
#define MOUSE_RIGHT 2
unsigned char mouseState[3];
GLfloat yaw = -90.0f;
GLfloat pitch = 0.0f;
GLfloat lastX = WIDTH / 2.0;
GLfloat lastY =... | true |
5aca788c8fc9f0f4d53f4b219ab9297def0fc8e1 | C++ | emptyland/mio | /src/lexer-test.cc | UTF-8 | 8,475 | 2.640625 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | #include "lexer.h"
#include "token.h"
#include "fixed-memory-input-stream.h"
#include "gtest/gtest.h"
namespace mio {
TEST(LexerTest, TestingStream) {
FixedMemoryInputStream s("abc");
ASSERT_FALSE(s.eof());
ASSERT_EQ('a', s.ReadOne());
ASSERT_FALSE(s.eof());
ASSERT_EQ('b', s.ReadOne());
ASS... | true |
89b309f67d6afa452b80bb520d4ee3de1832da78 | C++ | BubagraJamatia2001/Coding-Ninjas-Data-Structures-Algo-with-Cpp | /Binary Trees/Balanced.cpp | UTF-8 | 2,613 | 3.9375 | 4 | [] | no_license | /*
Balanced
Given a binary tree, check if its balanced i.e. depth of left and right subtrees of every node differ by at max 1. Return true if given binary tree is balanced, false otherwise.
Input format :
Elements in level order form (separated by space). If any node does not have left or right child, take -1 in its ... | true |
106bcab6439f6c24778f6f5db5d1eaa1d52f9a41 | C++ | yippp/CSC3002_Assignment | /hw3/src/p2.cpp | UTF-8 | 1,818 | 3.265625 | 3 | [] | no_license | /*
* File: p2.cpp
* --------------------------
* This is used to test the answer to question 2 of assignmet 3 of CSC 3002 at CUHKSZ
* Done by Shuqian Ye, 115010269
*/
#include "pqueue_list.h"
using namespace std;
/*
* Function: q2
* Usage: q2();
* ------------------------
* Test the code for question 2.
*/
void... | true |
80052e08b2ae7a530ca6d9e9765b2d8416b12751 | C++ | JakeKandell/rubiks-cube-teacher | /colors.cpp | UTF-8 | 7,099 | 2.65625 | 3 | [] | no_license | #include "colors.h"
#include <stdlib.h>
#include <time.h>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
using namespace cv;
using namespace std;
// compare function used to sort by x coordinate
bool xCmp(Point a, Point b) {
return a.x < b.x;
}
// compare function used to sort by y co... | true |
4eb7a7c415f540c934b2cb8711369c2bf9d90769 | C++ | Dong-wook94/KNU-AlgorithmStudy | /programmers/[2020카카오공채] 블록 이동하기/명훈/60063.cpp | UHC | 3,704 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
using namespace std;
#define MAX 100
struct robot {
int y, x; // y, x position
int dir; // if dir is 1 horizontal. else vertical
int cnt; // cnt
robot(int t_y, int t_x, bool t_dir, int t_count) {
y = t_y; x = t_x; dir = ... | true |
dbc9d73d7953a99a537010a5752ee714c73c6063 | C++ | poul250/SlimeGame | /SlimeGame/State.cpp | UTF-8 | 731 | 2.890625 | 3 | [] | no_license | #include "State.hpp"
State::State()
: nextState(nullptr)
, stateCond(STATE_GOOD)
{ }
State::~State()
{ }
void State::init(int & progress)
{
progress = 100;
}
void State::lostFocus()
{ }
void State::gainedFocus()
{ }
void State::enterState()
{ }
void State::leaveState()
{ }
void State::setStateCond(Sta... | true |
b140e1ca5ba2ab6801aed1db32dfc788ede4da60 | C++ | kmyk/rsk0315-library | /utility/action/add_sum.cpp | UTF-8 | 459 | 2.765625 | 3 | [
"MIT"
] | permissive | #ifndef H_action_add_sum
#define H_action_add_sum
/**
* @brief 区間和・区間加算用のヘルパークラス
* @author えびちゃん
*/
#include "utility/monoid/length.cpp"
template <typename Tp>
struct action_add_to_sum {
using operand_type = length_monoid<Tp>;
using action_type = Tp;
static void act(operand_type& op, action_type const& a) ... | true |
9386af5e2326be7cf7c23da5e85bdac17bd9eb6c | C++ | 260058433/LeetCode | /src/224_BasicCalculator.cpp | UTF-8 | 2,815 | 3.375 | 3 | [] | no_license | #include <string>
#include <stack>
using std::string;
using std::stack;
class BasicCalculator {
public:
int calculate(string s) {
/*
stack<int> operands;
stack<char> operators;
int i = 0, n = s.size();
while (i < n) {
if (s[i] == ' ') {
++i;
... | true |
69559456b0fbbfec831727ae261c71675c2927b8 | C++ | kasataku777/atcoder_solution | /ABC149/D/D.cpp | UTF-8 | 1,330 | 2.984375 | 3 | [] | no_license | // D.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#include <iostream>
#include<string>
using namespace std;
int main()
{
int n, k, r, s, p;
string t;
cin >> n >> k;
cin >> r >> s >> p;
cin >> t;
int sum = 0;
int flag[100000];
for (int i = 0; i < n; i++) {
fla... | true |
a52ffee6553dc3331d532edb1e29d4898e94f625 | C++ | acimadamore/iot-garden | /board/iot_garden/iot_garden.ino | UTF-8 | 7,717 | 2.875 | 3 | [] | no_license | #include <ArduinoJson.h>
#include <DHT_U.h>
#include <DHT.h>
class WateringStation
{
int uid;
byte waterPumpPin;
byte soilHumiditySensorPin;
int lowSoilHumidity;
int highSoilHumidity;
int wateringTime;
public:
String name;
WateringStation(){
this->lowSoilHumidity = 30;
this->high... | true |
57051a0883f673ce4e086cf7532f8401f55e8798 | C++ | ShiboYao/Leetcode_cpp | /0125_valid_palindrome.cpp | UTF-8 | 975 | 3.59375 | 4 | [] | no_license | #include <iostream>
#include <cctype>
using namespace std;
class Solution {
public:
bool isPalindrome(string s) {
if (s.empty() || s.size() == 1)
return true;
int i = 0, j = s.size()-1;
int move = 0;
while (i < j){
while (i < j && !isalnum(s[i])){
... | true |
8754c43c3954a93b182e8bf363523942f8bbff8f | C++ | Hillosanation/TetrisReverseSolve | /IO/StorageDataTransfer.cpp | UTF-8 | 8,552 | 2.625 | 3 | [] | no_license | #include <fstream>
#include <sstream>
#include <iostream>
#include <filesystem>
#include <chrono>
#include "../SettingsData.h"
#include "./StorageDataTransfer.h"
#include "../Misc/CommonFunctions.h"
void StorageDataTransfer::OutputPresentPiece(PresentPieces PPiece, std::ofstream& os) {
for (auto Piece : P... | true |
35709a2c90666653330fc5c3befeab2f954dd3e4 | C++ | Arihant1467/rookie-cplusplus | /HackerEarth_1/main.cpp | UTF-8 | 1,315 | 2.75 | 3 | [] | no_license | #include <iostream>
#include<vector>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main()
{
int test_cases=0,boys=0,girls=0,t,s,i=0;
vector<int> boys_height;
vector<int> girls_height;
bool con=true;
cin>>test_cases;
while(test_cases--)
{
cin>>boys;
cin>>girl... | true |
25d7dc459ad0ac432c4cc8c1bbfa5e671430df9d | C++ | Ethan136/LeetCode | /Medium/[437] Path Sum III/437_Iteration.cpp | UTF-8 | 2,964 | 3.140625 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | true |
632a866c90390662cfeb92ed892383eb850ed606 | C++ | GuyGoldenberg/HrmlParser | /hrml_token.cpp | UTF-8 | 5,082 | 3.078125 | 3 | [] | no_license | //
// Created by guy on 9/10/17.
//
#include <utility>
#include <stdexcept>
#include <memory>
#include <sstream>
#include <unordered_map>
#include "hrml_token.h"
#include "utils.h"
#include "validator.h"
bool HrmlToken::is_close_token() {
return this->closing_scope_token;
}
void HrmlToken::parse_token(std::stri... | true |