uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
50d1c56d-ef8a-4650-b4e6-2a1c7fac7b3d | manikanta2901/ubuntu | .history/imp/cpp/DataStructures/Hashing/LinearProbing_20200731193957.cpp | /* to use this method the data must have unique elements
table size must be greater than or euql to hash table size*/
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
string hashTable[21];
int hashTableSize = 21;
int hashFunc(string s){
return (s.size()) % hashTableSize;
}
void insert(string s){
... | ALGO | 0.999335 | 4.775461 |
24e1ff9b-22da-455a-a926-8512da622cbf | ishandutta2007/codeforces | monogon/normal/659/C.cpp | #include <bits/stdc++.h>
#define in std::cin
#define out std::cout
#define endl std::endl
#define Max(a, b) ((b) > (a) ? (b) : (a))
#define Max3(a, b, c) Max(a, Max(b, c))
#define Min(a, b) ((b) < (a) ? (b) : (a))
#define Min3(a, b, c) Min(a, Min(b, c))
#define MaxE(a, b) a = Max(a, b)
#define MinE(a, b) a = Min(a, b)... | ALGO | 0.999995 | 3.498647 |
6deaee7a-e21a-4612-a95c-9d6f69903acc | vuralt62/Twitter-Clone-App | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998693 | 6.797273 |
26677bfe-ecc9-45d1-8c56-ec14839d432e | mansi35/CPlusPlus-Daily-Questions-Interview-Prep | median-of-two-sorted-arrays/median-of-two-sorted-arrays.cpp | class Solution {
priority_queue<int> leftheap;
priority_queue<int, vector<int>, greater<int>> rightheap;
double median = INT_MIN;
public:
void addNum(int num) {
if (leftheap.size() == 0 and rightheap.size() == 0) {
leftheap.push(num);
median = num;
}
else ... | ALGO | 0.999992 | 6.164471 |
b963a75d-e4ba-4393-b051-3c842db92304 | murras/algorithm | BOJ/push/10000-19999/11923.cpp | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int n, c;
int eat = 0;
int maxCount = 0;
cin >> n >> c;
int arr[1001];
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
for (int i = 0; i < n; i++) {
int count = 0;
eat = 0;
for (int ... | ALGO | 0.999989 | 4.064004 |
87e4912c-e1a7-41b3-8a0e-b8aebf9d228e | istiaque010/BTCECC_Linuxkali | src/policy/fees.cpp | #include <policy/fees.h>
#include <policy/policy.h>
#include <clientversion.h>
#include <primitives/transaction.h>
#include <streams.h>
#include <txmempool.h>
#include <util/system.h>
static constexpr double INF_FEERATE = 1e99;
std::string StringForFeeEstimateHorizon(FeeEstimateHorizon horizon) {
static const st... | ALGO | 0.992547 | 5.903627 |
ef1168bd-26bf-4884-a0a2-d2d718dfca44 | jaswanthsurya/ncr-work | cppassignments/overloading/overloading.cpp | //program to overload all arithmetic operations
#include<iostream>
using namespace std;
class overload
{
int x;
int y;
public:
overload()//constructor
{
x = 0;
y = 0;
}
overload(int x, int y)//parameterised constructor
{
this->x = x;
this->y = y;
}
overload(int x)//parameterised contructor
{
this... | ALGO | 0.89016 | 4.563238 |
493849fe-18cb-4246-95f4-8f2d42962367 | Deejai007/CP-Solutions | CodeChef/C++14/SQUATS/80750101.cpp | /*~CF~10/10/22:*/
#include <bits/stdc++.h>
#define int long long
#define rd(x) \
int x; \
cin >> x
#define read(x, y) \
int x, y; \
cin >> x >> y
#define all(x) (x).begin(), (x).end()
#define get(a, n) \
for (int i = 0; i < n; i++) \
{ \
ci... | ALGO | 0.999871 | 5.144338 |
bfbc87e1-c35c-4d6d-8905-40ac5bdcae32 | sofkp/Leetcode | 64/64.cpp | class Solution {
public:
int minPathSum(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
vector<vector<int>> dp(m, vector<int>(n, 0));
dp[0][0] = grid[0][0];
for (int i = 0; i<m; i++){
for (int j = 0; j<n; j++){
if (i == 0 ... | ALGO | 0.999928 | 5.919387 |
9965dd6c-e335-41a1-83cf-5bc7dd101aa6 | mimakyuu/AtCoder | ARC/A039.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
//#define ACL
#ifdef ACL
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
#if __has_include("acl-all.h")
#include "acl-all.h" //on Wandbox
using namespace atcoder;
#endif
#endif //#ifdef ACL
typedef long... | ALGO | 0.999809 | 3.773354 |
ebf745e1-845f-4c36-9395-a1538c32178e | antgwy/Competitive-Programming | Codeforces/edu164/D.cpp | /*
观察到集合值只与最大值 mx 和总和 sum 相关,
mx < sum / 2, ans = (sum + 1) / 2
mx >= sum / 2, ans = mx
*/
#include <bits/stdc++.h>
using namespace std;
#define debug(x) cerr << #x << " is " << x << endl
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 0x3f3f3f3f;
const ll MOD = 998244353;
int main()
{
ios::syn... | ALGO | 0.999944 | 4.366374 |
8cca0fc2-2f68-438e-a5b5-a86054654453 | jiziye/cpp_tutorials | demo/samples/samples_10.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
float a,b,c,x1,x2,dis,real,imag;
cout<<"input a,b,c";
cin>>a>>b>>c;
dis=b*b-4*a*c;
if (dis>0)
{
x1=(-b+ sqrt(dis))/(2*a);
x2=(-b- sqrt(dis))/(2*a);
cout<<"x1= "<<x1<<endl;
cout<<"x2= "<<x2<<endl;
}
else if(dis=0)
{
x1=(-... | ALGO | 0.999379 | 3.648641 |
5e0b1144-f43e-4a8d-9c68-72504af91507 | JaehaNsg/mysubject- | Day4/oplogicalnot01.cpp | #include <stdio.h>
int main(void)
{
int nInput = 0, bResult = 0;
scanf("%d", &nInput);
//사용자가 입력한 값이 0이 아니면 참이다.
//그러므로 사용자가 0을 입력하면 거짓이나, ! 연산을 수행해 참이 된다.
bResult = !nInput;
printf("Result : %d (1 : True, 0 : False)\n", bResult);
return 0;
} | ALGO | 0.999322 | 3.403117 |
b2004cbb-cf72-43e6-a354-a7d36ab41a7f | zhyack/LeetCode | 21.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
ListNode ret(0);
ListNode *p = &ret, *p1=l1, *p2=l2;
w... | ALGO | 0.999922 | 5.94088 |
6725c012-638f-4be5-b863-db7c3e312458 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_11619_13.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, m;
cin >> n >> m;
long long a1, b, c, i, j, k;
vector<pair<int, int> > v;
pair<int, int> a;
for (i = 1; i <= n; i++) {
cin >> a.first;
a.second = i;
v.push_back(a);
}
sort(v.begin(), v.end());
int t[n + 1];
for (i = ... | ALGO | 0.999994 | 4.233864 |
440a66a1-f030-4e30-8927-9a0e92f65e71 | donbasta/leetcode-submissions | Medium/2139.cpp | class Solution {
public:
int minMoves(int target, int maxDoubles) {
int step = 0;
while (target > 1) {
if (maxDoubles == 0) {
step += (target - 1);
break;
}
if (target & 1) {
target--;
step++;
... | ALGO | 0.999822 | 6.365655 |
15c7f712-2055-48ba-bac6-2fe0f0e64e8b | gzgreg/ACM | 2016-01-09/c.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
double prob[1122];
int n, m; cin >> n >> m;
map<int, int> given;
for(int i = 0; i < n; i++){
string curr; cin >> curr;
if(i == n-1) break;
int val;
if(curr == "A"){
val = 11;
}
else if(curr == "J" || curr == "Q"... | ALGO | 0.997069 | 3.536077 |
265423c0-2e8e-48dc-8244-d4513303e05c | YAN-LIU05/Data_Structure | hw_5/template_of_6.cpp | /**
* @name template.cpp
* @brief p142模板程序
* @date 2022-12-02
*/
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
using namespace std;
/********... | ALGO | 0.998873 | 5.47323 |
96b3f4e7-94db-4b84-9189-96954ac12595 | nhazekam/cse_20232 | labs/lab_05/lab5_arrays.cpp | //
// lab5_arrays.cpp
//
// Nick Hazkeamp on 9/16/16.
//
#include <cmath>
#include <fstream>
#include <iostream>
#include <iomanip>
using namespace std;
// Sort Ascending
int minimum(int tosort[], int lower, int upper);
void sortAscending(int tosort[], int size);
// Sort Descending
int maximum(int tosort[], int l... | ALGO | 0.999877 | 5.289961 |
63cd0e5e-386d-4409-bfad-7e3c903d0182 | mohammed7700/competitive-programming | B/Woche3/b.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int gcd(ll a, ll b) {
int x;
if(a == 0) {
return b;
}
while(b != 0) {
x = a%b;
a = b;
b = x;
}
return a;
}
void run() {
int n;
cin >> n;
vector<int> ans;
ll t = 1;
for... | ALGO | 0.999965 | 4.120692 |
2d230fc6-c9a8-4c57-9fa4-e94c76f9f067 | FredaNg1103/WebExtension | Documents/Visual Studio 2013/Projects/Recursion/Recursion/Recursion.cpp | #include <iostream>
using namespace std;
int factorial(int);
int main(){
int number;
cout << "Enter an integer : ";
cin >> number;
if (number < 0)
cout << "This is negative integer ";
else
cout << number << " Factorial is " << factorial(number) << endl;
system("pause");
return 0;
}
int factorial(int ... | ALGO | 0.998798 | 4.386617 |
008a451d-dc60-4437-bbc0-a54fcd34de89 | Qazi677/c-and-c- | Home work/functions/Untitled5.cpp | #include<iostream>
using namespace std;
int max(int x, int y){
int g=y;
if(x>y){
g=x;
}
return g;
}
int main(){
int a , b;
cout<<"Enter two numbers"<<endl;
cin>>a>>b;
int temp=max(a,b);
cout<<"the grater number is "<<temp<<endl;
} | ALGO | 0.999767 | 3.202547 |
0f143f5b-3496-44f4-a4c4-50e8d4eed208 | danieltrt/SBFL | results/DYNAMIC_PROGRAMMING_SET_17_PALINDROME_PARTITIONING.java.cpp | int minPalPartion ( string str ) {
int n = str . length ( ) ;
vector < vector < bool >> C ( n , vector < bool > ( n , false ) ) ;
vector < vector < bool >> P ( n , vector < bool > ( n , false ) ) ;
int i , j , k , L ;
for ( i = 0 ;
i < n ;
i ++ ) {
P [ i ] [ i ] = true ;
C [ i ] [ i ] = 0 ;
}
... | ALGO | 0.999865 | 5.764903 |
1bd5d923-4c4b-4d99-b981-a4e6291f5ba2 | rushi-sahane2000/code-opps | tute71.cpp | #include<iostream>
#include<vector>
using namespace std;
void display(vector<int> &v){
for (int i = 0; i < v.size(); i++)
{
cout<<v[i]<<" ";
}
cout<<endl;
}
int main(){
vector<int> vec1;
int element, size;
cout<<"Enter the size of your vector"<<endl;
cin>>size;
for (int i = ... | ALGO | 0.977121 | 3.610734 |
830bee52-8bf7-409e-be2f-4cb4088d711f | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_12716_4.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
long long int a, b, c;
cin >> a >> b >> c;
if (min(a, b) != max(a, b))
cout << (2 * min(a, b) + 1 + 2 * c);
else
cout << (a + b + 2 * c);
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
solve();
return 0;
}
| ALGO | 0.999703 | 3.658442 |
9c96a78d-51e4-45d6-a0c8-fabb29e65899 | pvs-hd-tea/TCrules | c2c-translator/data/geeks_for_geeks_dataset/cpp/LENGTH_OF_THE_LONGEST_ARITHMATIC_PROGRESSION_IN_A_SORTED_ARRAY.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
int f_gold ( int set [ ], int n ) {
if ( n <= 2 ) return n;
int L [ n ] [ n ];
int llap = 2;
for ( int i = 0;
i < n;
i ++ ) L [ i ] [ n - 1 ] = 2;
... | ALGO | 0.995629 | 4.821756 |
b6af62b9-8000-4db4-a0d3-b36ca0a723dd | sonapraneeth-a/competitive-programming_submissions | platforms/binarysearch/practice/easy/166__interleaved-string/solutions.cpp | // clang-format off
/**
* FILE DESCRIPTION
*
* Filename: 166__interleaved-string/solutions.cpp
* Created on: 05 September 2021
* Last modified: 05 September 2021
* Author: sonapraneeth_a
* Description: BinarySearch submission for 'Interleaved String' problem
*/
/**
* CHANGELOG
*
... | ALGO | 0.999941 | 5.425002 |
3792b575-02a6-47a6-a858-0268f0daf687 | dl8sd11/online-judge | codeforces/1332F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define REP(i,n) for(int i=0;i<n;++i)
#define REP1(i,n) for(int i=1;i<=n;++i)
#define SZ(i) int(i.size())
#define eb emplace_back
#define ALL(i) i.begin(),i.end()
#define X first
#define Y second
#ifd... | ALGO | 0.99956 | 4.198644 |
62d476b9-3ec6-4479-8691-712e6d78ba2c | visheshgargavi/mission_faang | Daily_Coding_problems/43.cpp | /*
This problem was asked by Facebook.
You are given an array of non-negative integers that represents a two-dimensional
elevation map where each element is unit-width wall and the integer is the height.
Suppose it will rain and all spots between two walls get filled up.
Compute how many units of water remain trapp... | ALGO | 0.999966 | 6.22883 |
a0b4f184-21d6-4e24-8d69-ec033aab33cb | Xelerezex/languages-playground | C++/С++17-STL-A-ODvair/chapter-3-algo-with-iter/01-diap-only-for-read.cpp | #include <forward_list>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <iomanip>
#include <cassert>
#include <vector>
#include <list>
template<class InputIterator, class UnaryPredicate>
InputIterator my_find_if(InputIterator first, InputIterator last, UnaryPredicate p)
{
for (; first != last... | TEST | 0.877487 | 5.049878 |
5abe22b4-1d6f-4573-9836-0c36c3985ccd | Corycle/OI-Codes | Bashu OnlineJudge/5100.cpp | /*====Corycle====*/
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<cstdio>
#include<vector>
#include<cmath>
#include<ctime>
#include<stack>
#include<queue>
#include<map>
#define ll long long
using namespace std;
const ll inf=0x3f3f3f3f;
const ll M... | ALGO | 0.999957 | 3.603664 |
0090fd0b-cd4c-45af-8458-0e106db79fa7 | abhin2149/dice-roller | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
fdcb210b-8477-44de-810b-fcb47dfa6cbb | basicano/DSA_practice | Graphs/dijkstras_algo.cpp | #include<iostream>
#include<list>
#include<vector>
#include<set>
using namespace std;
class Graph{
int V;
list< pair<int,int> > *g;
public:
Graph(int n){
this->V = n;
g = new list< pair<int,int> >[n];
}
void addEdge(int v1, int v2, int weight, bool directed=false){
g[v1].push_back({v2,weight});
... | ALGO | 0.999949 | 4.964635 |
6f7dd283-c702-4a9b-984f-2c89bf2a689a | ShivPatel031/DSA | Array/Factorials_of_large_numbers.cpp | // Factorials of large numbers GFG
// Given an integer N, find its factorial. return a list of integers denoting the digits that make up the factorial of N.
// Example 1:
// Input: N = 5
// Output: [1,2,0]
// Explanation : 5! = 1*2*3*4*5 = 120
// Example 2:
// Input: N = 10
// Output: [3,6,2,8,8,0,0]
// Explanatio... | ALGO | 0.999758 | 6.26754 |
5e5caae9-93d7-4f63-af5f-49a972277984 | AstridGMC/SQLProyecto2-201731318 | TablasHash/HashString.cpp | #include "HashString.h"
int HashString :: ElegirIndice(string dato){
int indice = (StringToInt(dato))%(tamTabla);
return indice;
}
void HashString:: Rehashing(){
int carga = (datosAlmacenados / tamTabla)*100;
if(carga>60){
tamTabla = tamTabla+10;
}
}
int HashString:: StringToInt(string d... | ALGO | 0.978524 | 3.977382 |
b8c15929-e383-4e75-b941-a97c4aa9bc01 | matatabinoneko/Atcoder | ABC/144/d.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(void){
int a,b,x; cin >> a >> b >> x;
double p = a;
double q = 2*double(pow(a,2)*b - x)/(pow(a,2));
if(x < pow(a,2)*double(b/2)){
p = 2*x/double(a*b);
q = b;
}
// cout << p << ' ' << q << endl;
p... | ALGO | 0.997932 | 3.851234 |
7b257a66-0bab-46c7-9f58-5c2612034648 | lohar-animesh-27112001/LeetCode | 0123-best-time-to-buy-and-sell-stock-iii/0123-best-time-to-buy-and-sell-stock-iii.cpp | class Solution {
private:
int num = 0;
int maxProf(vector<int>& prices) {
int n = prices.size();
if(n <= 1) return 0;
int f = INT_MIN, s = INT_MIN, buy = prices[0];
for(int i = 1; i < n; i++) {
if(prices[i] >= prices[i-1]) continue;
else {
... | ALGO | 0.999965 | 6.138635 |
ab99aa3e-878e-452b-924e-76bd9a8d8a22 | Sachindebug/LeetCode-Problems | Bipartite Graph - GFG/bipartite-graph.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool check(int curr,vector<int>adj[], vector<int>& col){
queue<int> q;
q.push(curr);
col[curr]=1;
while(!q.empty()){
int node=q.front();
q.pop();
fo... | ALGO | 0.999924 | 6.045167 |
39c238be-4c3b-4034-9306-ae0ceea27eeb | azahar24/http_req | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998762 | 6.786404 |
2b15c3d3-5093-4fe4-a940-720844c1b876 | alexandraback/datacollection | solutions_2755486_0/C++/srik/C.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | ALGO | 0.999233 | 3.30078 |
fffb8c3a-811e-4647-9698-e467a43ef0c3 | FelipeSilva10/TOU | T2/NA-exercise_bondinho.cpp | /*https://neps.academy/br/course/programacao-basica-(codcad)/lesson/bondinho*/
#include <iostream>
int main() {
//Declaração de variáveis
int A,M;
//Entrada de dados
std::cout<<"Número de alunos: ";
std::cin>>A;
std::cout<<"Número de monitores: ";
std::cin>>M;
//Lógica e Saída de dados... | ALGO | 0.998946 | 4.029057 |
c016b390-2179-449d-82e3-6905d3e3740f | thesubhamdash/CPP | C++ with DSA/2. Operators/Arithmetic2.cpp | #include<iostream>
using namespace std;
int main() {
cout << "Unary Operators" << endl;
int a = 5;
// a = a + 1;
// a++;
// cout << a << endl;
// a--;
// cout << a << endl;
/*POST INCREMENT OPERATOR "a++"
First the value is used and then increment is done.
*/
int b = a... | ALGO | 0.913994 | 3.909193 |
34457f9a-e6ad-4c16-9254-0b256e99e598 | henriquejsb/streamfase_public | FaseMain.cpp | #include "Common.h"
#include "Fase.h"
#include "DynamicGraph.h"
#include "GraphMatrix.h"
#include "GraphUtils.h"
#include "Timer.h"
#include "Graph.h"
#include "Random.h"
#include "Stream.h"
#include "RecalculateStream.h"
#include "SubgraphStream.h"
#include "DESUStream.h"
using namespace std;
Graph *G;
Stream *S;
in... | ALGO | 0.942594 | 4.757534 |
612fe5f3-5ff7-4a7e-98a2-0a953607c56d | PaukIsUha/optimizing_formating_code | predictions/full_output_predicted_submissions/Codenet/p00423/239687119/1.cpp | #include <iostream>
#include <vector>
int main() {
int vec = 0;
int n;
int a = 0;
int b = 0;
int game_a, game_b;
std::vector<int> veca, vecb;
while (1) {
std::cin >> n;
if (n == 0)
break;
else {
for (int i = 0; i < n; ++i) {
std::cin >> game_a >> game_b;
if (game_a ... | ALGO | 0.997938 | 3.651997 |
6624bfd2-e233-4ece-8f76-991ebc11ec9b | lianglllll/TinySTL | TinySTL/MyMultiset.cpp | #pragma once
#include "MyRedBlackTree.cpp"
template <typename Key> class MyMultiSet {
private:
MyRedBlackTree<Key, size_t> rbTree;
size_t size;
public:
MyMultiSet(): size(0) {}
~MyMultiSet(){}
void Insert(const Key& key) {
auto count = rbTree.At(key);
if (count) {
(*count)++;
++size;
}
else {
rb... | ALGO | 0.991616 | 4.367405 |
a0b08c3b-1dd0-41b7-85ff-6afe10379b0d | xupeiwust/nextfoam-cfd | ThirdParty-2405/sources/cgal/CGAL-4.14.3/demo/Arrangement_on_surface_2/tests/Test.cpp | #include <CGAL/Exact_circular_kernel_2.h>
#include <CGAL/Arrangement_2.h>
#include <CGAL/Arrangement_with_history_2.h>
#include <CGAL/Arr_default_dcel.h>
#include <CGAL/Arr_circular_arc_traits_2.h>
#include <fstream>
typedef CGAL::Exact_circular_kernel_2 CircularKernel;
typedef CGAL::Arr_circular_arc_traits_2< Circul... | ALGO | 0.987859 | 4.667485 |
bfe75d1d-693f-4821-a247-16c533563dec | devyaniprajapati/DSA-TASKLIST | chapter-7/p8.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cout << "Enter the number of rows: ";
cin >> n;
for (int i = 1; i <= n; i++) { // Outer loop for rows
for (int j = i; j <= n; j++) { // Inner loop for printing numbers
cout << j << " ";
}
cout << endl;
... | ALGO | 0.994915 | 4.690852 |
84f03d21-8e59-4783-9e56-150e748bbff7 | Sam-Han2020/Data-Structure | 10-图/10-4广度优先搜索.cpp | #include <iostream>
#include <queue>
using namespace std;
#define MaxVertex 7
typedef char E;
typedef struct Node
{ // 结点和头结点分开定义,普通结点记录邻接顶点信息
int nextVertex;
struct Node *next;
} * List;
struct HeadNode
{ // 头结点记录元素,代表每一个顶点
E element;
struct Node* next;
};
typedef struct AdjacencyGraph {
int ... | ALGO | 0.999862 | 4.268272 |
5f8c4f1c-3670-4972-a17f-25fe3f98197f | patmjen/NOS | include/GEL/Geometry/Implicit.cpp | #include "../CGLA/CGLA-util.h"
#include "../Geometry/Neighbours.h"
#include "../Geometry/GridAlgorithm.h"
#include "XForm.h"
#include "Implicit.h"
using namespace std;
using namespace CGLA;
namespace Geometry
{
void Implicit::push_to_surface(Vec3d& p, double tau, double max_dist) const
{
Vec3d g = gra... | ALGO | 0.99813 | 6.395913 |
5250a694-e1cc-4cbb-b2b8-5a5e7c602e68 | tanvirtareq/codeforces | 1389A.cpp | #include<bits/stdc++.h>
#define nl '\n'
#define dbg(a) cout<<#a<<"="<<a<<endl
#define fast ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0)
#define ll long long
#define vl vector<ll>
#define pll pair<ll, ll>
#define ii pair<int,int>
#define vi vector<int>
#define md 998244353
using namespace std;
int sol... | ALGO | 0.999708 | 4.976181 |
811532df-3a83-4599-ae86-c16649fc74ad | panzy/android-opencore-amr | opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/qua_gain.cpp | /*
------------------------------------------------------------------------------
Filename: qua_gain.cpp
------------------------------------------------------------------------------
MODULE DESCRIPTION
Quantization of pitch and codebook gains.
------------------------------------------------------------------... | ALGO | 0.999649 | 5.50352 |
2c91a7ca-975c-4ced-b895-e0b0ec1854f1 | arthurpham/quantlib-full | QuantLib/ql/math/distributions/studenttdistribution.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <ql/math/distributions/studenttdistribution.hpp>
#include <ql/math/distributions/gammadistribution.hpp>
#include <ql/math/beta.hpp>
namespace QuantLib {
Real StudentDistribution::operator()(Real x) const {
static Gam... | ALGO | 0.984644 | 6.786916 |
ad9aa78e-686a-47f9-9c49-ad43868e4804 | felipesdias/Extractor-URI-Online-Judge | URI-PT/STRINGS/1448 - Telefone Sem Fio.cpp | // Autor: Felipe Souza Dias<<EMAIL>>
// Nome: Telefone Sem Fio
// Nível: 2
// Categoria: STRINGS
// URL: https://www.urionlinejudge.com.br/judge/pt/problems/view/1448
#include <iostream>
#include <cstring>
using namespace std;
int main () {
int i, j, n, tam, cont1, cont2;
char frase[101], time1[101], time2[101];
bool... | ALGO | 0.999983 | 3.880197 |
85c8b671-3398-44ed-9fb9-5ed93a8734ab | ishandutta2007/codeforces | wygzgyw/normal/1292/A.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &t) {
t=0; char ch=getchar(); int f=1;
while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f;
}
const int maxn=(1e5)+10;
int n,q,ans;
bool d[2][maxn];
int main() ... | ALGO | 0.999953 | 3.872833 |
daa9429b-8299-48e8-a9e7-595a1353a432 | GlodonOpenSrc/Qt5.9.5_Glodon | qtwebengine/src/3rdparty/chromium/third_party/WebKit/Source/platform/text/Hyphenation.cpp | #include "platform/text/Hyphenation.h"
#include "platform/fonts/Font.h"
#include "wtf/text/StringView.h"
namespace blink {
Vector<size_t, 8> Hyphenation::hyphenLocations(const StringView& text) const {
Vector<size_t, 8> hyphenLocations;
size_t hyphenLocation = text.length();
if (hyphenLocation <= minimumSuffix... | TOOL | 0.905373 | 7.443129 |
9141e8ce-fe59-4cd4-83db-6ab162fca48d | vikrant0/codingtriangle | Member function.cpp | //Create a class to find total marks in 4 main subjects with get_marks() and total_marks() member functions defined outside the class.
#include <iostream>
using namespace std;
class marks
{
private:
int maths,physics,chemistry,english;
public:
void get_marks();//member declaration inside the class
void total_m... | ALGO | 0.914602 | 3.846926 |
378cd284-528e-41ec-a63d-82f6fce7c152 | tashfi04/Programming_problem_solves | UVA/11679 - Sub-prime.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
//FILE *f;
//f = fopen("output.txt", "w");
int n, b, i, d, c, v;
bool opt;
while(cin>>b>>n && b != 0 && n != 0)
{
opt = true;
int reserves[b+1];
for(i=1; i<=b; i++)
{
cin>>reserves[i];
... | ALGO | 0.99764 | 3.218621 |
8fbc7439-eba0-4255-ac36-e31754715087 | harshitsuthar77731/striverSheet | Binary Tree part-II/543. Diameter of Binary Tree.cpp | class Solution {
public:
int h(TreeNode* root,int &ans){
if(root==NULL)
return 0;
int lh = h(root->left,ans);
int rh = h(root->right,ans);
ans = max(lh+rh,ans);
return max(lh,rh)+1;
}
int diameterOfBinaryTree(TreeNode* root) {
int ans = 0;
... | ALGO | 0.999819 | 6.37801 |
179140ce-2b3c-4ccc-9cc4-fd265b85901f | simulationcoin/ycash | src/snark/libsnark/common/utils.cpp | /** @file
*****************************************************************************
Implementation of misc math and serialization utility functions
*****************************************************************************
* @author This file is part of libsnark, developed by SCIPR Lab
* and... | TOOL | 0.966354 | 7.08307 |
d9d2d7f8-109c-4b1f-b917-f0dcea2c5d51 | Mdmunnasardar/Data-Structure | Llinked List/Stack & Queue/StackLinkedList.cpp | #include <iostream>
using namespace std;
class Stack
{
private:
class Node
{
public:
int data;
Node *next;
Node(int value) : data(value), next(nullptr) {}
};
Node *top;
public:
Stack() : top(nullptr) {}
void push(int data)
{
Node *newNode = new Node(data)... | ALGO | 0.998724 | 5.105631 |
cfb18376-1f34-4cd4-b87a-1cca45983f35 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9072_6.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
bool flag1 = true;
int count1 = 1, count2 = 1;
cout << (n + 1) / 2 << endl;
for (int i = 1; i <= n; i++) {
if (flag1) {
cout << count1 << " " << count2 << endl;
count2++;
flag1 = false;
} else {
cout ... | ALGO | 0.999718 | 3.042827 |
ca3541bc-b766-4969-a405-0c740a9e4385 | ukmaurya/GFG | Difficulty: Easy/Union of Arrays with Duplicates/union-of-arrays-with-duplicates.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template in C++
class Solution {
public:
// Function to return the count of number of elements in union of two arrays.
int findUnion(vector<int>& a, vector<int>& b) {
... | ALGO | 0.998999 | 6.400012 |
881c7e7c-7a95-47e7-b100-c162df50082c | ambujtripathi988/Coding | LeetCode/Maximum Subarray.cpp |
// https://leetcode.com/problems/maximum-subarray/
class Solution {
public:
int maxSubArray(vector<int>& nums)
{
int sum = 0 ;
int maxi = nums[0] ;
// kadane's algo
for(int i = 0 ; i < nums.size() ; i++)
{
sum += nums[i] ;
... | ALGO | 0.999931 | 6.423323 |
7a22836a-1c85-4fb1-81f3-79970be5b58d | Abdurrehman2021-CS-44/Programming_Fundamentals_Problem_Set_2 | Problem2.cpp | #include<iostream>
using namespace std;
const int TOTAL_NUMBER = 100;
int num[TOTAL_NUMBER];
int peaks[TOTAL_NUMBER];
int NUM;
void numbers(){
for(int i = 0; i < NUM; i++){
cout << "Enter the number " << i+1 << ": ";
cin >> num[i];
}
}
void miniPeaks(){
for(int i = 1; i < NUM-1; i++){
... | ALGO | 0.99994 | 3.7922 |
d3ac3794-e645-4eff-825d-26bb6f742278 | park9n/playground | fizzbuzz/main.cpp | #include <stdio.h>
int fizzbuzz(int n) {
for (int i = 1; i <= n; i++) {
if ((i % 3) == 0 && (i % 5) == 0) {
printf("FizzBuzz\n");
}
else if ((i % 3) == 0) {
printf("Fizz\n");
}
else if ((i % 5) == 0) {
printf("Buzz\n");
}
e... | ALGO | 0.998882 | 5.493448 |
e8bef164-7b06-4960-adf4-7bc1e27ed96c | raincross7/code-similarity | codes/train_code/problem216/problem216_423.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
using namespace std;
typedef uint64_t u64;
typedef int64_t s64;
ty... | ALGO | 0.999949 | 4.043308 |
209e24fa-3657-4841-9116-92b9b96b492d | sarvex/leetcode-perl | solution/0000-0099/0056.Merge Intervals/Solution.cpp | class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
sort(intervals.begin(), intervals.end());
int st = intervals[0][0], ed = intervals[0][1];
vector<vector<int>> ans;
for (int i = 1; i < intervals.size(); ++i) {
if (ed < intervals[i][0]) {... | ALGO | 0.999999 | 6.126431 |
cdccbc0b-b859-43b7-9282-88f9d0246630 | ErikHK/inkscape_animation | src/libavoid/tests/inlineoverlap02.cpp | // From p-overlap bug.
#include "libavoid/libavoid.h"
using namespace Avoid;
int main(void) {
Router *router = new Router(
PolyLineRouting | OrthogonalRouting);
router->setRoutingPenalty((PenaltyType)0, 50);
router->setRoutingPenalty((PenaltyType)1, 0);
router->setRoutingPenalty((PenaltyType... | ALGO | 0.975008 | 4.886995 |
1b9da9f4-e511-4f74-bba0-1c004ede97c4 | helenjw/CSC317 | lab3/eigen/unsupported/doc/examples/PolynomialUtils1.cpp | #include <unsupported/Eigen/Polynomials>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
Vector4d roots = Vector4d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,5,1> polynomial;
roots_to_monicPolynomial( roots, polynomial );
cout << "Polynomial:... | ALGO | 0.997759 | 4.010423 |
8e86f414-0a3b-47e9-978c-2cb3a8be7e2e | mshoe/DiffMPMAnimator3D | deps/igl/copyleft/cgal/coplanar.cpp | #include "coplanar.h"
#include "row_to_point.h"
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Point_3.h>
template <typename DerivedV>
IGL_INLINE bool igl::copyleft::cgal::coplanar(
const Eigen::MatrixBase<DerivedV> & V)
{
// 3 points in 3D are always coplanar
if(V.rows() < 4){ re... | ALGO | 0.9942 | 5.949702 |
dd26b938-857d-4138-8d98-7ca6dc5dff5b | warrenjl/EpiBuffer | src/spatial_corr_fun.cpp | #include "RcppArmadillo.h"
#include "EpiBuffer.h"
using namespace arma;
using namespace Rcpp;
// [[Rcpp::depends(RcppArmadillo)]]
// [[Rcpp::export]]
Rcpp::List spatial_corr_fun(double phi,
arma::mat spatial_dists){
double log_deter_inv = 0.00;
double sign = 0.00;
arma::mat corr = ... | ALGO | 0.99557 | 5.652384 |
cf01c7d1-5ad6-4a90-9b88-f129db8dc0b6 | amanverma21/cp | remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
set<int>s;
for(auto it:nums)
s.insert(it);
// cout<<st.size();
int ans = s.size();
nums.clear();
for(auto i:s)
{
nums.push_back(i);
}
return ans;
}
}; | ALGO | 0.999773 | 5.628447 |
2b80529e-cce2-4592-b5e2-e5cf2bf2b21c | ishandutta2007/codeforces | emthrm/normal/1428/E.cpp | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
constexpr int INF = 0x3f3f3f3f;
constexpr ll LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr double EPS = 1e-8;
constexpr int ... | ALGO | 0.999892 | 4.132615 |
78d3333e-adf0-4759-9ba5-820c7ee1e35b | nermeen03/OOP | task10.cpp | #include <iostream>
#include <string.h>
using namespace std;
int main()
{
char first[8];
char second[8];
char name[16];
cout<<"enter the first name (max 7 letters): ";
cin>>first;
cout<<"enter the second name (max 7 letters): ";
cin>>second;
//with pre-defined function
char full[16... | ALGO | 0.984388 | 3.53639 |
b11b7ceb-49c9-4648-82e4-050f8c2893ba | distributed-radio/plugin_template | nana/source/gui/widgets/menu.cpp | #include <nana/gui/compact.hpp>
#include <nana/gui/screen.hpp>
#include <nana/gui/widgets/menu.hpp>
#include <nana/gui/timer.hpp>
#include <nana/system/platform.hpp>
#include <nana/gui/element.hpp>
#include <nana/paint/text_renderer.hpp>
#include <cctype> //introduces tolower
#include <vector>
namespace nana
{
names... | TOOL | 0.930983 | 3.723953 |
228bd51c-7bc4-4380-a5d6-f4c5b34ce6a4 | AshwinSriram11/CP-Questions | Codeforces/A_Cover_in_Water.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
string s;
cin>>s;
int cnt = 0;
bool flag = false;
for(int i=0;i<n-2;i++){
if(s[i]==s[i+1] && s[i+1]==s[i+2] && s[i... | ALGO | 0.999484 | 3.480021 |
0f9f8dc3-2a2f-4e38-baba-e4e7090a2281 | tangziyi001/competitive-programming | Graph/Articulation/TouristGuide.cpp | /*
* UVA 10199
* Created by Ziyi Tang
* Basic Articulation Point
*/
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#incl... | ALGO | 0.999935 | 4.09643 |
a1f098da-9e60-494d-ac9e-d0a674757fd9 | deepin-community/openscenegraph | src/osgVolume/Shaders/volume_multipass_hull_frag.cpp | char volume_multipass_hull_frag[] = "#version 110\n"
"\n"
"uniform sampler2D colorTexture;\n"
"uniform sampler2D depthTexture;\n"
"uniform sampler2D frontFaceDepthTexture;\n"
... | ALGO | 0.917079 | 6.075825 |
1e5809fc-11b9-48f3-8dfc-21a738abec1f | gt-retro-computing/llvm-I8080 | libcxx/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp | // <algorithm>
// template<InputIterator Iter, Predicate<auto, Iter::value_type> Pred>
// requires CopyConstructible<Pred>
// constexpr Iter::difference_type // constexpr after C++17
// count_if(Iter first, Iter last, Pred pred);
#include <algorithm>
#include <functional>
#include <cassert>
#include "test_ma... | TEST | 0.954479 | 6.836083 |
4f6648f5-c7b5-4620-a5e8-c0292907dba5 | emNavi/ego-planner-swarm-v1 | src/planner/drone_detect/src/drone_detector.cpp | #include "drone_detector/drone_detector.h"
// STD
#include <string>
namespace detect {
DroneDetector::DroneDetector(ros::NodeHandle& nodeHandle)
: nh_(nodeHandle)
{
readParameters();
// depth_img_sub_.reset(new message_filters::Subscriber<sensor_msgs::Image>(nh_, "depth", 50, ros::TransportHints().tcpNoDela... | TOOL | 0.862479 | 5.642809 |
1f6ef2ff-8148-4d24-9202-f0cb45866bb7 | Kallaf/Codeforces | Codeforces Round #588 (Div. 2)/B - Ania and Minimizing.cpp | #include<bits/stdc++.h>
using namespace std;
int n,k;
string num;
int main()
{
cin >> n >> k >> num;
if(n == 1 && k == 1)cout << 0 << endl;
else{
if(k)
{
if(num[0] != '1')k--;
num[0] = '1';
}
for(int i=1;k && i<n;i++)
{
if(n... | ALGO | 0.999976 | 4.011836 |
5e2ce3cd-2bd8-4c19-ae95-423adb4ede64 | dducktai/IT003 | Tuần 1/Câu 3/Câu 3.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iomanip>
using namespace std;
int random(int minN, int maxN)
{
return minN + rand() % (maxN + 1 - minN);
}
void input_arr(int a[])
{
int n = 10000;
int r;
srand((int)time(0));
for (int i = 0; i < n; i++)
{
... | ALGO | 0.999261 | 4.22318 |
dd6de131-3d8b-44fc-9b08-4b58bc02b8b7 | ips610/UCS301-COURSE-TIET | 13. Simple Queue.cpp | // Simple Queue
#include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter the size of the queue: ";
cin >> n;
int queue[n];
int front = -1;
int rear = -1;
int choice;
while (choice != 4)
{
cout << "1. Insert an element in the queue" << endl;
cout <... | ALGO | 0.953287 | 4.381037 |
c6e08ff4-10ab-40e7-8015-20c9a3ddeae7 | Israfil1508/Tetris- | Tetromino.cpp | #include <vector>
#include "Global.hpp"
#include "GetTetromino.hpp"
#include "GetWalkickData.hpp"
#include "Tetromino.hpp"
#include "DrawText.hpp"
Tetromino::Tetromino(unsigned char i_shape, const std::vector<std::vector<unsigned char>>& i_matrix) :
rotation(0),
shape(i_shape),
minos(get_tetromino(i_shape, COLUMNS... | ALGO | 0.953719 | 5.725795 |
97708e7e-a9a5-4a71-90f0-46a9eff362d2 | PrinceInScripts/C-and-DSA-Foundation | Assignment/1. Data types and variables assignment/Q.3.cpp | //Write a C++ program to take length and breadth of a rectangle and print its area.
#include<iostream>
using namespace std;
int main()
{
int len=7,bre=4;
int rect=len*bre;
cout<<"Area Of Rectangle is : "<<rect;
return 0;
} | TOOL | 0.864742 | 3.731736 |
82668119-e75e-4aeb-902a-2f8d4c3ddbd6 | k1rbyd/Code-Harbor | C++/Assignment/m-5 Answers/Q3.cpp | #include <iostream>
using namespace std;
int main()
{
int x{0};
int y{0};
cin>>x>>y;
int sum{0};
sum = (x*x)+(y*y);
cout<<"Sum : "<<sum<<endl;
} | ALGO | 0.99892 | 4.946609 |
920088c8-78c5-41da-9ad9-3ddc8e022aad | patelpreet422/Data-Structures-and-Algorithms | factorial_of_large_numbers.cpp | #include <algorithm>
#include <iostream>
#include <string>
const int limit = 200;
std::string factorial(int n) {
std::string res(limit, '0');
res[0] = '1';
for (int j = 1; j <= n; ++j) {
int carry = 0;
for (int i = 0; i < limit; ++i) {
int product = (res[i] - '0') * j + carry;
res[i] = '0' + (... | ALGO | 0.999984 | 5.689231 |
6db26352-bef8-4bbe-93cf-cdbc9dfb876f | kokkia/kal | eigen3.3.7/unsupported/test/NumericalDiff.cpp | #include <stdio.h>
#include "main.h"
#include <unsupported/Eigen/NumericalDiff>
// Generic functor
template<typename _Scalar, int NX=Dynamic, int NY=Dynamic>
struct Functor
{
typedef _Scalar Scalar;
enum {
InputsAtCompileTime = NX,
ValuesAtCompileTime = NY
};
typedef Matrix<Scalar,InputsAtCompileT... | TEST | 0.990685 | 6.21049 |
776ec0b7-53a3-4b27-965a-28da67dc15f4 | m4oughi/100DaysofCode | pureCPP/0049. Day 49/C++14 Features/006. Variable Templates/001. Basic Variable Template (Generic Constant)/main.cpp | #include <iostream>
template<typename T>
constexpr T pi = T(3.1415926535897932385);
int main() {
std::cout << "Pi as float: " << pi<float> << std::endl;
std::cout << "Pi as double: " << pi<double> << std::endl;
std::cout << "Pi as long double: " << pi<long double> << std::endl;
return 0;
}
| TOOL | 0.910278 | 4.362435 |
d5c06c37-1208-47e2-9180-778a71f09f95 | younes08/Interval | Interval/ArLimiters.cpp | #include <cassert>
#include <iostream>
#include "ArLimiters.h"
using namespace std;
arith::ArLimiters::ArLimiters(unsigned int length, float lim1, float lim2):Array(length)
{
this->lim1 = lim1;
this->lim2 = lim2;
}
float arith::ArLimiters::operator[](unsigned int index)
{
assert(index >= 0 && index < this->length)... | TOOL | 0.902991 | 4.248145 |
75fdb05c-ebfd-42ee-bfac-74fffe121bfc | dt990pro/cs475 | proj0/proj_0.cpp | #include <omp.h>
#include <stdio.h>
#include <math.h>
#define NUMT 1
#define ARRAYSIZE 1024000 // you decide
#define NUMTRIES 20 // you decide
float A[ARRAYSIZE];
float B[ARRAYSIZE];
float C[ARRAYSIZE];
int
main()
{
#ifndef _OPENMP
fprintf(stderr, "OpenMP is not supported here -- sorry.\n")... | ALGO | 0.988634 | 4.694909 |
76bdab46-5e13-4953-a913-9ab58cda4117 | Shuvamrauniyar/shuvam-leetcode-journey | 1-two-sum/1-two-sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
int n=nums.size();
//vector<int>ans;
vector<pair<int,int>>v;
for(int i=0;i<n;i++)
{
v.push_back({nums[i],i});
}
sort(v.begin(),v.end());
int low=0,high=n-1... | ALGO | 0.999807 | 6.258813 |
01860125-8033-4838-a8cb-e58b7df88448 | AryanTapre/data-structures | ADT_Data_Structures/OutDate/BinarySearch/peak_index_mountain.cpp | // finding peak index in an mountain array e.g {3,4,5,1} peak will be 5..
#include<iostream>
using namespace std;
class Solution {
public:
int getPeakIndexInMountainArray(int *,int);
Solution() {
}
~Solution() {
// char *p = new char;
// delete p;
}
};
int Solution :: getPeakIndexInMountainA... | ALGO | 0.999945 | 4.236843 |
623b29d0-f141-4753-9fd4-659840a587ea | sinian666/code_41_27 | cpp_副本5/chapter_searching/linear_search.cpp | /**
* File: linear_search.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 线性查找(数组) */
int linearSearchArray(vector<int> &nums, int target) {
// 遍历数组
for (int i = 0; i < nums.size(); i++) {
// 找到目标元素,返回其索引
if (nums[i] == target)
re... | ALGO | 0.999605 | 5.587986 |
47cd41a0-9ce4-42c6-b911-3286f62cf06c | KarlsruheLongestPaths/KaLP | extern/KaHIP3.16/lib/partition/uncoarsening/uncoarsening.cpp | /******************************************************************************
* uncoarsening.cpp
* *
* Source of KaHIP -- Karlsruhe High Quality Partitioning.
* Christian Schulz <<EMAIL>>
*****************************************************************************/
#include "graph_partition_assertions.h"
#inc... | ALGO | 0.999156 | 4.958121 |
b4ba81dd-4f5a-43f0-a20e-1a1213487c8f | muhimin30/Other-OJ-Practice | UVA_583.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define bismillah() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(16);cout.setf(ios::fixed,ios::floatfield);
#define endl '\n';
const int sz = 1e5 + 23;
int mx = 1e5;
bitset<sz> is... | ALGO | 0.999232 | 3.822133 |
667b5032-7c84-404f-8e75-82f85080325f | ishandutta2007/codeforces | riverhamster/normal/538/H.cpp | #include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <vector>
#include <cassert>
using namespace std;
#define LOG(f...) fprintf(stderr, f)
using ll = long long;
template<class T> void read(T &x) {
char ch; x = 0;
int f = 1;
while (isspace(ch = getchar()));
i... | ALGO | 0.999973 | 3.994993 |
1c4ad587-3541-4f49-9d77-da82f1fad37b | drakawa/simgrid_cs_trace | simgrid-v3.35/src/smpi/colls/allgather/allgather-ompi-neighborexchange.cpp | /*
* ompi_coll_tuned_allgather_intra_neighborexchange
*
* Function: allgather using N/2 steps (O(N))
* Accepts: Same arguments as MPI_Allgather
* Returns: MPI_SUCCESS or error code
*
* Description: Neighbor Exchange algorithm for allgather.
* Described by Chen et.al. in
* ... | ALGO | 0.999866 | 5.624367 |
ef25c163-a644-4cef-a54c-e37f0a6323c1 | chjXu/multi_human_pose_estimation | src/human_identify.cpp | #include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <opencv2/highgui/highgui.hpp>
#include <cv_bridge/cv_bridge.h>
#include <opencv2/opencv.hpp>
#include <opencv2/aruco.hpp>
#include <string>
#include <iostream>
#include <sstream>
#include <array>
#include <opencv2/core/core.hpp>
#include <pthrea... | TOOL | 0.921317 | 4.285729 |
fb53d7a9-2d65-4b7d-83de-552778ea4e3c | npkhang99/Competitive-Programming | UVa/10114.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
const int N=109;
int n, m;
double a[N]={}, loan, downpayment;
int main(){
ios::sync_with_stdio(false);
while(cin>> n>> downpayment>> loan>> m, n>0){
int last = -1;
for(int i=0; i<m; i++){
int month; double val;
... | ALGO | 0.999665 | 3.080657 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.