uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b8416874-1a9d-4328-a476-1ea0e6cb1698 | Abinash4567/Data_Structure | Number_Theory/Print_Prime_Factor.cpp | #include <iostream>
#include <math.h>
using namespace std;
void Print_Prime_Factor(int n)
{
if(n<=1)
return;
while(n%2==0)
{
n/=2;
cout<<2<<" ";
}
while(n%3==0)
{
n/=3;
cout<<3<<" ";
}
for (int i = 5; i <= n; i+=6)
{
while(n%i==0)
{
n/=i;
cout<<i<<" ";
}
while(n%(i+2)==0)
... | ALGO | 0.999692 | 3.781373 |
8427a061-f4c4-4aec-9484-6330f69e60ef | hrabalik/fmo-cpp | fmo/explorer-v2/clusters.cpp | #include "explorer.hpp"
#include <fmo/agglomerator-impl.hpp>
#include <math.h>
namespace fmo {
namespace {
float distL2(const Pos& p1, const Pos& p2) {
int dx = p1.x - p2.x;
int dy = p1.y - p2.y;
return hypotf(float(dx), float(dy));
};
}
void ExplorerV2:... | ALGO | 0.999082 | 5.653114 |
3b50e458-1296-4df1-8025-8fa39f6f02bf | shubhamistic/leetcode | Easy/344. Reverse String.cpp | class Solution {
public:
void reverseString(vector<char>& s) {
int iterationCount = s.size()/2;
for(int i=0 ; i < iterationCount ; i++){
int temp = s[i];
s[i] = s[s.size() -1 -i];
s[s.size() -1 -i] = temp;
}
}
}; | ALGO | 0.99953 | 6.099143 |
667110d2-dda4-4b0c-97a9-3e8534938d6b | compilerai/counter | llvm-project/llvm/tools/llvm-rc/ResourceScriptCppFilter.cpp | #include "ResourceScriptCppFilter.h"
#include "llvm/ADT/StringExtras.h"
#include <vector>
using namespace llvm;
namespace {
class Filter {
public:
explicit Filter(StringRef Input) : Data(Input), DataLength(Input.size()) {}
std::string run();
private:
// Parse the line, returning whether the line should be i... | TOOL | 0.914963 | 6.948372 |
1123e341-5964-4b5d-b1e2-17128b44fc81 | myunbin/PS | BOJ/12013.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
#define fileio() freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)
#define fio() ios_base::sync_with_std... | ALGO | 0.999957 | 4.482848 |
1f648972-7933-4ab2-b591-4d3ddff513b1 | aosp10-public/external_libcxx | test/std/algorithms/alg.nonmodifying/alg.any_of/any_of.pass.cpp | // <algorithm>
// template <class InputIterator, class Predicate>
// constpexr bool // constexpr after C++17
// any_of(InputIterator first, InputIterator last, Predicate pred);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
struct test1
{
TEST_CONSTEXPR ... | TEST | 0.920535 | 7.196279 |
8fc0189d-d237-4c3a-9c6a-9099c4761a31 | SkyLoaderr/xray-last-days | xray/utils/xrAI/xr_graph_merge.cpp | ////////////////////////////////////////////////////////////////////////////
// Module : xr_graph_merge.cpp
// Created : 25.01.2003
// Modified : 25.01.2003
// Author : Dmitriy Iassenev
// Description : Merging level graphs for off-line AI NPC computations
/////////////////////////////////////////////////////////... | ALGO | 0.982547 | 4.302715 |
caf64d9b-f26d-4ea0-86bc-6da9817872ff | chenxiaohui/leetcode | leetcode/SimplifyPath.cpp | /*
Given an absolute path for a file (Unix-style), simplify it.For example,
path = "/home/", => "/home"
path = "/a/./b/../../c/", => "/c"
click to show corner cases.Corner Cases:
Did you consider the case where path = "/../"?
In this case, you should return "/".
Another corner case is the path might contain multiple s... | ALGO | 0.98944 | 6.129019 |
b999f0cd-cee8-415a-9841-427908b140d1 | ishandutta2007/codeforces | bluediamond/normal/794/F.cpp | #include <bits/stdc++.h>
using namespace std;
bool home = 1;
typedef long long ll;
#define int ll
signed realMain();
signed main() {
#ifdef ONLINE_JUDGE
home = 0;
#endif
if (home) {
freopen ("input", "r", stdin);
} else {
ios::sync_with_stdio(0); cin.tie(0);
}
realMain();
}
const int N = (int) 1e... | ALGO | 0.999647 | 4.558878 |
bccf9f86-f087-4794-9108-b0316decc7f5 | himel5113/Problem_solving- | 405A.Gravity Flip.cpp | #include<bits/stdc++.h>
#define ll long long
#define endl '\n'
#define st(a) sort(a, a+n)
#define vecst(v) sort(v.begin(), v.end())
#define tc() ll test_case;cin>>test_case;while(test_case--)
#define opt() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
int main() {
opt();
... | ALGO | 0.99941 | 3.573369 |
364f4976-a67a-4aff-b81d-ebac82d69262 | BHOJANE-VARUN/MyVscode | cp/Contests/contest137/A.cpp | #include<bits/stdc++.h>
#define int long long int
#define yes cout<<"YES"<<endl;
#define no cout<<"NO"<<endl
#define MOD 1000000007
//const int maxsize = 1e5;
//int arr[maxsize+1];
#define test int monu;cin>>monu;while(monu--)
using namespace std;
signed main()
{
test
{
vector<pair<int,int>> arr;
int n;
cin... | ALGO | 0.999927 | 4.035689 |
85dfbb77-3428-45a0-9d04-c4f4b67c7a1a | Souil51/flutter_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.9988 | 6.76073 |
1f9d1683-2e73-423f-85d7-59889b86169d | vertver/OpenLR | src/editors/LevelEditor/Edit/ESceneAIMapTools_Pick.cpp | #include "stdafx.h"
#pragma hdrstop
#include "ESceneAIMapTools.h"
#include "scene.h"
#include "../ECore/Editor/ui_main.h"
#include "ui_leveltools.h"
#include "ESceneAIMapControls.h"
#include "ui_levelmain.h"
SAINode* ESceneAIMapTool::PickNode(const Fvector& start, const Fvector& dir, fl... | TOOL | 0.993626 | 5.098211 |
12c2fd94-e1ea-403c-a69b-ba23e185df93 | SeonMoon-Lee/practicsCpp | StackToQueue/StackToQueue/main.cpp | #include <iostream>
#include <stack>
using namespace std;
template<typename T>
class StackToQueue
{
stack<T> inStack;
stack<T> outStack;
public:
void Enqueue(T data)
{
inStack.push(data);
}
T Dequeue()
{
if (isEmpty())
return 0;
T data;
while (!inStack.empty())
{
data = inStack.top();
inSta... | ALGO | 0.999553 | 5.163352 |
acb74b2e-f1d8-4479-9064-1e6871f8cfe4 | Safwan-Ibrahim/CPP | Codeforces Ratingwise/1700/D_Fewer_Batteries.cpp | // Created on: 2025-06-23 14:43
// Author: Safwan_Ibrahim
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
const int nn = 2e5 + 17;
int n, m, A[nn];
vector<pair<int, int>> G[nn];
bool bfs(int x) {
vector<ll>Mx_batt(n + 1, -1e9);
Mx_batt[1] = A[1];
for (int u = 1; u <=... | ALGO | 0.999974 | 5.010782 |
7087091f-ae30-4c60-8c8f-0578c411b946 | LostSunset/nextfoam-cfd-202407 | ThirdParty-2407/sources/boost/boost_1_74_0/libs/compute/perf/perf_stl_is_permutation.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
// create ve... | TEST | 0.933951 | 5.791606 |
a43713a5-061e-47ba-95af-a5511101e625 | abufarhad/Codeforces-Problems-Solution | 368B Sereja and Suffixes.cpp | #include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define scl(n) scanf("%lld", &n)
#define scf(n) scanf("%lf", &n)
int main()
{
ll m,n,t,c,d,i,j,k,x,y,z,l,q,r;
ll cnt=0,ans=0;
scl(n);
scl(m);
set<ll>s;
ll a[n],b[n];... | ALGO | 0.999905 | 3.751006 |
b58b3b47-1d66-4af9-a624-550dc8bf5b64 | leo-ai-for-trading/CodeChef | Contest/Geometric Mean Inequality .cpp | #include <iostream>
using namespace std;
int main(){
int test;
cin >> test;
while (test--){
int n;
cin >> n;
int arr[n];
int x = 0, y = 0;
for (int i = 0; i < n; i++){
cin >> arr[i];
if (arr[i] == -1){
x++;
... | ALGO | 0.999808 | 4.011034 |
e156dab2-0355-44c0-8beb-65b7b52f4a95 | whosthemaan/LeetCode_CPP | recursion/merge_sort.cpp | #include <iostream>
using namespace std;
void merge(int *a, int s, int e)
{
int mid = (s+(e-s))/2;
int len1 = mid - s + 1;
int len2 = e - mid;
int *first = new int[len1];
int *second = new int[len2];
int mainArrayIndex = s;
for(int i=0;i<len1;i++)
first[i] = a[mainArrayIndex+... | ALGO | 0.999981 | 4.276205 |
70fa8695-4e35-4a1b-af4a-7442ec028f3c | kevin1031-1/2020cce | Untitled6.cpp | #include<stdio.h>
int main()
{
int n,k=0;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
if(n%i==0) k=k+1;
}
printf("%d\n",k);
}
| ALGO | 0.999775 | 3.965395 |
36ce8b29-0c5c-4069-af7d-631b413e5653 | paulmathai01/CODECHEF | AGAMEONGRAPH.cpp | #ifdef _MSC_VER
#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:66777216")
#else
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#endif
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2000;
int n;
int ... | ALGO | 0.999784 | 5.065673 |
db591bc1-84bc-41da-a8dc-eaa366649ff6 | rohitsinghkcodes/Hacktober-CP-contributions | CODEFORCES Questions Solutions (CP)/1389A_LCM_Problem.cpp | //code by Nikhil Nagrale
//nikhilnagrale2 on EveryPlatform
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int l,r;
cin>>l>>r;
if(2*l>r) cout<<"-1 "<<"-1"<<endl;
else cout<<l<<" "<<2*l<<endl;
}
return 0;
} | ALGO | 0.999527 | 3.684984 |
c097aaf9-b26f-4279-82a3-b70b26a23b59 | debarpanj/Different-File-Allocation-Schemes-Implementation | indexed_allocation.cpp | #include <iostream>
#include <vector>
#include <string>
#include <chrono>
#include <algorithm>
#include <cmath>
#define total_num_blocks 50
#define block_size 5 // each block can hold 5 character data string
using namespace std;
int free_blocks = total_num_blocks;
// each block is capable of holding 5 char only
typedef... | TOOL | 0.899399 | 4.289358 |
7f2076dc-2d49-495b-ad8e-1d97f9e38334 | BitFunnelComp/dicComp | queryOpt.cpp |
#include<iostream>
#include<fstream>
#include<string>
#include<cstdio>
#include<cstdint>
#include <algorithm>
#include<math.h>
#include<string.h>
#include<vector>
#include<map>
#include<set>
#include<nmmintrin.h>
#include <sstream>
#include <string>
#include<sys/time.h>
#include<climits>
#include <chrono>
#includ... | DATA | 0.942965 | 3.53743 |
62f7d857-9931-4c26-a9f0-b0f481d7fd81 | madame-rachelle/hgzdoom | src/rendering/hwrenderer/scene/hw_walls_vertex.cpp | #include "r_defs.h"
#include "flatvertices.h"
#include "hwrenderer/scene/hw_drawinfo.h"
#include "hwrenderer/scene/hw_drawstructs.h"
EXTERN_CVAR(Bool, gl_seamless)
//==========================================================================
//
// Split upper edge of wall
//
//=========================================... | ALGO | 0.988607 | 4.867459 |
ec946ab8-666d-400e-9942-428da51a76cc | Platypus27-coder/Data-Structures-And-Algorithms | LeetCode for fun./Depth-First Search./from_s_to_t.cpp | #include <bits/stdc++.h>
#include <stdlib.h>
#include <vector>
using namespace std;
using ll = long long;
vector<int> adj[1005];
bool visited[1005];
int parent[1005];
void build(int n, int m) {
for (int i = 1; i <= n; i++) {
int x, y;
cin >> x >> y;
adj[x].push_back(y);
adj[y].pus... | ALGO | 0.999982 | 3.870841 |
89b6b246-8d15-4620-a5d4-a89e2669eb81 | Nakib-Arman/CSE318---ArtificialIntelligence | 3.ChainReaction/.history/main_20250616170354.cpp | #include <bits/stdc++.h>
using namespace std;
#define DEPTH 2
class Cell {
int orb_num;
int critical_mass;
char color;
public:
Cell() {
this->orb_num = 0;
this->color = 'W';
this->critical_mass = 4;
}
// Cell(int orb_num, char color) {
// this->orb_num = orb_... | ALGO | 0.998583 | 4.30577 |
3513e907-591c-401c-adfc-3da0ef432b01 | dootdoot1111/MiscCodes | Trees/ib_sorted_Array_to_balanced_BST.cpp | #include<bits/stdc++.h>
using namespace std;
// Definition for binary tree
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
//sorted array ka mid will be the node, and phir left child will start se mid-1 ka mid value, righ... | ALGO | 0.999983 | 6.064939 |
7317a371-d6ad-4237-b8db-b0f12c7d1d3a | farkhor/PaRMAT | src/GraphGen_notSorted.cpp | #include <vector>
#include <thread>
#include <mutex>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <functional>
#include <random>
#include <ctime>
#include "internal_config.hpp"
#include "GraphGen_notSorted.hpp"
#include "Square.hpp"
#include "Edge.hpp"
#include "threadsafe_queue.hpp"
#include "... | ALGO | 0.994175 | 6.302451 |
cd0ca9f4-9efe-4876-a60a-d92beff7096d | SingularDuo/C-COMPETITIVE-TRAINING | BT-CO-SUONG/redo/MOBI.cpp | /*
_.-- ,.--.
.' .' /
@ |'..--------._
/ \._/ '.
/ .-.- \
( / \ \
\ '. | #
\ \ -. /
:\ | )._____.' \
" | / \ | \ )
Kduckp ... | ALGO | 0.99977 | 4.412532 |
88ec6f7e-4c26-4330-8bf1-18d15869143b | olkido/libigl_smgpclass | include/igl/forward_kinematics.cpp | IGL_INLINE void igl::forward_kinematics(
const Eigen::MatrixXd & C,
const Eigen::MatrixXi & BE,
const Eigen::VectorXi & P,
const std::vector<
Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & dQ,
std::vector<
Eigen::Quaterniond,Eigen::aligned_allocator<Eigen::Quaterniond> > & vQ,
s... | ALGO | 0.99978 | 6.341595 |
4914c962-e1d1-4801-b5c6-800ed51f6fc1 | SanjnaGujral5/Cpp_Basics | Recursion/oneTon.cpp | #include<iostream>
using namespace std;
// void print(int x, int n){
// if(x>n) return;
// cout<<x<<"\n";
// print(x+1, n);
// }
// int main(){
// int n;
// cout<<"Enter n:";
// cin>>n;
// print(1, n);
// }
void print( int n){
if(n==0) return;
print(n-1);
cout<<n<<"\n";
}
in... | ALGO | 0.999356 | 3.975682 |
7a0b94f9-a9d1-4c9c-ab68-29bf01b180a5 | vishu9897/Leetcode | 18-4sum/4sum.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& arr, int target) {
int n=arr.size();
vector<vector<int>> ans;
sort(arr.begin(),arr.end());
for(int i=0;i<n;i++)
{
if(i>0 && arr[i]==arr[i-1]) continue;
for(int j=i+1;j<n;j++){
... | ALGO | 0.999959 | 5.972614 |
20776da0-16b3-467c-b06d-8e815470099e | haribaz/IPMP1921 | week-6/DAC/mergeKsortedlists.cpp | /**
* Definition for singly-linked list.
* 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) {}
* };
*/
class Solution {
public:
ListNode* combin... | ALGO | 0.999928 | 5.860197 |
cede9586-735e-463d-8a59-cb6905abb9ef | Nafyaz/my-codes | Codeforces GYM/103743K.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
#define ff first
#define ss second
#define show(x) cout << #x << ": " << x << "; "
#define MOD 1000000007
#define MAXN 1300
ll calc(ll n)
{
ll sum = 0;
while(n > (1LL << sum) - 1)
sum++;
return sum-1;
}... | ALGO | 0.99985 | 3.303855 |
a55e3eeb-ae6d-442e-a5c2-3cd7b606ab97 | orcun-gokbulut/ze-externals-sources | Source/libClang/Source/lib/Transforms/Utils/BasicBlockUtils.cpp | #include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Dominators.h"
#include "llvm/... | TOOL | 0.988419 | 7.889567 |
79095ab8-f517-48d5-8aa7-055cba1cd176 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_13269_26.cpp | #include <bits/stdc++.h>
using namespace std;
struct node {
int val;
int index;
int stat;
};
bool sortbyval(struct node a, struct node b);
bool sortbyindex(struct node a, struct node b);
int main() {
int n;
cin >> n;
struct node arr[n];
map<int, int> freq;
for (int i = 0; i < n; i++) {
cin >> arr[i]... | ALGO | 0.999967 | 3.878995 |
8051709e-9a52-4175-8333-1b56755da26c | Gin101/CS101 | luogu/T208078.cpp | #include <iostream>
#include <cmath>
using namespace std;
const int maxN = 1e5;
long long a[maxN] = {0};
int main()
{
int n = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 1; i < n; i++) {
a[i] = abs(a[i]);
}
long long result = 0;
for (int ... | ALGO | 0.999953 | 4.636934 |
dc2e0c2e-0aff-4b81-8369-351b0db18362 | SourVoice/c-leetcode-Experiment | DataStructures/graph/Breadth First Search or BFS for a Graph.cpp | #include <queue>
#include <list>
#include <iostream>
using namespace std;
class Solution
{
public:
// Function to return Breadth First Traversal of given graph.
vector<int> bfsOfGraph(int V, vector<int> adj[])
{
int s;
bool *visited = new bool[V];
for (int i = 0; i < V; i++)
... | ALGO | 0.999928 | 5.085562 |
953b1fee-ba6e-45d1-9a32-939ea09431e1 | moore3930/WMT23-Amsterdam | fairseq/fairseq/clib/libbleu/libbleu.cpp | #include <array>
#include <cstdio>
#include <cstring>
#include <map>
// NOLINTNEXTLINE
typedef struct {
size_t reflen;
size_t predlen;
size_t match1;
size_t count1;
size_t match2;
size_t count2;
size_t match3;
size_t count3;
size_t match4;
size_t count4;
} bleu_stat;
// left trim (remove pad)
void... | ALGO | 0.99563 | 7.152213 |
3ff2327b-3271-49a6-ac12-a6e4e1cf2716 | shubham21699/My-LeetCode-Solutions | 478-generate-random-point-in-a-circle/478-generate-random-point-in-a-circle.cpp | class Solution {
public:
double R, X, Y;
double doubleRand() {
return double(rand()) / double(RAND_MAX);
}
Solution(double radius, double x_center, double y_center) {
R = radius;
X = x_center;
Y = y_center;
srand(time(0));
}
... | ALGO | 0.976156 | 5.434322 |
8d3550fd-a694-44a7-b8fa-52579fbf7491 | aoaoluming/six_beauty | 代码2/poj_1915/poj_1915/poj_1915.cpp | #include<iostream>
#include<queue>
using namespace std;
struct stepNode
{
int x;
int y;
int step;
};
bool vist[301][301];
int chessSize;
queue<stepNode> stepQueue;
void doSearch(stepNode stepSour,stepNode stepDest)
{
//ʼ
memset(vist,0,sizeof(vist));
while(stepQueue.size()) stepQueue.pop();
stepQueue.push(s... | ALGO | 0.999833 | 3.232333 |
bce76a0d-8f7b-4221-978f-3241e7964733 | bantox1231/FinAnalyze | 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 |
504f5972-b486-4551-b50e-5ebc425c04e7 | Aditya-9131/Data_Structure_Algorithm_C_plus | LinearSearch.cpp | # include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter the sizeOfarray: ";
cin>>n;
int arr[n];
cout<<"Enter the element of array: ";
for(int i=0; i<n; i++){
cin>>arr[i];
}
int x;
cout<<"Enter x element of array: ";
cin>>x;
// check mark introduce Boo... | ALGO | 0.999801 | 4.103722 |
46c3ba8d-9071-4520-a3e2-62894f1364ed | abrowne2/MITIE-pNACL | MITIE/examples/matlab/tokenize_file.cpp | #include <dlib/matrix.h>
#include <fstream>
#include <string>
#include <mitie/conll_tokenizer.h>
using namespace dlib;
using namespace std;
using namespace mitie;
void mex_function (
const std::string& filename,
std::vector<std::string>& tokens
)
{
tokens.clear();
ifstream fin(filename.c_str());
i... | TOOL | 0.927107 | 5.341285 |
f9910f4f-0cbe-474b-9790-2b9b49c39021 | sivaps/optimized-algorithm-library | OptimizedAlgorithmLibrary/tests/algorithms/sorting/test_quick_sort.cpp | #include "quick_sort.h"
#include <iostream>
#include <vector>
int main() {
std::vector<int> arr = {38, 27, 43, 3, 9, 82, 10};
std::cout << "Original Array: ";
for (int num : arr)
std::cout << num << " ";
quickSort(arr, 0, arr.size() - 1);
std::cout << "\nSorted Array: ";
for (int num ... | ALGO | 0.999746 | 5.746155 |
d6c284d8-0574-4309-a99c-92f70b0cf169 | Arshkhan-14/full-c-with-oops | revsion of cpp/complex_clas.cpp | #include<iostream>
using namespace std;
class complex
{
private:
int a,b;
public:
void setdata(){
cout<<"enter value of a and b "<<endl;
cin>>a>>b;
}
void display(){
cout<<"value of a "<<a<<endl<<"value of b "<<b<<endl;
}
void setdatabysum(complex a1,complex a2){
... | TOOL | 0.960161 | 3.641636 |
c32b1df8-053e-4f3e-b8b1-a64534beefd3 | JeongHyeon-Kim/Algorithms | Weekly Contest 270/1번 - 3점/Finding 3-Digit Even Numbers.cpp | // problem source: https://leetcode.com/contest/weekly-contest-270/problems/finding-3-digit-even-numbers/
// https://ansohxxn.github.io/algorithm/permutation/#%EC%9E%AC%EA%B7%80%EB%A1%9C-%EA%B5%AC%ED%98%84%ED%95%9C-%EC%BD%94%EB%93%9C-1
// https://pythonq.com/so/c%2B%2B/805667
class Solution {
public:
void swap(int&... | ALGO | 0.999859 | 5.789537 |
ba9cd8ba-5f92-49b7-bb15-ffbbfb57f3b4 | zenvite2/DSAA_PTIT | _old C++/daysohailstone.cpp | #include <iostream>
#include <vector>
using namespace std;
main(){
int n;
while(1){
cin >> n;
if(n==0) break;
vector<int>v(1,n);
while(v.back() != 1){
if(n % 2 ==0){
n = n/2;
v.push_back(n);
}
else{
... | ALGO | 0.999982 | 4.389052 |
6e947ae6-ca31-46d8-a3b1-c2f291eda8c5 | speedcuberayush/DSA | 03_Strings/02ReverseWords.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
string reverseWords(string s)
{
stack<string> stk;
string word;
for (int i = 0; i < s.size(); ++i)
{
if (s[i] != ' ')
word += s[i];
else if (!word.empty())
... | ALGO | 0.999979 | 6.108717 |
9d24afb8-5ad5-4512-9477-39c03a917186 | motalhafarooqui/DSA-in-C-plus-plus | Functions/code.cpp | #include <iostream>
using namespace std;
//sum of 2 numbers
double sum(double a, double b){
double s = a + b;
return s;
}
//min of two numbers
int min(int a, int b){
if (a<b){
return a;
} else{
return b;
}
}
int main(){
cout<<"Sum of the number "<<5<<" and "<<6<<" is "<<sum(5,... | TOOL | 0.958321 | 4.763409 |
fce82662-a437-4386-9c29-784865264219 | viraj071/SPOJ | 4. Transform the Expression/ONP.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <map>
#include <stack>
using namespace std;
int main(){
int t=0;
cin>>t;
while(t--){
stack<char> mystack;
string s="";
cin>>s;
for(int i=0;i<s.length();i++){
if(s[i]>='a'&&... | ALGO | 0.999296 | 3.54576 |
75fb31f4-502b-475a-8de7-27d30ccb4002 | ishandutta2007/codeforces | shzhang/normal/981/D.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <utility>
#include <random>
#include <chrono>
using namespace std;
#define ll long long
int n, k;
ll cur = 0;
ll a[55];
boo... | ALGO | 0.999938 | 3.962586 |
84aabed2-ec43-4196-a73f-6f0e8bdc196d | C-2023-1-3/8209230217Lijingwen | Project1.5.cpp | #include<iostream>
#include<iomanip>
int main()
{
float F, t;
std::cout << "óڽ϶תΪ϶ȡ" << std::endl;
std::cout << "뻪϶ȣF = ";
std::cin >> F;
t = (F - 32) / 1.8;
std::cout << std::fixed << std::setprecision(2) << "Ӧ϶Ϊt = " << t << std::endl;
} | TOOL | 0.976093 | 3.893913 |
a5f4e379-0227-47ca-b385-f640c7a721af | sooglejay/geeksforgeeks | dp/[错题]技巧+数学+dp.cpp | //
// Created by sooglejay on 17/1/8.
//
//这道题我其实做对了,但是我没有想出来dp解法,和一般解法,所以,我找到几个同学的代码,来参考学习
// http://www.practice.geeksforgeeks.org/problem-page.php?pid=158
//这题的答案就是: N/2 +1
//下面首先是dp算法,其实还是在对已知的 数列作dp
#include <iostream>
#include <vector>
using namespace std;
int main()
{
long long int t;
cin >> t;
... | ALGO | 0.999846 | 4.920626 |
3d750aaf-d740-400c-99fa-2ed65fd96832 | leeeyupeng/leeeyupeng.github.io | project/algorithm/leetcode2021/src/lcci.17.09.getKthMagicNumber.cpp | #include"leetcode.h"
class Solution {
public:
int getKthMagicNumber(int k) {
vector<int> v(k,0);
v[0] = 1;
int n = 1;
int nextmin;
for(int i = 1;i < k; i ++){
nextmin = v[i-1] * 3;
for(int j = 0; j < i;j ++){
if(v[j] * 3 > v[i-1]){
... | ALGO | 0.999964 | 5.13905 |
92a3b48f-0d9e-4b8f-be68-ad58b5c08f81 | cyscgzx33/UdacityCPP | A_star/start_A_star.cpp | #include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using std::cout;
using std::ifstream;
using std::istringstream;
using std::string;
using std::vector;
using std::abs;
enum class State {kEmpty, kObstacle};
vector<State> ParseLine(string line) {
istringstream sline(line)... | ALGO | 0.999137 | 5.18611 |
ac2f9a7c-1336-4f2e-998f-5b18e4fab5fe | dirtyfilthy/llvm-project-14.0.6 | libcxx/test/std/containers/sequences/vector/vector.special/swap.pass.cpp | // <vector>
// template <class T, class Alloc>
// void swap(vector<T,Alloc>& x, vector<T,Alloc>& y);
#include <vector>
#include <iterator>
#include <cassert>
#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
int main(int, char**)
{
{
int a1[] = {1... | TEST | 0.877326 | 5.274514 |
91449970-d4b4-4127-bf99-eaab41912f2d | kwantz/training-cp | Chapter 1. Introduction/1.4 Getting Started - The Easy Problems/2. Easy/Extra UVa/00621.cpp | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
int main() {
int n, l;
cin >> n;
while (n--) {
string a;
cin >> a;
l = a.size();
if (a == "1" || a == "4" || a == "78") cout << "+" << endl;
else if (l > 2 && a[l-2] == '3' && a[l-1] == '5') ... | ALGO | 0.999929 | 4.156698 |
82a37ad5-04f2-4840-838b-b7f72e49f384 | nayeem-bd/Online-Judge-Solutions | Light OJ/1114 - Easily Readable.cpp | /*
NAYEEM
Information and Communication Engineering ,
University of Rajshahi
*/
#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define pii pair<int,int>
#define uu first
#define vv second
#define... | ALGO | 0.999652 | 3.54585 |
786a78df-40b2-4bdb-8a88-83bf997784a6 | KeepCodeing/AlgorithmRecords | LuoGu/动态规划/P6208 [USACO06OCT] Cow Pie Treasures G_dp.cpp | #include <iostream>
#include <cstring>
#define endl '\n'
using namespace std;
const int N = 100 + 10;
int mp[N][N], f[N][N];
int r, c;
int main() {
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
cin >> r >> c;
for (int i = 1; i <= r; i++) {
for (int j = 1; j <= c; j++) {
cin >> mp[i][j];
}
}
memse... | ALGO | 0.999607 | 4.372023 |
21a3214f-0f63-4147-bcea-b9ce3457d58e | Hadi-Hajieghrary/RRT-Path-planning | src/KDTree.cpp | #include "KDTree.hpp"
void KDTree::add(const std::shared_ptr<Node> &node) {
if (node->_parent != nullptr) node->_parent->_is_leaf = false;
_leaves.push_back(node);
if (std::log2(_leaves.size()) * (1 / REBALANCE_RATIO) <= _depth) {
// rebuild balanced kd-tree
recursiveClearOut(_root);
_root = nullptr... | ALGO | 0.999519 | 6.381863 |
94b40ac4-dedf-4bef-a963-b03bc6a05a26 | codecpacka/cprogrammes | selectionsortupdated.cpp | #include<stdio.h>
#include<stdlib.h>
#define pf printf
#define sf scanf
int min(int a[],int index,int n)
{ int j ,minval,loc;
minval=a[index];
loc=index;
for(j=index+1;j<n;j++)
{
if(minval>a[j])
{
minval=a[... | ALGO | 0.999972 | 3.074901 |
88fb608b-b933-4299-8034-f786438be356 | romie88/leetcode.com | 2010.10.Print.Edge.Nodes.Boundary.of.a.Binary.Tree.cpp | #include <iostream>
#include <stack>
/**
* Definition of left-most node
* If a node is a left-most node, then its left child must be a left-most node
* as well.
* If its left child does not exist, then its right child will be a left-most
* node.
*/
struct Node {
int val;
Node * left;
Node * ri... | ALGO | 0.999779 | 5.016144 |
c560aed7-bae1-4f7e-afd1-332a061f96c5 | nayoungk1m/CSE2010 | week12/binary_searcch/binary_search.cpp | // Practice 12. Search
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <sstream>
#include <tuple>
#include <vector>
#include <utility>
using namespace std;
const char BINARY_SEARCH = 'B';
const char PERFECT_SQUARE = 'P';
int binarySearch(vector<int> arr, int x) {
int start = 0; ... | ALGO | 0.982168 | 4.079306 |
0f1c58fc-8f19-4ce6-9b88-17e6533a7e00 | mdshoeb2050/CN-foundation-Cplusplus | patterns/trianglep2.cpp | #include<iostream>
using namespace std;
int main (){
int n,i,j;
cout<<"Enter a number to print Triangular pattern:"<<endl;
cin>>n;
i=1;
while(i<=n)
{
j=1;
int p=i; // Yaha p ko i ki har iteration ki Last value store karenge p variable me.
while(j<=i)
{ // ... | ALGO | 0.999899 | 4.256665 |
5cc5d8f0-f6ff-4e04-bcfd-e5ca19c0accf | NANDSS1/hot100 | tree/erchashudecengxubianli.cpp | class Solution {
public:
vector<vector<int>> levelOrder(TreeNode* root) {
//二叉树的层序遍历,先把根节点放进队列
if(root == nullptr) return {};
queue<TreeNode*> que;
que.push(root);
vector<vector<int>> ans;
while(!que.empty()){
int size = que.size();
vector<int>... | ALGO | 0.999956 | 5.821003 |
23f29b21-a9e4-4201-acfe-33a05159cacd | apache-hb/simcoe-project | src/common/config/src/config/options.cpp | #include "stdafx.hpp"
#include "core/core.hpp"
#include "core/error.hpp"
#include "config/config.hpp"
#include "config/parse.hpp"
#include "config/config.hpp"
using namespace sm;
using namespace sm::config;
static sm::opt<bool> gOptionHelp {
name = "help",
desc = "print this message"
};
static sm::opt<bool... | TOOL | 0.981688 | 7.086018 |
8ffd2c52-8f2d-40cb-905a-6a866f71f3d3 | martapereira0/DAA | Preparação_Testes/Preparação-Teste1/DAA010.cpp | #include <iostream>
#include <array>
#include <algorithm>
using namespace std;
int procurar(int high,int low, int value,int somas[],int N){
while(low < high){ // percorrer o array enquanto low != high ou então até encontrar exatamente o valor a procurar
int middle = low + (high - low) / 2;
if (valu... | ALGO | 0.999962 | 4.347579 |
091350d3-e192-4065-b916-dbe47b0bef87 | compix/Monte-Carlo-Raytracer | third_party/assimp/code/Importer/IFC/IFCBoolean.cpp | /** @file IFCBoolean.cpp
* @brief Implements a subset of Ifc boolean operations
*/
#ifndef ASSIMP_BUILD_NO_IFC_IMPORTER
#include "code/Importer/IFC/IFCUtil.h"
#include "code/PolyTools.h"
#include "code/ProcessHelper.h"
#include <assimp/Defines.h>
#include <iterator>
#include <tuple>
namespace Assimp {
namesp... | ALGO | 0.988919 | 7.170165 |
b3a60862-d8ea-47c7-b8f6-6fab0ab08381 | prernasaxena3/Coding_Practice | string/Edit Distance.cpp | //Edit Distance
/*Given two strings str1 and str2. Return the minimum number of operations required to convert str1 to str2.
The possible operations are permitted:
Insert a character at any position of the string.
Remove any character from the string.
Replace any character from the string with any other character.*/
... | ALGO | 0.999991 | 6.545951 |
bced8c6f-a79e-4ed9-925f-15aa19cc17c3 | saurabh-vit/GfG | Difficulty: Medium/Longest Substring with K Uniques/longest-substring-with-k-uniques.cpp | class Solution {
public:
int longestKSubstr(string &s, int k) {
// code here
int n = s.size();
vector<int> freq(26, 0);
int left = 0, right = 0;
int dist = 0;
int maxlen = -1;
while(right<n){
if(freq[s[right]-'a']==0){
dist++;
... | ALGO | 0.999883 | 5.281806 |
bb012c78-1b84-4c34-a878-0dc7e7279550 | tridhapuku/DSP_MLIR | libc/src/math/generic/fmaximum_magf128.cpp | #include "src/math/fmaximum_magf128.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/common.h"
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(float128, fmaximum_magf128, (float128 x, float128 y)) {
return fputil::fmaximum_mag(x, y);
}
} // namespace LIBC_NAMESPACE
| ALGO | 0.984068 | 6.289416 |
21185160-26eb-4625-875b-ddeff963554b | 21p31a0422/Owl-Coder | 975-range-sum-of-bst/range-sum-of-bst.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.99999 | 6.653168 |
52335847-8803-4340-940e-c1bd9a1e0fc6 | HC-Chang/LeetCode | complete/2016.maximum-difference-between-increasing-elements.cpp | /*
* @lc app=leetcode id=2016 lang=cpp
*
* [2016] Maximum Difference Between Increasing Elements
*/
// @lc code=start
class Solution
{
public:
int maximumDifference(vector<int> &nums)
{
int n = nums.size();
vector<int> max_arr(n);
vector<int> min_arr(n);
max_arr[n - 1] = num... | ALGO | 0.999757 | 5.593534 |
61b8b401-93a4-46f0-8506-b00ef02309d4 | theshinegupta/LeetCode | Pattern 1 - GFG/pattern-1.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void printSquare(int n) {
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
cout<<"*"<<" ";
}
cout<<"\n";
}
... | ALGO | 0.999649 | 4.781317 |
1cc4ed36-5f0f-401e-beb7-1e765338c4df | ishandutta2007/codeforces | sonechko/normal/895/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define ld long double
#define ll long long
const int N = 1e5 + 11;
int a[N];
map<int,int> mt;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n,x,k;
cin>>n>>x>>k;
for (int i=1; i<=n; i++)
cin>>a[i];
ll ans=0;
sort(a+1,a+... | ALGO | 0.999967 | 3.482369 |
b0834b55-54ba-438e-847e-56b0401155a2 | Caprico1/Docker-Botnets | mo/blackt/root/xmrig/src/core/Miner.cpp | #include <algorithm>
#include <mutex>
#include <thread>
#include "core/Miner.h"
#include "3rdparty/rapidjson/document.h"
#include "backend/common/Hashrate.h"
#include "backend/cpu/Cpu.h"
#include "backend/cpu/CpuBackend.h"
#include "base/io/log/Log.h"
#include "base/io/log/Tags.h"
#include "base/kernel/Platform.h"
#in... | TOOL | 0.896113 | 6.796966 |
79c900d4-ce95-4e84-8352-f3337465f38b | MiroKaku/Musa.Runtime | Microsoft.VisualC.Runtime/UCRT/10.0.22621.0/ucrt/mbstring/mbsspn.cpp | #ifndef _MBCS
#error This file should only be compiled with _MBCS defined
#endif
#include <corecrt_internal.h>
#include <corecrt_internal_mbstring.h>
#include <locale.h>
#include <stddef.h>
#include <string.h>
/***
*ifndef _RETURN_PTR
* _mbsspn - Find first string char not in charset (MBCS)
*else
* _mbsspnp - Fin... | ALGO | 0.993076 | 5.696128 |
9e737c31-0dc2-4978-9d4f-0905338299fc | zhbei/offer_code | q18deleteListNode.cpp | #include <iostream>
#include <cstdio>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode(int v){
val = v;
}
};
void PrintList(ListNode* head){
while(head != NULL){
cout << head->val << " ";
head = head->next;
}
cout << endl;
}
void PrintListNode(ListNode * head){
if(head != NULL)
... | ALGO | 0.999663 | 4.228287 |
f753da27-52d8-4c89-8e9b-1f0dd73c73ae | percyqaz/AdventOfCode_2024 | 06-b.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <set>
__int64 solution_06_b(const char* input)
{
std::ifstream file(input);
_ASSERT(file.is_open());
std::vector<std::string> lines;
std::string line;
size_t x{ 0 };
size_t y{};
char direction = 'U';
while (std::getline(file, ... | ALGO | 0.999813 | 4.739402 |
d16f28b4-c645-4b36-9ca4-73d478988a1b | vatsalvasani/Progrmamming2 | code/Min_Step_In_Grid.cpp | // You are in an infinite 2D grid where you can move in any of the 8 directions
// (x,y) to
// (x-1, y-1),
// (x-1, y) ,
// (x-1, y+1),
// (x , y-1),
// (x , y+1),
// (x+1, y-1),
// (x+1, y) ,
// (x+1, y+1)
// You are given a sequence of points and the order in which you ne... | ALGO | 0.999892 | 5.136389 |
75c3403e-a1a3-46c4-a751-f7571275f93e | iSuneast/uva-codes-for-acm-icpc | UVa 10000/10025 - The 1 2 ... n = k problem_0114_number theory.cpp | /*
10025 - The ? 1 ? 2 ? ... ? n = k problem
*/
/*
main----i---ΪӶηó.....
Ϊ (1+n)*n/2>=i..........
(1+i)*i/2............õ1+...+nĺ...
SUM1=1+2+.....+ANS+.....+i;
SUM2=1+2+.....-ANS+.....+i;
Եõ.....SUM2-SUM1=2*ANS........
ݶԳ....n........-n....ȡֵһ...
*/
#include<iostream>
#include<cmath>
using namespace std;
... | ALGO | 0.999835 | 3.980582 |
0a293a0d-c331-4fd7-a489-5b7a1a52ce67 | itstep2014springEvening/Klindziuk_DZ | Classwork/guess_the_animal/main.cpp | #include <cstring>
#include <cstdio>
#include <cstdlib>
#define STRLENGTH 1024
using namespace std;
struct Node
{
char str[STRLENGTH];
Node *yeslink;
Node *nolink;
};
void clearTree(Node *&node)
{
if(node)
{
clearTree(node->yeslink);
clearTree(node->nolink);
delete node;
... | TOOL | 0.85169 | 3.338176 |
b230bfdf-f761-4e92-9a17-d980674049ad | liamm545/mumo_parking | se2_navigation/se2_approach_pose_planning/approach_pose_planner/src/ApproachPosePlanner.cpp | /*
* ApproachPosePlanner.cpp
*
* Created on: Sep 11, 2019
* Author: jelavice
*/
#include "approach_pose_planner/ApproachPosePlanner.hpp"
#include "approach_pose_planner/ApproachPoseHeuristic.hpp"
#include "ompl/base/spaces/ReedsSheppStateSpace.h"
#include "se2_planning/OmplReedsSheppPlanner.hpp"
namespace ... | ALGO | 0.999681 | 5.036319 |
499e8f1b-72c7-46d5-b0cd-35ce95d82793 | Anshumanformal/CPP | polymorphism.cpp | #include<iostream>
using namespace std;
//Function overloading : same name but different parameters.
void area(int, int);
void area(int);
void area(int x, int y){
cout<< 3.14 * x * y;
cout<<endl;
}
void area(int x){
cout<< x * x;
cout<<endl;
}
int main(){
area(5,6);
area(5);
}
| TOOL | 0.973163 | 4.44764 |
12e5a1bc-8f72-4321-85ff-a9a0835e41aa | xajhab/IN2354 | Exercise-2/main.cpp | #include <iostream>
#include "Eigen.h"
#include "ImplicitSurface.h"
#include "Volume.h"
#include "MarchingCubes.h"
int main()
{
std::string filenameIn = "../../Data/normalized.pcb";
std::string filenameOut = "result.off";
// implicit surface
ImplicitSurface* surface;
// TODO: you have to switch between these su... | ALGO | 0.941639 | 6.179077 |
17f01ee5-e58a-4228-a7be-aa89781061ff | ishandutta2007/codeforces | icecuber/normal/1324/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int nax = 2e5;
int col[nax];
vector<int> node[nax];
int dp[nax]; //maxmimum for subtree of p
void dfs1(int p, int par) {
dp[p] = col[p];
for (int i : node[p]) {
if (i == par) continue;
dfs1(i, p);
dp[p] += max(dp[i], 0);
}
}
... | ALGO | 0.999962 | 4.441776 |
3443dfee-1f81-489c-afc1-cffd20546d3a | ishandutta2007/codeforces | theoneyouwant/normal/1468/H.cpp | //By TheOneYouWant
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define memreset(a) memset(a,0,sizeof(a))
#define testcase(t)... | ALGO | 0.999966 | 3.794486 |
fb68cdda-6a31-4891-9e1d-ae4626428d70 | xKMx1/tpProjekt3 | _deps/eigen-src/doc/examples/Tutorial_BlockOperations_corner.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::Matrix4f m;
m << 1, 2, 3, 4,
5, 6, 7, 8,
9, 10,11,12,
13,14,15,16;
cout << "m.leftCols(2) =" << endl << m.leftCols(2) << endl << endl;
cout << "m.bottomRows<2>() =" << endl << m.bottomRows<2>() << endl << ... | ALGO | 0.998158 | 4.092313 |
8c8502fd-f598-4db7-b5c9-589cc0bc4553 | ankurmittal9082/Assignment-hackerarnk | CUBE.cpp | #include<stdio.h>
int main()
{
int n;
printf("Enter Number : ");
scanf("%d",&n);
int cube = n*n*n;
printf("Cube is %d ",cube);
return 0;
}
| TOOL | 0.992606 | 3.237422 |
c60be984-1b4e-4fc8-b391-a8c05ad53ce1 | joshualass/CP | Solutions/Contests/CodeForces/CFEd152/arraypainting.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
void printV(const vector<bool> &x) {
cout << " --- vector --- \n";
for(bool y : x) {
cout << y << " ";
}
cout << "\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
... | ALGO | 0.999984 | 4.270453 |
1440cf0e-cfaf-4508-aeb5-d6d1e41b40c0 | joydip007x/CompetitiveCodeArchive | URAL/1009/18688593_AC_1ms_448kB.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll int
#define ret return
///*/////////////////// /// *
/*// author-joydip007x /// */
#define M 9999
ll dp[M] ,n,lmt,t,k;
vector<ll>v;
ll fun(ll last)
{
if(last==1) ret k;
if(last==0) ret 1;
// if(dp[last]!=-1) ret dp[last];
ret dp[last]= ( (k-1... | ALGO | 0.999973 | 3.400542 |
019db490-5148-41b1-a1ac-e97c1e98a2ec | praneethaBrindavanam/LeetCode | 226-invert-binary-tree/invert-binary-tree.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.999972 | 6.436763 |
59047ee5-c4e5-451b-8035-c5aebecc4142 | jordirocha/FIB | PRO1_2025_PRIMAVERA/Algorismes/p0014_valls_numeriques.cpp |
#include <iostream>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b>>c;
cout<<a+b+c<<endl;
}
| ALGO | 0.999608 | 3.442572 |
f2ce4070-ce4c-40b8-bba4-6f554929f340 | parthsarthiprasad/Competitive_Programming | codeforces/662div2/p2last.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
map<int,int> m;
int four=0,t=0;
void process(){
map<int,int>::iterator itr;
for( itr=m.begin();itr!=m.end();itr++){
int c=itr->second/4;
four+=c;
int tempcount=itr->second%4;
tempcount=tempcount/2;
t+=tempcount;
... | ALGO | 0.999904 | 4.081798 |
8edc9375-dbcc-4b16-9b5d-ad1846ab3567 | buyunwang/CS426 | CPSC426_A4/include/eigen/doc/examples/tut_matrix_coefficient_accessors.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,2);
m(0,0) = 3;
m(1,0) = 2.5;
m(0,1) = -1;
m(1,1) = m(1,0) + m(0,1);
std::cout << "Here is the matrix m:\n" << m << std::endl;
VectorXd v(2);
v(0) = 4;
v(1) = v(0) - 1;
std::cout << "Here is the vector v:\n... | ALGO | 0.998902 | 3.687909 |
e9382fb8-2ed3-45f9-825e-4ca7ccf53c05 | FranciscoThiesen/OldProblems | Codeforces/pastProblems/educational8A.cpp | #include <cstdio>
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
int n, b, p;
scanf("%d%d%d", &n, &b, &p);
int current = n;
int bottles = 0;
int towels = 0;
for(int j = 0; j < n;++j)
{
if(pow(2,j) > current)
{
bottles += (pow(2,j-1)*b) + ... | ALGO | 0.999395 | 3.483144 |
d9dad863-bd4e-46bd-8898-f6391d095a0e | Eyaslimen/Codeforces_solutionss | A - Hit the Lottery.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<string> vs;
#define in(v,n) for(int i=0; i<n; i++) cin>>v[i]
#define out(v,n) for(int i=0; i<n; i++) cout<<v[i]<<"... | ALGO | 0.99996 | 3.517688 |
c051b158-f6d6-4c92-82f0-961d978120aa | arshathMcw/AVX_Intrinsics | grayscale_conversion.cpp | #include<iostream>
#include <xmmintrin.h>
using namespace std;
void print_reg(__m128 reg){
float res[4];
_mm_store_ps((float*)&res,reg);
for(auto val : res) cout<<val<<" ";
cout<<endl;
}
void normal_function(){
int n = 16;
int m = 4;
int max = 255;
float input[n] = {1,2,3,4,5,6,7,8,9,10,... | ALGO | 0.980534 | 3.781887 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.