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 |
|---|---|---|---|---|---|---|
fc3dfa36-19c6-404e-9e9c-ee70a3117382 | MeowSalsa/Comp585 | 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.9988 | 6.76073 |
a9c8ece0-68aa-4ce3-849d-87cae6f7359b | Centre-of-Circle/problem-solving | codeforces/A. Twin Permutations/solution of ziyad-md.cpp | //--------------MAN!!! It's so beautiful!
#include <bits/stdc++.h>
using namespace std;
#define ll long long
using vi = vector<int>;
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
using pll = pair<ll, ll>;
#define endl "\n"
void setIO(string name = "")
{
if (sz(name))
{
freopen((name + ".... | ALGO | 0.999931 | 3.602622 |
5a72d124-f7aa-43f7-b175-7b69d4c00de2 | EASINTUHA/Coding-Journey-reset | April 2025 past/Square_String.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x)... | ALGO | 0.999833 | 4.325708 |
19c21728-2b77-4ebd-8961-0e7089ac1cb1 | rachitgupta0007/GraphsCM | 4_bfs/1_BFS_GraphTraversal.cpp | #include <bits/stdc++.h>
using namespace std;
class Graph
{
public:
int V;
list<int> *l;
Graph(int v)
{
V = v;
l = new list<int>[v];
}
void addEdge(int i, int j, bool undir = true)
{
l[i].push_back(j);
if (undir)
{
l[j].push_back(i);
... | ALGO | 0.999939 | 5.176668 |
c9477865-2e78-4459-802b-65cedadd9678 | shermz-lim/kattis-problems | electricaloutlets.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int k;
cin >> k;
int tot, o;
tot = 0;
for (int j = 0; j < k; j++) {
cin >> o;
tot += (o - 1);
}
tot += 1;
cout << tot ... | ALGO | 0.998572 | 3.403585 |
2878a43d-68e9-4294-b1de-f3a9dcb9bb37 | anagorko/informatyka | home/Miziol/ciekawe_liczby.cpp | //wymaga --std c++11
#include<iostream>
using namespace std;
bool p[100000];
void sito()
{
for (int i = 0; i < 100000; i++)
{
p[i] = true;
}
for (int i = 2; i < 100000; i++)
{
if ( p[i] )
{
for ( int j = i * 2; j < 100000; j = j + i)
{
p[j] = false;
}
}
}
return;
}
int odwr( int nor )
... | ALGO | 0.998792 | 3.260795 |
0b9b4fbd-a242-405c-9c15-3addfa824162 | tfninjadoom/5327_lemlib_code | src/lemlib/pid.cpp | /**
* @file src/lemlib/pid.cpp
* @author LemLib Team
* @brief FAPID class member definitions
* @version 0.4.5
* @date 2023-01-15
*
* @copyright Copyright (c) 2023
*
*/
#include <iostream>
#include <math.h>
#include "lemlib/pid.hpp"
#include "lemlib/util.hpp"
#include "lemlib/logger.hpp"
// define static vari... | ALGO | 0.929466 | 5.33746 |
510db516-98d0-4428-9c01-198fcfc3566e | Andwerpz/Competitive-Programming-Practice | - cpp -/platformplacing.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
//ICPC North America Qualifier 2022 H
ll solve(vector<ll>& a, ll s, ll k) {
ll n = a.size();
ll ans = 0;
vector<ll> radii(n, 0);
for(int i = 0; i < n; i++){
radii[i] = s;
}
bool isValid = true;
vector<ll> diff(0);
... | ALGO | 0.999947 | 4.532072 |
720b4e89-5967-4a97-a01f-159fd99fb994 | kohyatoh/contests | aoj/0013/0013.cpp | #include <stdio.h>
#include <vector>
using namespace std;
int main() {
vector<int> v;
int a;
while (scanf("%d", &a) != EOF) {
if (a != 0) v.push_back(a);
else {
printf("%d\n", v.back());
v.pop_back();
}
}
return 0;
}
| ALGO | 0.999724 | 3.416767 |
03acc762-bc01-46ba-91b0-d126b700dce5 | sidvarun/dsa | Leetcode Topicwise/slidingWindow/1004. Max Consecutive Ones III.cpp | https://leetcode.com/problems/max-consecutive-ones-iii/
https://leetcode.com/problems/max-consecutive-ones-iii/discuss/247564/JavaC%2B%2BPython-Sliding-Window
class Solution {
public:
int longestOnes(vector<int>& nums, int k) {
int n = nums.size();
int res = 0;
int i = 0;
int j = 0... | ALGO | 0.999826 | 6.173165 |
d276259f-6240-4ec5-bc14-5aeb43191dec | ishandutta2007/codeforces | ooops_no/normal/1687/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ld double
#define ll long long
mt19937 rnd(51);
signed main() {
#ifdef LOCAL
freopen("input.txt", "r", stdin);
#endif // LOCAL
ios_base::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--) {
int n, m;
... | ALGO | 0.999982 | 4.184814 |
bc35fb19-8e31-4455-b869-c2c40868bef0 | vsharkovski/Competitive-Programming | Programs/Mendo/Polica.cpp | #include <iostream>
#include <algorithm>
//#include <vector>
struct element {
int value;
int x_index;
};
bool sort_ascend(element i, element j) {
return i.value < j.value;
}
bool sort_descend(element i, element j) {
return i.value > j.value;
}
int main() {
int n, k;
std::cin >> n >> k;
... | ALGO | 0.999978 | 3.331877 |
424abd86-8bd6-4942-a5e3-779529eef0f6 | ishandutta2007/codeforces | sexpert/normal/1239/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, sum = 0, mn = 0, pos = 0;
string s;
cin >> n >> s;
for(int i = 0; i < n; i++) {
if(sum < mn) {
mn = sum;
pos = i;
}
sum += (s[i] == '(');
sum -= (s[i] == ')');
}
... | ALGO | 0.999949 | 4.054688 |
41f4dcff-211d-4047-99b5-c9b0249e4ee9 | aanyasirohi/rock_paper_scissor | 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.9988 | 6.76073 |
791dd206-0ca2-410c-b522-3bf50c1a8a5b | SAMeh-ZAGhloul/SOC2 | wazuh/src/engine/source/base/src/utils/stringUtils.cpp | #include "utils/stringUtils.hpp"
namespace base::utils::string
{
std::vector<std::string> split(std::string_view str, const char delimiter)
{
std::vector<std::string> ret;
if (!str.empty() && str[0] == delimiter)
{
str = str.substr(1);
}
while (true)
{
auto pos = str.find(deli... | TOOL | 0.966387 | 7.021532 |
040984a7-11ee-4158-b8ff-0c02fe280401 | kuailedeguisu/GeneralKnowledgeSummary | sourceCode/cpp1xy_code/NonModifyingAlgorithms/SumAndProd.cpp | #include <algorithm>
#include <functional>
#include <vector>
#include <iostream>
using namespace std;
// Function template to populate a container of ints.
// The container must support push_back().
template<typename Container>
void populateContainer(Container& cont)
{
int num;
while (true) {
cout << "Enter a num... | ALGO | 0.994092 | 5.992361 |
da280bed-a06d-4d02-b1d8-4f3df2580cf7 | RGillett/ProjectEuler | cpp/025_1000DigitFibonacciNumber.cpp | /******************************************************************************
* Program:
* 1000 Digit Fibonacci Number
* Author:
* Ryan Gillett
******************************************************************************/
#include <iostream>
#include <cstdlib>
#include "BigInt.h"
using namespace std;
/****... | ALGO | 0.999689 | 4.656661 |
25bfef85-6181-4c63-b699-5e86b00debfe | akhilpandit09/DSA-with-cpp | patterns/30_pattern.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int row, n, col;
char name = 'A';
cout << "Enter a number (5): ";
cin >> n;
for (row = 1; row <= n; row++)
{
for (col = 1; col <= n - row; col++)
{
cout << " ";
}
for (col=1; col<=row; col++)
... | ALGO | 0.99983 | 4.590553 |
cb3ac6e4-a263-4f04-a4e5-29a68d20d1f3 | AyadiMohamed/leave-management-mobile-application | 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.998859 | 6.785645 |
26908a90-9fa7-4531-a75e-09ac567f3f09 | madhavkataria1010/DSA-HW | Lab1/7.cpp | /*You are given a matrix as input. This matrix contains 0โs and 1โs. Now check all four corners of this matrix. If all the corners contain 1 then the program returns True (print "1") else it returns False (print "0"). If there are no rows present inside the matrix or no four distinct corner elements present, then also ... | ALGO | 0.999973 | 4.243804 |
1ffc26d7-d16e-4a78-9872-b97abc86b7ca | miguelpaniaguamuela/sack3d | LastBearStanding/src/World.cpp |
#include "PathFinding/Lista.h"
#include "PathFinding/Nodo.h"
#include "MyContactListener.h"
#include "BearManager.h"
#include "PlayerRed.h"
#include "Teleport.h"
#include "Metralla.h"
#include "Particle.h"
#include "Platform.h"
#include "Spawner.h"
#include "Cogible.h"
#include "Camera.h"
#include "Player.h"
#include ... | TOOL | 0.894857 | 3.853176 |
33cf3b73-e9e5-4ddd-90df-94a485614d0d | Ryukijano/B3tt3r | spann3r/croco/models/curope/curope.cpp | #include <torch/extension.h>
// forward declaration
void rope_2d_cuda( torch::Tensor tokens, const torch::Tensor pos, const float base, const float fwd );
void rope_2d_cpu( torch::Tensor tokens, const torch::Tensor positions, const float base, const float fwd )
{
const int B = tokens.size(0);
const int N = to... | DATA | 0.901163 | 6.262587 |
6df2cbca-9f81-4900-b6a4-694182d1584b | jorgehr12345/GPCFIIS25-1 | semana9-dijkstra/dijkstra.cpp | #include <bits/stdc++.h>
#define pb push_back
using namespace std;
typedef long long ll;
const ll MX = 1e5 + 2;
const ll INF = 1e18 + 2;
vector<pair<ll, ll>> adj[MX];
set<pair<ll, ll>> sepa;
ll distancia_minima[MX], primer_ancestro[MX];
void dijkstra(ll root) { // (n + m) * (log2 n)
sepa.insert(make_pair(0, roo... | ALGO | 0.999974 | 4.39233 |
8f2c986c-3819-4e0a-bdf6-e63f48031fe4 | vovatatarinov/labWorks | ratio/ratio.cpp | #include <iostream>
#include <sstream>
using namespace std;
class ratio
{
private:
int num, den;
void reduce();
//int numOfDig(int n);
int gcd(int n, int m);
int lcm(int a, int b);
public:
ratio();
ratio(int n, int d);
void set(int, int);
... | ALGO | 0.998465 | 4.832661 |
31091f9a-fc98-4672-83b5-0e5f18cc29be | ViBRUS/HackerRank-Problem_Solving | 03_Compare-the-Triplets.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
// Complete the compareTriplets function below.
vector<int> compareTriplets(vector<int> a, vector<int> b) {
int ptA=0,ptB=0;
vector<int> res(2);
for(int i=0;i<a.... | ALGO | 0.999945 | 5.312942 |
816f6d04-0bfa-4db2-a9d1-5218c730b506 | tashagrc/Codeforces-solution | longword.cpp | #include <stdio.h>
#include <string.h>
// https://codeforces.com/problemset/problem/71/A
int main() {
int in;
scanf("%d", &in);
for(int i = 0; i < in; i++) {
char str[101];
scanf("%s", str);
if(strlen(str) > 10) {
printf("%c%d%c\n", str[0], strlen(str) - 2, str[strlen(str)-1]);
}
else {
printf("%s\n... | ALGO | 0.999439 | 3.133537 |
6fb046d0-6cf7-463e-a0a3-88813d5f0c8f | legend507/MyLeetCodeSolutions | LeetCodeNo.546[tooHard]/main.cpp | #include <iostream>
#include <queue>
#include <functional>
#include <stack>
#include <string>
#include <unordered_set>
#include <sstream> // istringstream and ostringstream
#include <set>
#include <climits>
#include <algorithm>
#include <unordered_map>
#include <vector>
#include <map>
using namespace std;
st... | ALGO | 0.999534 | 4.995468 |
2af5ccf4-da58-4ed0-886d-f651fa7342dd | yitianhao/gpu_sched_new | gpu-sched-exp/minor/boost_1_61_0/libs/math/example/nc_chi_sq_example.cpp | // Caution: this file contains Quickbook markup as well as code
// and comments, don't change any of the special comment markups!
//[nccs_eg
/*`
This example computes a table of the power of the [chi][super 2]
test at the 5% significance level, for various degrees of freedom
and non-centrality parameters. The table... | ALGO | 0.927015 | 5.402257 |
930d5542-2c37-41ab-b1cf-5ad4d5881ca2 | JonathanJdeKoning/Problems | Problems/atcoder/ABCA/370.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
if (A+B == 1) {
if (A == 1)
cout << "Yes";
else
cout << "No";
} else {
cout << "Invalid";
}
} | ALGO | 0.999748 | 3.310732 |
8da21806-c3ca-4832-b5ea-59636fdfe6d3 | exmex/HC | Client/Code_Core/cocos2dx/platform/third_party/winrt/angleproject/src/compiler/depgraph/DependencyGraphBuilder.cpp | #include "compiler/depgraph/DependencyGraphBuilder.h"
void TDependencyGraphBuilder::build(TIntermNode* node, TDependencyGraph* graph)
{
TDependencyGraphBuilder builder(graph);
builder.build(node);
}
bool TDependencyGraphBuilder::visitAggregate(Visit visit, TIntermAggregate* intermAggregate)
{
switch (inte... | ALGO | 0.883137 | 7.513563 |
6c149012-0b7b-48e2-b96c-48ed21971aba | ANUJ0MUNJAL/LeetCode-POTD | 3500-minimum-cost-for-cutting-cake-ii/minimum-cost-for-cutting-cake-ii.cpp | class Solution {
public:
long long minimumCost(int m, int n, vector<int>& h, vector<int>& v) {
sort(h.rbegin(),h.rend());
sort(v.rbegin(),v.rend());
long long counth=1,countv=1;
long long i=0,j=0;
long long ans=0;
while(i < h.size() and j < v.size()){
... | ALGO | 0.999954 | 5.422109 |
95658fcc-da28-4bab-89bb-97ba8db34ff8 | VeganMoney/vegan | src/kernel.cpp | #include <boost/assign/list_of.hpp>
#include "kernel.h"
#include "txdb.h"
using namespace std;
typedef std::map<int, unsigned int> MapModifierCheckpoints;
// Hard checkpoints of stake modifiers to ensure they are deterministic
static std::map<int, unsigned int> mapStakeModifierCheckpoints =
boost::assign::map_l... | ALGO | 0.990791 | 5.833631 |
f12da59e-051a-4d6a-9011-a1f9af59ff76 | nvdungyb/DSA | Bai20_dat_ten_2_cach_2.cpp | #include<bits/stdc++.h>
using namespace std;
int n, k, ok;
int a[20];
void genNext()
{
int i = k;
while(a[i] == n-k+i)
{
i--;
}
if(i == 0)
ok = 1;
else{
a[i]++;
for(int j = i+1; j <= k; j++)
a[j] = a[j-1]+1;
}
}
void display()
{
for(int i = 1; i <= k; i++)
cout<<char('A'+a[i]-1);
cout<<endl;
}
... | ALGO | 0.99957 | 3.933147 |
c4ceac42-4615-4ca5-82b4-59bd87ba302c | Richarani-tarase/leetcode | 1701-average-waiting-time/1701-average-waiting-time.cpp | class Solution {
public:
double averageWaitingTime(vector<vector<int>>& c) {
int time=c[0][0];
double a=0;
for(int i=0;i<c.size();i++)
{
if(time<c[i][0]){
time=c[i][0]+c[i][1];
}
else{
time+=c[i][1];
}
... | ALGO | 0.999929 | 5.366055 |
925cadc5-5293-44d8-ba4b-8fa59cce32f2 | zhangyilin/leetcode | leetcode/sqrt.cpp | class Solution {
public:
int sqrt(int x) {
// Note: The Solution object is instantiated only once and is reused by each test case.
if (x <= 0) return 0;
if (x == 1) return 1;
int n = 0;
int y = x;
while (y != 1){
n++;
y >>= 1;
}
int half_n = n/2;... | ALGO | 0.999969 | 5.443911 |
cadfa87f-a5e7-46e0-9589-7bb970b2ccc9 | Arya-Gupta/CP-31-Sheet | 1829B.cpp | // https://codeforces.com/problemset/problem/1829/B
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int n, num, count = 0, max_len = 0;
cin >> n;
for(int i = 0; i < n; i++){
cin >> num;
if(num == 0) count++;
... | ALGO | 0.999849 | 4.607211 |
2ea35418-7411-4b85-826c-c93099e0fa28 | iman1999/acm | UVA/10050.cpp | #include<iostream>
#include<algorithm>
#include<math.h>
#include<stdio.h>
#include<string>
#include<vector>
#include<iomanip>
#include<map>
#include <cstdlib>
#include <cstdio>
#include<cmath>
#include <cstring>
#include<bitset>
#include<queue>
#include<list>
#include<sstream>
#include<functional>
#include<limits.h>
#... | ALGO | 0.995445 | 3.363014 |
20a691f4-d3d5-4617-8c19-619e55152eb4 | Cube1998/CubeCalculator | Cubelator/cocos2d/cocos/math/CCAffineTransform.cpp | #include "math/CCAffineTransform.h"
#include <algorithm>
#include <math.h>
using namespace std;
NS_CC_BEGIN
AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty)
{
AffineTransform t;
t.a = a; t.b = b; t.c = c; t.d = d; t.tx = tx; t.ty = ty;
return t;
}
Vec2 __CCPoint... | TOOL | 0.921613 | 6.373181 |
040195ab-78a2-4d30-b276-29af326ffc5a | LeenaAlmekkawy/Binary-Search-Tree-Implementation | src/binarytree.cpp | #include"../include/binarytree.h"
BstNode* GetNewNode(int data)
{
BstNode* newNode = new BstNode();
newNode->data = data;
newNode->left = newNode->right = NULL;
return newNode;
}
BstNode* Insert (BstNode* root, int data)
{
if(root == NULL)
{
//empty tree
root = GetNewNode(data)... | ALGO | 0.999866 | 4.267797 |
78dec024-2f44-45a6-a4c2-401239f3dd9b | letangphuquy/project-CRP | src/quy22.cpp | #include<bits/stdc++.h>
using namespace std;
#include "template.hpp"
#include "logger.hpp"
/*
Quy, Le Tang Phu 's algorithm
* New representation: Embed a permutation at beginning
+ New gene means: Move the priority of that stack to top
+ Fitness evaluation: traverse the permutation (consider stacks according ... | ALGO | 0.999244 | 4.303847 |
39b5c00c-4209-4ef0-bd53-c9eb7d7d6a76 | ishandutta2007/codeforces | alvingogo/normal/1559/C.cpp | #include <iostream>
#include <vector>
#define fastio cin.tie(0);ios_base::sync_with_stdio(0);cout.tie(0);
using namespace std;
int main(){
fastio;
int t;
cin >> t;
while(t--){
int n;
cin >> n;
vector<int> v(n);
for(int i=0;i<n;i++){
cin >> v[i];
}
if(v[0]==1){
cout << n+1 << " ";
for(int i=1;i... | ALGO | 0.999977 | 3.475123 |
1aea121f-37cb-4c8f-94a5-1429f1d69d82 | notacallforhelp/cf_practice | 1300-1500/sakurakofield.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long int ll;
typedef long double ld;
//ordered_sets
template <typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics... | ALGO | 0.999722 | 4.602481 |
d99fa246-be8e-4e09-b378-4b1b51eb612b | ishandutta2007/codeforces | lackadaisical_lad/normal/1034/B.cpp | #include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
using ll = long long;
void solve() {
ll n, m;
cin >> n >> m;
if (n > m)
swap(n, m);
if (n == 1) {
cout << ((m / 6 * 3) + (m % 6 > 3 ? m % 6 - 3 : 0)) * 2 << '\n';
... | ALGO | 0.999988 | 4.761401 |
f1678fbf-2f8d-4fbf-b746-6aaf5b7665ba | sarvex/leetcode-d | lcof2/ๅๆ Offer II 095. ๆ้ฟๅ
ฌๅ
ฑๅญๅบๅ/Solution.cpp | class Solution {
public:
int longestCommonSubsequence(string text1, string text2) {
int m = text1.size(), n = text2.size();
vector<vector<int>> dp(m + 1, vector<int>(n + 1));
for (int i = 1; i <= m; ++i) {
for (int j = 1; j <= n; ++j) {
if (text1[i - 1] == text2[j... | ALGO | 0.999897 | 6.551761 |
889a643f-78f5-4da5-8abc-8323db935a34 | Simrankumari-tech/LL-and-GfG | 18_whileloop.cpp | #include<iostream>
using namespace std;
void printREverse(int n){
int multiplier = 10;
while (multiplier>=1){
cout << n * multiplier << " ";
multiplier--;
}
}
int main(){
int n;
cin >> n;
printREverse(n);
return 0;
} | ALGO | 0.999761 | 3.83526 |
1dc509f2-d0ed-495b-b7f0-1a21f68fc97b | LvstoneF/Mycode- | Design and Analysis of Algorithms/BinarrSearch.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
template<class T>
int BinarrSearch(T *a, int size, T x)
{
int right = size-1;
int left = 0;
while(right >= left)
{
int middle = (right+left)/2;
if(a[middle] == x)
return middle;
if(a[middle] > x)
... | ALGO | 0.999391 | 3.765578 |
10b70b35-0dc0-4bbd-8191-569c8dbb9ec5 | darwin/boost | libs/program_options/example/multiple_sources.cpp | /* Shows how to use both command line and config file. */
#include <boost/program_options.hpp>
namespace po = boost::program_options;
#include <iostream>
#include <fstream>
#include <iterator>
using namespace std;
// A helper function to simplify the main part.
template<class T>
ostream& operator<<(ostream& os, cons... | TOOL | 0.902434 | 6.885257 |
dd894588-a532-4f5d-a42d-923a3720fc21 | horbyn/Roadmap | OJ/LeetCode/#524.cpp | // ้ขๆ๏ผๅ ้ค s ไธญๆไบๅญ็ฌฆ๏ผไนๅ่ฝๅน้
ไธๅญๅ
ธไธญ็ไธฒ๏ผ้ฃ่ฟไธชไธฒๅฐฑๅฏ่ฝๆฏ็ญๆก
// ๅๆ้๏ผไธไธชๆๅ s ๅฆไธไธชๆๅ dic[]๏ผ็ถๅๅฏนๆฏ
class Solution {
public:
string findLongestWord(string s, vector<string>& dictionary) {
int idx = -1, size1 = dictionary.size();
int size2 = s.size(), size3 = 0;
for (int k = 0; k < size1; ++k) {
int i = 0, j... | ALGO | 0.99988 | 5.64156 |
8f896b36-9dbc-47b7-9f23-faf8c36c331f | ethan89009/engineering-survival-guide | SE-OOPS(LAB)/exp5/prog9.cpp | //to compare two class objects using relational operators , implement using friend functions
#include<iostream>
using namespace std;
class num
{
int x;
public:
num()
{
x=0;
}
num(int x)
{
this->x=x;
}
friend int operator>(num &,num &);
friend int operator<(num &,num &... | ALGO | 0.977482 | 4.247979 |
18e5d5fe-ffad-45bc-9036-fda265b0830c | yashsiwach/DSA-Notes | Introduction_to_2D_Arrays_12th February 2023/Ques-5_Transpose_of_Matrix.cpp | #include<iostream>
using namespace std;
void transpose(int arr[][3],int rows,int cols){
for(int i = 0;i<rows;i++){
for(int j = 0;j<i;j++){
swap(arr[i][j],arr[j][i]);
}
}
}
int main(){
int arr[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
int rows = 3;
int columns = 3;
cout<<"Pr... | ALGO | 0.999917 | 4.218817 |
6c068ec4-7d51-4b5d-9c2c-d1d775ea6220 | sfu-dis/optiql | index-benchmarks/indexes/ARTLC/N256.cpp | #include <assert.h>
#include <algorithm>
#include "N.h"
namespace ART_OLC {
bool N256::isFull() const { return false; }
bool N256::isUnderfull() const { return count == 37; }
void N256::deleteChildren() {
for (uint64_t i = 0; i < 256; ++i) {
if (children[i] != nullptr) {
N::deleteChildren(children[i])... | ALGO | 0.887974 | 4.704606 |
0cebeffa-81ef-4e32-9384-dd15d37b095b | wzl1898/-1 | uploaded_files/wzl/cities and states.cpp | #include<iostream>
#include<string>
#include<map>
using namespace std;
map<string, int>Map;
int N;
string a, b;
int main()
{
cin >> N;
int i;
int ret = 0;
for (i = 0 ; i < N; i++)
{
cin >> a >> b;
a = a.substr(0, 2);
if (a != b)
{
ret += Map[a + b];
Map[b + a] = Map[b + a] + 1;
}
}
cout << ret;
... | ALGO | 0.999588 | 3.961802 |
88955b42-5292-4a06-9a86-3089e5161b2f | jacklynchiaentsai/zerojudge-practices | d038/d038.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// observe fibonacci sequence
// maximum of n = 50
long long int F[50];
F[0] = 1;
F[1] = 2;
for (int i =2; i<50; i++){
F[i] = F[i-1] + F[i-2];
}
int n;
while (cin>>n){
if (n ==0) break;
cout<< F[n-1]<< endl;
}
}
| ALGO | 0.999972 | 4.689438 |
837db29d-19cf-4013-b314-e92119cd0723 | Jooye0n/Algorithm | BAEKJOON/CPP/2352.cpp | #include <iostream>
#include <algorithm>
#include <cstring> //memset
using namespace std;
const int MAX = 40000;
int N;
int connect[MAX + 1];
int cache[MAX + 1];
//O(n^2)๋ ์๊ฐ์ด๊ณผ
/*
int portLIS(int leftPort)
{
int &result = cache[leftPort + 1];
if (result != -1)
return result;
... | ALGO | 0.999955 | 4.473043 |
8bf89547-bbf6-4d5a-81e2-6180a99859ed | Nadzmi-Freelance/Central-Tendency-Snap | tess-two/jni/com_googlecode_tesseract_android/src/wordrec/outlines.cpp | /*----------------------------------------------------------------------
I n c l u d e s
----------------------------------------------------------------------*/
#include "outlines.h"
#include "wordrec.h"
#ifdef __UNIX__
#include <assert.h>
#endif
namespace tesseract {
/*--------------------------------... | ALGO | 0.999865 | 5.745006 |
8dbcfb07-0418-439d-b2be-b2bdbab39ddb | en30/online-judge | atcoder/abc048_b.cpp | #include <bits/stdc++.h>
#include "../include/template"
int main() {
ll a, b, x;
cin >> a >> b >> x;
cout << b / x - (a == 0 ? -1 : (a - 1) / x) << endl;
return 0;
}
| ALGO | 0.999744 | 3.937108 |
fd256cd0-ce17-4950-a53a-4d1b379e12d1 | MeghnaS21/SdeSheetChallenge | stockbuysell/solution.cpp | #include <bits/stdc++.h>
int maximumProfit(vector<int> &prices){
int maxnum = 0;
int minnum = INT_MAX;
for (int i = 0; i < prices.size(); i++) {
minnum = min(minnum, prices[i]);
maxnum = max(maxnum, prices[i] - minnum);
}
return maxnum;
}
| ALGO | 0.999423 | 5.378752 |
81431eff-7966-4e35-8cc7-23f9c4bf091a | Shuhua-Group/AdmixSim2 | src/Utils.cpp | /****************************************
* Project Name: AdmimxSim 2
* File Name: Utils.cpp
* Author: Rui Zhang
* Date: July 7, 2020
****************************************/
#include "Utils.hpp"
#include <cmath>
#include <sstream>
#include <iomanip>
int findFloatPos(const std::vector<double> &poss, const doubl... | TOOL | 0.975633 | 5.125241 |
d695bdf4-b04f-40ae-8fab-ec04e9b878f3 | exolorethan/ethanexo | src/support/lockedpool.cpp | #include <support/lockedpool.h>
#include <support/cleanse.h>
#if defined(HAVE_CONFIG_H)
#include <config/ethanexo-config.h>
#endif
#ifdef WIN32
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501
#define WIN32_LEAN_AND_MEAN 1
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#else
#... | TOOL | 0.869983 | 7.379884 |
68b7031a-175c-4d69-8276-4009d16fb7a5 | Vesion/Misirlou | hihocode/1494-BrickWall.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <unordered_map>
using namespace std;
int main() {
unordered_map<int,int> m;
int N; cin >> N;
for (int i = 0; i < N; ++i) {
int C; cin >> C;
int w; cin >> w;
for (int j = 1; j <... | ALGO | 0.99966 | 3.728607 |
a08b15b9-1b9a-4a65-9efc-deac558030a7 | Tanishkagathara7/Flutter | 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 |
a583b587-0d49-4028-8a8f-0957ae59da3e | satyam4484/CP | codeforces/queueAtSchool.cpp | // problem link --> https://codeforces.com/problemset/problem/266/B
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mod 1000000007
#define inf 1e18
#define ump unordered_map
#def... | ALGO | 0.999931 | 4.099416 |
0c58d781-816e-4110-b029-70463dda9849 | cemu-project/Cemu | src/Cafe/HW/Espresso/Recompiler/PPCRecompilerImlGen.cpp | #include "Cafe/HW/Espresso/Interpreter/PPCInterpreterInternal.h"
#include "Cafe/HW/Espresso/Interpreter/PPCInterpreterHelper.h"
#include "Cafe/HW/Espresso/EspressoISA.h"
#include "PPCRecompiler.h"
#include "PPCRecompilerIml.h"
#include "IML/IML.h"
#include "IML/IMLRegisterAllocatorRanges.h"
#include "PPCFunctionBoundar... | TOOL | 0.932181 | 6.299852 |
254f1e9f-357d-4643-aaf6-4e06aac35886 | vatsayash/CodeForces | CF677/A.cpp | #include <bits/stdc++.h>
#include <iterator>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <math.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vector<int> >
#define vl vector<long long>
#define vc vector<char>
#define vvc vector<vector<char> >
#define vpi vec... | ALGO | 0.999702 | 4.990433 |
4667322f-5340-4d16-9f4b-34250edcedc1 | BadhonAhmad/Codeforces-Solve | G_Together_Square.cpp | #include<bits/stdc++.h>
#define int long long
#define endl "\n"
using namespace std;
const int N = 1e6 + 10;
vector<int> prime_divisor[N];
int32_t main()
{
for (int i = 2; i < N; i++){
if(prime_divisor[i].empty()){
for (int j = i; j < N; j+=i){
prime_divisor[j].push_back(i);
... | ALGO | 0.999904 | 4.544329 |
a442f405-05ca-45e7-8e42-26ab91d9475a | Akshitguptaa/cp | cp/E_Klee_s_SUPER_DUPER_LARGE_Array.cpp | //// AKSHIT - template ////
#include <bits/stdc++.h>
#include<chrono>
#include<unordered_set>
using namespace std;
typedef long long int int64;
typedef unsigned long long int uint64;
#define int long long
#define endl "\n"
#define INF LLONG_MAX
#define MOD 1000000007
#define PI 3.1415926535897932384626433832795
// ... | ALGO | 0.999861 | 4.578889 |
02dacfa6-877a-4c6e-80f6-ac7a471eb5f2 | yehudisimon/ttbar | tt_MG/MyCodeResum/main.cpp | // ************************************************************************* //
// Includes //
// ************************************************************************* //
// -------- Standard headers -------------------------- //
#include <iostream> ... | DATA | 0.99542 | 4.561252 |
4d541b06-4d5b-4bd3-8cd9-fd4cbb43f95c | Yang890912/Leetcode | LeetCode/Medium/2780-minimum-index-of-a-valid-split/2780-minimum-index-of-a-valid-split.cpp | class Solution {
public:
int minimumIndex(vector<int>& nums) {
int cnt = 0, dominant = 0;
for (int i = 0; i < nums.size(); i++){
if (cnt == 0) dominant = nums[i];
cnt += (nums[i] == dominant) ? 1 : -1;
}
int numOfDominant = count(nums.begin(), nums.end(), dom... | ALGO | 0.999996 | 5.753756 |
908208d9-080f-4575-982f-74b0ba92cfec | Pavlograd/Piscine-CPP-2020 | cpp_d14m_2019/ex01/main.cpp | /*
** EPITECH PROJECT, 2020
** main
** File description:
** main
*/
#include "FruitBox.hpp"
#include "Banana.hpp"
#include "Lemon.hpp"
#include "Lime.hpp"
#include "LittleHand.hpp"
#include <iostream>
void print_box_content(FruitBox input, std::string name_box)
{
std::cout << "==== " << name_box << " (size : " <<... | TOOL | 0.971588 | 4.925559 |
d092366b-6633-4602-a9f2-f4b145811370 | syntheticpp/zerobugs | typez/lookup_child.cpp | using namespace std;
typedef set<pair<RefPtr<SharedString>, addr_t> > SymSet;
namespace
{
class InfiniteRecursivityGuard : boost::noncopyable
{
SymSet& set_;
DebugSymbol *sym_;
public:
InfiniteRecursivityGuard(SymSet& set, DebugSymbol* sym)
: set_(set), sym_(sym)
... | TOOL | 0.915115 | 7.079001 |
924fa369-3ddd-450f-bc1e-9f0aafdae140 | shnoh171/problem-solving | backjoon-online-judge/10942-palindrome/palindrome.cpp | #include <iostream>
#include <vector>
using namespace std;
bool IsRange(int index, int size) { return index >= 1 && index <= size; }
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
vector<int> seq(n+1);
for (int i = 1; i < n+1; ++i)
cin >> seq[i];
vector<vect... | ALGO | 0.999907 | 4.422172 |
c0f4e288-3e7d-4e25-bd42-94426db0b20e | you-need-change/cPlusPlus_Record | charpt_six/function_demo1.cpp | #include <iostream>
using namespace std;
// ๅฝๆฐๅฃฐๆ
int foo(int);
// ๅฝๆฐๅฎไน
int foo(int n)
{
int res = 1;
for (int i = 0; i <= n; i ++ ) res *= i;
return res;
}
// ็ญไธๅจๅฝๆฐๅ
้จๅผไบไธไธชๅชๆ่ฏฅๅฝๆฐๅฏไปฅ็จ็ๅ
จ้จๅ้
int output()
{
static int cnt;
}
int main()
{
} | ALGO | 0.999223 | 3.956491 |
debfe84b-2f61-4929-9ecf-bad3308f5fa5 | Coalcoin-COAL/Coalcoin | src/rpcnet.cpp | #include "net.h"
#include "bitcoinrpc.h"
using namespace json_spirit;
using namespace std;
Value getconnectioncount(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getconnectioncount\n"
"Returns the number of connections to other nodes.");
... | WEB | 0.926101 | 6.646237 |
d5f196c2-5ed8-4acc-a326-1203cde997d1 | travp624/frameworks_base | media/libstagefright/codecs/aacdec/pns_left.cpp | /*
Pathname: pns_left.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Modified from original shareware code
Description: Brought code in-line with PV standards.
Merged PNS and Intensity blocks into one function.
Modifi... | ALGO | 0.996689 | 4.79338 |
7920bd98-b59e-41f7-9180-521acb824a1e | sgholap/CarND-Path-Planning-Project | src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
m << 1,-2,
-3,4;
cout << "1-norm(m) = " << m.cwiseAbs().colwise().sum().maxCoeff()
<< " == " << m.colwise().lpNorm<1>().maxCoeff() << endl;
cout << "infty-norm(m... | ALGO | 0.999486 | 4.076589 |
5ff353bc-cdcc-4039-a607-e4074573d676 | QuantumLoop1/ProjectC- | ัะบะฐะทะฐัะตะปะธ/ัะบะฐะทะฐัะตะปะธ/MAaartix.cpp | #include "matrix.h"
#include "arrays.h"
#include <iostream>
int** WorkingWithMatrix::lowTriangleMatrix(int size)
{
if (size <= 0)
{
throw std::out_of_range("Array length must be more than 0");
}
int** matrix = new int* [size];
for (size_t i = 0; i < size; i++)
{
int k = i + 1;
... | ALGO | 0.947934 | 5.390855 |
01bc9811-cd07-495d-b906-5d9cd51f9da0 | Shabes7171/DSA-Final | Recursion-Backtracking/Rat_in_maze_using_recursion.cpp | #include<bits/stdc++.h>
using namespace std;
//complete this function;
void helper(vector<vector<int>>&mat, int r, int c, string path, vector<string>&ans, vector<vector<bool>>&vist)
{
int n=mat.size();
if(r<0 || c<0 ||r>=n || c>=n || mat[r][c]==0 || vist[r][c]==true)
{
return ;
}
if... | ALGO | 0.999968 | 4.771619 |
219440ab-0ac3-42d6-a5ef-48f9ff458786 | dxFeed/labs-openjdk-17 | src/hotspot/share/gc/g1/g1BatchedGangTask.cpp | #include "precompiled.hpp"
#include "gc/g1/g1BatchedGangTask.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1GCParPhaseTimesTracker.hpp"
#include "runtime/atomic.hpp"
#include "utilities/growableArray.hpp"
void G1AbstractSubTask::record_work_item(uint worker_id, uint index, size_t count) {
G1Coll... | TOOL | 0.884708 | 7.212192 |
9cbbc03f-a742-4cfb-9486-79c8ddc0ce18 | 3agwa/CompetitiveProgramming | CodeForces/CF220-D1-B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<vector<int> > vvi;
typedef vector<pii> vii;
type... | ALGO | 0.999926 | 3.854843 |
27ebcc08-4cdd-40a8-b85b-34fee4fad4d7 | lballabio/QuantLib | ql/math/randomnumbers/sobolbrownianbridgersg.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*! \file brownianbridgersg.hpp
\brief interface class to map the functionality of SobolBrownianGenerator
to the "conventional" sequence generator interface
*/
#include <ql/math/randomnumbers/sobolbrownianbridgersg.hpp>
na... | ALGO | 0.994487 | 6.888462 |
439fa7e9-9e08-4567-989c-e4c645a91860 | spencerkohan/CoreEngine3D | Engine/Box2D/Box2D/Common/b2Math.cpp | #include <Box2D/Common/b2Math.h>
const b2Vec2 b2Vec2_zero(0.0f, 0.0f);
/// Solve A * x = b, where b is a column vector. This is more efficient
/// than computing the inverse in one-shot cases.
b2Vec3 b2Mat33::Solve33(const b2Vec3& b) const
{
float32 det = b2Dot(ex, b2Cross(ey, ez));
if (det != 0.0f)
{
det = 1.0f... | ALGO | 0.999264 | 6.95739 |
335210ba-8217-4e29-8a73-7bb760a831f0 | hiranoo/atcoder | lib/complex.cpp | struct P {
double a, b;
P(){}
P(double a, double b) : a(a), b(b) {}
P operator* (const P &p) {
return P(a*p.a-b*p.b, a*p.b+b*p.a);
}
P operator+ (const P &p) {
return P(a+p.a, b+p.b);
}
P operator- (const P &p) {
return P(a-p.a, b-p.b);
}
P operator/ (int d) {
return P(a/d, b/d);
}... | ALGO | 0.985784 | 3.655412 |
b83c707a-8544-461f-8961-94d8caf72239 | ishandutta2007/codeforces | basic_string/normal/1588/A.cpp | #include<bits/stdc++.h>
using namespace std;
map<int,int>ma,mb;
int main(){ios::sync_with_stdio(0),cin.tie(0);
int T,n,i,j,k;
for(cin>>T;T--;){
cin>>n;ma=mb={};
for(i=1;i<=n;++i)cin>>j,++ma[j];
for(i=1;i<=n;++i)cin>>j,++mb[j];
for(i=109;i>-109;--i){
if(mb[i]){
if(ma[i])mb[i]-=ma[i],ma[i]=0;
if(mb[i... | ALGO | 0.999928 | 3.269658 |
c53becf5-85e2-4f85-9175-69a4b12b9f72 | sunyongjie1984/cs_to_be_delete | template/dataStructureAndAlgorithm/dataStructureAndAlgo2Edition/sourceCode/library.cpp | #include <iostream>
#include <string>
#include <list>
#include <algorithm>
using namespace std;
class Patron; // forward declaration;
class Book {
public:
Book() {
patron = 0;
}
bool operator== (const Book& bk) const {
return strcmp(title,bk.title) == 0;
}
private:
char ... | TOOL | 0.981846 | 5.194301 |
8aa5dfdf-589a-4b8f-88f7-29652e2a7e07 | Nektonion/cpp | wave_for_table.cpp | #include<climits>
#include<iostream>
#include<queue>
#include<vector>
#include<cmath>
// Adjacency matrix, wave algorythm
// what is the smallest amount of steps is needed to reach i-node from 0-node?
using namespace std;
int main() // chess board 5x5
{
queue<int> q; ... | ALGO | 0.999832 | 3.939996 |
8b71682a-4834-4a4f-a51a-0b8b66889986 | zishahed/Kattis-Easy-problems | detaileddifferences.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
void solve()
{
string s1;
cin >> s1;
string s2;
cin >> s2;
string result = "";
for (int i = 0; i < s1.size(); i++)
{
if (s1[i] != s2[i])
result += '*';
else
result ... | ALGO | 0.999835 | 3.358518 |
51b1b102-c9b9-4f29-bbb2-ddb564313724 | csl-iisc/SUV-MICRO24 | llvm/llvm/tools/llvm-xray/xray-graph.cpp | #include "xray-graph.h"
#include "xray-registry.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/XRay/InstrumentationMap.h"
#include "llvm/XRay/Trace.h"
using namespace llvm;
using namespace llvm::xray;
// Setup llvm-xray graph subcommand and its options.
static cl::SubCommand GraphC("graph", "Generate funct... | CONFIG | 0.917505 | 7.609847 |
13ec4a00-76bf-4841-8b4f-18bdc0be4f1c | RPI-Game-Architecture-Spring-2020/homework-1-queuing-zenkdare | src/engine/framework/ga_sim.cpp | #include "ga_sim.h"
#include "ga_compiler_defines.h"
#include "entity/ga_entity.h"
#include "jobs/ga_job.h"
#if defined(GA_MINGW)
#include <malloc.h>
#endif
ga_sim::ga_sim()
{
}
ga_sim::~ga_sim()
{
}
void ga_sim::add_entity(ga_entity* ent)
{
_entities.push_back(ent);
}
void ga_sim::update(ga_frame_params* param... | ALGO | 0.914472 | 5.383578 |
920d2f27-81b5-46ea-ac2e-43c78de714e9 | Jitendra1mp4/prsu-mca-cpp-assignment | programs/swapWithAddress.cpp | #include<iostream>
using namespace std;
void printIntro(string topic, string time){
cout << "Program topic : " << topic<< endl ;
cout << "Author : Jitendra Kumar Sahu" << endl ;
cout << "Time : "<< time << endl ;
cout << "---------------*----------------"<< endl<< endl ;
}
void swap(int *a, int *b){
int temp = *... | ALGO | 0.998919 | 5.104182 |
e0e11b66-4e03-42a7-8528-168a9549590a | ram4279/cpp_data_structures_and_algorithms | By_Topic/TreeDS/bstree.cpp | #include <iostream>
#include <cstddef>
#include <cstring>
#include "bstree.h"
using namespace std;
typedef int (*tree_node_compare_t) (void*, void*);
typedef void (*tree_data_print) (void*);
void t_print_int(void *data)
{
printf("%d ", *(int *)data);
return;
}
void initialize_tree(BSTree* tree)
{
tree->... | ALGO | 0.999767 | 4.865219 |
03451cc5-a629-4d98-8232-ac0d4c1f46f9 | man0307/GraduationProjectByCPP | GraduationProject/JacobiIterationParallelAlgorithm.cpp | #include "pch.h"
#include "JacobiIterationParallelAlgorithm.h"
#include <math.h>
#include <windows.h>
#include<iostream>
#include<process.h>
using namespace std;
struct JacobiIterationContext{
public:
double** A;
double* B;
double* X;
double* result;
int index;
int N;
JacobiIterationContext(double** A, d... | ALGO | 0.999855 | 4.712902 |
daf0c834-e314-4222-b1fd-0487036355ef | zhanghangForStudy/android_system_core | adb/console.cpp | #include "sysdeps.h"
#include <stdio.h>
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/strings.h>
#include <cutils/sockets.h>
#include "adb.h"
#include "adb_client.h"
#include "adb_io.h"
#include "adb_utils.h"
// Return the console authentication command for the emulator, if... | TOOL | 0.982011 | 7.134289 |
569fdfc2-f14a-4fd4-8f5b-78d3a73aae4b | ruidexu/phys | Phys/JetAccessories/src/PFlowProtoFilter.cpp | // Include files
#include <boost/foreach.hpp>
// from Gaudi
#include "Event/ProtoParticle.h"
#include "GaudiAlg/GaudiAlgorithm.h"
#include "TrackInterfaces/ITrackSelector.h"
// from LHCb
#include "Event/ProcStatus.h"
#include "Event/RecVertex.h"
#include "KalmanFilter/FastVertex.h"
#include "LoKi/Constants.h"
#inclu... | ALGO | 0.854328 | 6.373345 |
2d8836fb-6d54-46be-a3b2-8b2e78d69e6a | itsgajraj/dsa-sublimeditor | mergesortin.cpp | #include<bits/stdc++.h>
using namespace std;
void display(vector<int> &v){
for(int i=0;i<v.size();i++){
cout<<v[i]<<" ";
}
}
void MergeSort(vector<int> &arr1, vector<int>& arr2, vector<int> &arr3) {
// code here
int i=0,j=0,k=0;
while(i<arr1.size() && j<arr2.size()){
if(arr1... | ALGO | 0.999976 | 4.141887 |
472f90da-2786-46b1-b42f-bc9d3ca4f7e0 | pari2dhi3/Hackerrank | stock_values.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
vector <int> p(20,0);
int i, sum, n, t, diff1, diff2, a;
cin >> t;
while(t--)
{
cin >> n;
for(i=0;i<n;i++)
cin >> p[i];
if(n%2==0)
{
for(i=1;i<(n-1);i++)
{
if((p[i-1]%2==0)&&(p[i+1]%2==0))
{
d... | ALGO | 0.999601 | 4.22785 |
5fe254f3-fbe8-4472-8e02-57a7bdd6d280 | Ultron011/DSA | BINARY SEARCH/MEDIUM/SEARCH IN ROTATED SORTED ARRAY/WITH UNIQUE ELEMENTS ONLY/searchInRotatedArray.cpp | /*
Problem Statement:
Given a rotated sorted array which may contain duplicates,
write a function to search for a target value. If the target is
found in the array, return its index. Otherwise, return -1.
You may assume no duplicate exists in the original array before rotation.
... | ALGO | 0.999974 | 6.838344 |
5ba77fad-69bb-4bd1-bf5e-3f9c80d3a965 | GonzaloPereira/CompetitiveProgramming | RPC/2021-02/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define FIO ios_base::sync_with_stdio(false), cin.tie(NULL);
#define N
int main(){
FIO;
int n; cin >> n;
vector<pair<int,int>> k(n);
for(int i =0 ; i < n ; i++){
int x; cin >> x;
k[i] = {i,x};
}
int curr = 0,new... | ALGO | 0.999987 | 4.395887 |
6e6d1e19-8202-4970-b278-893808d7c333 | shinigamirex888/6Companies30days | GoldmanSachs/Total_Decoding_Messages.cpp | #include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int CountWays(string str){
// Code here
int n=str.length();
int dp[n+1];
int mod = 1e9 + 7;
dp[0]=1;
dp[1]=1;
if(n==1 && str[0]!='0')
return 1;
if(str[0]=='0')
return 0;
... | ALGO | 0.999522 | 6.328086 |
3124f299-5769-43a0-aebe-b02dc7ba77c3 | phUR99/ps | 2024/24_ํ๋ฐ๊ธฐ/8~11/2602.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
string scroll;
string bridge[2];
int l, n;
/*
pos : start์ ๋ฐฐ์ด ์์น ์์๋ฅผ ๋ฐ๋๋ก ํด์ ๋ฉ๋ชจ๋ฆฌ ์ ๊ทผ ์ค๋ฅ๋จ
์์ ํ์ ์์ด๋์ด
ํ์ฌ ์์น์์ ์ฒดํฌํ ํ ๋ค์์ผ๋ก ๊ฐ ์ ์๋ ๋ชจ๋ ์์น์ ๋ํด์ ... | ALGO | 0.999671 | 4.053067 |
1a78bb06-0832-428b-a2c7-763f54faf175 | kunal299/Data-Structures-and-Algorithms | SDE Sheet by Striver/Recursion/6. Permutation Sequence/Approach - 2.cpp | /*
Time Complexity - O(n^2)
Space Complexity - O(1)
*/
class Solution {
public:
string getPermutation(int n, int k) {
int fact = 1;
string nums = "";
for(int i=1; i<=n; i++) {
fact *= i;
nums += (i+'0');
}
fact /= n;
... | ALGO | 0.999976 | 6.748145 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.