uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
66a21fcb-3515-4750-aa74-b1bd541287bc | vmmc2/Competitive-Programming | UVA 12515 - Movie Police.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
vector <string> m;
vector <string> c;
string aux, aux2;
int movies, clips;
int repeticoes, marcador, mark;
int contador;
int i;
int answer = 0, indmaior;
//int aux, answer;
scanf("%d %d", &movies, &clips);
for(i = 1;... | ALGO | 0.999798 | 3.600209 |
f7cfcb88-ffce-4d76-9269-02925c5c408e | PinkArmor/OOP-PTIT-v-B-i-Th-c-H-nh | bai1.cpp | #include <bits/stdc++.h>
using namespace std;
int b=1;
void thuong(string &s){
for(int i=0; i<s.size(); i++){
s[i] = tolower(s[i]);
}
}
class HocVien{
private:
string msv,ten,lop,date;
double gpa;
public:
friend istream &operator>>(istream &in, HocVien &a){
if(b<10) a.msv="B20DCCN00";
else a.msv="B20DCCN0";
... | ALGO | 0.969146 | 3.782352 |
6ba8602d-e1f1-4378-9265-9f488ed7f1f0 | kyohei8937/ProgramingContest | ABC/ABC209/ABC209_E_.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 1LL << 60;
const int MOD = 1000000007;
// マクロ
#define rep(i,n) for(int i=0;i<n;++i)
#define rep2(i,n,m) for(int i=n;i<m;++i)
#define ALL(x) (x).begin(),(x).end()
// 便利関数
// ...最小値・最大値交換
template<class T> inline bool chmin(T& a, T b) ... | ALGO | 0.999775 | 3.61979 |
57c20e6c-ad95-4e9c-ad8f-aeaaab6daea7 | wcscherer/high_perf_computing_amath583 | final/norm/mpi_norm.cpp | #include <vector>
#include <numeric>
#include <cmath>
#include <iostream>
#include <mpi.h>
#include <string>
#include "Timer.hpp"
#include "amath583.hpp"
double mpi_norm(const Vector& local_x) {
double global_rho = 0.0;
// Write me -- compute local sum of squares and then REDUCE
// ALL ranks should get the sam... | ALGO | 0.99535 | 5.28257 |
e9a14321-9365-4811-8fcb-162cb233b7b8 | Alex-Shen1121/SZU_Learning_Resource | 计算机与软件学院/面向对象程序设计(荣誉)/大作业1/素材1/2018152008_1120_2.cpp | 2018152008:Problem1120:д
#include<iostream>
#include<string>
using namespace std;
class Animal
{
protected:
string kind;
string name;
int age;
public:
virtual void speak();
void display();
};
void Animal::speak()
{
;
}
void Animal::display()
{
cout<<"Hello,I am "<<name<<",";
speak();
}
class tiger:publi... | ALGO | 0.919876 | 4.332965 |
9495474a-6ed9-4b7d-b0e9-45fce90a776e | yzzupgo/MFTCG | Data/abc123_b/orc17/wa/11640852.cpp | #include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<deque>
#include<math.h>
#include<functional>
#include<cassert>
using namespace std;
#define ll long long
int main(){
ll a,b,c,d,e;
cin... | ALGO | 0.993022 | 3.13686 |
afc48928-5022-4ec9-9bea-0824afc31cf1 | HeptaDecane/CNL_SEM5 | A02/Sender.cpp | #include "bits/stdc++.h"
using namespace std;
class Sender{
private:
bool *message;
bool *polynomial;
bool *crc;
bool *encodedMessage;
int m,n;
public:
Sender(int n, int m){
this->m = m;
this->n = n;
message = new bool[n];
polynomial = new bool[m];
crc = new bool[m-1];
encodedMessage = new bool[n+... | ALGO | 0.99952 | 4.078343 |
6e1d42a6-abf6-40bc-807c-829087641246 | kajal0176/leetcode | 3227-find-missing-and-repeated-values/3227-find-missing-and-repeated-values.cpp | class Solution {
public:
vector<int> findMissingAndRepeatedValues(vector<vector<int>>& grid) {
int xr=0;
for(int i=0;i<grid.size();i++){
for(int j=0;j<grid[0].size();j++){
xr^=grid[i][j];
}
}
int n=grid.size();
for(int i=1;i<=n*n;i++){
... | ALGO | 0.999827 | 5.225086 |
e0378123-3933-4e2d-8dca-78d1ed69dea0 | Atharvagoswami/loops | invertstar.cpp | #include<iostream>
using namespace std;
int main ()
{
int i,j;
for( i=1;i<=5;i++)
{
for(j=5;j>=i;j--)
{
cout<<" *"<<" ";
}
cout<<" \n";
}}
//output
/*
* * * * *
* * * *
* * *
* *
*
*/ | ALGO | 0.999867 | 3.309634 |
9ef55d2d-ba67-4383-a47c-8588f9abc920 | Amit72777/LeetCode-POTD | FindKthBitinNthBinaryString.cpp | class Solution {
void solve(string &ans, int n) {
if (n <= 0){
return;
}
string temp = ans;
int i = 0, j = temp.size() -1;
while( i< j){
// reverse and invert
temp[i] = temp[i] == '1' ? '0' : '1';
temp[j] = temp[j] == '1... | ALGO | 0.999972 | 5.896052 |
aacca7cd-2d45-42b8-8219-420e9a427381 | cweinber/secure-file-transfer-client-server | Client/cryptopp/chacha.cpp | // chacha.cpp - written and placed in the public domain by Jeffrey Walton.
// Based on Wei Dai's Salsa20, Botan's SSE2 implementation,
// and Bernstein's reference ChaCha family implementation at
// http://cr.yp.to/chacha.html.
#include "pch.h"
#include "config.h"
#include "chach... | ALGO | 0.998484 | 5.237955 |
2b02b4d4-c0e2-4b42-a888-a2b9170b8acf | sarahannali/elementsofprogramming | Chapter12/12_8.cpp | #include <iostream>
#include <vector>
#include <random>
using namespace std;
int PartitionVector(vector<int> &given_vector, int L, int U, int idx)
{
int pivot_val = given_vector[idx];
int partition = L;
swap(given_vector[U], given_vector[idx]);
for (int i = L; i < U; i++)
{
if (given_vect... | ALGO | 0.999966 | 4.766922 |
7fa7fd3a-4baa-4902-8cc4-55599b700ed5 | emaankhuram/DSA-PROJECT-sorting_algo_visualiser | project/sorting_algorithm.cpp | #include <cpprest/http_listener.h>
#include <cpprest/json.h>
#include <iostream>
#include <stdexcept>
#include <chrono>
using namespace std;
void swap(int* a, int* b) {
int t = *a;
*a = *b;
*b = t;
}
double bubbleSort(int arr[], int n) {
auto start = std::chrono::high_resolution_clock::now();
for ... | ALGO | 0.999728 | 5.908353 |
dc5287d8-432c-462a-b7ed-d9a8936893ea | steward-fu/sdl2 | swiftshader/third_party/llvm-10.0/llvm/lib/CodeGen/PHIElimination.cpp | #include "PHIEliminationUtils.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineBasic... | ALGO | 0.999134 | 7.790928 |
cdd3330e-87b0-4959-934c-2a05ccae39ba | 308912190/gitcode | cpp/leetcode/链表操作.cpp | #include <iostream>
using namespace std;
class node {
public:
int data;
node* next;
};
class list {
public:
node* head;
int size;
};
list* initlist()
{
list* l = new list;
l->size = 0;
l->head = new node;
l->head->data = NULL;
l->head->next = NULL;
return l;
}
void listinsert(list* l, int pos, int data)
{
i... | ALGO | 0.999628 | 4.074991 |
51401476-13ee-4f0a-aae2-af5c86b1f4e5 | Omair95/A_prototype_MPEG-G_encoder | boost_1_66_0/libs/numeric/odeint/examples/mpi/phase_chain.cpp | #include <iostream>
#include <vector>
#include <boost/random.hpp>
#include <boost/timer/timer.hpp>
//[phase_chain_mpi_header
#include <boost/numeric/odeint.hpp>
#include <boost/numeric/odeint/external/mpi/mpi.hpp>
//]
using namespace std;
using namespace boost::numeric::odeint;
using boost::timer::cpu_timer;
using boo... | ALGO | 0.999973 | 5.417043 |
cef7f770-1292-4f13-9df6-47d33755f587 | ArushNo1/Competitive-Programming | CF/1279D.cpp | #pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector... | ALGO | 0.999829 | 4.137243 |
86a21e08-261e-4075-9311-dbabf906db7c | Beman/boost-trunk-git-svn | libs/graph/example/canonical_ordering.cpp | #include <boost/graph/planar_canonical_ordering.hpp>
#include <boost/graph/boyer_myrvold_planar_test.hpp>
using namespace boost;
int main(int argc, char** argv)
{
typedef adjacency_list
< vecS,
vecS,
undirectedS,
property<vertex_index_t, int>,
property<edge_index_t, int>
>
grap... | ALGO | 0.99876 | 7.245264 |
39c5a4d0-1e39-4d1a-8612-0e212d8b4825 | Vranjan7077/Var_Plat_Codes | Interviewbit/Two Pointers/diffk.cpp | int Solution::diffPossible(vector<int> &A, int B) {
int n=A.size();
int p=0,q=0;
while(q<n){
if(q==p)
q++;
else if(A[q]-A[p]==B && q!=p)
return 1;
else if(A[q]-A[p]>B)
p++;
else if(A[q]-A[p]<B)
q++;
}
return 0;
} | ALGO | 0.999995 | 4.699758 |
7405154b-bbc3-44f2-8407-dd2d43e32b74 | Rebeca-Reis/Competitive-Programming | 2018/Contest1/f.cpp | #include <bits/stdc++.h>
//
using namespace std;
#define mp make_pair
#define pb push_back
#define db(x) cerr << #x << " == " << x << endl;
#define _ << " " <<
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
const long double EPS = 1e-9;
const int N=1e5+5;
const int MOD=1e9+7;
const int INF=0... | ALGO | 0.999977 | 3.308525 |
e5b62a07-a07a-45ba-af47-94657680ce40 | mingfeisun/gazebo | deps/opende/src/box.cpp | /*
standard ODE geometry primitives: public API and pairwise collision functions.
the rule is that only the low level primitive collision functions should set
dContactGeom::g1 and dContactGeom::g2.
*/
#include <gazebo/ode/common.h>
#include <gazebo/ode/collision.h>
#include <gazebo/ode/matrix.h>
#include <gazebo/od... | ALGO | 0.998918 | 6.355925 |
1c98d72b-208c-46cb-b839-fb0e11e5631a | ZackSungy/Learn-C-Language | Assault/main.cpp | #include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
struct Job{
int j, b;
bool operator<(const Job&x)const{
return j>x.j;
}
};
int main()
{
int n, b, j, kase = 1;
while (scanf("%d", &n) == 1 && n)
{
vector<Job>v;
for (int i = 0; i<n; i++)
{
scanf("%d%d", &b, &j);
v.push_bac... | ALGO | 0.999128 | 4.293958 |
93244930-f6de-4183-a3b2-704181ce681e | krishna-gavas/Competitive-Coding | GeeksForGeeks/General/NegativeWeightCycle.cpp | // Negative weight cycle(using Bellman Ford Algorithm)
// Question:
// Given a graph, the task is to check if it contains a negative weight cycle or not.
// Input:
// The first line of input contains an integer T denoting the no of test cases. Then T test cases follow.
// Each test case contains 2 lines the first li... | ALGO | 0.999878 | 5.440627 |
6e8c7737-9e93-4c3b-b995-bc3ae5f11776 | alexandraback/datacollection | solutions_5652388522229760_0/C++/radsilver/CountingSheep.cpp | // CountingSheep.cpp : ܼ α մϴ.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int T;
int N;
int target;
int digit[10]{ 0 };
int digitcount;
cin >> T;
for (int i = 0; i < T; i++) {
cin >> N;
cout << "Case #" << i + 1 << ": ";
if (N == 0) {
cout << "INSOMNIA" << end... | ALGO | 0.996899 | 5.857962 |
0e5af3d9-6f49-4f30-ad90-3c7f00bdcd85 | ishandutta2007/codeforces | alishahali1382/normal/1017/G.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O2")
#pragma GCC optimize ("unroll-loops")
//#pragma GCC optimize("no-stack-protector,fast-math")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef pair<ll, ll> pll;
#define debug(x) cerr<... | ALGO | 0.99979 | 4.861436 |
8323a812-8d28-4fac-8e62-31fcb4bab84a | miscellaneous-mice/CPP_Basics | 000_Prototyping/ComplexNumbers/main.cpp | #include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <ranges>
int main()
{
using namespace std::literals::complex_literals;
std::cout << std::fixed << std::setprecision(2); // Sets the decimal precision for console output
std::complex<int> z1 = 1i * 1i; // imaginary unit sq... | ALGO | 0.857283 | 5.026234 |
7f85b5e5-e7e9-4439-8f37-0f51209fe172 | akhilkammila/leetcode-screenshotter | editorial_code/2000-2999/2707. Extra Characters in a String/cpp-3.cpp | class TrieNode {
public:
unordered_map<char, TrieNode*> children;
bool is_word;
};
class Solution {
public:
int minExtraChar(string s, vector<string>& dictionary) {
int n = s.length();
auto root = buildTrie(dictionary);
vector<int> dp(n + 1, 0);
for (int start = n - 1; star... | ALGO | 0.99986 | 6.260802 |
e5b59bd0-c7c6-4993-976d-61c0613bc064 | openeuler-mirror/arkui-linux | ace_engine/frameworks/core/components_ng/pattern/text/text_layout_algorithm.cpp | #include "core/components_ng/pattern/text/text_layout_algorithm.h"
#include "text_layout_adapter.h"
#include "base/geometry/dimension.h"
#include "base/i18n/localization.h"
#include "base/utils/utils.h"
#include "core/components/text/text_theme.h"
#include "core/components_ng/base/frame_node.h"
#include "core/compone... | TOOL | 0.894652 | 7.177372 |
e5e2f7b6-d017-466c-bd13-dacfc9dff88f | NestZ/competitive-programming | UsaCo/PrefaceNumbering.cpp | /*
ID: nestz
LANG: C++14
TASK: preface
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
char page[] = {'I', 'V', 'X', 'L', 'C', 'D', 'M'};
map<char, int> ans;
void cnt(int n){
//count thousand
if(n >= 1000){
ans['M'] += n / 1000;
}
n %= 1000;
//count hundred
if(n / 100 == 9){
//100... | ALGO | 0.999753 | 4.017709 |
b02e462e-ef6e-47f9-9cb0-f31c4e8d3957 | ysk24ok/leetcode-submissions | 0802/reverse_edges.cpp | #include <gtest/gtest.h>
#include <algorithm>
#include <cstdlib>
#include <queue>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> eventualSafeNodes(vector<vector<int>>& graph) {
vector<vector<int>> incoming_graph = getReversedGraph(graph);
queue<int> q;
vector<int> ret;
... | ALGO | 0.999812 | 6.778858 |
2633d662-149d-406a-b490-f3472a5d86c4 | hxy951118/Algorithm | Leetcode/深度优先搜索/Leetcode 79-单词搜索.cpp | /*
Leetcode 79-单词搜索
题意:给定一个二维网格和一个单词,找出该单词是否存在于网格中。“相邻”单元格是那些水平相邻或垂直相邻的单元格。
算法:DFS
思路:首先枚举起点,从起点开始,依次搜索下一个点的位置,在枚举的过程中,要保证目标单词匹配
时间复杂度:O(nm * 3^k)
*/
int dx[4] = {-1, 1, 0, 0}, dy[4] = {0, 0, 1, -1};
int n, m;
bool exist(vector<vector<char>>& board, string word) {
n = board.size();
m = board[0].size();
... | ALGO | 0.999982 | 6.378941 |
59670b0e-78e5-4ed4-819e-cf3c461760da | aadarsh231099/CodeChef | Starters 75/Saving Taxes.cpp | //https://www.codechef.com/problems/TAXSAVING
//Saving Taxes
#include <bits/stdc++.h>
using namespace std;
void solve(){
int x,y;
cin>>x>>y;
cout<<x-y<<endl;
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin>>t;
while(t--)
solve();
return 0;
} | ALGO | 0.999644 | 4.519011 |
d66f9c76-3372-4bde-8ee4-1756661d5af1 | ymatevva/DSA-FMI | Practicums/Practicum_group_1/Practicum_5/RemoveElements.cpp | #include<stack>
#include<vector>
#include<list>
#include<string>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode* next) : val(x), next(next) {}
};
#include<stack>
#include<vector>
#include<li... | ALGO | 0.999446 | 4.586036 |
94dddccc-b877-4658-9524-5603a8b1493e | hoanxuanbach/Competitive-Programming | OI/APIO/2008/beads.cpp | #include "beads.h"
#include<bits/stdc++.h>
using namespace std;
const int maxn = 300005;
int N,M,P[maxn];
vector<pair<int,int>> pos[maxn];
void init(int _N, int _M, std::vector<int> A) {
N=_N;M=_M;
for(int i=1;i<=N;i++) pos[i].push_back({0,i}),P[i]=i;
for(int i=0;i<M;i++){
int x=A[i],y=A[i]+1;
... | ALGO | 0.999967 | 3.542058 |
dee56107-440d-4b73-9d77-0d217d112908 | rachitpanwar151/hello-world | sum.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,c;
cout<<"enter two number";
cin>>a>>b;
c=a+b;
cout<<"c is "<<c;
}
| TOOL | 0.941381 | 3.363888 |
73c968d8-47e7-4fcb-a56c-ef767b469aa8 | myp0402/OI-CPP | 樱花.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=2e5+10;
int hh1,hh2,mm1,mm2;
int f[N],vv[N],ww[N],cnt;
int v,w,s;
int n,V;
int main(){
scanf("%d:%d %d:%d %d",&hh1,&mm1,&hh2,&mm2,&n);
V=(hh2-hh1)*60+(mm2-mm1);
for(int i=0;i<n;i++){
scanf("%d%d%d",&v,&w,&s);
if(!s) s=1010;
for... | ALGO | 0.999816 | 3.637245 |
199113c1-e18d-4d8e-83c1-15c6d06c9045 | svn2github/keeperfx | keeperfx/src/lens_mist.cpp | /******************************************************************************/
// Free implementation of Bullfrog's Dungeon Keeper strategy game.
/******************************************************************************/
/** @file lens_mist.cpp
* Mist lens effect functions.
* @par Purpose:
* Function... | TOOL | 0.933488 | 4.722454 |
1ecfb2dc-e8ed-4c8d-8e15-db2eada5b21d | saymore21/Parallel-Computing | MergeSort,LCS,BubleSort-openmp-advanced/lcs/lcs.cpp | #include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <iostream>
#include <unistd.h>
#include <vector>
#include <omp.h>
#include <chrono>
#include <string.h>
using namespace std;
using seconds = chrono::seconds;
using check_time = std::chrono::high_resolution_clock;
#ifdef __cplu... | ALGO | 0.999399 | 4.226543 |
d563724a-0a24-4b1b-b37d-5615f0fa6e22 | rafid-dev/rice | src/search.cpp | #include "search.h"
#include "eval.h"
#include "fancyterminal.h"
#include "misc.h"
#include "movescore.h"
#include "see.h"
#include <cmath>
#include <cstring>
#include <iostream>
int lmr_table[MAXDEPTH][64];
int lmp_table[2][8];
constexpr int probcut_depth = 5;
/* Initialize LMR table using the log formula */
void... | ALGO | 0.99991 | 5.659528 |
b14f5659-232b-4d1b-a131-678ca49a9892 | DannyWuzhiheng/somecode | cnnmmm.cpp | #include <iostream>
using namespace std;
int main()
{
int a;
cin>>a;
int mx=0,mn=9;
for (int i = a;i>0;i=i/10)
{
int g=i%10;
if(mn>g){mn=g;}
if(mx<g){mx=g;}
}
cout<<mx+mn;
} | ALGO | 0.99976 | 3.804706 |
7eb5f386-ea51-4724-bcc9-ad2473881ae1 | eemoreira/biblioteca-de-problemas | cf/271/d.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
template<typename T> using pqmin = priority_queue<T, vector<T>, greater<T>>;
#define mp make_pair
#defi... | ALGO | 0.999962 | 4.38198 |
081999bb-0c45-45f6-9c61-d8f34e0a18fb | 786offiun/week-10 | task3.cpp | #include <iostream>
using namespace std;
main()
{
int elements = 0, count = 0;
cout << "Enter the number of elements: ";
cin >> elements;
int socket[elements];
int store[elements];
for (int i = 0; i < elements; i++)
{
cout << "Enter number " << i + 1 << " ";
cin >> socket[i... | ALGO | 0.999993 | 3.451723 |
8c097938-85c1-43d5-8b62-55827fe5b043 | SOHAM2543/DSA-CPP---Hands-on | 30. alphabet pattern.cpp | // Online C++ compiler to run C++ program online
#include <iostream>
using namespace std;
int main() {
char i,j;
for(i=1;i<=5;i++) {
char name = 'a' + (i-1);
for(j=1;j<=i;j++) {
cout<<name<<"";
}
cout<<endl;
}
return 0;
}
| ALGO | 0.980563 | 3.178655 |
6bd1aaf5-1bae-4baf-8808-0c5f9e665bd7 | quanganh208/Cpp-CodePTIT | CPP0234 - MA TRẬN XOẮN ỐC - 3.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n, m, K;
cin >> n >> m >> K;
vector<vector<int>> a(n, vector<int>(m));
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
cin >> a[i][j];
vector<vector<int>> b(n, vector<int>(m));
int dong = n, cot = m, k =... | ALGO | 0.999808 | 3.621986 |
454df0f5-1960-4951-8b59-6bcb35945a41 | Djazy-Faradj/Leetcode | Easy/69. Sqrt(x)/solution1.cpp | /*
Author: Djazy Faradj
Problem: 69. Sqrt(x)
Description:
- Given a non-negative integer x, return the square root of x rounded down to the nearest integer. The returned integer should be non-negative as well.
- You must not use any built-in exponent function or operator.
- For example, do not use pow(x, 0.5) in c+... | ALGO | 0.999963 | 5.802172 |
cb3035f9-dbdb-44cb-b29f-7eab7c25b075 | Roh727an/LeetCode_GFG | 3307-find-the-maximum-sum-of-node-values/find-the-maximum-sum-of-node-values.cpp | class Solution {
public:
long long maximumValueSum(vector<int>& nums, int k,
vector<vector<int>>& edges) {
int n = nums.size();
long long ans = 0;
int xor_d = 1e9;
int nxor_d = 1e9;
int cnt = 0;
for (int i = 0; i < n; i++) {
i... | ALGO | 0.999968 | 5.697592 |
13ac132d-b97c-4436-b0c6-78d1096db549 | bavis-m/raycast | glm/test/core/core_func_integer_find_lsb.cpp | ///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentatio... | ALGO | 0.997398 | 5.183555 |
ac3ec547-29b3-4aba-ac46-d0b2af059ec8 | Bungmint/competitiveprogramming | contest/USACO/Feb 2018 Gold/C.cpp | // Problem: Problem 3. Taming the Herd
// Contest: USACO - USACO 2018 February Contest, Gold
// URL: http://www.usaco.org/index.php?page=viewproblem2&cpid=815
// Memory Limit: 256 MB
// Time Limit: 4000 ms
//
// Powered by CP Editor (https://cpeditor.org)
using namespace std;
using ll = long long;
using vi = vector<... | ALGO | 0.99988 | 3.829168 |
49ec510c-e523-4933-8980-6a7bbce69874 | ishandutta2007/codeforces | vepifanov/normal/60/E.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
using namespace std;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(in... | ALGO | 0.999976 | 3.766388 |
7f4b2b49-e271-4886-ac7b-eec12e107055 | harshrg2003/Codechef_Problems | CHEFBOTTLE.cpp | #include <iostream>
using namespace std;
int main() {
int t,n,x,k;
cin>>t;
while(t--)
{
cin>>n>>x>>k;
int noOFbottle=k/x;
if(noOFbottle<=n)
cout<<noOFbottle<<endl;
else
cout<<n<<endl;
}// your code goes here
return 0;
}
| ALGO | 0.99993 | 3.705537 |
4a12f39c-fbec-45ca-9eb9-9585eed7901f | Rhithick02/C-code | Misc/coffeeandcourse.cpp | #include<bits/stdc++.h>
using namespace std;
#define lli long long
#define For(i,n) for(int i=0;i<n;i++)
int main(){
int n,m,flag=-1,fi,la,mid,tot=0;
cin>>n>>m;
vector<int> ar(n);
For(i,n)
{
cin>>ar[i];
tot+=ar[i];
}
if(tot<m)
cout<<"-1";
else
{
lli s... | ALGO | 0.999995 | 3.675284 |
1d4bca9b-8a68-487f-9c49-c4aa572a4251 | ishandutta2007/codeforces | linkus/normal/1641/A.cpp | #include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdio>
#include <iostream>
#include <set>
#include <unordered_set>
#include <vector>
#define pb push_back
#define mp make_pair
#define all(a) begin(a),end(a)
#define FOR(x,val,to) for(int x=(val);x<int((to));++x)
#define FORE(x,val,to) for(auto x=(va... | ALGO | 0.999604 | 3.744832 |
8317c948-e2c1-47e3-ab20-caf01ab5064c | Genicc/QualityCheckBox | libraries/cobalagi_inferencing/src/edge-impulse-sdk/tensorflow/lite/kernels/internal/portable_tensor_utils.cpp | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_TENSOR_UTILS_H_
#define TENSORFLOW_LITE_KERNELS_INTERNAL_TENSOR_UTILS_H_
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/portable_tensor_utils.h"
#include <algorithm>
#include <cmath>
#include <cstdint>
#include "edge-impulse-sdk/tensorflow/lite/core/c/builtin_op_... | TOOL | 0.945593 | 7.397056 |
ca84c117-20f6-434f-ae0b-bf6ec11af1b0 | mf06359/cp-cpp | ants/p321.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
// #include<bits/stdc++.h>
using namespace std;
int n, k, ans;
vector<bool> centroid;
vector<int> subtree_size;
int compute_subtree_size(const vector<vector<pair<int,int>>> &_g, int _v, int _p = -1) {
int c = 1;
for (auto [_nv, l]: _... | ALGO | 0.999866 | 5.115711 |
effa14f5-628e-4eb0-829e-552ecbc3a2f3 | czaja307/AGChallengePubl | AGChallenge/Optimizer.cpp | #include "Optimizer.h"
COptimizer::COptimizer(CLFLnetEvaluator& cEvaluator)
: c_evaluator(cEvaluator)
{
random_device c_seed_generator;
c_rand_engine.seed(c_seed_generator());
d_current_best_fitness = 0;
greedy_counter = 0;
}
COptimizer::~COptimizer()
{
for (int i = 0; i < population.size(); i++) {
delete po... | ALGO | 0.999549 | 4.847003 |
17677d1a-4285-4375-b16c-ee2965ae8475 | SomeFeaKOS/android_frameworks_av | media/libstagefright/codecs/amrnb/common/src/az_lsp.cpp | /*
Pathname: ./audio/gsm-amr/c/src/az_lsp.c
Funtions: Chebps
Chebps_Wrapper
Az_lsp
------------------------------------------------------------------------------
REVISION HISTORY
Description: Finished first pass of optimization.
Description: Made changes based on review comments.
Descri... | ALGO | 0.999674 | 6.1934 |
0e2e2670-106d-41e8-9131-dbbb028ce7f1 | raincross7/code-similarity | codes/train_code/problem005/problem005_356.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(void){
cin.tie(0);
ios::sync_with_stdio(false);
int N,ans = 0;
cin >> N;
string s[N];
rep(i,N)cin >> s[i];
for(int k=0;k<N;k++){ //(0,k)番目の要素を*とする
bool ok = 1;
for(int i=0;i<N;i++){
for(int j=0;j<N;j++){
i... | ALGO | 0.999961 | 3.78661 |
21c8fab4-0289-4cb7-aef1-6eb7000d6923 | AhmadFarazWeb3Developer/First-Semester-Coding- | Pointers/print.cpp | #include<iostream>
#include<string>
using namespace std;
char *Reverse_it(char *str)
{
int i,len=0,n;
char temp;
len=strlen(str);
n=len-1;
for(i = 0; i <=(len/2); i++)
{
temp=str[i];
str[i]=str[n];
str[n]=temp;
n--;
}
return str;
}
int main()
{
char String [] ="Reversing A Character";
cout <<String... | ALGO | 0.999477 | 4.324489 |
69372dcb-4754-4d48-98ea-fbb45fec1240 | ishandutta2007/codeforces | nishant403/normal/847/K.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>
const int N =2e5+10;
map<int,int> inv;
vo... | ALGO | 0.999073 | 3.941 |
d7d76c86-9e29-4576-b7df-6a3a963e8fda | Gabriel123Duarte/maratona-final | Contests/V Escola de Inverno da UFU/Intermediário 2 - dia 2/d.cpp | /*input
2
1 1 1
2 0 4
3
1 0 0
0 1 0
0 0 0
0
*/
#include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define fst first
#define snd second
#define debug(x) cout << #x << " = " << x << endl;
typedef long long ll;
typedef pair<int, int> ii;
int v[3][110];
int n;
bool vi... | ALGO | 0.999877 | 4.009927 |
05a03fd9-f12a-43db-82a2-df23a8aa13b6 | kanghuiseon/algorithmStudy | Rare4_구현/hee/15686+치킨배달.cpp | #include <iostream>
#include <vector>
#include <queue>
#define MAX 0x7fffffff
#define MAX_INDEX 51
using namespace std;
int n, m;
int arr[MAX_INDEX][MAX_INDEX];
int Min = 0x7fffffff;
vector<pair<int, int>> chicken;
void dfs(int cnt, int current, vector<vector<int>> dists){
if(cnt == m){
int sum = 0;
... | ALGO | 0.999881 | 3.785474 |
0042b995-a711-43cb-9cf6-3e14f7644d93 | Shreyas-Rathod/QCPP | 29-divide-two-integers/divide-two-integers.cpp | class Solution {
public:
int divide(int dividend, int divisor) {
// Handle overflow case
if (dividend == INT_MIN && divisor == -1) {
return INT_MAX;
}
// Convert to absolute values
long div = abs((long)dividend);
long dsor = abs((long)divisor);
l... | ALGO | 0.999848 | 6.644901 |
2dbb5cb1-56bd-4493-bffa-c69488c1e8f9 | sarvex/leetcode-beef | solution/0100-0199/0101.Symmetric Tree/Solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999967 | 6.867349 |
e714e5c9-077c-4516-8e99-5d6d663931ac | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10900_17.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1500000 + 10;
const int mod = 100;
const double PI = acos(-1.0);
vector<int> a, b;
int v[N];
int sz_v = 0;
int k;
struct Complex {
double x, y;
Complex(double x = 0.0, double y = 0.0) : x(x), y(y) {}
Complex operator+(const Complex &b) const {
return... | ALGO | 0.999907 | 3.743459 |
4617b8fe-fe9b-4bb4-b481-526e906ba662 | kibria30/Combinatorial_optimization | Dynamic_prog/editDistance.cpp | #include<bits/stdc++.h>
#define leftarrow -100
#define uparrow -101
#define diagarrow -102
#define empdiarrow -103
#define MAX 1000
using namespace std;
struct cell{
int count;
int operation;
}matrix[MAX][MAX];
char str1[100], str2[100];
void editDistance(int m, int n){
matrix[0][0].count = 0;
for(in... | ALGO | 0.999998 | 4.340941 |
d0540db3-aa25-463d-afe8-472941a67b9c | jimar884/AOJ | PROBLEM/Vol0/0000.cpp | // |Z\
#include <iostream>
using namespace std;
int main(void) {
for(int i = 1; i <= 9; ++i) {
for(int j = 1; j <= 9; ++j) {
cout << i << "x" << j << "=" << i*j << endl;
}
}
} | ALGO | 0.974368 | 3.576944 |
58f1f1fb-17a5-47bd-8648-5dd076d1cac8 | meditates/metacast | simulation/gem5_06/gem5-20.0.0.3/src/systemc/tests/systemc/misc/unit/data/datawidth_unsigned/lost_carry/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.896766 | 5.330676 |
c9162e62-c41b-45c4-828c-78ed86551cee | pafin10/CompetitiveProgrammingExercises | year_2_contests/atCoder_beginner_392/1.cpp | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <fstream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
#include <bitset>
#include <numeric>
#include <set>
#include <queue>
#include <unordered_map>
#include <cassert>
#include <array>
#include <deque>
#includ... | ALGO | 0.999976 | 4.217371 |
2002a042-9d54-4ca1-bbbf-a7d513bc58ea | qiuyongchen/code_saver | C++/StackWithList/StackWithList/main.cpp | #include "myStack.h"
#include <iostream>
#include <string>
using namespace std;
int main() {
Stack<int> s;
cout << (s.empty() ? "empty" : "not empty") << endl;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
int t;
cin >> t;
s.push(t);
}
cout << s.size() << endl;
cout << s.top() << endl;
... | ALGO | 0.992538 | 3.682751 |
909ce638-f0e7-45bb-999c-c8733ca567b7 | jash459/Today | Striver/7. Linkedlist/30. Clone Linked List with Random and Next Pointer.cpp | //Link : https://takeuforward.org/data-structure/clone-linked-list-with-random-and-next-pointer/
// video : https://www.youtube.com/watch?v=q570bKdrnlw
/*
1. Brute
#include<bits/stdc++.h>
using namespace std;
class Node {
public:
int val;
Node* next;
Node* random;
Node(int value) ... | ALGO | 0.999411 | 4.800941 |
9cb9cae9-6c6b-4f5d-ac15-d66a8dcf8b17 | ARJUN5042/Arjun | C++/Assignment/Module 4/Module 4.2/Q15. Sort the array using templates.cpp | #include<iostream>
using namespace std;
template <class A>
class Sort{
public:
A arr[100],i,j,k,n;
void input()
{
cout<<"\n Enter Size of Array : ";
cin>>n;
for(i=0;i<n;i++)
{
cout<<"\n Enter Element ["<<i<<"] = ";
cin>>arr[i];
}
cout<<"\n\n Sorting Array Elements in Assc... | ALGO | 0.997234 | 4.256831 |
822d3d11-ddf7-4b8e-9802-ff1eb7d3f56d | voIatiIe/fluxxx | src/integrand.cpp | #include <cmath>
#include "integrand.hpp"
#include "wrapper.hpp"
#include <iostream>
Integrand::Integrand(int dim) : dim(dim), calls(0) {}
at::Tensor Integrand::operator()(at::Tensor x) {
calls += x.size(0);
return callable(x);
}
void Integrand::reset() {
calls = 0;
}
GaussIntegrand::GaussIntegrand(i... | DATA | 0.942202 | 6.306037 |
aa68779b-1923-458d-b637-058f19c3a62e | Haricharan1212/CP | oldcode/1792E.cpp | // Haricharan
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define vi vector<int>
#define vii vector<vector<int>>
#define vb vector<bool>
#define pi pair<int, int>
#define si set<int>
#define rep(var, l, r) for (int var = l; var < r; var++)
void solve()
{
int n, m1, m2;
cin >> n >> ... | ALGO | 0.999867 | 4.35532 |
aad9079f-5fcb-4d5f-a6a1-0453aac91a2b | Prakhar314/Graphics-Modeling | examples/e4.cpp |
#include "../src/mesh.hpp"
#include <iostream>
/**
* Smoothing example
*/
int main(){
//Mesh mesh("meshes/bunny-1k.obj");
//Mesh mesh("meshes/cube.obj");
//Mesh mesh("meshes/teapot.obj");
Mesh mesh("meshes/noisycube.obj");
// Umbrella operator
//mesh.smoothing(20, 0.33);
// Taubin smoothing
mesh.smoot... | ALGO | 0.899586 | 3.305595 |
994ad2a2-eb57-44ff-b951-314337b768f4 | dungkaito/Data-Structures-and-Algorithms---PTIT | contest1/bai17.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> x;
void sinhkt(int i) {
x[i]=9;
for(int j=i+1; j<x.size(); j++) x[j]=0;
}
int main() {
int t,n,i;
cin>>t;
while(t--) {
cin>>n;
x.clear();
x.push_back(9);
while(true){
//check chia het
long long ans=0;
// for(i=x.size()-1; i>=0; i--)
// ... | ALGO | 0.999331 | 4.25713 |
d902bc5d-5de3-441d-aec1-72d41077268b | marc1222/kalmanfiltersforecooltra | battery_ekf/eigen/doc/examples/class_VectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived>
segmentFromRange(MatrixBase<Derived>& v, int start, int end)
{
return Eigen::VectorBlock<Derived>(v.derived(), start, end-start);
}
template<typename Derived>
const Eigen::Vec... | TOOL | 0.983948 | 4.383477 |
a5ddb326-a147-4e50-ad04-618e65635492 | KatsuyaKikuchi/ProgrammingContestCpp | AtCoder/ABC/252/D.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using pll = pair<ll, ll>;
#define FOR(i, n, m) for(ll i = (m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(40)
const ll MOD = 1000000007;
const ll INF = (ll) 1e15;
const long double PI = 3.14159265358979323846264338... | ALGO | 0.999923 | 3.793479 |
411f4866-4bf0-4bf6-a11f-18e19fe64a2b | ryancheung/cocos2d-x-3.17.1-raw | cocos/base/CCConfiguration.cpp | #include "base/CCConfiguration.h"
#include "platform/CCFileUtils.h"
#include "base/CCEventCustom.h"
#include "base/CCDirector.h"
#include "base/CCEventDispatcher.h"
NS_CC_BEGIN
extern const char* cocos2dVersion();
Configuration* Configuration::s_sharedConfiguration = nullptr;
const char* Configuration::CONFIG_FILE_... | CONFIG | 0.913589 | 6.127709 |
3907b313-196b-4a6c-aab6-db01c22232b3 | elkurin/simulation | logistic.cpp | #include <iostream>
using namespace std;
double next_x;
double x;
double t;
double k;
double r;
int time_end;
double time_bunkai;
int main(void)
{
cout << "Equation will be dx = r * x * (1 - x / k)" << endl;
cout << "Input k ->" ;
cin >> k;
while (k == 0) {
cout << "Invalid. Try again ->";
cin >> k;
}
cou... | ALGO | 0.999843 | 4.067721 |
8f913210-32ab-48c4-bc13-2c6b6f7221ae | YanteLB/practicals | p2/Source/UserInput.cpp | #include<iostream>
using namespace std;
int main()
{
double dblP, dblRate;
dblP = dblRate = 0.0;
cin >> dblP >> dblRate ;
cout << dblP << endl << dblRate << endl;
return 0;
}
| ALGO | 0.921042 | 3.284073 |
c20524f5-83f0-403d-9ce6-9559867f9c0d | GiacomoLorenzon/algorithms-and-parallel-computing | sourcecode_notebook/Chapter_3/Exe_4/LargestFirstMDK.cpp | #include <iostream>
#include <utility>
#include "LargestFirstMDK.hpp"
// returns a vector of sorted item indices with nonincreasing size
std::vector<unsigned> LargestFirstMDK::sort (void) const
{
std::vector<unsigned> sorted_idx;
// first copy all indices
for (unsigned i = 0; i < items.size (); ++i)
sorted... | ALGO | 0.997751 | 4.94607 |
19b9b0aa-d677-4805-84fc-c7a345e12d4f | hafijul233/Dawn-of-Programming-Contest-By-Mahbubul-Hasan | Biginner Syntex Practics/TIMUS-1264-Workdays.cpp | #include <iostream>
using namespace std;
int main(){
long long n_numbers, m_times, total_appearance;
while(cin >> n_numbers >> m_times){
total_appearance = n_numbers * (m_times+1);
cout << total_appearance << endl;
}
return 0;
}
| ALGO | 0.999542 | 3.513667 |
612a82cf-8250-4760-a911-6d7414ee850e | VipulChauhan89/Leetcode-solutions | Array/1051-Height_Checker.cpp | class Solution {
public:
int heightChecker(vector<int> &heights)
{
vector<int> a(heights.begin(),heights.end());
sort(a.begin(),a.end());
int count=0;
for(int i=0;i<heights.size();i++)
{
if(a[i]!=heights[i])
{
count++;
... | ALGO | 0.999864 | 5.570393 |
fe5e0f74-e313-4036-9be3-0c8e4becc497 | ishandutta2007/codeforces | ainta/normal/191/C.cpp | #include<stdio.h>
#include<algorithm>
using namespace std;
int t,n,a,s[200001],l[200001],v[200001],b[200001],c,r[200001],p[200001],pp[200001],Dep[200001],x,j,q,tt,rr[200001],ttt,ss[200001];
int st[200001],sz[200001],top,R[200001],R2[200001],Res[200001],P[200001];
struct A{int a,b,c;bool operator()(A p,A q){return p.a<q... | ALGO | 0.999675 | 3.511427 |
21a69099-d8b3-48ec-81df-631d0453e15e | Karthikdvl/Cplusplus | q16.cpp | #include <iostream>
#define CUBE(x) ((x) * (x) * (x))
using namespace std;
int main() {
int number, result;
cout << "Enter a number: ";
cin >> number;
result = CUBE(number);
cout << "Cube of " << number << " is: " << result << endl;
return 0;
}
| TOOL | 0.971843 | 4.810406 |
280320cc-6615-4b04-9d3c-81541d28a614 | MridulGupta75/Leetcode-Daily-challanges-all | 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divamazon-divdiv-classcompanytagscontainer-tagoccurence10-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-... | class Solution {
public:
int fib(int n) {
if(n==0)return 0;
if(n==1)return 1;
return fib(n-1)+fib(n-2);
}
}; | ALGO | 0.99997 | 5.741977 |
2b5b8830-42e7-4b35-91ee-a77d2b4a0ae2 | SpeedyE1780/PCG-Tool | PCG Engine/maze-generation/src/NodeCoordinates.cpp | #include <pcg/engine/math/vector3.hpp>
#include <pcg/engine/maze-generation/NodeCoordinates.hpp>
namespace pcg::engine::maze_generation
{
namespace
{
/// @brief Return Vector3 used to reach adjacent node following the direction
/// @param direction Direction from current to adjacent node
... | ALGO | 0.880391 | 6.517153 |
d5453911-25d6-4e59-aaff-99f52fb5a076 | sed-int/algorithm | DS/basic_2752.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
vector<int> v(3);
for (int i = 0; i < 3; i++) cin >> v[i];
sort(v.begin(), v.end());
for (int i = 0; i < 3; i++) cout << v[i] << ' ';
} | ALGO | 0.99949 | 3.534014 |
4b09df63-cf9f-45ff-a1fa-dc143d6afd67 | Kushagraupadhyay/C-Prog | Graph-Spanning-Tree.cpp | #include<iostream>
#include<bits/stdc++.h>
#define max 10
int adj[max][max],n,tree[max][max];
void readmatrix(void);
int spanningtree(int);
void display(int);
int main()
{
int source,treecost;
readmatrix();
printf("\nEnter the source :-");
scanf("%d",&source);
treecost=spanningtree(source);
display(treecost... | ALGO | 0.999775 | 3.771828 |
60a57496-287d-4b87-a1f4-aba9afb8e9c8 | champgourav007/C-Programming | square.cpp | #include<stdio.h>
#include<stdlib.h>
typedef struct nodetype
{
int data;
struct nodetype *next;
}node;
node *start = NULL;
node *temp, *ptr, *q;
void create()
{
int ran,i;
printf("Enter the the number of the node: ");
scanf("%d",&ran);
for(i=0;i<ran;i++)
{
temp = (node*)malloc(siz... | ALGO | 0.999038 | 3.296475 |
3138bcb4-2894-482c-bf0c-04d563108333 | Tharun26-G/Cpp | Arrays/11.matrix.cpp | //addition
#include <iostream>
using namespace std;
int main()
{
int A[2][3]={{2,4,6},{3,6,7}};
int B[2][3]={{6,3,9},{9,4,3}};
int C[2][3];
for(int i=0;i<2;i++)//rows
{
for(int j=0;j<3;j++)//colums
{
C[i][j]=A[i][j]+B[i][j];
cout<<C[i][j]<<" ";
}
... | ALGO | 0.996033 | 3.624669 |
463e0d44-c974-4ca7-9179-c3b8ee6edc3b | xyyandhtl/LeggedExplorer | ros2_integration/src/map_manager/include/map_manager/clustering/Kmeans.cpp | /*
FILE: Kmeans.cpp
------------------------
function implementation of k means
*/
#include <map_manager/clustering/Kmeans.h>
KMeans::KMeans(int dimension_data, int number_clusters){
this->dimension_data = dimension_data;
this->number_clusters = number_clusters;
centroid = new double*[number_clusters];... | ALGO | 0.999691 | 5.054819 |
5449e844-2b25-43d0-bc99-0dd340c20b2a | maparham/flow_update | gurobi751/mac64/examples/c++/lpmethod_c++.cpp | /* Solve a model with different values of the Method parameter;
show which value gives the shortest solve time. */
#include "gurobi_c++.h"
using namespace std;
int
main(int argc,
char *argv[])
{
if (argc < 2)
{
cout << "Usage: lpmethod_c++ filename" << endl;
return 1;
}
try {
// Read m... | ALGO | 0.997943 | 6.134356 |
ad28994c-654a-4552-abc2-09445fa29af6 | ishandutta2007/codeforces | tzc_wk/normal/1230/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define MOD 1000000007
#define FOR(i,l,r) for(int i=l;i<=r;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define REP0(i,n) for(int i=0;i<n;i++)
#define PB push_back
#define MP make_pair
#define PII pair<int,int>
#define VI ... | ALGO | 0.999792 | 4.123945 |
d06f2bf9-5405-402c-88bb-9ba7b0c6e930 | CieloKaren/2024-CCOMP2-2 | capitulo4/Palindrome.cpp | #include <iostream>
using namespace std;
int main(){
int num, original, reverso=0, digito;
cout << "Ingrese un numero: ";
cin >> num;
original = num;
while(num !=0){
digito = num%10; //obtiene el ultimo digito
reverso = reverso * 10 + digito; //construye el inverso
num /= 10... | ALGO | 0.999567 | 3.859503 |
6679bd14-367a-4697-bf22-a461e17e47b0 | GeekAvi007/DSA | char arrays & strings/inbuilt.cpp | #include <stdio.h>
#include <stdlib.h>
struct Node {
int data;
struct Node* next;
};
// Function to create a new node
struct Node* createNode(int data) {
struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
if (newNode == NULL) {
perror("Memory allocation failed");
exit(EX... | ALGO | 0.99961 | 5.9584 |
210da2f0-6a69-44b1-85fc-5cf7f5314fdd | Nithin-Rokkam/My_Files | CompetitveProgramming-master/0/ropeProblem.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
int arr[5]={4,3,2,7,9};
vector<int> vec(arr,arr+5);
int t=0;
while(vec.size()>1){
sort(vec.begin(),vec.end());
vec[0]=(vec[0]+vec[1]);
vec.erase(vec.begin()+1);
t+=vec[0];
}
... | ALGO | 0.999983 | 3.931435 |
8c393bcc-c9c9-4311-8e0f-c0b06a87240c | morris821028/UVa | OnlineJudge/JudgeGirl/20008. Fast Multiple Knapsack Problem/main-NWlogC.cpp | #include <bits/stdc++.h>
using namespace std;
namespace {
static const int MAXW = 5000005;
static const int MAXN = 1005*12;
static void run(int A[][2], int dp[], int W, int N) {
for (int i = 0, sum = 0; i < N; i++) {
int w = A[i][0], v = A[i][1];
for (int j = min(W, sum + w); j >= w; j--)
... | ALGO | 0.999933 | 4.058127 |
4861985c-2b05-4aa1-9759-df45a08eacd4 | ashgen/Greeks | extern/dlib/dlib/test/cca.cpp | #include <dlib/statistics.h>
#include <dlib/sparse_vector.h>
#include <dlib/timing.h>
#include <map>
#include "tester.h"
namespace {
using namespace test;
using namespace dlib;
using namespace std;
logger dlog("test.cca");
dlib::rand rnd;
// ------------------------------------------------------... | TEST | 0.898931 | 7.018962 |
0dcd069f-930d-4168-a804-ef84d5ee74b3 | stark4192/CPlusPlus | 64.cpp |
#include <iostream>
#include <deque>
using namespace std;
void printKMax(int arr[], int n, int k)
{
deque<int> q; // Monotonically Increasing Queue
for (auto i = 0; i < n; ++i)
{
while (!q.empty() && arr[i] > q.back())
{ // Make room for arr[i]
q.pop_back(); // R... | ALGO | 0.999977 | 4.953022 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.