uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d3140a27-53b4-4d5f-91b5-60fb24513993 | StrawHatWess/Competitive-Programming-Solutions | IOI/09/D1/Hiring.cpp | //Never stop trying
#include "bits/stdc++.h"
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef long long ll;
#define int ll
typedef string str;
typedef long double ld;
typedef pair<int, int> pi;
#define fi first
#define se second
typedef vector<int> vi;
typedef vector... | ALGO | 0.999982 | 3.467676 |
2824fdc8-07cf-4e7e-b5b0-b3d74b80990b | Deborah-Digges/SDC-ND-term-2 | P5-Model-Predictive-Control/CarND-MPC-Project/src/Eigen-3.3/doc/special_examples/Tutorial_sparse_example_details.cpp | #include <Eigen/Sparse>
#include <vector>
#include <QImage>
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
typedef Eigen::Triplet<double> T;
void insertCoefficient(int id, int i, int j, double w, std::vector<T>& coeffs,
Eigen::VectorXd& b, con... | ALGO | 0.996976 | 5.388735 |
d6732293-8d8a-49db-a722-cd5f86dd28a0 | anfelder/GeneralStuff | C++/functionExample.cpp | #include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int add(int x, int y, int z){
return ( x + y + z);
}
void printStuff(){
cout << "Hello world" << endl;
}
void addOne(int &num){
num++;
}
int addOneNR(int num){
return num++;
}
int main(){
int a = add(3, 4, 5);
cout << a << endl;
c... | TOOL | 0.926159 | 4.057676 |
b15a15ad-adad-4724-a1d3-8a8263e30964 | omkar-kashid/Problems | Is Binary Number Multiple of 3 - GFG/is-binary-number-multiple-of-3.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int isDivisible(string s){
//complete the function here
int i,odd=0,eve=0,n=s.size();
for(i=0;i<n;i++){
if(s[i]=='1'){
if(i%2==1... | ALGO | 0.999422 | 5.723529 |
ccc73e8f-0516-4f16-bf75-d00633e5d6f0 | Mfrosty1/ME-507-Phone-Gimbal-Shared-Repo | src/Controller/PID.cpp | /** @file PID.cpp
* This file implements a PID controller to be used with
* discrete data from a sensor. Additional features beyond
* a base PID controller include:
* - Low-pass filter on differentiation
* - Derivative-on-measurement
* - Integrator anti-windup
* - Controller ouptut clamping... | ALGO | 0.993742 | 6.245515 |
2f9d5808-1f1b-4d46-8f82-3dfaaa7add9f | LiGuan2003/https---git.rwth-aachen.de-gamephysics1-game-physics | custom_dynamics_world.cpp | #include "custom_dynamics_world.h"
#include <BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h>
#include <vector>
#include <iostream>
void CustomDynamicsWorld::internalSingleStepSimulation(btScalar timeStep)
{
// TODO: Enable this? Don't think it's so important for our purposes here though.
// BT_PRO... | ALGO | 0.876672 | 5.927072 |
acab7a70-a156-4481-afbd-35eed0c1c6a6 | faisals345/ProblemSolvingShorts | HackerEarth Algo/Searching/largestSubString.cpp | #include <bits/stdc++.h>
using namespace std;
#define ld long double
#define int long long
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define rep(i,ini,n) for(ll i=ini;i<(int)n;i++)
#define all(x) x.begin(),x.end()
#define tc int tt; cin>>tt; while(tt--)
#define endl "\n"
#define... | ALGO | 0.999973 | 4.703921 |
c1e7af72-b1dc-4f66-8c97-580771fb4748 | AruzhanBazarbai/pp1 | acmp/1116.cpp | //Разность времен
#include <iostream>
using namespace std;
int main(){
int h1,h2,m1,m2,s1,s2;
cin >> h1 >> m1 >> s1 >> h2 >> m2 >> s2;
long long s=3600*(h2-h1)+60*(m2-m1)+(s2-s1);
cout << s;
return 0;
}
| ALGO | 0.998747 | 4.347439 |
4e9be026-444c-41b7-a4b5-fe08e97eb2b4 | 042Vidhi/DSA-preparation-questions | TwoPointers/MaxConsecutive.cpp | /*
1004. Max Consecutive Ones III
Given a binary array nums and an integer k,
return the maximum number of consecutive 1's in the array if you can flip at most k 0's.
https://leetcode.com/problems/max-consecutive-ones-iii/description/
*/
//two pointer approach
#include <bits/stdc++.h>
using namespace std;
class Sol... | ALGO | 0.999905 | 5.947519 |
1344a59f-c38c-44b8-8f73-252a0112a1b0 | kilted-release-test/coal-release | src/distance/convex_halfspace.cpp | /** \author Joseph Mirabel */
#include "coal/shape/geometric_shapes.h"
#include "coal/internal/shape_shape_func.h"
#include "../narrowphase/details.h"
namespace coal {
namespace internal {
template <>
CoalScalar ShapeShapeDistance<ConvexBase, Halfspace>(
const CollisionGeometry* o1, const Transform3s& tf1,
... | ALGO | 0.998944 | 7.19193 |
a92312f0-7159-4bcc-95d0-6eb8cdd47107 | henrymound/2018-Summer-Research | Golang/Tello/references/opencv/3rdparty/carotene/src/gaussian_blur.cpp | #include "common.hpp"
#include "saturate_cast.hpp"
#include "separable_filter.hpp"
namespace CAROTENE_NS {
bool isGaussianBlur3x3Supported(const Size2D &size, BORDER_MODE border)
{
return isSupportedConfiguration() && size.width >= 8 &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_... | ALGO | 0.99104 | 6.777441 |
86944c7e-1120-491c-a711-15d65b03d427 | wayne1204/ICCAD-2019-ProblemB | src/tdm.cpp | #include <fstream>
#include <algorithm>
#include <iostream>
#include <set>
#include <math.h>
#include <stdio.h>
#include <limits>
#include <unordered_set>
#include <time.h>
#include "tdm.h"
#include "../include/ctpl.h"
using namespace std;
bool groupCompare(NetGroup* a, NetGroup* b) {
return (a->getSubnetNum() ... | ALGO | 0.992802 | 3.387041 |
76136a04-2ace-40ec-8bbd-9ffc2cb1038e | nobinov/image_resizer_server | include/boost_1_75_0/libs/intrusive/example/doc_entity.cpp | using namespace boost::intrusive;
//A class that can be inserted in an intrusive list
class entity : public list_base_hook<>
{
public:
virtual ~entity();
//...
};
//"some_entity" derives from "entity"
class some_entity : public entity
{/**/};
//Definition of the intrusive list
struct entity_list : list<en... | TOOL | 0.865794 | 5.08235 |
0e9f6643-290d-45f5-ab1c-79371848fa64 | arnabnandikgp/algolab | sorting/heapsort.cpp | #include<iostream>
using namespace std;
// implement heapsort without using stl library
int main() {
int n;
cin>>n;
int* arr = new int[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
// heapify the array
for(int i=n/2-1;i>=0;i--){
int child = i;
while(child>0){
... | ALGO | 0.999984 | 4.217989 |
932a7805-5885-4811-ac42-30e26836b1fe | GregWagner/Udemy-DSA-Courses | Coding-Minutes/Data_Structures_and_Algorithms_Essentials/Section_10_Recursion/is_array_sorted.cpp | #include <iostream>
#include <vector>
template <typename T>
bool isSorted(const std::vector<T>& a, unsigned start = 0) {
// if there is only element, it is sorted
if (start == a.size() - 1) {
return true;
}
// this will short circuit if the first condition is false
return (a[start] < a[star... | ALGO | 0.999558 | 5.87205 |
bc4dfa4d-570c-40f9-8a2d-cce5b02f6c01 | plumkewe/scuola | Attivita-svolta/2022/Gennaio/10/Fatto/Compito_esercizio_5.cpp | #include <iostream>
using namespace std;
int riempire (int nome_array[], int i, const int lunghezza)
{
if (i == lunghezza)
return 0;
cout << "Inserisci il " << i + 1 << " numero del codice a barre: ";
cin >> nome_array[i];
i ++;
return riempire (nome_array, i, lunghezza);
};
int main() {
int codice_ba... | ALGO | 0.997366 | 3.718046 |
6b3c13ad-1c90-4c7a-bf1b-6cec66e83987 | VishavdeepSingh/data-structure | Experiment 8.cpp | #include<iostream>
using namespace std;
void insertionsort(int a[],int n)
{
int i,j,k,temp,m;
for(i=0;i<n;i++)
{
m=a[i];
j=i;
while(a[j-1]>m && j>0)
{
a[j]=a[j-1];
j--;
}
a[j]=m;
}
}
int main()
{
int i,a[20],n;
cout<<"Enter... | ALGO | 0.999953 | 3.725759 |
2be8949c-0839-46f2-91dd-112ffa67b5a6 | JeanGyuHu/Algorithm | 단속 카메라/source.cpp | #include <bits/stdc++.h>
using namespace std;
int solution(vector<vector<int>> routes) {
int answer = 1;
int nearest;
sort(routes.begin(), routes.end());
nearest = routes[0][1];
for(int i=0 ;i<routes.size()-1; i++){
if(nearest<routes[i+1][0]){
answer++;
... | ALGO | 0.999635 | 4.940601 |
ea53908a-23c0-4c2e-bab3-6e8ada48223b | MuhammadAhmadA01/Leetcode-challenges | 368-largest-divisible-subset/largest-divisible-subset.cpp | class Solution {
public:
vector<int> largestDivisibleSubset(vector<int>& nums) {
sort(nums.begin(), nums.end());
int n = nums.size();
vector<int> groupSize(n, 1), prevElement(n, -1);
int maxIndex = 0;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < i; ++... | ALGO | 0.99999 | 5.770703 |
3041cfc6-35a8-477c-a6a9-cdfa44118a63 | LarryXing0/Base | Cpp/Cpp/primier_tutial/10/rcomma.cpp | #include <string>
using std::string;
#include <algorithm>
using std::find;
#include <iostream>
using std::cin; using std::cout; using std::endl;
int main()
{
string line;
getline(cin, line);
// find the first element in a comma-separated list
string::iterator comma = find(line.begin(), line.end(), ',');
cout <... | TOOL | 0.997121 | 4.015345 |
7826e815-29d9-4a1d-9591-0f2ab8f3a561 | s0chu/Huffman-ENCODING-DECODING | STATIC/Sources/text.cpp | #include <bits/stdc++.h>
#include "../Headers/text.h"
#include "../Headers/heap.h"
#include "../Headers/char.h"
#include "../../Headers/terminal.h"
using namespace std;
STATIC::Text::Text(string s)
{
text = s;
R = nullptr;
process();
build();
calcAverageLen();
encode();
}
void STATIC::Text::p... | ALGO | 0.990799 | 3.827522 |
cebf46aa-8c68-43e5-aa9e-dc3dcf5d7692 | CKCat/android2.3.3 | frameworks/base/media/libstagefright/codecs/aacdec/sbr_update_freq_scale.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#ifdef AAC_PLUS
#include "sbr_update_freq_scale.h"
#include "shellsort.h"
#include "pv_pow2.h"
#include "pv_log2.h"
#include "fxp_mul32... | TOOL | 0.999304 | 4.949198 |
a0346312-9be2-4dd1-9c0c-e50729f18e08 | johnnyqian/algorithm | OnlineJudge/HihoCoder/1049/Source.cpp | #include <string>
#include <iostream>
using namespace std;
string postOrder(string preOrder, string inOrder);
int main()
{
#ifndef ONLINE_JUDGE
freopen("Input.txt", "r", stdin);
#endif
string preOrder, inOrder;
cin >> preOrder;
cin >> inOrder;
cout << postOrder(preOrder, inOrder) << endl... | ALGO | 0.999994 | 5.051136 |
52d62db0-9297-49a1-9827-ba5e6d75f5ba | pesocheck/Logika | lab 1/задание 4/задание 4/задание 4.cpp | #include <iostream>
#include <windows.h>
int main() {
SetConsoleOutputCP(1251);
SetConsoleCP(1251);
const int size=5;
int sum=0;
int arr[size][size];
srand(time(NULL));
for (int i = 0; i < size; i++) {
for (int j = 0; j < size; j++) {
arr[i][j] = rand() % 10;
}
... | TOOL | 0.970193 | 3.606042 |
1692212a-d0a7-400e-8bbd-ccbd25daa20b | FacundoCG/Competitive-Programming | ArgenissSoftware 2024/problemE.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll UNDEFINED = -1;
const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;
const ll zero = 0;
const ld EPSILON = 1e-10;
const double PI = acos(-1.0);
#define pb push_back
#define f... | ALGO | 0.999324 | 4.161857 |
86faebcd-72ae-477a-b2a7-74c3fd6a35b3 | oursuccess/cplusplus_primer_practices | QueryResultSV.cpp |
//get word and search it in the map
//then returns the appeared lines of the word
//and the content of the line
#include<iostream>
#include"strVec.hpp"
#include<set>
#include<memory>
#include<map>
#include<string>
#include"TextQuerySV.h"
using std::set;
using std::shared_ptr;
using std::ostream;
using std::endl;
usi... | ALGO | 0.910413 | 3.780232 |
aad21f5a-638d-4b65-8c3a-830e22a035e8 | ishandutta2007/codeforces | stevenkplus/normal/1648/E.cpp | // =========== Template ========== //
#include <bits/stdc++.h>
using namespace std;
int fastio() { ios_base::sync_with_stdio(false); cout << fixed << setprecision(10); cin.tie(nullptr); return 0; }
int __fastio = fastio();
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p);
template<... | ALGO | 0.999985 | 5.435353 |
7bd336eb-5d55-48be-9502-04493177b8ac | Kavin1421/Leetcode-Solution | 2100-2199/2139.Minimum Moves to Reach Target Score/Solution2.cpp | class Solution {
public:
int minMoves(int target, int maxDoubles) {
int ans = 0;
while (maxDoubles > 0 && target > 1) {
++ans;
if (target % 2 == 1) {
--target;
} else {
--maxDoubles;
target >>= 1;
}
... | ALGO | 0.999797 | 6.210703 |
28077b50-163b-48c7-b0c4-14b4e3ef433f | liandd/Competitive_programming_2020_2024 | 2023/01/I.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string num;
cin>>num;
int ceros=0;
float respuesta=0;
int dias=0;
for(int i=0;i<num.size();i++){
if(num[i]=='1'){
if(ceros>respuesta){
respuesta=ceros;
}
ceros=0;
}
... | ALGO | 0.99984 | 3.736174 |
29727317-7418-4bbd-a858-c8c27b602bda | TravHaran/cpp_indepth_concepts | memory/dynamic_memory_3.cpp | #include <iostream>
using namespace std;
void myFunction(int *pointerVar) {
*pointerVar = 20;
}
int *myOtherFunction(){
int *localVar = new int(5);
return localVar;
}
int main() {
int *mainPointer = myOtherFunction();
cout << *mainPointer <<endl;
*mainPointer = 540;
cout << *mainPointer ... | TOOL | 0.862228 | 3.900009 |
fe60dd9f-5b46-4eda-9872-efe5bc6100bb | tecshogo/contest | ABC/085/B/answer.cpp | #define rep(i, n) for (int i = 0; i < (n); i++)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MOD = 1000000007;
int main() {
int N;
cin >> N;
set<int> UniqueD;
rep(i, N) {
int tmp;
cin >> tmp;
UniqueD.insert(tmp);
}
... | ALGO | 0.999053 | 4.471826 |
f8ac517f-2827-45a7-a623-d4a0eafc5366 | rizk-omarsherif/cpp-modern-study | 01-basics/05-loops/examples/ex8/src/ex8.cpp | using namespace std;
int main() {
int n=10;
int a=0, b=1;
cout<<a<<" "<<b<<" ";
for (int i=2;i<n;++i)
{
int c = a+b;
a=b;
b=c;
cout<<c<<" ";
}
return 0;
}
| ALGO | 0.999824 | 3.066313 |
27885411-0a2f-4702-b945-1be8f38701ef | dancar22/data-structures-at-cc | search/main.cpp | #include <iostream>
using namespace std;
void BS (int array[], int high, int &numIter) {
numIter = 0;
int i, j;
int temp;
bool sorted = false;
int upperLimit = high;
for (i = 0; i < high && !sorted; i++) {
sorted = true;
for (j = 0; j < upperLimit; j++) {
numIter++;
if (array[j] > array[j + 1]) {
... | ALGO | 0.999699 | 3.917984 |
5be69a1a-755e-419c-a23d-0f4ac2b3ea32 | copasi/COPASI | copasi/utilities/CMethodFactory.cpp | #include "copasi/copasi.h"
#include "copasi/utilities/CTaskFactory.h"
#include "copasi/utilities/CMethodFactory.h"
#include "copasi/crosssection/CCrossSectionMethod.h"
#include "copasi/elementaryFluxModes/CBitPatternMethod.h"
#include "copasi/elementaryFluxModes/CBitPatternTreeMethod.h"
#include "copasi/elementaryFlu... | ALGO | 0.989945 | 5.830884 |
1a50c4ff-ed02-46f0-8381-cd26564bdf83 | megasonlab/blender4.0-goo | extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp | #include "btPersistentManifold.h"
#include "LinearMath/btTransform.h"
#include "LinearMath/btSerializer.h"
#ifdef BT_USE_DOUBLE_PRECISION
#define btCollisionObjectData btCollisionObjectDoubleData
#else
#define btCollisionObjectData btCollisionObjectFloatData
#endif
btScalar gContactBreakingThreshold = btScalar(0.02);... | ALGO | 0.972785 | 5.011851 |
461dbc03-4d11-432c-b126-d2f61cacb45b | jorgesg82/TicTacToe | src/board.cpp | #include "board.h"
const std::array<std::array<Pair, 3>, 8> Board::winPosibilities =
{{// Horizontal
{Pair(0, 0), Pair(0, 1), Pair(0, 2)},
{Pair(1, 0), Pair(1, 1), Pair(1, 2)},
{Pair(2, 0), Pair(2, 1), Pair(2, 2)},
// Vertical
{Pair(0, 0), Pair(1, 0), Pair(2, 0)},
{Pair(0, 1), ... | ALGO | 0.925905 | 5.1943 |
44e18c80-99d0-4080-b164-6940be91f12d | avikola/inverse-kinematics-with-skinning | eigen/failtest/colpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
ColPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.933827 | 3.159166 |
27ae9284-4091-4c9f-909d-fee0f0d43331 | project-march/ProjectMarch | ros2/src/libraries/ginac/check/check_lsolve.cpp | /** @file check_lsolve.cpp
*
* These test routines do some simple checks on solving linear systems of
* symbolic equations. They are a well-tried resource for cross-checking
* the underlying symbolic manipulations. */
#include "ginac.h"
using namespace GiNaC;
#include <cstdlib> // for rand()
#include <iostrea... | TEST | 0.903201 | 6.500215 |
6f43a494-1d95-4212-a45f-381c53f3a685 | CaioCity/Competitive_Programming_Questions | LeetCode/IPO_502.cpp | // https://leetcode.com/problems/ipo/
// 502 - IPO
class Solution {
public:
int findMaximizedCapital(int k, int w, vector<int>& lucro, vector<int>& custo) {
vector<pair<int,int>> projects;
int n =lucro.size(),index=0,count=0;
for(int i=0; i<n; i++)
projects.push_back({custo[i],... | ALGO | 0.999931 | 5.042512 |
1db34418-c924-439a-b5d9-a0ca37b68a8c | Salman-Farid/Competitive_programming_codes_and_snippets | Practice Code & Notes/A-04_ Last year_s Regional Preliminary Contest Problems/Codes/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#ifdef LOCAL
#define Gene template< class
#define Rics printer& operator,
Gene c> struct rge{c b, e;};
Gene c> rge<c> range(c i, c j){ return {i, j};}
struct printer{
~printer(){cerr<... | ALGO | 0.999394 | 4.593473 |
a5e24358-e588-40d0-a711-debb6b4f2098 | VadVergasov/OlympTasks | BSU/Tour8C/main.cpp | using namespace std;
int main() {
int n, tmp, sum = 0;
cin >> n;
vector<int> a, b;
for (int i = 0; i < n; i++) {
cin >> tmp;
a.push_back(tmp);
sum += tmp;
}
if (sum % 3 != 0) {
cout << 0;
return 0;
}
b.resize(sum, -1);
for (int i = 0; i < n; i... | ALGO | 0.999882 | 3.781964 |
86dc6cf1-ed54-4cf7-adb6-afb68462a4c7 | hoangsavitar/change_hair | models/CtrlHair/external_code/face_parsing/modules/src/inplace_abn_cpu.cpp | #include <ATen/ATen.h>
#include <vector>
#include "utils/checks.h"
#include "inplace_abn.h"
at::Tensor reduce_sum(at::Tensor x) {
if (x.ndimension() == 2) {
return x.sum(0);
} else {
auto x_view = x.view({x.size(0), x.size(1), -1});
return x_view.sum(-1).sum(0);
}
}
at::Tensor broadcast_to(at::Ten... | DATA | 0.890506 | 6.634133 |
02cc4e7f-4280-442f-a41f-0da184bf2be6 | jlstmac/Algorithm | ZigZagConversion/main.cpp | //https://leetcode.com/problems/zigzag-conversion/description/
//
//The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
//
//P A H N
//A P L S I I G
//Y I R
//And then read line by line: "P... | ALGO | 0.999607 | 5.413445 |
322c97ef-90c5-4c1f-98f6-d2a27b792173 | shinchan367/interview_DS | Array/2d array/count days without meetings.cpp | class Solution {
public:
int countDays(int days, vector<vector<int>>& meetings) {
int n=meetings.size();
int ans=0;
sort(meetings.begin(),meetings.end());
int last=1;
for(int i=0;i<n;i++){
int s=meetings[i][0],e=meetings[i][1];
if(s>last){
... | ALGO | 0.999973 | 5.840883 |
a1bc4087-2887-4f6e-b2b4-e213f0757248 | Kaushik268mlore/CSES-PROBLEMSET | INTRODUCTORY_PROBLEMS/Palindrome_Reorder.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
void solve(){
string s;cin>>s;
int n=s.length();
string res="";
vector<int>arr(26);
map<char,int>m;
for(char c:s)m[c]++;
int of=0;
char c='.';
for(auto i:m){
if(i.second&1){of++;c=i.first;}
}
if(of>1)cout<<"NO SOLUTION\n";
else{
for(auto i:m){
... | ALGO | 0.999988 | 3.83357 |
a123fc71-73af-435a-b3c8-d961436650d7 | AnirudhGeek/DSA | 0007-reverse-integer/0007-reverse-integer.cpp |
class Solution {
public:
int reverse(int x) {
long ans = 0;
while (x != 0) {
ans = ans * 10 + x % 10;
x /= 10;
}
return (ans < INT_MIN || ans > INT_MAX) ? 0 : ans;
}
}; | ALGO | 0.999931 | 6.174622 |
01287ca5-b5d3-4c1f-8c04-c0931ce6e659 | mangowar/leetcode | dailyTemperatures.cpp | #include<iostream>
#include<stack>
#include<vector>
using namespace std;
class Solution {
public:
vector<int> dailyTemperatures(vector<int>& temperatures) {
stack<int> buf;
vector<int> res(temperatures.size());
buf.push(0);
for(int i = 1; i < temperatures.size(); i++)
{
... | ALGO | 0.999944 | 5.727604 |
0a30025c-1ea6-47d4-ab26-a8bbbc89ac80 | Rahul-Kumar-Parida/400-DSA_Practice_ACCENTURE | DSASHEET30/STRING QUESTION/11Length of Last Word.cpp | #include<iostream>
using namespace std;
int main(){
string str;
getline(cin,str);
int n=str.length();
int i=n-1,j=n-1;
while(i>0){
while(i>0 && str[i]==' '){
i--;
}
j=i;
while(j>0&& str[j]!=' '){
j--;
}
if(i>j){
stri... | ALGO | 0.999339 | 3.427728 |
d2dd3d8d-8b85-41a7-9f48-d1be00a0f9dd | fadilachmad/uas-lab4 | ProcedureFunction/func.cpp | #include <iostream>
using namespace std;
void nilai(int n){
switch (n)
{
case 0 ... 64 :
cout << "D";
break;
case 65 ... 74 :
cout << "C";
break;
case 75 ... 84 :
cout << "B";
break;
case 85 ... 100 :
cout << "A";
break;
de... | ALGO | 0.950468 | 3.800326 |
a94039a7-5e4f-457c-9d85-b8b3c0b34276 | ftanvir/Problem-Solving | Codeforces/A_Doors_and_Keys.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--) {
string s;
cin>>s;
if(s.find('R')<s.find('r') || s.find('G')<s.find('g') || s.find('B')<s.find('b')) {
cout<<"NO"<<endl;
} else {
cout<<"YES"<<endl;
}
}
... | ALGO | 0.999208 | 4.292034 |
7b23cf94-d617-44a5-bf8a-22098414252b | tushar-29/Advance-Data-Structure | STL/dequeue.cpp | // DEQUEUE IS SIMILEAR TO VECTOR
// INSERTION AND DELETION AT BEG OR LAST TAKE O(1) time
// INSERTION AND DELETION AT OTHER POS TAKE O(n)
#include<bits/stdc++.h>
using namespace std;
void display(deque<int> dq){
for(auto i: dq){
cout<<i<<", ";
}
cout<<endl;
}
int main()
{
// push_fornt(), pu... | TOOL | 0.929784 | 4.701899 |
321bbde5-c882-4985-8a34-65af0572e598 | career-sp/Cpp_language_dsa | doubly_linked_list/implementation_of_doubly_linkedList.cpp | /*
Every node in doubly linked list will point to it's next node as well as it's previous node.
*/
#include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *prev;
Node *next;
Node(int data)
{
this->data = data;
prev = NULL;
next = NULL;
}
};
class ... | ALGO | 0.998364 | 5.654912 |
a068743a-cae7-4298-a857-f06531764872 | vuhuytungss7/code-c-random-0.1- | 2A.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main()
{
int k;
cin>>k;
while(k>3){
k=k/3;
}
cout<<k;
}
| ALGO | 0.999617 | 3.35575 |
fa51c32c-b358-48b4-98fb-4f371efd91fa | equadras/CompetitiveProgramming | codeforces/round849/c.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
int t; cin >> t;
while(t--){
int n; cin >> n;
string s; cin >> s;
int l = 0, r = n -1;
bool flag = false;
while(!(l > r)) {
if(s[l] == s[r] || n == 0){
... | ALGO | 0.999865 | 4.097673 |
2e5d4113-babf-4d29-9521-10b79a740b10 | uttam282005/DSA-questions | 1744E2.cpp | #include <bits/stdc++.h>
#include <vector>
using namespace std;
// Defines
#define db double
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define rep(i, a, b) for (int i = a; i < b; i++)
#define itr(container) for (auto &it : container)
#define ss second
#define gcd(a, b) __gcd(a, b)
#define vs ... | ALGO | 0.999886 | 4.684921 |
bd335274-8b36-4364-8b1c-c665ca563387 | hemantsingh0557/My-Leetcode-Solutions | 0074-search-a-2d-matrix/0074-search-a-2d-matrix.cpp |
// class Solution {
// public:
// bool searchMatrix(vector<vector<int>>& matrix, int target) {
// }
// };
//
// // // // // // // Solve Using Three Method ===>
//
//
// // // // 1st Method ======> (Not Recommended) Noraml TC = O(m*n) , SC = O(1) constant
// //
// //
// // // // ... | ALGO | 0.999981 | 6.091196 |
50e80997-2dae-444e-be02-1f3e4a073ec2 | Cola-kk/kl.github.io | project8/project8 maxtrix-chain multiplication problem.cpp | #include <stdio.h>
#include <stdlib.h>
int m[7][7] = { 0 };
int s[7][7] = { 0 };
void Print_Optimal_Parens(int s[][7], int i, int j) //Ž
{
if (i == j)
{
printf("A%d", i);
}
else
{
printf("(");
Print_Optimal_Parens(s, i, s[i][j]);
Print_Optimal_Parens(s, s[i][j] + 1, ... | ALGO | 0.999946 | 3.356219 |
9fe6ba19-219f-4f6b-a848-033841ed7450 | aniiiee18/LearningC- | lecture 14 & 15/binarysearch.cpp | #include <iostream>
using namespace std;
//----------->binary search<------------//
/* int search(int arr[], int size, int key)
{
int start = 0;
int end = size - 1;
int mid = start + (end - start) / 2;
while (start <= end)
{
if (key == arr[mid])
{
return mid;
}... | ALGO | 0.999248 | 4.061583 |
f167fa8e-698d-4636-8a7c-681486b757c1 | JZY-Revival/JZY-Revival | dep/g3dlite/source/Welder.cpp | /**
@file Welder.cpp
@author Morgan McGuire, Kyle Whitson, Corey Taylor
@created 2008-07-30
@edited 2009-11-29
*/
#include "G3D/platform.h"
#include "G3D/Vector2.h"
#include "G3D/Vector3.h"
#include "G3D/Sphere.h"
#include "G3D/PointHashGrid.h"
#include "G3D/Welder.h"
#include "G3D/Stopwatch.h" // for profilin... | TOOL | 0.994334 | 7.780924 |
eb025db4-c306-40a0-8cc0-5742523b976a | DavidBergevoet/AdventOfCode | 2022/Day-10/part2.cpp | #include <iostream>
#include <vector>
#include "FileHandler.hpp"
#include "Matrix.hpp"
int main(int argc, char const *argv[])
{
std::string filePath = "input.txt";
FileHandler file(filePath);
const uint CRT_HEIGHT=6;
const uint CRT_WIDTH=40;
uint currentRow = 0;
Matrix<char> CRT(CRT_HE... | TOOL | 0.923797 | 5.242472 |
269b6f32-a7fe-487d-944c-efd5dfb43d71 | wojtek2kdev/Zadania-ze-SPOJ-a | Latwe/PolePewnegoKola.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main(){
double r,d,rk;
while(cin>>r>>d){
rk = (r*r)-((d/2)*(d/2));
cout<<fixed<<setprecision(2)<<rk*3.141592654<<endl;
}
} | ALGO | 0.99902 | 3.67864 |
1b481648-aabd-46fa-a455-72af5fcafd34 | FrasIrfan/icodehere | minandmaxofnumbers.cpp | #include<iostream>
using namespace std;
int main()
{
int n, max=999999, min;-9999999
char choice;
do
{ cout<<"Enter number : ";
cin>>n;
if(n>max)
max=n;
if(n<min)
min=n;
cout<<"Do you want to Continue(y/n)? ";
cin>>choice;
}while(choice=='y' || choice=='Y');
cout<<"Maximum Number :"<<max<<"\... | ALGO | 0.997486 | 3.356573 |
e91e9803-c08d-4a89-beae-3c87fd27defa | xdtianyu/android-4.3 | ndk/sources/cxx-stl/llvm-libc++/test/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter, StrictWeakOrder<auto, Iter::value_type> Compare>
// requires ShuffleIterator<Iter> && CopyConstructible<Compare>
// void
// sort_heap(Iter first, Iter last, Compare comp);
#include <algorithm>
#include <functional>
#include <cassert>
#ifndef _LIBCPP_HAS_NO_R... | TEST | 0.995264 | 5.64639 |
90906ffc-a938-475a-9b8c-e152e0754e56 | fgenesis/pseuwow | src/dep/src/irrlicht/CTRGouraudAlpha2.cpp | #include "IrrCompileConfig.h"
#include "IBurningShader.h"
#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
// compile flag for this file
#undef USE_ZBUFFER
#undef IPOL_Z
#undef CMP_Z
#undef WRITE_Z
#undef IPOL_W
#undef CMP_W
#undef WRITE_W
#undef SUBTEXEL
#undef INVERSE_W
#undef IPOL_C0
#undef IPOL_T0
#undef IPOL_T1
// de... | ALGO | 0.919732 | 5.959538 |
3b831e5a-af5d-4a7c-9b5d-e5b5ced9a6c8 | park-minhyeong/boj | 01330_comparing/Comparing.cpp | #include <iostream>
using namespace std;
int main()
{
int A, B;
cin>>A>>B;
if(A>B)
cout<<">";
else if(A<B)
cout<<"<";
else
cout<<"==";
return 0;
} | ALGO | 0.999951 | 3.555784 |
a3a4cb5f-adb1-4e7c-9cf6-39283f9bb0b0 | ishandutta2007/codeforces | oierwanhong/normal/559/E.cpp | #include<cstdio>
#include<iostream>
#include<cstring>
#include<vector>
#include<algorithm>
#include<random>
#include<chrono>
typedef long long ll;
typedef unsigned un;
typedef std::vector<int> P;
typedef std::pair<int,int> pii;
ll read(){ll x=0,f=1;char c=getchar();while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}while(... | ALGO | 0.999851 | 3.705676 |
853de356-1811-48a4-be6c-1ebf647acf1e | c4Polo/ecli5 | stockfish/src/evaluate.cpp | #include "evaluate.h"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <memory>
#include <sstream>
#include <tuple>
#include "nnue/network.h"
#include "nnue/nnue_misc.h"
#include "position.h"
#include "types.h"
#include "uci.h"
#include "nnue/... | ALGO | 0.999777 | 7.649961 |
70eee826-e202-41eb-98e6-4a549e2b62aa | ishandutta2007/codeforces | krijgertje/normal/947/E.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include... | ALGO | 0.99999 | 3.036593 |
ddefe2ca-72cf-4344-95c9-aa55c51b4904 | Zwlin98/Learn_ACM | 1099.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main(int argc, char const *argv[])
{
int n;
double sum=0;
cin>>n;
for (int i = 1; i <=2*n-1; i+=2)
{
sum+=1.0/i;
}
cout
<<setiosflags(ios::fixed)
<<setprecision(2)
<<sum
<<endl;
return 0;
} | ALGO | 0.998979 | 3.509492 |
be87fb81-b01f-4c63-b407-fe3b5e5df16b | raincross7/code-similarity | codes/train_code/problem260/problem260_63.cpp | #include <queue>
#include <iostream>
#include <string>
using namespace std;
priority_queue<int> S; // priority queue in nonincreasing order
int k; // the integer to insert
int main() {
string word; // insert, extract, or end
while (cin >> word) {
if (word == "insert") {
cin >> k;
S.push(k);
}
... | ALGO | 0.998984 | 4.305897 |
5617216f-974c-4196-b2f2-ed56d51d7aea | kinaphar/AtCoder | ABC/ABC298/d_WIP1(wrong).cpp | #include <bits/stdc++.h>
#include <atcoder/modint>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
typedef long long ll;
#define I_MAX 2147483647;
#define LL_MAX 9223372036854775806;
#define rep(i, s, n) for (int i = s; i < (int)(n); i++)
#define repl(i, s, n) for (ll i = s; i < (int)(n); i... | ALGO | 0.998168 | 5.39744 |
f3141ed7-1494-4521-a3ac-101595c29b11 | aospSX/platform_frameworks_av | media/libstagefright/codecs/amrwb/src/get_amr_wb_bits.cpp | /*
------------------------------------------------------------------------------
Filename: get_amr_wb_bits.cpp
Date: 05/08/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
---------------------------------------------------------------------... | ALGO | 0.996342 | 5.8666 |
8282cbf6-8e85-43e7-b829-6ddaca4412eb | kalpeshbhosle/C-Programs | programm36.cpp | //Write a program in C++ to print the following pattern.
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
cout << "\n\n Print the following pattern:\n";
cout << "--------------------------------\n";
cout << " xxxxx\n";
cout << "x x x x\n";
cout << "x x x\n";... | ALGO | 0.998238 | 3.047261 |
2d8135b7-b54a-42bf-adb4-7d530162c8c9 | BSanandu88/Coding-questions | leetcode/perfect_squares.cpp | /* Given an integer n, return the least number of perfect square numbers that sum to n.
A perfect square is an integer that is the square of an integer; in other words, it is the product of some integer with itself. For example, 1, 4, 9, and 16 are perfect squares while 3 and 11 are not.
*/
class Solution {
public... | ALGO | 0.999966 | 5.861355 |
5177243b-d022-4cc7-83ba-48f76be5560c | raincross7/code-similarity | codes/train_code/problem154/problem154_66.cpp | #include <stdio.h>
int main(){
int a,b,c,i,n;
scanf("%d %d %d",&a,&b,&c);
for(i=a;i<=b;i++){
if(c%i==0){
n++;
}
}
printf("%d\n",n);
return 0;
} | ALGO | 0.999946 | 4.152862 |
9f0e3db6-96b3-4411-9bcf-ed90ae4a07f0 | chandanrakholia/LeetcodeSubmissions | count-of-smaller-numbers-after-self/Accepted/1-17-2023, 11:02:58 PM/Solution.cpp | // https://leetcode.com/problems/count-of-smaller-numbers-after-self
class Solution {
public:
void print(vector<pair<int,int>> &L){
for(auto i: L){
cout<<i.first<<" "<<i.second<<endl;
}
}
void print1(vector<int> &ans){
for(auto i: ans){
cout<<i<<' ';
... | ALGO | 0.999993 | 5.77878 |
15638959-de28-4583-9709-0df1a5c0c8e6 | upsj/ginkgo-bot-playground | core/solver/upper_trs.cpp | #include <ginkgo/core/base/array.hpp>
#include <ginkgo/core/base/exception_helpers.hpp>
#include <ginkgo/core/base/executor.hpp>
#include <ginkgo/core/base/polymorphic_object.hpp>
#include <ginkgo/core/base/precision_dispatch.hpp>
#include <ginkgo/core/base/types.hpp>
#include <ginkgo/core/base/utils.hpp>
#include <gin... | TOOL | 0.969424 | 7.334233 |
c0700e32-3292-4b84-bdb9-566e23b95c07 | romit0226/DS_Algo | LeetCode/414. Third Maximum Number.cpp | class Solution {
public:
int thirdMax(vector<int>& nums) {
vector<int> v;
int len=nums.size();
sort(nums.begin(),nums.end());
v.push_back(nums[0]);
for(int i=1;i<len;i++){
if(nums[i]>nums[i-1])
v.push_back(nums[i]);
}
... | ALGO | 0.999969 | 5.403098 |
c0e1a106-8342-4f71-89c6-658b7ce86a92 | zahmryan/CSE498-C-to-C-FaceTracking | SharedContent/cpp/GameContent/Level.cpp | /,
float /* elapsedTime */,
float /* timeRemaining*/,
std::vector<GameObject^> objects
)
{
int left = 0;
for (auto object = objects.begin(); object != objects.end(); object++)
{
if ((*object)->Active() && (*object)->Target())
{
if ((*object)->Hit())
{... | TOOL | 0.917555 | 5.494109 |
7d0a4231-46f2-4b01-b56f-70d0a104da69 | 4ment/gdp | src/main.cpp | //
// main.cpp
// PhyCPP
//
// Created by Mathieu on 23/09/2015.
//
#include <stdio.h>
#include <fstream>
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <regex>
#include <random>
#include "Nexus.hpp"
#include "Newick.hpp"
#include "Patristic.hpp"
#include "Multinomial.hpp"
#include "C... | ALGO | 0.997803 | 4.998112 |
b254140e-d10b-4ae2-989a-d27346bc1b0c | MozaffarMotwakil/cpp-problem-solving | level-2/Ex16-CheckSparceMatrix/Ex_16-CheckSparceMatrix.cpp | #include <iostream>
#include <cstdlib>
#include <iomanip>
#include "C:\Users\mozaf\C++ Projacts\MyLibrary\MyInputLib.h"
using namespace std;
int RandomNumber(int From, int To) {
return rand() % (To - From + 1) + From;
}
void FillMatrixWithRandomNumbers(int Matrix[3][3], int Rows, int Columns) {
int Counter = 0;
... | ALGO | 0.985022 | 3.420965 |
c0a20ff8-0bf6-493a-afde-2f05d738882c | boyslikeguy23/devC_semester_01 | DevCbaitap/daysotangdan.cpp | #include<stdio.h>
#include<math.h>
int main(){
int i, dem=0, n;
printf("Moi nhap so phan tu cua mang:");
scanf("%d", &n);
int a[n+1];
for (i=1;i<=n;i++){
printf("Nhap phan tu thu %d:", i);
scanf("%d", &a[i]);
}
for (i=1;i<=n;i++) printf("%d\t", a[i]);
printf("\n");
for (i=1;i<=n-1;i++){
if(a[i+1]... | ALGO | 0.999781 | 3.030419 |
dad7424b-3dc2-4603-92bc-e047682039c3 | CGCL-codes/LoomIO | src/boost/libs/numeric/odeint/examples/harmonic_oscillator_units.cpp | #include <iostream>
#include <vector>
/* WARNING: Compilation in debug mode might consume enormous memory
(e.g. ~2GB on gcc 4.4 )
*/
// first increase fusion macro variables (now done by odeint itself)
//#define BOOST_FUSION_INVOKE_MAX_ARITY 15
//#define BOOST_RESULT_OF_NUM_ARGS 15
//[ units_define_basic_quanti... | ALGO | 0.855809 | 7.393019 |
1b6b6a09-156f-4855-841b-c24d6412b98e | ohnley/game-of-life | src/game_helper.cpp |
#include "../include/Board.h"
#include <iostream>
const int REANIMATE_REQ = 3;
const int UNDERPOP_THRESH = 2;
const int OVERPOP_THRESH = 3;
namespace game_of_life_logic {
void print_board(Board &b) {
for (const std::vector<Cell> &row: b.get_board()) {
for (const Cell &c: row) {
... | ALGO | 0.984208 | 6.038026 |
5343008d-ad89-496c-a73a-3627f6906f16 | Coder-Vippro/Code | Archived/GiaHung/RENHANH (3).cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
freopen ("RENHANH.inp","r",stdin);
freopen ("RENHANH.out","w",stdout);
int a,b;
cin>>a>>b;
if(a%b==0)cout<<"yes";
else cout<<a/b<<" "<<a%b;
return 0;
}
| ALGO | 0.999833 | 4.411412 |
5623c378-b69f-4ef0-be3a-c813adcf7093 | unix-follower/math-practice | cpp/linalg/src/example1.cpp | #include "constants.hpp"
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/lu.hpp>
#include <armadillo>
#include <iostream>
#include <sstream>
#include <exception>
#include <cassert>
void solve_with_armadillo()
{
std::cout << "Solve with Armadillo" << std::endl;
arma::mat coefficient_m... | ALGO | 0.995239 | 5.511385 |
911d2ff8-d735-43d1-90f3-2719d5b515bc | ShaopengLin/Sorting-Visualizer | Hitbox.cpp | #include "functionPrototypes.h"
//hit box of quick sort button
bool hitboxQuick(ALLEGRO_MOUSE_STATE mouState)
{
if (mouState.x >= SCREENWIDTH/16 && mouState.y >= SCREENHEIGHT/2 && mouState.x <= SCREENWIDTH/4+SCREENWIDTH/16 && mouState.y <= SCREENHEIGHT/4*3) {
return true;
}
return false;
}
//hit box... | ALGO | 0.941876 | 4.547554 |
a264e559-52fd-4f2d-8dcc-e17318392986 | cruisewu/cornealReflex | opencv-master/modules/imgproc/src/phasecorr.cpp | #include "precomp.hpp"
#include <vector>
namespace cv
{
static void magSpectrums( InputArray _src, OutputArray _dst)
{
Mat src = _src.getMat();
int depth = src.depth(), cn = src.channels(), type = src.type();
int rows = src.rows, cols = src.cols;
int j, k;
CV_Assert( type == CV_32FC1 || type == C... | ALGO | 0.997589 | 5.966908 |
0bc5d962-1770-4f75-b52a-8491f539231f | santi3223/PreseleccionIOI | Codeforces/Contests/Simulaciones o Contests Reales/SanSi Cup Clasificatoria/D - Navidad.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vl vector<ll>
#define vs vector<string>
#define vb vector<bool>
#define vc vector<char>
#define ull unsigned long long
#define pll pair<ll, ll>
#define pb push_back
#define fi first
#define se second
#define ff(i, p, x) for (ll i = p; i < x; i++... | ALGO | 0.999983 | 4.099178 |
727e489f-b9fc-4131-8b73-598c5da36253 | fr0m-scratch/clickhouse | src/Processors/Merges/Algorithms/IMergingAlgorithmWithSharedChunks.cpp | #include <Processors/Merges/Algorithms/IMergingAlgorithmWithSharedChunks.h>
#include <Processors/Merges/Algorithms/MergeTreePartLevelInfo.h>
namespace DB
{
IMergingAlgorithmWithSharedChunks::IMergingAlgorithmWithSharedChunks(
Block header_, size_t num_inputs, SortDescription description_, WriteBuffer * out_row_so... | TOOL | 0.990039 | 5.665919 |
18abd952-3435-462a-962b-a0d9dc347ab0 | xndrxssx/Beecrowd_URI_Judge | C++/1142.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=1, j=0; j<n; j++){
int c=3;
while(c--){
cout<<i<<" ";
i++;
}
i++;
cout<<"PUM\n";
}
} | ALGO | 0.99974 | 3.09989 |
04a8a586-3a50-4959-9b67-de8cac6e0bd7 | test-bai-cpu/hdi_plan | src/dynamic_motion_planner/chomp_cost.cpp | #include "dynamic_motion_planner/chomp_cost.hpp"
namespace hdi_plan {
ChompCost::ChompCost(const std::shared_ptr<ChompTrajectory>& trajectory, const std::vector<double> &derivative_costs,
double ridge_factor) {
int num_vars_all = trajectory->get_num_points_diff();
int num_vars_free = num_vars_all - 2 * (hdi_p... | ALGO | 0.995803 | 5.644265 |
c02c89d0-a346-45c0-ace3-af49286ff597 | UsernameIsNotAvailab1e/OOTP_LAB1-8 | Project6/FileName6.cpp | #include <iostream>
#include <stack>
#include <string>
#include <sstream>
#include <Windows.h>
#include <unordered_map>
//
class Context {
public:
void setVariable(const std::string& name, int value) {
variables[name] = value;
}
int getVariable(const std::string& name) const {
if (va... | ALGO | 0.974295 | 6.104945 |
f3246576-66a5-4c08-be6a-7a2591478cc8 | kartikj360/Cpp-codes | dnas7.cpp | // By Kartik Joshi
// Impelementing circular link list
#include <iostream>
#include <stdio.h>
using namespace std;
template <class K>
class node
{
public:
K data;
node<K> *next;
node(K val)
{
data = val;
next = NULL;
}
};
template <class T>
class circular_link_list
{
public:
... | ALGO | 0.999882 | 4.433953 |
9bfda0b9-399e-423c-b9bf-f459d530b70d | SWAGATSWAROOP/C- | fibbonacciseq.cpp | #include<iostream>
using namespace std;
void fibbo(int n){
int t1=0;
int t2=1;
int nextterm;
for(int i=1; i<=n;i++){
cout<<t1<<endl;
nextterm=t1+t2;
t1=t2;
t2=nextterm;
}
return;
}
int main(){
int n;
cin>>n;
fibbo(n);
return 0;
} | ALGO | 0.999949 | 4.09067 |
a328a983-4d1b-4d2d-ab0b-f55615057828 | mjayalam/Problems-Solutions | Omegaup/Proyectiles.cpp | #include <cstdio>
#include <set>
using namespace std;
typedef pair <int,int > ii;
set <ii>setii;
set <ii>::iterator it;
int main(){
int n,k;
scanf("%d%d",&n,&k);
while(n--){
int x,y;
scanf("%d%d",&x,&y);
setii.insert(ii(x,y));
}
while(k--){
int x,y;
scanf("%d%d",&x,&y);
it = setii.find(ii(x,y));
it =... | ALGO | 0.999917 | 3.258451 |
e654abf3-5866-41b0-baa2-5a0d9610bd32 | chinchila/ICPC | code/geometry/lineIntersection.cpp | /**
If a unique intersection point of the lines going through s1,e1 and s2,e2 exists \{1, point\} is returned.
If no intersection point exists \{0, (0,0)\} is returned and if infinitely many exists \{-1, (0,0)\} is returned.
The wrong position will be returned if P is Point<ll> and the intersection point does not have ... | ALGO | 0.999723 | 5.168421 |
ec5419f0-d4cb-4635-ac4d-79e6fcdc8397 | raincross7/code-similarity | codes/train_code/problem321/problem321_344.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<(ll)n;++i)
using P = pair<ll,ll>;
const ll dv = 1000000007;
int main() {
ll n,k;cin >> n >> k;
vector<ll> a(n);
rep(i,n) cin >> a.at(i);
ll base = 0; // 与えられた数列の転倒数
rep(i,n-1){
for(ll j=i+1;j<n;++j){
if( a.at(... | ALGO | 0.999903 | 3.644314 |
6bcbc2d0-5175-4d78-a1c4-f24c8c96e2c0 | Emad-W/CarND-Path-Planning-Project | src/Eigen-3.3/failtest/colpivqr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
ColPivHouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.909831 | 3.159166 |
abb48ded-af8d-4ac7-8b7e-2893ba4cf519 | rooprete1cham/C-Programing | 7장 연습문제/20230424/20230424_3/20230424_3/main.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
void main()
{
int num1, num2, num3, sum;
printf(" Էϼ: ");
scanf("%d %d %d", &num1, &num2, &num3);
sum = 0;
if (num1 >= 0)
{
sum += num1;
}
if (num2 >= 0)
{
sum += num2;
}
if (num3 >= 0)
{
sum ... | ALGO | 0.996045 | 3.985111 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.