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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1d21457482907290fcc6aa89dcb29d8dde13af85 | C++ | Microbot-it/Microbot-WiFi-Relay-Shield | /src/microbot_wifi_relay_shield.cpp | UTF-8 | 1,669 | 2.765625 | 3 | [
"MIT"
] | permissive | /*####################################################################
FILE: microbot_wifi_relay_shield.h
VERSION: 1.0
PURPOSE: WiFi Relay Shield library for Arduino
HISTORY:
Mirko Prosseda - Original version (20/07/2020)
#######################################################################*/
#inclu... | true |
514faa386bf996d9b2b52ffcd4fd455b025841bc | C++ | mikerainey/pbbslib | /examples/bfs.h | UTF-8 | 1,307 | 2.859375 | 3 | [] | no_license | #pragma once
#include "sequence.h"
#include "ligra.h"
// **************************************************************
// BFS edge_map structure
// **************************************************************
namespace pbbs {
using vertex = ligra::vertex;
struct BFS_F {
sequence<vertex> Parents;
vertex... | true |
83ea297d1d139b33bf0a9673472496026905bae0 | C++ | Pacman29/OOP_3 | /canvas/graphical_sys.cpp | UTF-8 | 734 | 2.515625 | 3 | [] | no_license | #include "graphical_sys.h"
#include "model/model.h"
void Graphical_sysImpl::Draw_model(base_painter* pntr, base_model &mod, base_camera &cam)
{
size_t line_count = mod.line_count();
if(!line_count)
throw graphic_sys_error::model_empty();
for(size_t i = 0; i<line_count; ++i)
{
line tmp... | true |
789d1189350c4cba0c42573d6e7eb8fd15b31394 | C++ | rcory/drake | /math/wrap_to.h | UTF-8 | 988 | 3.203125 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
#include <cmath>
#include "drake/common/double_overloads.h"
#include "drake/common/drake_assert.h"
namespace drake {
namespace math {
/// For variables that are meant to be periodic, (e.g. over a 2ฯ interval),
/// wraps `value` into the interval `[low, high)`. For example:
/// wrap_to(.1, 0, 1) = .1... | true |
68b9aa0a107aab37a4748859f030d1f978b3688a | C++ | sidoh/Join-Compression | /compression/Compressor.cpp | UTF-8 | 3,948 | 2.671875 | 3 | [] | no_license | /*
* Compressor.cpp
*
* Created on: Jul 24, 2011
* Author: mullins
*/
#include "Compressor.h"
#include <EncodedFileHeader.h>
#include <DictionaryDefinition.h>
#include <StringDictionary.h>
#include <IndexDictionary.h>
#include <ColumnDictionaryEntry.h>
#include <IndexEntry.h>
#include <InnerDictionaryEntry... | true |
61ca2c068e60e7a9872e07944debb8a27dc2ad5b | C++ | alexanderlvarfolomeev/ITMO | /Algorithms and Data Structures/StackQueueDisjoinedSet/CountingExp.cpp | UTF-8 | 1,308 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <string>
#include <utility>
#include <stack>
using namespace std;
int p[200001];
int r[200001];
long gexp[200001];
int get(int x)
{
if (p[x]!=x)
{
int root = get(p[x]);
... | true |
e76dce9bd6ee87033d07cf8fba4570d97f41221a | C++ | NguyenTrongLuan/KTLT-Assignment02 | /Book.h | UTF-8 | 2,328 | 2.5625 | 3 | [] | no_license | //
// Created by hvlpro98 on 02/05/2017.
//
#ifndef ASSIGNMENT2_BOOK_H
#define ASSIGNMENT2_BOOK_H
#include <iostream>
#include <fstream>
#include <string>
#include "Date.h"
#define TYPE_SIZE 50
#define AUTHOR_SIZE 100
#define TITLE_SIZE 100
#define SUM_SIZE 400
class Book
{
public:
Book(std::stri... | true |
2c853cfb0c51efd4ff683d75b20eed521e4d0d66 | C++ | sherlock-coding/LeetCode | /SqrtX.cpp | UTF-8 | 812 | 4 | 4 | [] | no_license | /*
* 69 Sqrt(x)
* Implement int sqrt(int x).
*
* Compute and return the square root of x.
* */
#include <iostream>
using namespace std;
int mySqrt(int x)
{
if (x == 0)
return 0;
if (x == 1 || x == 2 || x == 3)
return 1;
int low = 0, high = x;
while (low < high) {
long lo... | true |
145fb7e645be4b62a70a9ee03e14ed7b8aab37ea | C++ | Coracaos/demo-game | /src/Game.cpp | UTF-8 | 2,374 | 3.390625 | 3 | [] | no_license | #include "Game.h"
#include <iostream>
using namespace std;
Game::Game()
{
}
void Game::updateScreen(Tank * tank, vector <Bullet>& bullets){
// Set clear color
glClearColor(0,1,0,1);
// Clear screen
glClear(GL_COLOR_BUFFER_BIT);
tank->drawTank();
for(int i=0; i<bullets.size(); i++){
b... | true |
96e9212f3efe32cf09f3f7a1be7fca3504bbe209 | C++ | wjb127/Algorithm_Code_Note | /์๋ฃ ๊ตฌ์กฐ/์คํ/3015 ์ค์์์ค ์ฌ๊ฒฐํฉ.cpp | UTF-8 | 1,438 | 3.046875 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<memory.h>
#include<string>
#include<cmath>
#define f(n) for(int i=0;i<n;i++)
#define p(a) cout<<a<<endl
#define pb push_back
using namespace std;
int n;
int a[500000];
int main()
{
// ์
๋ ฅ ๋ฐ๊ธฐ
scanf("%d", &n);
for (int i = 0; i < n; i+... | true |
dde2f076928fe4a912160db2a3e40cdc81955cb2 | C++ | feliperubin/Newton-Image-Interpolation | /Code/app.cpp | UTF-8 | 20,768 | 2.734375 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
// #include <vector>
#include <iostream>
#include <png.h>
#include <math.h>
// #define DEBUG
using namespace std;
typedef struct{
unsigned char** data;
unsigned int width;
unsigned int height;
unsigned int bitdepth;
unsigned int channels;
unsigned int color_type;
}I... | true |
b78eac98b09d25184135213a43e36a068f77a4b2 | C++ | tac-kit/LeetCodeCpp | /1143-Longest-Common-Subsequence.cpp | UTF-8 | 962 | 3.21875 | 3 | [] | no_license | /*
Solution 1: DP
*/
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
class Solution {
public:
int longestCommonSubsequence(string text1, string text2) {
vector<vector<int>> dp(text2.length()+1, vector<int>(text1.length()+1, 0));
for (int idx2=0; idx2<... | true |
6c3614b756f73d2efd200d9126d65d8f2d60f564 | C++ | shreyaasridhar/SimpleCodes | /Random/Maximum sum.cpp | UTF-8 | 896 | 2.59375 | 3 | [] | no_license | \\Maximum sum such that no two elements are adjacent
#include <bits/stdc++.h>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define printA(s) for (auto& it: s) cout << it << ' ';
#define what(x) cout<< #x << " is " << x <... | true |
88b2b28f0dd740e77e5ea76a11a36aed3819f8b7 | C++ | Lbrewbaker/SchoolProjects | /CS161/Projects/Final - Library Simulator/Library.cpp | UTF-8 | 9,552 | 3.15625 | 3 | [] | no_license | /********************************
Author: Luke Brewbaker
Date: 11/28/14
Modified: 11/28/14
File:
Overview:
Input:
Output:
*******************************/
#include "Library.h"
#include "Book.h"
#include "Patron.h"
#include <string>
#include <iostream>
#include <vector>
#include <iomanip>
using namespace std;... | true |
7fe4c0ffb05a5ce3bb597dd43f1f53e30ace8937 | C++ | gauthiier/Plank | /software/apps/Music/Up_and_down/Up_and_down.ino | UTF-8 | 1,386 | 2.65625 | 3 | [] | no_license |
// This needs to be in all sketches at the moment
#include <stdint.h>
// The Music and Midi objects are automatically instantiated when the header file is included.
// Make calls to the Music and Midi objects with "Music.function(args)" and "Midi.function(args)"
// You still need to call Music.init() and Midi.init() ... | true |
81a9672c9e14dbdb645b6c99259c3b08a87a93b7 | C++ | nikhilyadv/UVA | /Problem Solving Paradigms/Dynamic Programming/10684 - The jackpot.cpp | UTF-8 | 690 | 2.640625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
int n;
while(cin >> n , n){
vector<int> a(n);
for(int i = 0 ; i < n ; i++)
cin >> a[i];
... | true |
c5305e1d1eb2c543aacde22ca6b8afb855efa7fb | C++ | dereksodo/codeforces | /954E_my_understand.cpp | UTF-8 | 857 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;
typedef struct{
double a;
double t;
}tap;
bool cmp(tap a,tap b)
{
return a.t < b.t;
}
int main()
{
int n,T;
cin>>n>>T;
tap tp[n];
for(int i = 0;i < n; ++i)
{
cin>>tp[i].a;
}
double cur = 0;
for(int i = 0;i < n;... | true |
ef9155deef09826e3e4595a7ad61a34f28371694 | C++ | jcnast/SimpleVersus | /Collision.h | UTF-8 | 655 | 2.9375 | 3 | [
"Zlib",
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer",
"Libpng",
"LicenseRef-scancode-unknown-license-reference",
"IJG",
"libtiff"
] | permissive | #ifndef COLLISION_H
#define COLLISION_H
// include game objects
// include necessary libraries
class Object;
class Collision{
// collision objects
Object *obj_1;
Object *obj_2;
// collision location
float xPos;
float yPos;
// collision velocity
float obj_1_xVel;
float obj_1_yVel;
float obj_2_xVel;
float ... | true |
5360f0b93664b940e120fe4c3122f76e988746b0 | C++ | lizhiwill/LeetCodeStudy | /็ฎๆณ/1002_ๆฅๆพๅธธ็จๅญ็ฌฆ/Solution01.cpp | UTF-8 | 1,519 | 2.625 | 3 | [] | no_license | class Solution
{
public:
vector<string> commonChars(vector<string>& A)
{
vector<string> vs ;
map<char,int> mci ;
vector<map<char,int>> vmci ;
int ... | true |
b927728810b2b373ef9c1a6a4b3324b07d0482e1 | C++ | SamAlexe/OpenGl-Texture-Program | /Model/ model.h | UTF-8 | 736 | 2.5625 | 3 | [] | no_license | #ifndef __MODEL_H__
#define __MODEL_H__
class model
{
public:
model(string modelFilename, string textureFilename);
void initrendering();
void drawscene();
void handlekeypress(unsigned char key, int x, int y);
void handleResize(int w, int h);
float getCenterX() { return m_CenterX; }
flo... | true |
392c09ead1cd9c374c6000fc6e60b9d1f2bb8f85 | C++ | Algue-Rythme/ACM | /louisB_10616.cpp | UTF-8 | 2,337 | 2.546875 | 3 | [] | no_license | #include <algorithm>
#include <cstdint>
#include <iostream>
#include <vector>
#define _DEBUG_
using namespace std;
const unsigned int nbNumbersMax = 200;
const unsigned int nbChoosenMax = 10;
const int64_t DMax = 20;
uint64_t dyna[nbNumbersMax+1][nbChoosenMax+1][DMax+1];
int64_t numbers[nbNumbersMax+1];
int main() ... | true |
3fbd779df2a0cbc8af66aa6f572d266c8f9296a2 | C++ | 0xDkXy/GenshinWaterFriendsTeamTemplate | /ๅฅณ็่ช็จๆฟๅญๆๅ/LCA.cpp | UTF-8 | 2,008 | 2.8125 | 3 | [] | no_license | #include "Headers.cpp"
#include "foreach.cpp"
/* ไป1ๅฐn้ฝๅฏ็จ๏ผ0ๆฏไฟ็ๅญ 5b4026638a0f469f91d26a4ff0dee4bf */
struct LCA
{
std::vector<std::vector<int>> fa;
std::vector<int> dep, siz;
std::vector<std::vector<int>> &E;
/* ๆ้ ๅฝๆฐๅ้
ๅ
ๅญ๏ผไผ ๅ
ฅ่พนๆฐ็ป */
LCA(int _siz, std::vector<std::vector<int>> &_E) : E(_E)
{
... | true |
d20b0871f56896eee2c29ecf5a1cbc83fd9004d0 | C++ | JuliaNortman/LabWorksSem2 | /LabWork2/Lab2/Source code/matrix.cpp | UTF-8 | 1,632 | 2.75 | 3 | [] | no_license | #include "matrix.h"
#include "ui_matrix.h"
Cell::Cell()
{
//set cell styles
setFixedSize(35, 28);
setValidator(new QIntValidator(-1000, 1000));
setStyleSheet("QLineEdit { border: 2px solid gray;"
"border-radius: 5px;}");
setText("0");
}
Matrix::Matr... | true |
050ecf68483bd9bf8391008eac9e625bc965c10b | C++ | derek-zr/leetcode | /Solution/352-data-stream-as-disjoint-intervals/data-stream-as-disjoint-intervals.cpp | UTF-8 | 1,698 | 3.4375 | 3 | [] | no_license | // Given a data stream input of non-negative integers a1, a2, ..., an, ..., summarize the numbers seen so far as a list of disjoint intervals.
//
// For example, suppose the integers from the data stream are 1, 3, 7, 2, 6, ..., then the summary will be:
//
//
// [1, 1]
// [1, 1], [3, 3]
// [1, 1], [3, 3], [7, 7]
// [1,... | true |
a87dbf14078e5fc4e97ff2d337ab42f3cedc3ac5 | C++ | bell0136/TIL | /C12/pointer1.cpp | UTF-8 | 165 | 2.546875 | 3 | [] | no_license | #include <stdio.h>
int main(void)
{
const char* strarr[3] = { "simple","string","array" };
printf("%p\n%p\n%p", &strarr[0], &strarr[1], &strarr[2]);
return 0;
}
| true |
dad0b133c7b5b5003a0cae87201b23408cb3328a | C++ | kingsmad/leetcode_2017 | /131.palindrome-partitioning.cpp | UTF-8 | 1,642 | 2.640625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
class Solution {
map<string, vector<vector<string>>> ms;
vector<vector<int>> pal;
public:
vector<vector<string>> partition(string s) {
ms.clear();
int n = s.size();
pal = vector<vector<int>>(n + 1, vector<int>(n + 1, 0));
... | true |
4daabbd5b5dc59e6c9f20658d15c6798077b672c | C++ | memory4963/CCpp2016 | /practices/cpp/level1/p04_cppScoreManagement/Student.h | UTF-8 | 871 | 3.453125 | 3 | [] | no_license | #pragma once
#include<iostream>
#include<string>
class Student
{
public:
Student();
~Student();
void set_name(std::string str);
void set_ID(int ID);
void set_score(int score);
std::string get_name();
int get_ID();
int get_score();
private:
std::string name;
int ID;
int score;
};
Student::Student()
{
st... | true |
717f91937ff4e107a3429e0b4cdaf33628bacb51 | C++ | ddouup/COMP2012H | /project4/brute.cpp | UTF-8 | 1,250 | 3.375 | 3 | [] | no_license | #include "brute.h"
#include <algorithm>
using namespace std;
brute::brute(){}
brute::brute(const vector<point> p) :points(p) {}
brute::~brute(){}
vector<vector<point> > brute::searchColinearPoints() {
vector<vector<point> > lines;
vector<point> line;
sort(points.begin(), points.end());
int n = points.size();
i... | true |
41677105a7c767d1f5c30bdb18e549e55466ab45 | C++ | anniepap/projject-1 | /Part2/ArrayStack.cpp | UTF-8 | 443 | 3.375 | 3 | [] | no_license | #include "ArrayStack.h"
Stack::Stack(uint32_t size_of_stack): size_of_stack(size_of_stack), size(0){
array= new uint32_t[size_of_stack];
}
Stack::~Stack(){
delete[] array;
}
void Stack::push(uint32_t element){
array[size++]=element;
}
uint32_t Stack::pop(){
if (size==0){
return NONE;
}
return array[--size];... | true |
43ddb117ec89162316e7256df9ab105f387234c9 | C++ | ititandev/onlinejudge | /DSA/testcase/TEST/program/sort.cpp | UTF-8 | 708 | 2.984375 | 3 | [] | no_license | #include "sort.h"
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <iomanip>
using namespace std;
int N=-1;
double *arr;
void swap(double& a, double& b)
{
double tmp=a;
a=b;
b=tmp;
}
void Input(fstream& f)
{
string str;
getline(f,str);
N=stoi(str);
arr=new double[N];
getline(... | true |
64367e7d6a1ad15c60107330d3b48db8a2bdbab7 | C++ | jensecj/code-challenges | /hackerrank/general-programming/basic-programming/easy-grading-students.cpp | UTF-8 | 648 | 3.953125 | 4 | [] | no_license | /*
tags: loop, round
task: given an array of numbers, if a number is above 38, and is
less than 3 from its nearest multiple of 5 (upwards), round the
number up to that multiple of 5
*/
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n; // the number of grades
cin >> n;
vecto... | true |
56893cf3c7b83120c1440c77859da9265e072743 | C++ | krujeen/C-Programming | /Day01_08_max_n.cpp | UTF-8 | 265 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int i,n;
int x,max_x;
cin>>n;
cin>>max_x;
for (i=2;i<=n;i++)
{
cin>>x;
if (max_x > x)
max_x = x;
}
cout<<max_x;
return 0;
}
| true |
d3ce4a8d75241e3bcf7a42b593328eaedc1fd7ee | C++ | EidosMedia/infobright-core | /cpp/infobright_jni/com_infobright_NamedPipe.cpp | UTF-8 | 5,604 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "jniutils.h"
#include <windows.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_infobright_io_WindowsNamedPipe
* Method: serverCreate
* Signature: (Ljava/lang/String;ZZIJ)J
*/
JNIEXPORT jlong JNICALL Java_com_infobright_io_WindowsNamedPipe_serverCreate
(JN... | true |
69079c8462e888e66a91a743be6f4498faf97834 | C++ | tiger1710/didactic-octo-funicular | /source/c++(c)-code/acmicpc.net/2206.cpp | UTF-8 | 2,165 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
#define endl '\n'
#define ALL(x) (x).begin(), (x).end()
#define REP(i, from, to) for (int i = (from); i < (to); i++)
using point = tuple<int, int, char>;
vector<string> map;
vector<vector<vector<int> > > visited;
const in... | true |
768b392f970092431c6df5587e83681bd1567ca5 | C++ | ordonezt/vcart | /Arduino/Motores_Serial/Motores_Serial.ino | UTF-8 | 2,651 | 2.625 | 3 | [] | no_license | #define X_STEP_PIN 54
#define X_DIR_PIN 55
#define X_ENABLE_PIN 38
#define X_MIN_PIN 3
#define X_MAX_PIN 2
#define Y_STEP_PIN 60
#define Y_DIR_PIN 61
#define Y_ENABLE_PIN 56
#define Y_MIN_PIN 14
#define Y_MAX_PIN 15
#define Z_STEP_PIN 46
#define Z_DIR_PIN 48
#define Z_ENABLE_PIN 62
#define Z_MIN_PIN 18
#define Z_MAX_... | true |
5e667b546c194574b0d23c2f9833eb03b879a9fc | C++ | chubbymaggie/irreg-simd | /spmm-float-and-double/spmm-float/seq/seq.cpp | UTF-8 | 1,992 | 2.796875 | 3 | [] | no_license | #include "../tools/csr_loader.h"
#include "../tools/fast_hash.h"
#include "util.h"
#include <atomic>
#include <unordered_map>
#include <iostream>
#include <vector>
#include <x86intrin.h>
using namespace std;
template<class ValueType>
Csr<ValueType>* SpMM(const Csr<ValueType>* m1, const Csr<ValueType>* m2,
... | true |
4e0c866bec1374d0bf07cecb0237fb34b312e837 | C++ | georgerapeanu/c-sources | /A. Quasi-palindrome/main.cpp | UTF-8 | 273 | 2.65625 | 3 | [] | no_license | #include <iostream>
using namespace std;
string a;
int main()
{
cin>>a;
int dr=a.size()-1;
while(a[dr]=='0'&&dr)dr--;
int st=0;
while(st<dr)
{
if(a[st]!=a[dr]){cout<<"NO";return 0;}
st++;dr--;
}
cout<<"YES";
return 0;
}
| true |
6fb8702c99f915d5f56f9a316665b12256bd0a8a | C++ | Ella-Han/algorithm | /baekjoon/baekjoon/Sorting.cpp | UTF-8 | 2,508 | 3.28125 | 3 | [] | no_license | //
// Sorting.cpp
// baekjoon
//
// Created by ํ์๋ฆ on 2021/03/29.
// Copyright ยฉ 2021 Ella-Han. All rights reserved.
//
#if 0
#include <stdio.h>
#include <algorithm>
#include <limits.h>
using namespace std;
#define SIZE 10
int sequence[10] = {10, 3, 2, 1, 9, 8, 7, 5, 6, 4};
void selectionSort() {
for (i... | true |
c525b3fb514145210fa3df393caaa76c1d24a80c | C++ | egandunning/learn-crypto | /CapstoneCryptography/src/bruteforcefactor.cpp | UTF-8 | 1,014 | 2.921875 | 3 | [
"MIT"
] | permissive | #include <headers/bruteforcefactor.h>
BruteForceFactor::BruteForceFactor() {
name = "Brute force";
}
/**
* Trial division starting with 2.
* @brief Factor::bruteForceFactor
* @param composite number to factor
* @return A point (number of digits, time to Factor(milliseconds))
*/
QPointF BruteForceFactor::fac... | true |
a0936e417aa2928899c9edd0e7717b3362ca18d9 | C++ | EEAIC/Baekjoon-Online-Judge | /10814/10814.cpp | UTF-8 | 677 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
pair<int, string> *members;
bool compare_age(pair<int, string> i, pair<int, string> j) {
return (i.first < j.first);
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N, age;
string name;
cin >> N;
members = ... | true |
d43b75111c0328453c601ac7364384f4d6898660 | C++ | DahamChoi/ModernCpp-DesignPattern | /structural/decorater/TransparentShape.h | UTF-8 | 584 | 3.3125 | 3 | [] | no_license | #pragma once
#include "Shape.h"
#include <sstream>
template <typename T> class TransparentShape : public T
{
static_assert(std::is_base_of<Shape, T>::value, "Template argument musb be a Shape");
public:
uint8_t transparency;
public:
template<typename...Args>
TransparentShape(uint8_t transparency, Args ...args)... | true |
34e300f205617696682cdbe8c85eec4fa3c4c742 | C++ | gaurikadam/farm_monitoring | /motor/motor.ino | UTF-8 | 731 | 2.890625 | 3 | [] | no_license | int motor_Pin = 9;
int m = 0;
void setup() {
// put your setup code here, to run once:
pinMode(motor_Pin,OUTPUT);
Serial.begin(9600);
}
void loop()
{
// serial read section
while (Serial.available()) // this will be skipped if no data present, leading to
// the code... | true |
f071977d6001d24dc277d2dffa4d8fbccbf576c7 | C++ | zzdqqqq/MyCode | /MyCode3_pointandreference/main.cpp | UTF-8 | 315 | 2.671875 | 3 | [] | no_license | //
// main.cpp
// MyCode3_pointandreference
//
// Created by Zidong Zhang on 1/12/19.
// Copyright ยฉ 2019 Zidong Zhang. All rights reserved.
//
#include <iostream>
using namespace std;
int main()
{
int i = 1;
cout << "Value: " << i << endl << "Address: " << &(i) << endl \
<< "Value: " << *(&(i)) << en... | true |
eebde77c1fc9318068dbcd8b1e1de60e93349c61 | C++ | ADKosm/Design-Patterns | /Strategy/EstimateByMean.cpp | UTF-8 | 391 | 2.65625 | 3 | [] | no_license | //
// Created by alex on 16.07.16.
//
#include "EstimateByMean.h"
EstimateByMean::EstimateByMean() {
}
EstimateByMean::~EstimateByMean() {
}
float EstimateByMean::run(std::vector<float>::iterator begin, std::vector<float>::iterator end) {
float sum = 0;
float count = 0;
for(;begin!=end; begin++) {
... | true |
3024503720b3b2d934763bfbbbf7318d56e4ef90 | C++ | BrodySchulke/MovieStore | /src/person.h | UTF-8 | 1,323 | 3.578125 | 4 | [] | no_license | #ifndef PERSON_H
#define PERSON_H
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
//---------------------------------------------------------------------------
// Person class: contains a first and last name for Customers, and is the
// parent class for Customer
//
// Implementation ... | true |
4c58a799d37e5383eb299618007a10a7d7c2754c | C++ | simunova/mtl4 | /libs/numeric/linear_algebra/test/concept_map_test.cpp | UTF-8 | 1,093 | 3.296875 | 3 | [
"MTLL"
] | permissive | #include <concepts>
#include <iostream>
#include <string>
#if 0 // Crashes ConceptGCC :-!
concept CExplicit<typename T>
{
requires std::CopyConstructible<T>;
requires std::CopyAssignable<T>;
// How do I request printability????
std::ostream& operator<<(std::ostream& os, T const& t);
}
template <CExplic... | true |
8f49b5e654ca35c9683aaaeee8c39ce483827c75 | C++ | katherine0504/POJ | /1325.cpp | UTF-8 | 1,310 | 2.921875 | 3 | [] | no_license | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#define MAX 110
using namespace std;
int n, m, k, x, y, out;
bool used[MAX];
int llink[MAX], rlink[MAX];
vector <int> edge[MAX];
bool DFS(int r);
int Bipartite(int nL, int nR);
int main () {
int i, j;
while (scanf("%d", ... | true |
3ff6e3a21c7078b1e28299c89ff7de7237782247 | C++ | alexandraback/datacollection | /solutions_2464487_0/C++/xfighter/bullseye.cpp | UTF-8 | 519 | 3.015625 | 3 | [] | no_license | #include <iostream>
using namespace std;
bool check(long long r, long long t, long long k) {
if (k > t) return false;
return k * (2 * r - 1 + 2 * k) <= t;
}
int main () {
int T;
cin >> T;
for (int c = 1; c <= T; c++) {
long long r, t;
cin >> r >> t;
long long l = 1, h = 1000000000;
while (l... | true |
e16aa4130ad66c0e17e24603caf3175890de8d03 | C++ | Yac836/leetcode | /MaximumProductSubarray.cpp | UTF-8 | 728 | 3.90625 | 4 | [] | no_license | /*
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the largest product = 6.
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int maxProduct(vector<i... | true |
21b6f61a292e4fc5ba112581c1d713f7d48d29f6 | C++ | HyungseobKim/Hon | /hon_source/Asterisk/C_RigidBody.cpp | UTF-8 | 2,063 | 2.546875 | 3 | [] | no_license | /******************************************************************************/
/*!
\file C_RigidBody.cpp
\author Jooho Jeong
\par email: jooho556 \@ gmail.com
\date 2019/01/15
\copyright
All content 2019 DigiPen (USA) Corporation, all rights reserved.
*/
/*****************************************************... | true |
613d4ee1ac8387d81c18ca47f9ad35689513cf38 | C++ | ArmandAgopian/CompsciSpring2018 | /src/Lab04-Functions/TestFunctionPrototype.cpp | UTF-8 | 948 | 4.25 | 4 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
// Return the max between two int values
int max(int num1, int num2) {
if (num1 > num2)
return num1;
else
return num2;
}
// Find the max between two double values
double max(double num1, double num2) {
if (num1 > num2)
return num1;
els... | true |
66c9376e82851541a490526fa49aa42394d019a3 | C++ | timeflies1113/learnToProgram | /language/cppPrimer/src/ch03/ex3_36b.cpp | UTF-8 | 652 | 3.453125 | 3 | [] | no_license | /*
* @Author: Wang Yi
* @Github: https://github.com/timeflies1113
* @Date: 2019-11-19 19:22:58
* @LastEditors: Wang Yi
* @LastEditTime: 2019-11-19 19:28:06
* @FilePath: \cppPrimer\src\ch03\ex3_36b.cpp
* @Description: vectorๅฏไปฅ็ดๆฅไฝฟ็จ==ๆฅ็ๆฏๅฆ็ธ็ญ
*/
#include <iostream>
#include <vector>
using namespace std;
int main()... | true |
defbff82002faec7611ec55f8d0135a58e535904 | C++ | temple-engr-ece3822/examples | /example_15/foo.cc | UTF-8 | 1,247 | 3.4375 | 3 | [] | no_license | #include <stdio.h>
bool jp_test(float x);
bool jp_test(float* x);
bool jp_test2(float* x);
int main (int argc, char** argv) {
// call by value
//
fprintf(stdout, "call by value:\n");
float x = 27;
fprintf(stdout, " x before = %f\n", x);
jp_test(x);
fprintf(stdout, " x after = %f\n", x);
fprintf(stdou... | true |
ec20b0d46e88bb9be992c8e201f8db07df20e286 | C++ | agrbin/msa | /src/GappedLine.cpp | UTF-8 | 4,747 | 2.71875 | 3 | [] | no_license | #include "GappedLine.hpp"
#include <iostream>
#include <algorithm>
#include <cassert>
namespace acgt {
using std::vector;
using std::pair;
using std::cout;
using std::endl;
using std::sort;
GappedLine::GappedLine(
const vector<string_t> fragments,
const vector<off_t> offsets) :
size_(0),
words_(... | true |
ab415e258cbbbd071b077ed654b489a8584735cf | C++ | rostam/PreCol | /Orderings/LargestFirstOrderingDegrees.h | UTF-8 | 1,101 | 2.796875 | 3 | [] | no_license | //
// Created by rostam on 19.07.16.
//
#ifndef PRECOL_LARGESTFIRSTORDERINGDEGREES_H
#define PRECOL_LARGESTFIRSTORDERINGDEGREES_H
#include "Ordering.h"
/**
* \brief Order vertices based on the degrees
*
* In this ordering, the vertex with the largest degree comes first
*
* A specific preordering for the colorin... | true |
b1beb7f3e0b1f608b6432d1e217e54c000b40101 | C++ | Huangyan0804/luogu | /P1223/P1223/P1223.cpp | UTF-8 | 521 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include<cstdio>
using namespace std;
struct n {
int time;
int num;
}man[1005];
bool cmp(n a, n b) {
return a.time < b.time;
}
int main() {
int n, k;
double sum = 0;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> man[i].time;
man[i].num = i;
}
sort(man + 1, man + ... | true |
bbce68b74a7060a1e85b9787c1066790c216440c | C++ | emtsdmr/C-and-Cpp-Exercises | /C++/LinkedList/Main.cpp | UTF-8 | 251 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include "LinkedList.h"
#include <string>
using namespace std;
int main()
{
LinkedList list;
list.add(1);
list.add(2);
list.add(3);
list.insert(1, 4);
list.remove(0);
cout << list << endl;
return 0;
}
| true |
2aa97d67a7ee3b32dbddca82dcfd531623f7974a | C++ | wu-yakun/CPP_TensorRT_YOLOV3TINY | /utils/post_process.cpp | UTF-8 | 2,641 | 2.9375 | 3 | [] | no_license | //
// Created by ๅดๅญๅก on 2020/7/13.
//
#include "post_process.h"
namespace post_process{
float sigmoid(float in) {
return 1.f / (1.f + exp(-in));
}
float exponential(float in) {
return exp(in);
}
float arg_max(vector<float> &label_list){
float ret_id = 0;
float last_max = 0;
for(int i=0;i<label_... | true |
bc05ca4b7d823985d2ce6024278fcb1f60eff8f3 | C++ | MrJookie/AGE | /Plugins/Physics/Bullet/BulletBoxCollider.hpp | UTF-8 | 1,002 | 2.625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | #pragma once
#include "BoxColliderInterface.hpp"
#include "BulletCollider.hpp"
#pragma warning(push)
#pragma warning(disable: 4250)
namespace AGE
{
namespace Physics
{
class BulletBoxCollider final : public BoxColliderInterface, public BulletCollider
{
// Friendships
friend ObjectPool < BulletBoxCollider... | true |
f9a7e6c6ba3714369b3d7f997c7278458fe966b4 | C++ | jiabailie/Algorithm | /daily-practice/2013/13102401.cpp | UTF-8 | 3,300 | 3.28125 | 3 | [] | no_license | /*
* Largest Independent Set
* References : mp.weixin.qq.com/mp/appmsg/show?__biz=MjM5ODIzNDQ3Mw==&appmsgid=10000312&itemidx=1&sign=0e53a19fb344fb7e09292a2e40e3ffab
*/
#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#define DEBUG
#undef DEBUG
using namespace ... | true |
d6457506fd49ee90b77b45484876130f81d1da57 | C++ | Arniox/Game-Programming-Work | /COMP710-2019-S2/students/nikkolas.diehl/Assignment 1 - Personal Game Project/FWT - 16945724/Really Warm/Really Warm/Walls.h | UTF-8 | 824 | 2.609375 | 3 | [] | no_license | #pragma once
#include "backbuffer.h"
#include "entity.h"
#include "Article.h"
// Library includes:
#include <cassert>
#include <cmath>
class Walls:
public Article
{
public:
Walls();
~Walls();
//Wall Creation
void UpdateWall(float x1, float y1, float x2, float y2);
void Draw(BackBuffer& backBuffer);
void Crea... | true |
1d8abb641d43d9be381d4502036d280dcb7de910 | C++ | sanyaade-g2g-repos/opensynth | /headers/WaveForm.h | UTF-8 | 3,380 | 3.203125 | 3 | [] | no_license | /** \file Waveform.h Header for WaveForm Object
* \author Samuel L. Banina 901278567 CSE21212.02
*
* This file declares the WaveForm class which is the fundamental
* unit in the heirarchy of the synthesizer. It dynamically creates
* samples of the specified waveform and returns the next sample scaled
* to... | true |
6d9c9302c646bc306779ba56d0862b3eaa759807 | C++ | ssizova/Trajectory | /config.cpp | UTF-8 | 6,067 | 2.9375 | 3 | [] | no_license | #include "config.h"
namespace {
bool section_find(ifstream& in, const string& sectname) {
string line;
while (getline(in, line) && line.find(sectname) != 0);
if (in.eof()) {
ostringstream msg;
msg << "EOF while looking for " << sectname << " section" << endl;
throw runtime_error(msg.str... | true |
88aad2db3d8234cdfa97c5d2b164b8f7e8be5d4e | C++ | shirosweets/Soluc11 | /Guia11E4.cpp | UTF-8 | 769 | 3.1875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <fstream>
using namespace std;
// SOLUCIONARIO DE EJERCICIOS
//
//
// Ejercicio Guia 11 N4
const int N=100;
const int M=3;
int main()
{
ifstream entrada;
int n=0;
int matriz[N][M];
entrada.open("Numeros.txt");
while( entrada >> matr... | true |
85cede29a515f38feab27db6b047444f6ea11c30 | C++ | ssicard/programming-digital-media | /hardware1/morsecode/morsecode.ino | UTF-8 | 3,197 | 3.609375 | 4 | [] | no_license | //**************************************************//
// Type the String to Convert to Morse Code Here //
//**************************************************//
String message = "Hi LEEZ";
// Create variable to define the output pins
int led13 = 13;
int dotLen = 100; // length of the morse code 'dot'
int dashL... | true |
fe2e2edaf4c70fc3c51f853c1b47f7fb32b09058 | C++ | menglecho/Kattis | /artichoke.cpp | UTF-8 | 710 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;
vector<double> price;
double f(int p, int a, int b, int c, int d, int k){
return p * (sin(a * k + b) + cos(c * k + d) + 2);
}
int main(void){
int p, a, b, c, d, n;
double dec;
cin >> p ... | true |
488b4701c3355c7aeed3887fc468a1d3c94744f0 | C++ | chencaf/KrigingManifoldData | /src/Model.hpp | UTF-8 | 3,837 | 2.921875 | 3 | [] | no_license | #ifndef _MODEL_HPP_
#define _MODEL_HPP_
#include <vector>
#include <iostream>
#include <string>
#include <utility>
#include <Eigen/IterativeLinearSolvers>
#include <memory>
#include "Helpers.hpp"
/*! \file
@brief Model class
*/
namespace model_fit {
/*!
@brief Class to compute and store the linear model on ... | true |
dd431025a1abee275ee3563cd8d632e1567705f0 | C++ | arponbasu/CS154_Labs_2ndSem | /CS154_Labs_2ndSem/Lab4/Game.cpp | UTF-8 | 6,791 | 2.765625 | 3 | [] | no_license | /*
#include <bits/stdc++.h>
#include <FL/Fl.H> // needed in every fltk program
#include <FL/Fl_Window.H> // needed to use the Fl_Window class
#include <FL/Fl_Button.H> // needed to use the Fl_Box class
using namespace std;
char* int2charstar (int v) {
char *s = new char[sizeof(int)];
sprintf(s,"%d",v);
retur... | true |
b5b9d113237312dfd81962829509f8c27ee16e1a | C++ | russellim/Algorithm | /BeakJoon/14426_์ด๋ชจํฐ์ฝ.cpp | UTF-8 | 1,404 | 3.375 | 3 | [] | no_license | ๏ปฟ// 21.06.04. ๊ธ
// 14426: ์ด๋ชจํฐ์ฝ https://www.acmicpc.net/problem/14426
// DP.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
namespace BOJ_14226
{
vector<int> dp;
// ๋๋ ๋จ์ด์ง๋ ์์์ ๋ณต๋ถํ๋ฉด?.
void FindMin(int num)
{
for (int i = num / 2; i >= 2; --i)
{
if (num % i == 0)
{
dp... | true |
b55a6d99be1624f4d3620520715012f89d8d20c6 | C++ | JaceRiehl/Cheat | /test/CheatControllerTest.cpp | UTF-8 | 3,463 | 2.6875 | 3 | [] | no_license | #include "CheatControllerTest.h"
TEST_F(CheatControllerTest,testStartGame)
{
ASSERT_TRUE(true);
EXPECT_CALL(*deckMock,shuffle())
.Times(1)
.WillOnce(Return());
EXPECT_CALL(*viewMock,welcomeMessage())
.Times(1)
.WillOnce(Return());
EXPECT_CALL(*viewMock,chooseNumPlayers(_))
.Times(1)
.WillOnce(Return(2));
... | true |
cb505d95d16fcc02b0651f020d53c7e5e5e87ff6 | C++ | aurelienjoncour/Bombercraft | /lib/gameEngine/src/EntityManager/EntityManager.hpp | UTF-8 | 6,778 | 2.8125 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2021
** gameEngine
** File description:
** 27/05/2021 EntityManager.hpp.h
*/
#ifndef ENTITYMANAGER_HPP
#define ENTITYMANAGER_HPP
#include <array>
#include <algorithm>
#include <memory>
#include "entity.hpp"
#include "IComponentTypeRegister.hpp"
#include "EntityContainer/EntityRegister.hpp"
#inc... | true |
171dfc9bd44f8dec07492af899ec6e777cfd5ba7 | C++ | anthony-phillips/utoledo-ieeextreme-12 | /snakes_and_ladders/snl.cpp | UTF-8 | 2,706 | 3.109375 | 3 | [] | no_license | #include<iostream>
#include<iomanip>
#include<tuple>
#include<map>
#include<fstream>
#define files 1
using namespace std;
//as reference - how to access elements
//cout <<"head at (" <<std::get<0>(std::get<0>(snakes[i])) <<',' <<std::get<1>(std::get<0>(snakes[i])) <<")\n";
int board_size;
class link{
p... | true |
114957333f1266a543c91cac554eb911f3ba34dc | C++ | rilianx/manto3D | /manto/base/spaces/spaces3/Vector3.cpp | UTF-8 | 1,136 | 3.078125 | 3 | [] | no_license | //
// Created by Braulio Lobo on 9/18/19.
//
#include <iostream>
#include "Vector3.h"
#include "../../figures/figures3/Figure3.h"
Vector2 Vector3::getProjection(const int PROJECTION_PLANE) {
switch (PROJECTION_PLANE){
case Figure3::PROJECTION_XY:
return {this->x, this->y};
case Figure3... | true |
a15bd07e3f6242a65f453cb24124dc5d2736606c | C++ | JMarianczuk/SmallSorters | /sorters/StdSortWrapper.cpp | UTF-8 | 3,504 | 2.640625 | 3 | [] | no_license |
#include "StdSortWrapper.h"
#include "Quicksort_Copy.h"
#include "Quicksort_Copy2.h"
#include "../StructHelpers.generated.h"
#include "ska_sort.h"
#include "radix_sort_thrill.h"
namespace measurement
{
template <typename ValueType>
bool NormalCompare(ValueType& left, ValueType& right)
{
return le... | true |
a260e7d337f4f976e16a9f4ba78583318c0321e3 | C++ | jflcarvalho/FEUP-AEDA | /utils.h | UTF-8 | 6,944 | 3.34375 | 3 | [] | no_license | /**
* @file C:\Users\ineeve\Documents\GitHub\aeda-casino\utils.h
*
* @brief Declares the utilities.
*/
#pragma once
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <time.h>
using namespace std;
/**
* @struct Card
*
... | true |
cb886e1c6fd938dc9455035e0e143d7be793fc4e | C++ | qzhongwood/CppRpcDemo | /src/RemotingCommand.cpp | UTF-8 | 4,009 | 2.609375 | 3 | [] | no_license | #include "StdAfx.h"
#include "RemotingCommand.h"
#include "Buffer.h"
AtomicCounter RemotingCommand::counter;
RemotingCommand::RemotingCommand(void)
: resultCode(0)
, releasePayload(false)
{
++counter;
}
RemotingCommand::RemotingCommand(BufferPtr buffer)
: releasePayload(true)
{
++counter;
buffer2Command(... | true |
e78e38430a18443e15ed45548ff487f9837e0df9 | C++ | abhishekchandra2522k/CPPrograms | /GFG/Kaprekar_Number.cpp | UTF-8 | 742 | 2.9375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int isKaprekar(int N)
{
if (N == 1)
{
return 1;
}
long long sqr = N * N;
long long div = 1;
long long temp = sqr / 10;
while (temp != 0)
{
div *= 10;
... | true |
e52f9424b355264c8cd8c4ac071fec910175e3b7 | C++ | abdllhyalcn/Cryptology | /Kriptoloji/ZigZag.cpp | UTF-8 | 1,248 | 3.203125 | 3 | [] | no_license | #include "ZigZag.h"
void ZigZag::Encryption(string& mesaj, const int key)
{
string* satir = new string[key];
int liner = 0;
int positioner = +1;
for (int i = 0; i < mesaj.length(); i++) {
if (liner == key-1) {
positioner=-1;
}
else if (liner == 0) {
positioner=+1;
}
(*(satir+liner)).push_back(mesaj... | true |
62c4981157782b98187fc1a09932161aa97c4109 | C++ | niranjan-85/Data-structures | /C++/Binary Search Trees/BSTusingPreorder.cpp | UTF-8 | 2,030 | 3.53125 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef struct node {
int data;
node* left, *right;
};
node* newnode;
void preorder(node* p) {
if (p) {
preorder(p->left);
cout << p->data<<" ";
preorder(p->right);
}
}
node* make(node *ptr,int k) {
newnode = new node;
newnode->left =... | true |
8abce6c026ec1c4c40f9a7facdaa0eb6ef334c4c | C++ | coding-freak456/algorithmsUse | /C++/Math/binary_exponentiation.cpp | UTF-8 | 444 | 3.5 | 4 | [
"MIT"
] | permissive | /*
* Author: karthikeyan rathore
* Binary Exponentiation Algorithm recursive approach
*/
#include<bits/stdc++.h>
using namespace std;
long long bin(long long a , long long b){
if(b == 0) return 1;
long long res = bin(a , b/2);
if( b % 2) {
return res * res * a;
}
else return res * res;
}
int main(){
lon... | true |
e1e2015abb59bd9ead30da237dd9fcf325f8131e | C++ | AutumnKite/Codes | /Codeforces/1555F Good Graph/std.cpp | UTF-8 | 6,447 | 2.75 | 3 | [] | no_license | #include <bits/stdc++.h>
class DSU {
std::vector<int> fa;
public:
DSU(int n) : fa(n) {
for (int i = 0; i < n; ++i) {
fa[i] = i;
}
}
int find(int x) {
return fa[x] == x ? x : (fa[x] = find(fa[x]));
}
bool merge(int x, int y) {
x = find(x), y = find(... | true |
be4fda16ac19434431a1f9e471387371f4948b92 | C++ | olesyastorchakprojects/Vocabulator | /Database/examplestable.cpp | UTF-8 | 3,285 | 2.59375 | 3 | [] | no_license | #include "examplestable.h"
#include <QSqlQuery>
#include <QVariant>
#include <QDateTime>
#include "database.h"
QList<Example> ExamplesTable::selectAll()
{
QList<Example> list;
QSqlQuery q;
if(q.exec(QString("SELECT id, example, created, type from examples")))
{
while(q.next())
{
... | true |
c7fe855f610e2f72cbad1dbeea2b2a06ba831d9a | C++ | Alexisflipi/Club-de-Algoritmia | /Online-judge/COJ/2202 - How Many Lattice Points.cpp | UTF-8 | 606 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long lld;
struct Punto{
lld x, y, z;
Punto(lld a, lld b, lld c) : x(a), y(b), z(c) {}
};
lld ad(Punto &A, Punto &B) {
lld x = (B.x - A.x);
lld y = (B.y - A.y);
lld z = (B.z - A.z);
return abs(__gcd(x, abs(__gcd(y, z)))) - 1;
}
lld solve(Punto &A... | true |
d7851fd227f39092492f967b1ba892e142650bfb | C++ | mcvine/mantid | /Framework/CurveFitting/src/ParDomain.cpp | UTF-8 | 3,157 | 2.6875 | 3 | [] | no_license | //----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidCurveFitting/ParDomain.h"
#include "MantidKernel/MultiThreaded.h"
namespace Mantid {
namespace CurveFitting {
/**
* Create and return i-th doma... | true |
f774f6d117a7e4c476724e54467b0cc145982ac6 | C++ | tjy1985001/Teaching | /C-2018/C่ฏญ่จๅพช็ฏ/stu_score.cpp | UTF-8 | 575 | 3.046875 | 3 | [] | no_license | ๏ปฟ#include <stdio.h>
int main()
{
int score = 0;
int max_score = 0;
int min_score = 100;
int sum = 0;
for (int i = 0; i < 5; i++)
{
printf("่ฏท่พๅ
ฅ็ฌฌ%dไธชๅญฆ็ๆ็ปฉ\n", i + 1);
scanf("%d", &score);
if (score > max_score)
{
max_score = score;
... | true |
21da7f5af9a254ec423c0f44edcaf828be03c702 | C++ | aptx1231/PAT_BasicLevel | /1087 ๆๅคๅฐไธๅ็ๅผ(20).cpp | WINDOWS-1252 | 333 | 2.640625 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
using namespace std;
int a[11000]; //ึต10000/2+10000/3+10000/5=10333
int main() {
int n;
cin >> n;
int cnt = 0;
for (int i=1;i<=n;i++) {
int tmp = i/2+i/3+i/5;
//cout << tmp << endl;
if (a[tmp] == 0) {
a[tmp] = 1;
cnt++;
}
}
cout << cnt << endl;
return 0;
... | true |
5aa314f9b4b1db6b1ec49a16ea109dddbdc21d3c | C++ | zhmu/ananas | /external/gcc-12.1.0/libstdc++-v3/testsuite/23_containers/deque/modifiers/swap/2.cc | UTF-8 | 3,906 | 2.78125 | 3 | [
"LGPL-2.1-only",
"GPL-3.0-only",
"GCC-exception-3.1",
"GPL-2.0-only",
"LGPL-3.0-only",
"LGPL-2.0-or-later",
"Zlib",
"LicenseRef-scancode-public-domain"
] | permissive | // 2005-12-20 Paolo Carlini <pcarlini@suse.de>
// Copyright (C) 2005-2022 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Sof... | true |
3a9ffa73ce869decaca8f85e9eab28d44a1cca11 | C++ | OpMonTeam/Projet-Pokemon-Regimys | /src/jlppc/regimys/start/main.hpp | WINDOWS-1250 | 1,056 | 2.515625 | 3 | [] | no_license | /*
main.hpp
Auteur : Jlppc
Fichier sous licence GPL-3.0
http://regimys.tk
Contient des fonctions necessaires au programme
*/
#ifndef MAIN_HPP
#define MAIN_HPP
#include <iostream>
#include <fstream>
#include "../../utils/File.hpp"
#include "../playercore/Player.hpp"
#include <sstream>
#define UNS using namespace std;
#... | true |
ea146e8f1e7999669c25b694370fd040544e899a | C++ | Spuddles/OpenCL-Testing | /Converters/FullBlock.cpp | UTF-8 | 1,006 | 2.984375 | 3 | [] | no_license | #include "FullBlock.h"
#include <algorithm>
#include <sstream>
#include "Utils.h"
#include "Structs.h"
FullBlock::FullBlock()
{
}
FullBlock::~FullBlock()
{
}
bool FullBlock::initialise()
{
return Converter::initialise();
}
unsigned char FullBlock::getMainColour(RGBA *image)
{
int r{ 0 }, g{ 0 }, b{ 0 };
for (int... | true |
ff9da37c1e9581b7021e59cc296b59feaa096474 | C++ | Mikolka09/TESTING | /TESTING_OOP/Admin.cpp | UTF-8 | 21,682 | 2.765625 | 3 | [] | no_license | ๏ปฟ#include"Admin.h"
void Admin::shapka_start()
{
string S(40, '#');
gotoxy(30, 1);
SetColor(8, 0);
cout << S << endl;
gotoxy(37, 2);
SetColor(12, 0);
cout << "ะขะะกะขะะะะฏ ะะะะ ะขะะกะขะะ ะะะะะะ" << endl;
gotoxy(30, 3);
SetColor(8, 0);
cout << S << endl << endl;
}
Admin::Admin(const Admin& ob)
{
log_admin_.clear();... | true |
977216aab4bb97e04134c3ab102f5825591df8c3 | C++ | liupucn/Radiosity | /่พๅฐๅบฆ็ฎๆณๆธฒๆๅ็ๅบๆฏ๏ผๆน่ฟ็๏ผ/P3.cpp | GB18030 | 1,788 | 3.234375 | 3 | [] | no_license | #include "stdafx.h"
#include "Test.h"
#include "P3.h"
#include <math.h>
#define ROUND(d) int(d + 0.5)
CP3::CP3(void)
{
z = 0.0;
num = 0;
}
CP3::~CP3(void)
{
}
CP3::CP3(double x, double y, double z):CP2(x, y)
{
this->z = z;
num = 0;
}
CP3 operator + (const CP3& p0, const CP3& p1)//
{
CP3 p;
p.x = p0.x + p1.x;... | true |
385bca1225286d324abdb14b20c665466aa57d5c | C++ | Variapolis/OpenGL-CW1-CarGame | /3DExample1/src/PlayerCar.h | UTF-8 | 614 | 2.765625 | 3 | [] | no_license | #pragma once
#include "Rect.h" //Player car used to represent the player, check collisions with the border and obstacles and contain score.
class PlayerCar :
public Rect
{
int _score;
bool _hasWon;
public:
GLfloat _speed;
PlayerCar(GLfloat speed, int startScore, GLfloat x, GLfloat y, GLfloat width, GLfloat heig... | true |
5e71cfebaac18ff4c719019222e3ac11834c574f | C++ | thexujie/xui | /x/core/color.h | GB18030 | 17,651 | 2.953125 | 3 | [] | no_license | #pragma once
namespace core
{
struct colorf
{
union
{
struct
{
float32_t a;
float32_t r;
float32_t g;
float32_t b;
};
float32_t arr[4];
};
};
// สฝARGBษซ
class col... | true |
5beb1b7ab5599ff149cbce54130fef737294bcbe | C++ | GuilhermeMatheus/AcessoUFABC | /src/KeyPadListener.h | ISO-8859-1 | 2,187 | 3.09375 | 3 | [] | no_license | #ifndef KEYPADLISTENER_H
#define KEYPADLISTENER_H
#define ROW_1 3
#define ROW_2 2
#define ROW_3 1
#define ROW_4 0
#define THRESHOLD_TOLERANCE 30
#define MIN_THRESHOLD_ROW_1 128
#define MAX_THRESHOLD_ROW_1 384 - THRESHOLD_TOLERANCE
#define MIN_THRESHOLD_ROW_2 384 + THRESHOLD_TOLERANCE
#define MAX_THRESHOLD_ROW_2 640... | true |
33175afe072a5b0e71cfc6b16c217f0d74d508ba | C++ | ssliuyi/ACMCode | /LeetCode/Triangle.cpp | UTF-8 | 990 | 2.859375 | 3 | [] | no_license | class Solution {
public:
int minimumTotal(vector<vector<int> > &triangle) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
vector<int> min;
vector<vector<int>>::iterator i;
vector<int>::iterator j;
int k=0;
for(i=triangle.begin();i!=trian... | true |
c56af1a4c75ea6a324221838f6d48609f14ae1cd | C++ | txaaron/Segs | /Projects/CoX/Common/GameData/serialization_common.h | UTF-8 | 5,094 | 2.578125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* SEGS - Super Entity Game Server
* http://www.segs.io/
* Copyright (c) 2006 - 2018 SEGS Team (see Authors.txt)
* This software is licensed! (See License.txt for details)
*/
#pragma once
#include "Colors.h"
#include "Logging.h"
#include <glm/vec3.hpp>
#include <glm/vec2.hpp>
#include <cereal/archives/json.hpp>... | true |
e8df2a6fb0f7fb0e44822c5655d9a63bc9ce695b | C++ | GabrielPlante/SaeGE2D | /SuperDUPER/Text.cpp | UTF-8 | 1,214 | 2.953125 | 3 | [] | no_license | #include "Text.h"
#include <iostream>
Text::Text(const std::string& text, const Position<>& position, SDL_Renderer* renderer, const Font& font, const Color& color)
:color{ color }
{
//To compensate for strange ttf behaviour
const int positionY = position.y - font.getHeight() / 5;
rect = Rectangle{ position.x, pos... | true |
74444162e501c4919f08a2f7151bfdbff2113760 | C++ | bharatkumarnitc/Compative-Programming | /Dynamic Programming 1/Q10.cpp | UTF-8 | 689 | 2.734375 | 3 | [] | no_license | #include<bits/stdc++.h>
#include<vector>
using namespace std;
int solve(int n,vector<int>A){
int arr[1000];//={0};
int dp[1000];//={0};
memset(arr,0,1000);
memset(dp,0,1000);
vector<int>::iterator it;
dp[0]=0;
dp[1]=A[0];
for(it=A.begin(); it!=A.end();it++)
{
arr... | true |
662180829b0abc982ecbf4368d20d686e57d7c98 | C++ | ivanovdimitur00/programs | /Programs/domashno 2 (29.12)/gotovi/zadacha_2.cpp | UTF-8 | 2,223 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <cstring>
void replace_exact (char* word, char* sent_word) {
for (int i = 0; i < strlen(word); i++) {
sent_word[i] = word[i];
}
}
void replace_with_shorter (char* word, char* sent_word) {
for (int i = 0; i < strlen(word); i++) {
sent_word[i] = word... | true |
7ee54e5a9b6061c319e0a6699ecbbf1f5dc8a8ed | C++ | Lrs121/winds | /arm9/include/_gadget/gadget.fileview.h | UTF-8 | 3,422 | 2.734375 | 3 | [
"MIT"
] | permissive | // Check if already included
#ifndef _WIN_G_FILEVIEW_
#define _WIN_G_FILEVIEW_
#include <_type/type.gadget.h>
#include <_type/type.uniqueptr.h>
#include <_type/type.sound.static.h>
#include <_gadget/gadget.scrollArea.h>
#include <_gadget/gadget.fileobject.h>
class _fileView : public _scrollArea
{
privat... | true |