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 |
|---|---|---|---|---|---|---|
1bc5684d-9711-4a66-80d8-c176eb2d65c7 | charvig23/TRC_assignment1 | a1_q9.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,i,j,gcd=1,lcm=1,max=0;
cout<<"enter two numbers";
cin>>a>>b;
for(i=1;i<=a && i<=b;i++){
if(a%i==0 && b%i==0){
max=i;
}
}
cout<<"gcd is - "<<max<<"\n";
cout<<"lcm is - "<<((a*b)/max);
}
| ALGO | 0.999835 | 3.354511 |
e96efc98-4002-478b-9a3b-1f1c2162b870 | sattrr/MeetDigest | 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 |
37f8294d-fbab-49c4-8c5b-63e3a59d1eec | albertforweb/blender | extern/bullet2/src/BulletSoftBody/btDeformableContactConstraint.cpp | #include "btDeformableContactConstraint.h"
/* ================ Deformable Node Anchor =================== */
btDeformableNodeAnchorConstraint::btDeformableNodeAnchorConstraint(const btSoftBody::DeformableNodeRigidAnchor& a, const btContactSolverInfo& infoGlobal)
: m_anchor(&a), btDeformableContactConstraint(a.m_ct... | ALGO | 0.99768 | 5.636289 |
6cccc5cb-2cb3-432e-acc1-a31641ed58e1 | OpenTenBase/TXSQL | boost/boost_1_77_0/libs/graph/test/dag_longest_paths.cpp | #include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dag_shortest_paths.hpp>
#include <boost/property_map/vector_property_map.hpp>
#include <boost/core/lightweight_test.hpp>
using namespace boost;
#include <iostream>
using namespace std;
int main(int, char*[])
{
typedef adjacency_list< vecS, vecS, dir... | ALGO | 0.999018 | 5.48924 |
dcc514ce-f412-4beb-86f3-2cc7454567be | projectescape/cp-archive | IB/best-time-to-buy-and-sell-stocks-ii.cpp | int Solution::maxProfit(const vector<int> &A) {
int ans = 0;
for (int i = 1; i < A.size(); i++) {
if (A[i] > A[i - 1]) {
ans += (A[i] - A[i - 1]);
}
}
return ans;
} | ALGO | 0.998319 | 5.7244 |
bf4a2e3d-4bce-4473-91e7-d35e23b29f25 | fate7902/study | Programmers/Lv.1/신규 아이디 추천.cpp | #include <string>
#include <vector>
#include <regex>
using namespace std;
string solution(string new_id) {
for(auto& c : new_id) if(isupper(c)) c = tolower(c);
regex pattern("[^a-zA-Z0-9\\-_.]");
new_id = regex_replace(new_id, pattern, "");
while (new_id.find("..") != string::npos) {
new_i... | ALGO | 0.999331 | 6.330121 |
e1cc80a3-55fc-4b14-9aa6-5237c468ef6c | mohitg66/dsa | Graphs/kosarajuAlgorithm.cpp | // Kosaraju Algorithm for Strongly Connected Components (SCCs), O(V+E)
vector<bool> visited;
stack<int> s;
void dfs(vector<vector<int>>& adj, int i, bool topoSort){
visited[i]= 1;
for (int next: adj[i]){
if (!visited[next])
dfs(adj, next, true);
}
if (topoSort) s.push(i);
}
int kosa... | ALGO | 0.999861 | 6.012383 |
5a040221-325e-415f-b99c-317b9a0c862e | jhui/driving | Ipopt-3.12.1/Ipopt/examples/ScalableProblems/LuksanVlcek2.cpp | #include "LuksanVlcek2.hpp"
#ifdef HAVE_CONFIG_H
#include "config.h"
#else
#include "configall_system.h"
#endif
#ifdef HAVE_CMATH
# include <cmath>
#else
# ifdef HAVE_MATH_H
# include <math.h>
# else
# error "don't have header file for math"
# endif
#endif
#ifdef HAVE_CSTDIO
# include <cstdio>
#else
# ifdef HAVE_S... | ALGO | 0.99843 | 5.568479 |
4600b3d8-059f-4420-9f0d-c4999903a0be | Punctuality/Algorithms_and_Data_structures_ITMO_2020 | tasks/common_2/the_one_who_visits_1726.cpp | //
// Created by Sergey Fedorov on 26/03/2020.
//
#include <iostream>
#include <algorithm>
using namespace::std;
bool simple_compar(long long a, long long b){
return a < b;
}
int main(){
int n;
cin >> n;
long long xs[n];
long long ys[n];
for (int i = 0; i < n; ++i) {
cin >> xs[i] >... | ALGO | 0.99963 | 4.500899 |
74d04a21-6f2c-4450-bfa5-e515fc944adc | ratna-abhinav/DSA-LeetCode-GFG | Maths/LCM of N numbers.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
#define accuracy chrono::steady_clock::now().time_since_epoch().count()
mt19937 rng(accuracy);
int rand(int l, int r)
{
uniform_int_distribution<int> ludo(l, r);
return ludo(rng);
}
const int MX = 1e6+2, MOD = 1e9+7;
vector<int> spf(MX+1);
int mod... | ALGO | 0.99962 | 4.362782 |
a30f5608-f641-44be-915b-b8e8374e2cb8 | raincross7/code-similarity | codes/train_code/problem409/problem409_313.cpp | #include<string>
#include<cstdio>
#include<map>
int main(){
using namespace std;
int a,b;
char c,d,s[9];
map<char,char> code;
while(scanf("%d",&a),a){
while(a--){
scanf(" %c %c",&c,&d);
code[c]=d;
}
scanf("%d",&a);
while(a--){
scanf(" %c",&c);
if(code.count(c)==1){
putchar(code[c]);
}... | ALGO | 0.999526 | 3.147611 |
129ab70a-3bd7-4ccc-8723-4fc3502e47ea | realjjhfordev/BOJ | solved/class2/11023_eof.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n;
int sum = 0;
while(1)
{
cin >> n;
if(cin.eof()) break;
sum = sum + n;
}
cout << sum;
}
// 또는 밑의 코드
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
ios::sync_wit... | ALGO | 0.99761 | 3.748173 |
624961e2-a222-4d45-b27a-9794e09c974b | Krishna-Tiwarii/100-DAYS-OF-CODE | DAY 59:- Postorder Traversal iterative.cpp | class Solution{
public:
vector<int> postOrder(Node* node) {
// code here
stack<Node*>s;
s.push(node);
vector<int>ans;
while(!s.empty())
{
Node *temp=s.top();
s.pop();
ans.push_back(temp->data);
if(temp->left... | ALGO | 0.999981 | 6.063328 |
9c85b6de-6d9b-409b-9d3d-3e3910a841ad | stonexing/OpenPano-iOS | OpenPano-iOS/eigen-337/bench/geometry.cpp |
#include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace std;
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 8
#endif
typedef SCALAR Scalar;
typedef NumTraits<Scalar>::Real RealScalar;
typedef Matrix<RealScalar,Dynamic,Dynamic> A;
type... | ALGO | 0.944179 | 5.941502 |
2882f75e-16ee-4c42-88d3-73143c1b0971 | shrivastava12/C-programming | c++program/array_stack.cpp | #include<iostream>
using namespace std;
class Stack
{
private:
int stack_array[5];
int top;
public:
Stack()
{
top = -1;
}
int full()
{
if(top==4)
return 1;
else
return 0;
}
int Empty()
{
if(top==-1)
return 1;
... | ALGO | 0.988326 | 3.793498 |
ade4f95d-5197-437a-8eb6-e0f5376d82da | stevessr/Mooc2023t1spring | i am tired/educg/number/29731/1.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
int T;
cin >> T;
string str;
while (T--)
{
cin >> str;
reverse(str.begin(), str.end());
cout << str << endl;
}
return 0;
} | ALGO | 0.999858 | 5.076238 |
000e465a-9387-4020-8378-45e241eb67f4 | michimani/atcoder | abc/001-100/032/cpp/a.cpp | #include <iostream>
using namespace std;
using ui = unsigned int;
int main()
{
ui a, b, n;
cin >> a >> b >> n;
while (n % a != 0 || n % b != 0)
{
n++;
}
cout << n << endl;
return 0;
} | ALGO | 0.999831 | 3.960384 |
57fb7c63-6bf3-4a51-b592-962f7e8a7fde | ForhanShahriarFahim/Problem-Solving | C_Make_Them_Equal.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;
using namespace std;
//********************************************************************************************************************... | ALGO | 0.999752 | 3.990399 |
7bf15d49-8387-4d80-90e2-6f644ce76bc1 | ArmaanSeth/Cpp | Data_structure/LeetCode/BuyAndSellStock.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int recursion(vector<int> prices,vector<int>& dp, int pos){
if(pos>=prices.size()-1){
return 0;
}
else if(dp[pos]!=-1){
if(dp[pos]<0)
return 0;
return dp[pos]... | ALGO | 0.999768 | 5.206998 |
d24c1726-7abc-450f-aec1-602a18af8694 | rohitbhatghare/c-c- | Sept-10-20/FibbonacciByRecursion.cpp | #include<iostream>
#include<conio.h>
int fibo(int n);
using namespace std;
int main()
{
int n,f;
cout<<"Enter the number \n";
cin>>n;
f= fibo(n);
cout<<f<<"\n";
}
int fibo(int n)
{
if(n==0)
{
return 0;
}
else if(n==1)
{
return 1;
}
else
{
return fibo(n-1)+fibo(... | ALGO | 0.998795 | 3.000707 |
0b57e0ce-5ec4-4843-9821-60de4ac60106 | Mohid169/MPC_cart_pend | cart_pendulum.cpp | #include "cart_pendulum.hpp"
#include <iostream>
#include <cmath>
//Constants
const double g=9.81;
//Constructor for CartPendulum class
CartPendulum::CartPendulum(const double cartMass, const double pendulumMass, const double pendulumLength)
: M(cartMass), m(pendulumMass), l(pendulumLength),
x(0.0), z(pend... | ALGO | 0.992686 | 5.464225 |
c35658de-a7dc-484e-9fa3-9a0e6a03726a | Mi-Kram/HseCpp-Course1 | 06/contest/e/main.cpp | #include <algorithm>
#include <iostream>
#include <vector>
struct Group {
int number_;
int solved_;
int penalty_time_;
Group(int num, int solved, int penalty_time) : number_(num), solved_(solved), penalty_time_(penalty_time) {
}
};
class SortRule {
public:
bool operator()(const Group& a, const Group& b)... | ALGO | 0.999765 | 5.364885 |
55fb7d73-0643-49a1-a38d-1c2d3fa12aab | JonnierGrajalesAlzate/Retos-con-cpp | ciclos numeros.cpp |
#include <iostream>
using namespace std;
int main()
{
int num=10, acum;
acum=1;
do{
cout <<acum <<endl;
acum=acum + 1;
}while (acum <=num);
return 0;
}
| ALGO | 0.995622 | 3.11204 |
bffe01f2-ea83-4c78-a429-5a1464c8e268 | Ajeet1606/LeetCode-practice-problems | minimum-value-to-get-positive-step-by-step-sum/minimum-value-to-get-positive-step-by-step-sum.cpp | class Solution {
public:
int minStartValue(vector<int>& nums) {
int ans = 1, prefix = 0;
for(auto &x: nums){
prefix += x;
if(prefix < 0) ans = max(ans, abs(prefix)+1);
}
return ans;
}
}; | ALGO | 0.999919 | 5.533973 |
02a16699-a9a6-4470-9597-bbc7cb3852b7 | LifeIsRightward/Baekjoon | SWEA/D2/1926.cpp | #include <bits/stdc++.h>
using namespace std;
int n, cnt = 0;
string str;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
str = to_string(i);
cnt = 0;
for (auto a : str) {
if ((a - '0') % 3 == 0 && (a - '0') != 0) {
cnt++;
}
}
if (cnt > 0) {
for (int j = 0; ... | ALGO | 0.999558 | 4.204619 |
795f1822-f960-4bf3-a234-0961cc91b345 | vancegroup-mirrors/open-dynamics-engine-svnmirror | ode/demo/demo_crash.cpp | // This is a demo of the QuickStep and StepFast methods,
// originally by David Whittaker.
#include <ode/ode.h>
#include <drawstuff/drawstuff.h>
#include "texturepath.h"
#ifdef _MSC_VER
#pragma warning(disable:4244 4305) // for VC++, no precision loss complaints
#endif
// select correct drawing functions
#ifdef dD... | ALGO | 0.982651 | 3.972609 |
818beaa5-659d-44dc-8c5c-408f4b37df7f | vinci-grape/Rectifier | output/ChatGPT/codenet/Python/C++/s000375264.cpp | #include <iostream>
using namespace std;
int main() {
int X, t;
cin >> X >> t;
int answer;
if (X > t) {
answer = X - t;
} else if (X <= t) {
answer = 0;
}
cout << answer << endl;
return 0;
} | ALGO | 0.999726 | 3.938766 |
c6ad0358-87b0-4907-b3cc-fc358a642c0e | jlee923/cs9f-selfpace | lib/cs9f/cat+mouse.cpp | #include <iostream>
#include <cmath>
#include "positions.h"
using namespace std;
// You define the GetPositions function.
// It should read legal cat and mouse positions from the user
// and return the position values in its two arguments.
void GetPositions ( ... [you fill these in] ) {
... [you fill this in]
}
... | ALGO | 0.990107 | 3.615882 |
354ccb04-d038-42cd-944b-544a112391a1 | peteflorence/DirectSim | LineSegmentWorld-stepped-manual/scripts/eigen/doc/snippets/Tutorial_solve_triangular.cpp | Matrix3f A;
Vector3f b;
A << 1,2,3, 0,5,6, 0,0,10;
b << 3, 3, 4;
cout << "Here is the matrix A:" << endl << A << endl;
cout << "Here is the vector b:" << endl << b << endl;
Vector3f x = A.triangularView<Upper>().solve(b);
cout << "The solution is:" << endl << x << endl;
| ALGO | 0.99977 | 3.055453 |
a729c0c9-7b0e-41cf-afc8-27abae5c4514 | Randomlyclueless/DSA | C++/StriverA_to_Z/Arrays-Easy/RotatingArray.cpp | // Given an integer array nums, rotate the array to the right by k steps, where k is non-negative.
class Solution
{
public:
void rotate(vector<int> &nums, int k)
{
vector<int> temp(nums.size());
for (int i = 0; i < nums.size(); i++)
{
temp[(i + k) % nums.size()] = nums[i];
... | ALGO | 0.999891 | 6.039654 |
d49d4d2a-8b54-441f-b6f8-7d81a32e811b | tobi-ha/CarND-Path-Planning | src/Eigen-3.3/bench/spmv.cpp |
//g++-4.4 -DNOMTL -Wl,-rpath /usr/local/lib/oski -L /usr/local/lib/oski/ -l oski -l oski_util -l oski_util_Tid -DOSKI -I ~/Coding/LinearAlgebra/mtl4/ spmv.cpp -I .. -O2 -DNDEBUG -lrt -lm -l oski_mat_CSC_Tid -loskilt && ./a.out r200000 c200000 n100 t1 p1
#define SCALAR double
#include <iostream>
#include <algor... | ALGO | 0.94885 | 4.318557 |
25f4b0fb-5923-4cc8-ac5c-571e2ce95f54 | jaehoo1/Baekjoon-Online-Judge | BOJ/20000 ~ 29999/25418.cpp | # include <cstdio>
# include <queue>
using namespace std;
int A, K;
int bfs(void) {
bool visited[1000001]={false, };
queue<pair<int, int>> q;
q.push({0, A});
while(!q.empty()) {
int size=q.size();
while(size--) {
int cou=q.front().first;
int num=q.front().second;
q.pop();
if(num==K)
return co... | ALGO | 0.999833 | 3.694046 |
3fdc75c1-2bdb-4ba3-986a-b2de5673969e | hwangheejung/codingTest | c++/BOJ/_18258/18258.cpp | #include<iostream>
#include<queue>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int test_case;
cin >> test_case;
queue<int> que; //queue
for (int i = 0;i < test_case;i++) {
string str;
cin >> str;
if (str == "push") {
int a;
cin >> a;
que.push(a);
}... | ALGO | 0.998728 | 4.140681 |
4323fdf3-b4a4-455e-a230-42375131d6a5 | torchesburn/physx-wasm | PhysX/physx/source/immediatemode/src/NpImmediateMode.cpp | #include "PxImmediateMode.h"
#include "../../lowleveldynamics/src/DyBodyCoreIntegrator.h"
#include "../../lowleveldynamics/src/DyContactPrep.h"
#include "../../lowleveldynamics/src/DyCorrelationBuffer.h"
#include "../../lowleveldynamics/src/DyConstraintPrep.h"
#include "../../lowleveldynamics/src/DySolverControl.h"
#in... | ALGO | 0.930907 | 6.839583 |
9fc04981-2f48-4c6d-a7a4-97594ca7d099 | bellicose77/Problem-Solving | Codeforces/Div 2/Nested_Vector.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int x;
vector<vector<int>>v;
for(int i=0; i<3; i++)
{
vector<int>temp;
for(int j=0; j<5; j++)
{
cin>>x;
temp.push_back(x);
}
v.push_back(temp);
}
/*
// Display vector of... | ALGO | 0.997731 | 3.214005 |
a80bf6a3-6ca5-45a4-b7cb-3d3919eb29fb | H451B/problem_solving | A_Carrot_Cakes.cpp | #include <bits/stdc++.h>
using namespace std;
#define syncC ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int main(){
syncC;
int x,y,z,a,b=0,c=0;
cin>>x>>y>>z>>a;
b=ceil((double)x/(double)z);
(((b*y)-a)<=y)?cout<<"NO":cout<<"YES";
return 0;
} | ALGO | 0.996459 | 3.111533 |
22fd6163-0e94-4ff9-a372-bd815e25fd77 | lxb1226/leetcode_cpp | hot100/question39.cpp | #include <bits/stdc++.h>
#include "../templates/data_struct.h"
using namespace std;
class Solution {
public:
vector<vector<int>> res;
vector<int> path;
void backtrack(vector<int>& candidates, int idx, int target){
if(target == 0){
res.push_back(path);
return;
... | ALGO | 0.999958 | 5.378726 |
ba22f3b1-49af-4adf-87b9-aecc96aa7938 | robotology/gz-sim-yarp-plugins | plugins/controlboard/src/ControlBoardTrajectory.cpp | #include <ControlBoardTrajectory.hh>
#include <gz/physics/GetEntities.hh>
#include <gz/sim/Model.hh>
#include <gz/sim/Types.hh>
#include <gz/sim/World.hh>
#include <yarp/os/Time.h>
#include <yarp/sig/Image.h>
namespace yarp
{
namespace dev
{
namespace gzyarp
{
void Watchdog::reset()
{
m_lastUpdate = yarp::os::T... | TOOL | 0.982121 | 5.128836 |
a134161b-83cc-4bf8-a1bd-036a8b7fad80 | mitchellnel/CPP-Learning | Sorting/sorts/sorts/sorts.cpp | // sorts.cpp
#include <iostream>
#include <algorithm>
#include <numeric> // for std::accumulate
#include <utility>
#include <vector>
#include <string>
#include <random>
#include <cassert>
using namespace std;
//========================================================================
// Set this to false to skip t... | ALGO | 0.997473 | 6.867002 |
0bbb6264-2b3b-4f40-8ece-6899e3892bee | AliothDevelopment/android_hardware_qcom-caf_sm8250_media | libplatformconfig/ConfigParser.cpp | #define LOG_TAG "ConfigParser"
#include <string.h>
#include <errno.h>
#include <utils/Log.h>
#include <sys/mman.h>
#include "PlatformConfig.h"
#include "ConfigParser.h"
namespace Platform {
#define BUF_SIZE 1024
void ConfigParser::processProperty(const XML_Char **attr, ConfigMap &configMap) {
... | CONFIG | 0.874477 | 5.654586 |
9598b713-2aa2-4ec1-8288-87c206565b66 | DroidTh3ory-xx/platform_frameworks_av | media/libstagefright/codecs/avc/common/src/mb_access.cpp | #include <string.h>
#include "avclib_common.h"
OSCL_EXPORT_REF void InitNeighborAvailability(AVCCommonObj *video, int mbNum)
{
int PicWidthInMbs = video->PicWidthInMbs;
// do frame-only and postpone intraAvail calculattion
video->mbAddrA = mbNum - 1;
video->mbAddrB = mbNum - PicWidthInMbs;
video-... | ALGO | 0.983097 | 5.760294 |
f19f2004-55c5-43fb-b7d1-35a7866b1481 | qing42102/Physical_Simulation_Projects | furious_birds1/deps/libigl/include/igl/flood_fill.cpp | template <typename Derivedres, typename DerivedS>
IGL_INLINE void igl::flood_fill(
const Eigen::MatrixBase<Derivedres>& res,
Eigen::PlainObjectBase<DerivedS> & S)
{
using namespace Eigen;
using namespace std;
typedef typename DerivedS::Scalar Scalar;
const auto flood = [&res,&S] (
const int xi,
co... | ALGO | 0.989451 | 5.372252 |
788a7815-191c-4e75-882e-09c7597a61fd | thienchidh/ListBaiTapCoBan_C-_-_DeBai | 273_.cpp | /* Bài 273: Xóa tất cả các số âm trong mảng*/
#include<bits/stdc++.h>
using namespace std;
#define MAX 100
template <typename T> void nhap (T a[], int &n) {
cin >> n;
for(int i = 0; i < n; i++) {
cin >> a[i];
}
}
template <typename T>void xuat(T a[], int n) {
for(int i = 0; i < n; i++) {
... | ALGO | 0.999771 | 3.916943 |
e2cd99d6-81e3-4b4d-ad85-9c0de03c4c23 | YingFan-Chen/Atcoder | contest/rgc148/A.cpp | #include <bits/stdc++.h>
#define ll long long
#define ll_max LONG_LONG_MAX
#ifndef ONLINE_JUDGE
#include "..\..\lib\debug"
#endif
using namespace std;
/* If only 2 elementsm -> always cout << 1 << endl; */
int main(){
int n; cin >> n;
vector<int> v;
for(int i = 0; i < n; i ++){
int tmp;
c... | ALGO | 0.999701 | 3.650153 |
9616fe09-9e12-4af5-864b-0213190a2c57 | Shreyanshsingh23/Competitive-Programming | Not_too_far_Replacement.cpp | #include <bits/stdc++.h>
using namespace std;
#define ShreyanshSinghGautam cin.tie(nullptr);cout.tie(nullptr);ios::sync_with_stdio(false);
#define int long long
#define ln '\n';
#define all(x) x.begin(), x.end()
#define MAX LLONG_MAX
#define MIN LLONG_MIN
#define sz(x) x.size()
#define vi vector<int>
#define v vecto... | ALGO | 0.999865 | 4.322516 |
26963c0f-1d98-4680-8a3c-144f2047a461 | Justin-YimYim/Cpp-CompProg-Practice | 11-11/The 2020 ICPC Asia Shenyang Regional Programming Contest/c.cpp | #include <bits/stdc++.h>
using namespace std;
int n=0, m=0;
const int M = 1e6;
int cnt=0;
int visited[2 * M + 5];
char ans[M + 5];
bool t[2 * M];
bool f[2 * M];
struct edge{
int y, last_edge;
long long weight;
};
long head[4 * M];
edge Edges[4 * M];
long ct=0;
void insertEdge(int x, int y, long long weight){
i... | ALGO | 0.99985 | 3.803234 |
44b20403-d10b-4342-91c1-9d98387bf4d6 | GuiArraes/Linguagem_C | Lista_2/Ex07.cpp | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
//7) Solicite um valor inteiro e apresente se este PAR ou IMPAR
int n;
int main (){
printf ("Digite um valor inteiro: ");
scanf ("%d",&n);
if (n % 2 == 0){
printf ("%d e PAR \n",n);
}
else{
printf ("%d e IMPAR \n... | ALGO | 0.991535 | 3.079457 |
8ec5d60d-b697-472b-90ba-2b80682c015d | djorna/terrain-generation | src/ThermalErosion.cpp | #include "ThermalErosion.hpp"
#include <iostream>
#include <queue>
#include <omp.h> // OpenMP for multithreading
namespace terrain
{
ThermalErosion::ThermalErosion() {}
//ThermalErosion::ThermalErosion(KernelType kt) : kernel_type(kt) {
ThermalErosion::ThermalErosion(KernelType kt)
{
kernel_type = kt;
}
ThermalE... | ALGO | 0.965898 | 6.154564 |
add319bc-072c-416e-9b14-262a3f308338 | Harleen365/100_Days_Coding_Challenge | missing_no.cpp | class Solution {
public:
int missingNumber(vector<int>& nums) {
int n=nums.size();
int res=0;
for(int i=0;i<=n;i++){
res=res^i;
}
for(int i=0;i<n;i++){
res=nums[i]^res;
}
return res;
}
};
| ALGO | 0.999979 | 5.463929 |
639b15d6-3f6c-4a92-82c6-b73b3c841f4e | RoelCastano/ICPC | UVA/ProgrammingChallenges/3n+1Problem.cpp | #include <iostream>
using namespace std;
int main()
{
int i,j,max;
cin >> i >>j;
for (int k = i; k < j; ++k)
{
int cycles = 0, x = k;
while(x != 1){
if (x % 2 == 0) {
cycles++;
x /= 2;
} else {
cycles++;
x = (x*3)+1;
}
}
if (cycles > max) max = cycles;
}
cout << i << " " <... | ALGO | 0.999969 | 3.802646 |
759511e6-4b11-4e3f-b5dc-dcba7c03b43c | ganeshkamath89/CSolutionBlind75 | ReverseBits/ReverseBits.cpp | #include <stdio.h>
#include <stdbool.h>
#include <malloc.h>
char* toBinary(int n)
{
int len = 32;
char* binary = (char*)calloc(len+1, sizeof(char));
int index = 0;
for (unsigned i = (1 << len - 1); i > 0; i = i / 2) {
binary[index++] = (n & i) ? '1' : '0';
}
return binary;
}
int getReverse(int n)
{
int resul... | ALGO | 0.999329 | 4.648831 |
cbb2fa5d-ad8f-4e67-aa9c-e13f9d412c17 | weiii8708271688/UVA | UVA/10901/34111956_AC_130ms_0kB.cpp | #include <iostream>
#include <map>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <set>
#include <deque>
#include <queue>
#include <stack>
using namespace std;
struct car_{
string way;
int arrive;
int ans;
bool hasans = false;
};
int main() {
int c;
cin >> c;
while(c--) ... | ALGO | 0.999955 | 3.930259 |
9eb079ed-f73f-4be0-9db7-fcf32e328fc0 | haiderkumail/PROGRAMMING-FUNDAMENTALS | week 04 PD/task11.cpp | #include<iostream>
using namespace std;
void ischallenged(int speed);
main(){
int speed;
cout<<"enter the speed of car=";
cin>>speed;
ischallenged(speed);
}
void ischallenged(int speed){
if(speed>100){
cout<<"halt...you will be challenged" <<endl;
}
if(speed<=100){
cout<<"you are going good" << endl;
}
} | TOOL | 0.85528 | 3.412436 |
f1ca6125-ce17-42ae-8716-04b2ca99ddba | SPsuyash/LeetCode | 2966-divide-array-into-arrays-with-max-difference/2966-divide-array-into-arrays-with-max-difference.cpp | class Solution {
public:
vector<vector<int>> divideArray(vector<int>& nums, int k) {
int n=nums.size();
sort(nums.begin(),nums.end());
vector<vector<int>> ans;
for(int i=0;i<=n-3;i=i+3)
{
if(nums[i+1]-nums[i] <=k && nums[i+2]-nums[i+1] <=k &&
nums[i+2... | ALGO | 0.999967 | 5.44447 |
41d158b5-ed4c-4005-a514-e7bb21182398 | bill20509/leetcode-practice | cpp/array/easy/448. Find All Numbers Disappeared in an Array.cpp | class Solution {
public:
vector<int> findDisappearedNumbers(vector<int>& nums) {
int n = nums.size();
for(int& num:nums){
int ind = (num - 1) % n;
nums[ind] += n;
}
vector<int> res;
for(int i = 0; i < n; i++){
if(nums[i] <= n) res.push_back... | ALGO | 0.999744 | 5.261515 |
0bcd6a5f-c556-496b-8cc1-41dea7a93327 | suziyxm/llvm-15 | libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.difference/set_difference_comp.pass.cpp | // <algorithm>
// template<InputIterator InIter1, InputIterator InIter2, typename OutIter,
// CopyConstructible Compare>
// requires OutputIterator<OutIter, InIter1::reference>
// && OutputIterator<OutIter, InIter2::reference>
// && Predicate<Compare, InIter1::value_type, InIter2::value_type... | TEST | 0.913756 | 6.845963 |
3f50dc52-7aaa-45c3-9b7b-2140d4aea0ae | ishandutta2007/codeforces | krk/normal/1498/F.cpp | #include <bits/stdc++.h>
using namespace std;
const int Maxm = 40;
const int Maxn = 100005;
int n, k;
vector <int> neigh[Maxn];
int a[Maxn];
vector <int> dp[Maxn], dpup[Maxn], fromup[Maxn];
int res[Maxn];
vector <int> Rotate(const vector <int> &V)
{
vector <int> res(V.size());
for (int i = 0; i < V.size(); i++)
... | ALGO | 0.999994 | 4.093698 |
4e35198e-247f-4685-943f-35a360decef4 | hameem008/Competitive_Programming | Codeforces_and_others/AndItsNonZero.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define gap ' '
typedef long long ll;
typedef long double lld;
const ll infinite = INT64_MAX;
ll arr[19][(ll)2e5 + 1];
void fun()
{
for (ll i = 0; i < 19; i++)
{
for (ll j = 1; j < 2e5 + 1; j++)
{
if ((j & (1 << i)) == ... | ALGO | 0.999641 | 4.292172 |
279ac721-841c-49a0-b6e0-a775a2425331 | ishandutta2007/codeforces | pikel_rik/normal/1511/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
auto ten = [&](int n) -> int {
int pw = 1;
for (int i = 0; i < n; i++) {
pw *= 10;
}
return pw;
};
int t;
cin >> t;
while (t--) {
int a, b, c;
cin >> a >> b >> c;
a = ten(a - 1), b = te... | ALGO | 0.999893 | 4.380475 |
cdd8d8c6-8d47-418f-85f9-ddcd251d39ef | cfreeze111/ncnn_face_rec | source/lite/tnn/cv/tnn_pfld98.cpp | //
// Created by DefTruth on 2021/11/21.
//
#include "tnn_pfld98.h"
using tnncv::TNNPFLD98;
TNNPFLD98::TNNPFLD98(const std::string &_proto_path,
const std::string &_model_path,
unsigned int _num_threads) :
BasicTNNHandler(_proto_path, _model_path, _num_threads)
{
}
void... | DATA | 0.956517 | 6.314493 |
a6e63e36-1a49-4910-9b82-6ff93db5a2c5 | Antzed/CS466-CHERI | contrib/subrepo-cheri-libc++/src/hash.cpp | #include <__hash_table>
#include <algorithm>
#include <stdexcept>
#include <type_traits>
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wtautological-constant-out-of-range-compare")
_LIBCPP_BEGIN_NAMESPACE_STD
namespace {
// handle all next_prime(i) for i in [1, 210), special case 0
const unsigned small_primes[] =
{
0,
... | ALGO | 0.999595 | 6.914343 |
4f279e8b-80b8-4542-934e-fae9e4294591 | linadk/HackerRank | LeetCode/Algorithms/Two Sum/Solution.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
auto indices = unordered_map<int, int>();
// Single Pass
for (int i = 0; i < nums.size(); i++) {
int complement = target - nums[i];
// If we have the complement, we've got our result!
if (indices.find(complement) != indices.e... | ALGO | 0.99994 | 6.483696 |
8347e32d-3397-4acb-bd16-ab61127628c9 | omnibor/llvm-omnibor | llvm-project/llvm/tools/llvm-extract/llvm-extract.cpp | #include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Bitcode/BitcodeWriterPass.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#inclu... | TOOL | 0.921382 | 7.557098 |
b254dd53-e399-452c-81a3-774515c6e97c | tanbirrr/CPP_For_Data-Structure_And_Algorithm | Day_8/O_Sort_String.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int cnt[26]={0};
for(int i=0; i<n; i++)
{
char s;
cin>>s;
int val=s-'a';
cnt[val]++;
}
for(int i=0; i<26; i++)
{
while(cnt[i]!=0)
{
cout<<char(i+97);
... | ALGO | 0.99993 | 4.114813 |
80eecb37-490e-4a10-b4a8-5a711e1468a5 | ArunRathaur1/DSA-II | c++/reverselinkedlist.cpp | #include<bits/stdc++.h>
using namespace std;
struct Listnode{
int val;
Listnode* node;
};
Listnode* addelement(int val){
Listnode* head=new Listnode();
head->val=val;
return head;
}
Listnode* createList(vector<int>values){
int n=values.size();
Listnode* head=new Listnode();
head->node=NU... | ALGO | 0.999966 | 5.023964 |
96f90fb2-c63f-489f-a1da-ddd8a93c062e | KALYAN1045/Leetcode-Solved-Questions | 2436-make-array-zero-by-subtracting-equal-amounts/2436-make-array-zero-by-subtracting-equal-amounts.cpp | class Solution {
public:
int minimumOperations(vector<int>& nums) {
int ans = 0;
unordered_map<int,int>mp;
for(auto i:nums) {
if(i == 0) continue;
mp[i]++;
}
return mp.size();
}
}; | ALGO | 0.99988 | 5.951544 |
7ac78a6f-dfda-4f1d-ac3a-f96c18d61d74 | Gaofei244617/Demo | lib/opencv/sources/3rdparty/carotene/src/accumulate.cpp | #include "common.hpp"
#include "vtransform.hpp"
#include <cstring>
namespace CAROTENE_NS {
void accumulate(const Size2D &size,
const u8 *srcBase, ptrdiff_t srcStride,
s16 *dstBase, ptrdiff_t dstStride)
{
internal::assertSupportedConfiguration();
#ifdef CAROTENE_NEON
size_t roi... | ALGO | 0.998419 | 5.666943 |
94e68486-668c-431b-adb5-082b634c46d4 | ameyjain99/InterviewBit | Graphs/LevelOrder.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
vector<vector<int>> Solution::levelOrder(TreeNode *root) {
vector<vector<int>> ans;
if (root == NULL) {
return ans;
}
queue<Tr... | ALGO | 0.999975 | 5.312687 |
d6f43d87-c269-4c4c-aaee-fc7d3a29423a | crossfirev/AppliedDataAlg-CPE593 | Class Notes/Trees/Lecture.cpp | /*
Binary Tree
Ordered Binary Tree
Balanced Trees
RB-Tree
AVL Trees (not covered)
Fibonacci tree (not covered)
BTree
Tries
*/
// Binary Tree
// Root - Node, start of the tree
// Every node has AT MOST 2 children
// Nodes with no children are LEAF NODES
// Branches cannot rejoin
class BinaryTree
{
... | ALGO | 0.998906 | 4.245867 |
1b7e70fd-c313-4e1d-84fe-a27bd5580940 | kyj93790/42-cursus | CPP_Module/CPP_Module_02/ex03/bsp.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* bsp.cpp :+: :+: :+: ... | ALGO | 0.998747 | 5.171572 |
1fbf9dcf-d712-4adb-b47a-4cbd31ced4ed | ramim2219/total_problem_solved | graph/BFS-DFS/V-Judge contest/TheSeasonalWar.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
void bfs(int row, int col, vector<vector<int>>& vis, const vector<vector<char>>& grid) {
int n = grid.size();
vis[row][col] = 1;
queue<pair<int, int>> q;
q.push({row, col});
... | ALGO | 0.998486 | 6.203695 |
b17cf675-1ce3-4805-8e43-62edda32fcf7 | AniketKul/CMPS229_OpenLambda_Ceph | experiments/single-node/docker/boost/libs/spirit/example/karma/calc2_ast_rpn.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// A Calculator example demonstrating generation of AST which gets dumped into
// a reverse polish notation afterwards.
//
// [ JDG April 28, 2008 ]
// [ HK April 28, 2008 ]
//
////////////////////////////////////////////////////////... | TOOL | 0.950813 | 7.724718 |
e2e2e3dc-73ae-4b39-8fdd-3469df81b1c1 | mosioc/cpp-bootcamp | Source Code/VariableTemplateEmulationTest/main.cpp | #include "my_pi.h"
#include <iostream>
#include <utility>
using std::cout; using std::pair;
extern pair<double, double> f();
int main()
{
auto ret = f();
cout << ret.first << '\t' << ret.second << '\n';
return 0;
} | TOOL | 0.953275 | 4.231053 |
0b18a148-0f6a-4811-b9a0-03a1109cbbae | ImC4k/COMP2011 | sort_and_search/sort_and_search_main.cpp | #include <iostream> // the bubble sort algorithm
#include "sorting.h"
using namespace std;
int main(){
int arr_size;
cout<<"input size of data"<<endl;
cin>>arr_size;
arr_size = (int) arr_size;
double *arr = new double[arr_size];
cout<<"please input data, press enter to commit each data"<<endl;
for(int ... | ALGO | 0.999729 | 4.232543 |
ff643cd2-634f-4391-9336-e1a3ebf02810 | jjthrash/OpenCV-2.2.0-iphone | modules/legacy/src/corrimages.cpp | #include "precomp.hpp"
//#include "cvtypes.h"
//#include <float.h>
//#include <limits.h>
//#include "cv.h"
//#include "highgui.h"
#include <stdio.h>
/* Valery Mosyagin */
/* ===== Function for find corresponding between images ===== */
/* Create feature points on image and return number of them. Array points fills ... | ALGO | 0.984559 | 3.610805 |
ddfcb5cd-b2ff-4daa-a333-8a250b161bea | Rudra-Kumar-Dubey/SDOT | C++/Interim 2021/Program3.cpp | /* Implement the following operations on the stack using linked list data structure.
* In addition to the usual operations of the stack and the linked list, your implementation should handle two more operations.
o Split(p(i1,i2,i3…ip),q(j1,j2,…jq)) in the stack, where the stack of length n will be split in two stack... | ALGO | 0.999282 | 4.810053 |
0236b7af-65e8-4875-9b9d-b0ec4f5214e9 | jh9amn/Master-DSA | SEARCHING/Binary Search/BinarySearchAlgo.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
// int arr[] = {2,5,1,7,4,92,9,6,34,25};
vector<int> v;
v.push_back(1); //0
v.push_back(2); //1
v.push_back(4); //2
v.push_back(8); //3
v.push_back(6); //4
v.push_back(7); //5
v.push_back(3); //6
v.push_back... | ALGO | 0.999994 | 4.593184 |
ba0a0d07-3fa2-4bb2-95d0-e517bdfab01b | Dashbah/Algorithms_2 | contest14_MinPath/B_BelmanFord.cpp | //
// Created by Dashbah on 26.05.2023.
//
#include <iostream>
#include <vector>
const int64_t kInf = 500 * (1e9) + 1;
int main() {
int n, m;
std::cin >> n >> m;
std::vector<std::vector<int64_t>> graph(n, std::vector<int64_t>(n, kInf));
int f, t, weight;
for (int i = 0; i < m; ++i) {
std::... | ALGO | 0.999784 | 4.797572 |
07dffcc4-da62-4cfe-b448-44da86707657 | MedoN11/CompetitiveProgramming | LiveArchive/5108.cpp | #include <iostream>
#include <cstdio>
#include<list>
#include<iomanip>
#include<cmath>
#include<queue>
#include <functional>
#include<stdio.h>
#include<assert.h>
#include<stack>
#include<sstream>
#include <cstdlib>
#include<map>
#include<algorithm>
#include<iostream>
#include<set>
#include<utility>
#include<memory.h>
#... | ALGO | 0.999911 | 3.897674 |
b7ad7720-a1c8-44b0-821e-a6f25cf622e0 | YashGupta018/LeetCode | LeetCode January Challenge(2023)/Restore IP Addresses.cpp | class Solution {
public:
vector<string> result;
string solution;
vector<string> restoreIpAddresses(string s) {
backtracking(s, 0, 0);
return result;
}
private:
void backtracking(string s, int start, int part) {
if(start == s.size() && part == 4) {
result.push_back... | ALGO | 0.999141 | 6.109703 |
411a54cc-a9e4-44aa-aa52-3051148bf2de | MagnusFHanssen/sphero-godot | thirdparty/bullet/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp | #include "LinearMath/btScalar.h"
#include "SphereTriangleDetector.h"
#include "BulletCollision/CollisionShapes/btTriangleShape.h"
#include "BulletCollision/CollisionShapes/btSphereShape.h"
SphereTriangleDetector::SphereTriangleDetector(btSphereShape* sphere, btTriangleShape* triangle, btScalar contactBreakingThreshold... | ALGO | 0.998013 | 7.309117 |
81d693f6-405f-468a-9909-a3da160d88d1 | heavenMOJANG/ICPC | programmes_C_Cpp/.history/AtCoder/abc416/C_20250726201941.cpp | #pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
void solve() {
int n, k, x; cin >> n >> k >> x;
vector<string> a(n);
for (int i{}; i < n; ++ i) cin >> a[i];
string tmp{};
vector<string> ans;
function<v... | ALGO | 0.999948 | 5.10861 |
ed7cdaf9-4b08-4803-916d-06e7e69e42d8 | truthspy/LeetCode | Session2/404_Sum_of_Left_Leaves.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int sumOfLeftLeaves(TreeNode* root) {
if(root == NULL)
return 0;
re... | ALGO | 0.999801 | 6.286077 |
8944768c-c954-461c-ad11-5af53fe1eb89 | Kimnyunyu/CodingAssignment | ObjectOrientedProgramming/1/GPA Calculator_(Switch-case).cpp | #include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char** argv)
{
/* 제출 시에는 line 8~12의 주석 처리를 해제해주세요. */
char OOP= argv[1][0];
char ComputerProgramming= argv[2][0];
char DiscreteMathematics= argv[3][0];
char LogicCircuitDesign= argv[4][0];
char HolisticEducatiosnI= argv[5]... | ALGO | 0.992577 | 4.003881 |
38a3888c-81bb-4d00-8678-bef708133d52 | SHY-Corp/LeetCode-Solutions | C++/33.SearchInRotatedSortedArray.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int left=0;
int right = nums.size()-1;
int mid;
while(left<=right)
{
mid = (left+right)/2;
if(nums[mid]==target)
return mid;
//if the LEFT side of the a... | ALGO | 0.999979 | 6.093555 |
b8309ae6-19a1-443e-a764-f4775de308a9 | dirtyteeth/os | os_all/mru_lru_fifo.cpp | #include<bits/stdc++.h>
using namespace std;
void print(deque<int>v)
{
deque<int>::iterator it=v.begin();
while(it!=v.end())
{
cout<<*it<<" ";
it++;
}
cout<<endl;
}
int fifo(vector<int>v,int nf)
{
int np=v.size();
deque<int>mem;
for(int j=0;j<nf;j++)
{
mem.push_back(v[j]);
print(mem);
}
... | ALGO | 0.999164 | 3.900795 |
5f91cd9d-5a47-4507-8eac-0a40449732c1 | krish-1114/c-javascript-html-css-tailwind | Practical/c++ pro/Array/min.cpp | #include<iostream>
using namespace std;
int main() {
int x[5];
cout << "Enter 5 integers: ";
for (int i = 0; i < 5; i++) {
cin >> x[i];
}
int max = x[0]; // Initialize max with the first element of the array
for (int i = 1; i < 5; i++) {
if (x[i] < max) {
max = x[... | ALGO | 0.999444 | 4.344498 |
2124bf44-2b6d-47be-922d-eb453956aff6 | Vaishnavi7276/TY_DAA_LAB | high_pivot.cpp | #include <iostream>
using namespace std;
class quick {
public:
void printarray(int arr[], int n) {
for (int i = 0; i < n; i++) {
cout << arr[i] << "|";
}
cout << endl;
}
void quicksort(int arr[], int low, int high) {
if (low < high) {
int p = partiti... | ALGO | 0.999888 | 5.664377 |
ae0ab8aa-a158-4457-8784-4f03bc09b37d | DocCreator/DocCreator | thirdparty/tesseract/textord/pithsync.cpp | #ifdef __UNIX__
#include <assert.h>
#endif
#include <math.h>
#include "memry.h"
#include "makerow.h"
#include "pitsync1.h"
#include "topitch.h"
#include "pithsync.h"
#include "tprintf.h"
#define PROJECTION_MARGIN 10 //arbitrary
#define EXTERN... | ALGO | 0.99931 | 4.26112 |
4eb7f817-d75c-42aa-b337-2c1ed3e0bc44 | ishandutta2007/codeforces | yeputons/normal/553/C.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <map>
using namespace std;
#define pb push_back
#define mp make_pair
#ifdef DE... | ALGO | 0.999976 | 4.746164 |
5a7b2c4e-eb44-4445-aa92-76ea6d49e921 | soon-yau/SDCND_Term2 | CarND-MPC-Project/src/Eigen-3.3/doc/examples/Tutorial_BlockOperations_block_assignment.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
Array22f m;
m << 1,2,
3,4;
Array44f a = Array44f::Constant(0.6);
cout << "Here is the array a:" << endl << a << endl << endl;
a.block<2,2>(1,1) = m;
cout << "Here is now a with m copied into its cent... | ALGO | 0.940358 | 3.331377 |
96544dec-f642-49b8-8f12-eb441336ebc1 | V-lambow/ortfortcp | include/bytetrack/include/eigen/bench/spmv.cpp |
//g++-4.4 -DNOMTL -Wl,-rpath /usr/local/lib/oski -L /usr/local/lib/oski/ -l oski -l oski_util -l oski_util_Tid -DOSKI -I ~/Coding/LinearAlgebra/mtl4/ spmv.cpp -I .. -O2 -DNDEBUG -lrt -lm -l oski_mat_CSC_Tid -loskilt && ./a.out r200000 c200000 n100 t1 p1
#define SCALAR double
#include <iostream>
#include <algor... | ALGO | 0.988779 | 4.293816 |
6743bbdd-85cb-427d-b536-5b79f3cf19fc | Kolanu-nikshith/code | code/vowel_consonant_string.cpp | /*Example: “aba”
approach: Take the count of both vowel and consonants using a for loop.
now iterate over each char of string, whenever you find a vowel, the number of substrings that can be formed is equal to the number of consonants.so add count of consonants to answer. similarly, when you get consonants add the coun... | ALGO | 0.999967 | 5.851804 |
b5107cc5-ab6f-4ee9-84aa-4d1c94a5d7fa | baixun2307/asd | solution/0700-0799/0775.Global and Local Inversions/Solution.cpp | class Solution {
public:
bool isIdealPermutation(vector<int>& nums) {
int mx = 0;
for (int i = 2; i < nums.size(); ++i) {
mx = max(mx, nums[i - 2]);
if (mx > nums[i]) return false;
}
return true;
}
}; | ALGO | 0.999986 | 5.647105 |
a4881e45-1e9d-424d-a107-a0d6cab8552a | S-Q-U-I-D/frameworks_av | media/libstagefright/codecs/m4v_h263/dec/src/vlc_decode.cpp | /***********************************************************HeaderBegin*******
*
* File: vlc_dec.c
*
* Author: Paulo Nunes (IST) - <EMAIL>
* Created: 1-Mar-96
*
* Description: This file contains the VLC functions needed to decode a
* bitstream.
*
* Notes:
* The functions contained in this file were adapt... | ALGO | 0.98912 | 4.133549 |
b5cc2822-1323-4c5e-abc3-ac8426673629 | HappyRa1n/Sort | BinarySearch/binary_search_right.cpp | #include <iostream>
using namespace std;
int Binary_Search(int mas[], int L, int R, int a) {
int m;
R++;
while (L < R) {
m = (L + R) / 2;
if (mas[m] <= a) {
L = m + 1;
}
else {
R = m;
}
}
if (mas[L - 1] == a)
return L - 1;
else
return -1;
}
int main()
{
int n;
cin >> n;
int a;
int* mas = n... | ALGO | 0.999992 | 4.032227 |
8f2b6f55-0b42-4ccd-b94b-d66181caeced | saysdf/GameTest | code/battle.cpp | #include "battle.h"
void Battle::doBattle(Unit *u1, Unit *u2)
{
log("BATTLE "+std::to_string(u1->getId()) + " " + std::to_string(u2->getId()));
if (u1->getPower()==u2->getPower()){
log("ALL DEAD\r\n");
u1->defeat();
u2->defeat();
}
else if (u1->getPower()>u2->getPower()){
... | TOOL | 0.88052 | 4.797871 |
69f4d3d0-dffc-4deb-94a8-a8d038b32882 | ABID066/C_PLUS_PLUS | practice/map/leetcode1.cpp | #include<bits/stdc++.h>
using namespace std;
class leet
{
public:
int check (vector<int> v )
{
map<int, int>mp;
int an;
for(int i=0; i<v.size(); i++)
{
int x= v[i];
mp[x]++;
}
for(auto it : mp)
{
int y= it.second;
... | ALGO | 0.999831 | 4.460863 |
28b7aa91-98fc-40f2-96f3-1eb283300508 | MuhammadTarek10/docs-clone-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.998859 | 6.785645 |
16ea8363-8e5c-40a5-a359-71d5199467cb | ishandutta2007/codeforces | radal/normal/1447/D.cpp | #include <bits/stdc++.h>
#pragma GCC target ("avx,avx2,fma")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define X first
#define Y second
#define debug(x) cerr << #x << ": " << x << endl;
#define endl '\n'
#define pb push_back
#define mp make_pair
#define rep(i,l,r) for (int i=l; i<r; i++)... | ALGO | 0.999972 | 3.781926 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.