uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
a4b3a23f-dc42-4198-82d3-5b02d0f6057b | sujanrupu/Love_Babbar_Supreme_Assignments | Dynamic Programming/Best Time to Buy and Sell Stock with Transaction Fee.cpp | class Solution {
public:
int solve(vector<int>& prices, int index, int buy, int fee, vector<vector<int>>& dp) {
if(index >= prices.size()) return 0;
if(dp[index][buy]!=-1) return dp[index][buy];
int profit = 0;
if(buy) {
int buy = -prices[index] + solve(prices, index+1,... | ALGO | 0.999937 | 5.677435 |
46d777f3-32e0-4721-bd18-01ab678a99b0 | ishandutta2007/codeforces | bilibilitdasc/normal/1637/A.cpp | #include <bits/stdc++.h>
//#define CinCout
#define rep(i,n) for(int i=0,_##i##__end=(n);i<_##i##__end;++i)
#define per(i,n) for(int i=(n)-1;i>=0;--i)
#define rep1(i,n) for(int i=1,_##i##__end=(n);i<=_##i##__end;++i)
#define per1(i,n) for(int i=(n);i>=1;--i)
#define repk(i,a,b) for(int i=(a),_##i##__end=(b);i<=_##i##__e... | ALGO | 0.999921 | 3.955397 |
cc199040-65f6-44ea-aec8-efa87b2067c2 | shahidul-brur/OnlineJudge-Solution | Codeforces (volume 2)/727_A - Transformation from A to B.cpp | /*=================================*\
| |
| Md. Shahidul Islam |
| CSE, BRUR |
| Rangpur, Bangladesh |
| mail: <EMAIL> |
| FB : fb.com/shahidul.brur |
| |
\*=================================*... | ALGO | 0.999989 | 3.715274 |
ec8689bc-278b-42a7-b382-e0a986401095 | SWG-Unity/src | engine/shared/library/sharedMath/src/shared/core/ShapeUtils.cpp | #include "sharedMath/FirstSharedMath.h"
#include "sharedMath/ShapeUtils.h"
#include "sharedMath/MultiShape.h"
#include "sharedMath/Transform.h"
#include "sharedMath/Sphere.h"
#include "sharedMath/Cylinder.h"
#include "sharedMath/OrientedCylinder.h"
#include "sharedMath/AxialBox.h"
#include "sharedMath/YawedBox.h"
#inc... | TOOL | 0.957358 | 7.766944 |
5e9067d6-0ff7-4bef-94a4-00fe5899c8de | jwnhy/lam | llvm-project/libc/src/math/generic/fminimum_magf128.cpp | #include "src/math/fminimum_magf128.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float128, fminimum_magf128, (float128 x, float128 y)) {
return fputil::fminimum_mag(x, y);
}
} // na... | ALGO | 0.993 | 6.128852 |
0562358a-5f37-4599-8b16-8a5c024225ef | hkwww/gtsam | timing/timeSFMBALnavTcam.cpp | /**
* @file timeSFMBALnavTcam.cpp
* @brief time SFM with BAL file, expressions with navTcam pose
* @author Frank Dellaert
* @date July 5, 2015
*/
#include "timeSFMBAL.h"
#include <gtsam/slam/expressions.h>
#include <gtsam/nonlinear/ExpressionFactor.h>
#include <gtsam/geometry/Cal3Bundler.h>
#include <gt... | DATA | 0.913468 | 5.834304 |
1cd6caf0-efc6-4922-8384-d679bacc4a88 | JooseRajamaeki/TVCG18 | SCA/ode-0.12/OPCODE/OPC_AABBCollider.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////... | ALGO | 0.999138 | 7.294527 |
c5a0ce63-7559-4e4b-8b5e-13f4c631c1a6 | ravibajpai001/data_structure_and_algo | diif_odd_and_even.cpp | #include <iostream>
#include<cstdio>
#include <stack>
#include<malloc.h>
#define MAX_Q_SIZE 500
using namespace std;
// Binary Tree node
struct node
{
int data;
struct node *left, *right;
};
void dif_odd_even(struct node *root,int lev,int *sum)
{
if(root)
{
if(lev%2==0)
{
*sum=*sum+root->data;
}
... | ALGO | 0.999908 | 3.774468 |
8af3430a-0f70-42b7-a9de-ff0654e5de03 | avinashkkumar/cdsa | cpppractice/optimize_prime.cpp | #include<iostream>
bool prime_check(int n);
int main(){
std::cout << prime_check(137) << std::endl;
}
bool prime_check(int n){
if (n%2==0)
{
return false;
}
int i = 0 ;
while(i < n){
if (n%i==0)
{
return false;
}
i+2;
}
r... | ALGO | 0.999806 | 4.595969 |
6d1b5592-b701-4578-a7b7-dbbd83f8d14b | Joonking/Study_CodingTest | Study_CodingTest/Programmers/코딩테스트입문/최댓값만들기2.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(vector<int> numbers) {
int answer = 0;
sort(numbers.begin(), numbers.end());
int a = numbers[0] * numbers[1];
int b = numbers[numbers.size() - 1] * numbers[numbers.size() - 2];
if (a > b) answer = a;
... | ALGO | 0.999661 | 5.216688 |
8cb4fd05-027c-4169-8a56-7b85cb978024 | Jinming-Su/caffe-source-code-analysis | caffe-test/src/caffe/solvers/rmsprop_solver.cpp | #include <vector>
#include "caffe/sgd_solvers.hpp"
namespace caffe {
#ifndef CPU_ONLY
template <typename Dtype>
void rmsprop_update_gpu(int N, Dtype* g, Dtype* h, Dtype rms_decay,
Dtype delta, Dtype local_rate);
#endif
template <typename Dtype>
void RMSPropSolver<Dtype>::ComputeUpdateValue(int param_id, Dtype r... | ALGO | 0.9815 | 7.295526 |
3bedbffa-17a3-44d3-b9b7-fb2b03008a43 | manikanta2901/ubuntu | .history/practice/hackerEarth/Bsequence_20200723171419.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.99992 | 3.750244 |
c0364fa2-0302-41df-ba60-bb0cdc6831bc | tmuttaqueen/MyCodes | Online Judge Code/[Other] Online-Judge-Solutions-master_from github/UVA/Contest Volumes/12302 - Nine-Point Circle.cpp | #include <cstdio>
#include <cmath>
using namespace std;
struct point{
double x,y;
point(){}
point(double _x, double _y) : x(_x), y(_y){}
point operator - (point P){
return point(x - P.x,y - P.y);
}
point operator + (point P){
return point(x + P.x,y + P.y);
}
... | ALGO | 0.999575 | 3.339051 |
d15ddd71-ca14-4f28-8ad0-9d750188d0dd | rasulzhan/Hermetic-client | client/sftp/zip/lz77.cpp | #include "lz77.h"
#include <assert.h>
#include <limits.h>
#include <stdint.h>
#include <string.h>
#include "bits.h"
#define HASH_SIZE 15
#define NO_POS SIZE_MAX
#define MIN_LEN 4
/* Compare the substrings starting at src[i] and src[j], and return the length
* of the common prefix. The match must be strictly lo... | ALGO | 0.998252 | 5.717468 |
d97e5524-8d94-4e47-a6ba-dabe38482bad | YaominJun/ant_colony_algorithms_for_multi_agents | src/aco_planner/src/basicFuction.cpp | #pragma once//防止重定义
#include "basicFunction.h"
vector<Node> connecte(vector<Node> v1, vector<Node> v2)
{
for(int i=0; i<v2.size(); i++)
{
v1.insert(v1.end(),v2.at(i));
}
return v1;
}
float angle(Node point1, Node point2)
{
float dx, dy, angle;
dx = point2.x - point1.x;
dy = point2.y - point1.y;
if(fabs(d... | TOOL | 0.888246 | 3.595126 |
8174c587-8efc-427f-b9bb-ab9171624dfc | shahjigar556/6Companies30Days | GoldmanSachs/14_minSizeSubArraySum.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int minSubArrayLen(int target, vector<int>& nums) {
int n=nums.size();
int ans=INT_MAX;
int start=0;
long long int sum=0;
for(int i=0;i<n;i++)
{
sum+=nums[i];
if(nums[i]>=t... | ALGO | 0.999975 | 6.013986 |
1b59d235-b6a2-4449-9555-ed5a4f5c8682 | radall1/DroneQuest | src/Freyja/waypoint_manager/src/waypoint_manager.cpp | /*
Handles user-requested discrete waypoints and produces the appropriate
reference_state for the controller.
Two modes are supported for waypoints: TIME (0) and SPEED (1).
TIME(0): generates a trajectory that meets the requested waypoint
at exactly t seconds in the future. t is user-provided.
This is an implem... | ALGO | 0.994864 | 4.316601 |
6a09271c-3df1-4221-8aa2-27dae2587c6c | ishandutta2007/codeforces | zayin/normal/1555/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define mt make_tuple
#define rep(i,begin,end) for (__typeof(begin) i=(begin),_end=(end),_step=1-2*((begin)>(end));i!=_end;i+=_step)
// OUTPUT
template<class a, class b>
ostream& operator << (ostream& os, const pair<a,b>& p) {
os<<"("<<p.first<<",... | ALGO | 0.999944 | 4.080275 |
f9baa592-3b1f-47c4-a9bb-305368154d87 | openeuler-mirror/llvm-project | openmp/runtime/test/tasking/kmp_task_modifier_simple_ws_old.cpp | // RUN: %libomp-cxx-compile-and-run
#include <stdio.h>
#include <omp.h>
#define NT 4
#define INIT 10
/*
The test emulates code generation needed for reduction with task modifier on
parallel construct.
Note: tasks could just use in_reduction clause, but compiler does not accept
this because of bug: it mistakenly req... | TEST | 0.891872 | 5.302878 |
c84f4276-ae67-4061-9952-8e5b9a609e40 | MiquelBenllochArmijo/AdventOfCode | day11/day11_parte2.cpp | #include <algorithm>
#include <cmath>
#include <fstream>
#include <iostream>
#include <memory>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>
constexpr int MAX_LEVEL = 75;
// Estructura que representa un nodo en el árbol
struct Node {
long long engraving; // Cambiado de "value" a "... | ALGO | 0.999922 | 7.187788 |
8eac0939-ef46-461a-ade2-e2df50b47745 | nbutacm/NBUTACM | 2019级/2020年暑期集训 - 课件&标程&题解/2020-暑假出题总附录/std/K/3.cpp | #include <queue>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
struct node {
int x, y, t, st;
node( int X, int Y, int T, int S ) {
x = X, y = Y, t = T, st = S;
}
};
queue < node > q;
int n, m, len, sx, sy;
int dir[16], dx[4] = { 0, 0, 1, -1 }, dy[4] = { 1, -1, 0, 0 }... | ALGO | 0.999761 | 3.447645 |
fe075d79-5f8c-4f96-9545-9e9fb47136ae | HIllya51/LunaTranslator | src/cpp/shareddllproxy/FileLocksmithLibInterop/FileLocksmith.cpp | #include "FileLocksmith.h"
#include "NtdllExtensions.h"
static bool is_directory(const std::wstring path)
{
DWORD attributes = GetFileAttributesW(path.c_str());
return attributes != INVALID_FILE_ATTRIBUTES && attributes & FILE_ATTRIBUTE_DIRECTORY;
}
// C++20 method
static constexpr bool starts_with(std::wstri... | TOOL | 0.938809 | 5.721759 |
2598ac18-ced9-466b-89d8-1a35f10d59c3 | keijak/comp-pub | cf/contest/1499/E/main.cpp | #include <bits/stdc++.h>
#define REP_(i, a_, b_, a, b, ...) \
for (int i = (a), END_##i = (b); i < END_##i; ++i)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(x) std::begin(x), std::end(x)
using i64 = long long;
template<unsigned M>
struct ModInt {
constexpr ModInt(long long val... | ALGO | 0.999952 | 5.271216 |
1d58201d-9b73-4a61-8d9f-339d19620158 | masonarchhsieh/Training_LeetC | 2492-length-of-the-longest-alphabetical-continuous-substring/2492-length-of-the-longest-alphabetical-continuous-substring.cpp | class Solution {
public:
int longestContinuousSubstring(string s) {
int res = 0;
int _len = 1;
for (auto i = 1; i < size(s) && i <= size(s) - res; i++) {
if (s[i] - s[i-1] != 1) {
res = max(res, _len);
_len = 1;
continue;
... | ALGO | 0.999938 | 5.689009 |
53300a95-0506-489e-ab94-0c9f9a96b87f | xx123456xx/C- | 3.13-1/3.13-1/程序设计-14.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void fun(char tt[81])
{
int i=0;
for(i=0;i<strlen(tt);i++)
{
if(i%2==1&&tt[i]>='a'&&tt[i]<='z')//±ΪСдĸȴдĸСдĸͬĸСд32
{
tt[i]=tt[i]-32;
}
}
}
int main()
{
char tt[81];
char s[81]="abc4efg";
system("CLS");
printf("\nPle... | TOOL | 0.96137 | 3.414593 |
3dd2fdc3-b368-4a4a-83fe-c2fa06c017ad | kaushaljalan15/Algorithms-4th-Sem | Rotation_BS(logN).cpp | #include <bits/stdc++.h>
using namespace std;
//Jai Shreee Ram
int bsearch(int a[],int l,int e,int key)
{
if (l > e)
return -1;
int mid = (l+e)/2;
if (a[mid] == key)
return mid;
if (a[l] <= a[mid])
{
if (key >= a[l] && key <= a[mid])
return bsearch(a, l, mid... | ALGO | 0.99983 | 4.982073 |
71fe90e5-03d2-4cb8-a1d2-2387128f8be9 | kisho1131/Leetcode-Practice | Knapsack with Duplicate Items - GFG/knapsack-with-duplicate-items.cpp | // { Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
int knapSack(int n, int w, int val[], int wt[])
{
int dp[n + 1][w + 1];
for (int i = 0; i < n + 1; i++)
for (i... | ALGO | 0.999997 | 5.549416 |
f998da03-3ca4-4c54-8083-516a72810260 | SabreFoxx/Cubico | thirdparty/polyvox/Picking.cpp | #include "Picking.h"
#include "Raycast.h"
namespace PolyVox
{
namespace
{
/**
* This is just an implementation class for the pickVoxel function
*
* It makes note of the sort of empty voxel you're looking for in the constructor.
*
* Each time the operator() is called:
* * if it's hit a voxel it s... | ALGO | 0.911538 | 7.194879 |
94daacdb-8c06-4053-a750-3a9143fd15d0 | PragmaCube/Stan-Robotix-Source | Compets/2023/2023_StanRobotix_FRC/FirstRobot6622/src/main/cpp/commands/AutoConeHigh.cpp | #include "../../include/commands/AutoConeHigh.h"
#include "../../include/RobotContainer.h"
#include <iostream>
AutoConeHigh::AutoConeHigh(RobotContainer * iRobotContainer)
{
mCurrentStep = Phase1_;
mRobotContainer = iRobotContainer;
mGenericTimer.Reset();
EnableSubsystemLog(kLogAutoConeHighEnable);
... | TOOL | 0.861367 | 4.578448 |
db65deae-945f-4a42-9ead-2674415479c4 | radekgryglicki/cpp_czesc5 | Czesc_5/zadania/zad_46/main.cpp | #include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int a[7];
int i;
int wieksze = 0, rowne = 0, mniejsze = 0;
system("chcp 1250");
system("cls");
for( i=0;i<8;i++)
{
cout<<"podaj A["<<i<<"]=";
cin>>a[i];
if(a[i]>0){
wieksze++;
}else if(a[i]<0){
mniejsze++;
}else{
rowne++;
... | ALGO | 0.997013 | 3.383924 |
0c180db0-47e0-44bb-9ebf-da6f4f308bf8 | lsChen916/NCTU_CASE | HW3/inverse_kinematics_source_code/Eigen/eigen-eigen-c58038c56923/doc/examples/DenseBase_middleRows_int.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(2..3,:) =\n" << A.middleRows(2,2) << endl;
return 0;
}
| ALGO | 0.936065 | 3.312439 |
228d580a-b201-4f20-95f0-5da9ab272a06 | szabodabo/CUDA-MPI-Reductions | cuda/C/src/bicubicTexture/bicubicTexture.cpp | /*
Bicubic texture filtering sample
sgreen 6/2008
This sample demonstrates how to efficiently implement bicubic texture
filtering in CUDA.
Bicubic filtering is a higher order interpolation method that produces
smoother results than bilinear interpolation:
http://en.wikipedia.org/wiki/Bicub... | ALGO | 0.990146 | 5.978744 |
4e4ce4e3-d400-4fa5-bd2f-ec7385288eda | tghyyhjuujki/ProblemSolving | BOJ/15685_드래곤커브.cpp | #include<iostream>
#include<queue>
using namespace std;
struct dragon{
int x, y;
};
int arr[101][101];
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,-1,0,1 };
int asdf[11] = {0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512};
queue<dragon> q;
int main() {
dragon dra;
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,... | ALGO | 0.999125 | 3.675983 |
00945720-4d25-4026-8a70-94f546364b17 | eschgr/BlockyVoyages | BlockyVoyages/Geometry/AABB.cpp | #include "stdafx.h"
#include "AABB.h"
namespace BlockyVoyages {
namespace Geometry {
AABB::AABB(const Vector3f& min, const Vector3f& max)
: m_minCoord(min),
m_maxCoord(max)
{}
AABB::AABB(const Vector3f& point, float32 sideSize) {
fromCenterSize(point, sideSize);
}
AABB::AABB(const AABB& other) {
... | ALGO | 0.993427 | 7.5588 |
0af0bb93-b79a-4427-a62a-293ddccaf0ca | tippesi/Atlas-Engine | src/engine/terrain/Terrain.cpp | #include "Terrain.h"
#include "../renderer/helper/GeometryHelper.h"
#include <algorithm>
namespace Atlas {
namespace Terrain {
Terrain::Terrain(int32_t rootNodeSideCount, int32_t LoDCount, int32_t patchSizeFactor, float resolution,
float heightScale) : rootNodeSideCount(rootNodeSideCount), ... | TOOL | 0.990145 | 3.934781 |
3dd1de0f-dc39-4b7c-aca3-d180ccecd353 | Jebearssica/LeetCode | Tree/101.对称二叉树.cpp | /*
* @lc app=leetcode.cn id=101 lang=cpp
*
* [101] 对称二叉树
*
* https://leetcode-cn.com/problems/symmetric-tree/description/
*
* algorithms
* Easy (53.00%)
* Likes: 1063
* Dislikes: 0
* Total Accepted: 215K
* Total Submissions: 405.4K
* Testcase Example: '[1,2,2,3,4,4,3]'
*
* 给定一个二叉树,检查它是否是镜像对称的。
* ... | ALGO | 0.999952 | 6.707107 |
6aa0d470-4f05-47f2-ab30-e1e53d05df19 | techcraze00/Array_in_DSA | reverseArray.cpp | #include <bits/stdc++.h>
using namespace std;
void reverseArray(int arr[], int start, int end)
{
int n = end;
while (start < end)
{
int temp = arr[start];
arr[start] = arr[end];
arr[end] = temp;
start++;
end--;
}
cout << "Reverse Of array : " << endl;
... | ALGO | 0.998786 | 5.149641 |
d3adf4e3-9fc5-4885-afe5-ae0b600c25da | shota-higaki/atcoder | contests/abc123/abc123_a.cpp | // A - Five Antennas
// https://atcoder.jp/contests/abc123/tasks/abc123_a
#include <iostream>
using namespace std;
int main() {
int a, b, c, d, e; cin >> a >> b >> c >> d >> e;
int k; cin >> k;
if(e-a<=k) cout << "Yay!" << endl;
else cout << ":(" <<endl;
}
| ALGO | 0.999671 | 3.464303 |
1ab82f71-02ea-4744-a271-c8e6d63c5470 | irele/school | school/year1/semester 1/iwanov- basics of programming/lab 2/task1.5/Project3/Source.cpp | #include<iostream>
using namespace std;
//PROGRAMME FOR FIND Y (7 VARIANT)
void main() {
double y, a, b, step, f;
int i, j, k, n;
cout << "Input n ";
while (!(cin >> n) || (cin.peek() != '\n'))
{
cin.clear();
while (cin.get() != '\n');
cout << "Error! You entered non numeric data" << endl << "Input n ";
... | ALGO | 0.99899 | 3.487663 |
71334ab3-7b36-4c69-8eaf-98fe9f8c1255 | u-wyh/luogu-code | P1746(2).cpp | #include<bits/stdc++.h>
using namespace std;
int n;
int vis[1005][1005];
int h[4]={0,0,1,-1},s[4]={1,-1,0,0};
char a[1005][1005];
struct node{
int x,y;
};
queue<node>q;
bool check(int x,int y){
if(a[x][y]=='1')
return false;
if(vis[x][y]>0)
return false;
if(x>n||x<1)
return false;
if(y>n||y<1)
... | ALGO | 0.999716 | 4.217355 |
ce100206-234d-42fc-98b9-e9d045173f15 | UltraProton/PlacementPrep | Graph/Shortest paths/Dijkstras/fastImplementation.cpp | /*
* We can't have prim's fastimplemenation.cpp kind of optimization here. Because when we change the distance in dist[] we also need
* to change the distance of the vertex in the priority_queue. So we need to maintain some kind of index according to the vertices
* which stores at which index in the priority queue the... | ALGO | 0.999994 | 4.505185 |
ae42918a-a9d5-4c02-a374-0cbfe1ce8de3 | Lamobo/Lamobo-D1 | src/pctool/Anyka IP Camera/Anyka IP Camera/Anyka IP Camera/ServerSearch.cpp | #include "StdAfx.h"
#include "ServerSearch.h"
#include <time.h>
CServerSearch::CServerSearch(void)
: m_bIsOpen(FALSE)
{
}
CServerSearch::~CServerSearch(void)
{
DeleteAllServer();
m_NetCtrl.CloseSearch();
}
int CServerSearch::Search()
{
if (!m_bIsOpen) {
m_NetCtrl.OpenSearch();
m_NetCtrl.RegisterServerRespond(... | WEB | 0.851399 | 3.331034 |
006b3ee2-e123-43e2-ba2b-8d982c861e84 | amsraman/Competitive_Programming | 15-295/S22/Contest 12/G.cpp | #include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
const int mod = 1e9 + 7;
template<class B>
struct LazySegTree : public B {
using T_q = typename B::T_q;
using T_u = typename B::T_u;
size_t n, sz, log;
vector<T_q> seg, init;
vector<T_u> lazy;
LazySegTree(size_t ... | ALGO | 0.999783 | 4.396129 |
6e34218f-a637-41fe-b537-e78bc73343fb | yongjianchn/s2e-MemoryManager | s2e/stp/src/sat/cryptominisat2/PartFinder.cpp | #include "PartFinder.h"
#include "Solver.h"
#include "Gaussian.h"
#include "GaussianConfig.h"
#include "ClauseCleaner.h"
#include "time_mem.h"
#include "VarReplacer.h"
#include <set>
#include <map>
#include <iomanip>
#include <math.h>
#include "FailedVarSearcher.h"
using std::set;
using std::map;
//#define VERBOSE_D... | ALGO | 0.999148 | 5.272369 |
3edef0a7-2f92-4065-aadd-2bf7300f1a87 | KseniaImprota/MatrixCalc | Matrix.cpp | #include "Matrix.h"
Matrix::Matrix(int row, int column)
{
_row = row;
_column = column;
matrix = new double* [row];
for (int i = 0; i < row; i++) {
matrix[i] = new double[column];
}
}
Matrix::Matrix(const Matrix& other)
{
_row = other._row;
_column = other._column;
matrix = new double* [_row];
for (int i ... | ALGO | 0.992762 | 4.168826 |
4a91dd39-3b35-485e-8750-fc223f4afbbb | animshamura/Codeforces-Solve- | Winner.cpp | #include <bits/stdc++.h>
using namespace std;
int n,c[1000],mx = INT_MIN;
string s[1000];
map<string,int> a,b;
int main(){
cin >> n;
for (int i = 0;i < n;i++){
cin >> s[i] >> c[i];
a[s[i]] += c[i];
}
for (int i = 0;i < n;i++) mx = max(mx,a[s[i]]);
for (int i = 0;i < n;i++){
b[s[i]] += c[i];
if (b[s[i]] >= ... | ALGO | 0.999909 | 4.032279 |
03f5c8b0-4be0-448f-b16e-c72753baf163 | krgaurav2011/cppCodes | hrDP_candies.cpp | #include <iostream>
#define lli int
using namespace std;
int main()
{
lli n,i,A[1000001],B[1000001];
cin>>n;
for(i=0;i<n;i++)
{
cin>>A[i];
}
lli count=1;
B[0]=1;
for(i=1;i<n;i++)
{
if(A[i]>A[i-1])
{
B[i]=B[i-1]+1;
}
else
{
B[i]=1;
}
count+=B[i];
//cout<<B[i] ;
}
for(i=n;i>0;i--... | ALGO | 0.999908 | 3.62002 |
6325f5a0-3030-4969-8c06-a5d52d6bef37 | kkaoww/lab12 | lab12_2.cpp | #include<iostream>
using namespace std;
int gcd(int,int);
int main(){
int x, y;
cin >> x >> y;
cout << gcd(x,y);
return 0;
}
int gcd(int x,int y)
{
if(x%y==0){
return y;
}
else{
return gcd(y, x%y);
}
} | ALGO | 0.999843 | 4.638456 |
4f9880ad-b814-4910-bb64-943e9f568c2b | David-5-5/tutorial | cplus/leetcode/202505/algo1472.cpp | #include <bits/stdc++.h>
using namespace std;
// 常用数据结构 - 栈 3.1 基础
class BrowserHistory {
private:
vector<string> st;
int inx = 0;
public:
// 自行解答
BrowserHistory(string homepage) {
st.push_back(homepage);
inx = st.size()-1;
}
void visit(string url) {
st.resize(inx+1... | ALGO | 0.996605 | 5.009778 |
91eb49fd-a1a9-4eb6-ad39-5c72f24288a1 | SKIRT/SKIRT7 | SKIRTcore/CubBackgroundGeometry.cpp | /*//////////////////////////////////////////////////////////////////
//// SKIRT -- an advanced radiative transfer code ////
//// © Astronomical Observatory, Ghent University ////
///////////////////////////////////////////////////////////////// */
#include <cmath>
#include <limits>
#include... | ALGO | 0.865509 | 6.338028 |
9ab30f8c-15cd-4b2e-b78f-ee846f4d7ea0 | jaypatil22/Leet-Code-Solutions | 1295. Find Numbers with Even Number of Digits.cpp | class Solution {
public:
int findNumbers(vector<int>& nums) {
int res = 0;
for(int a : nums) {
if(a<0) a*=-1;
if((int)log10((double)a)%2) res++;
}
return res;
}
}; | ALGO | 0.99973 | 5.607014 |
aca82b9a-ce77-4d7d-b575-66e93641cdf0 | davidstutz/superpixels-revisited | lib_ers/MERCFunctions.cpp | #include "MERCFunctions.h"
using namespace std;
double MERCFunctions::ComputeERGain(double wij,double ci,double cj)
{
double er = ((wij+ci)*log(wij+ci) + (wij+cj)*log(wij+cj) - ci*log(ci) - cj*log(cj) - 2*wij*log(wij) )/log(2.0);
if( er!=er )
return 0;
else
return er;
}
double MERCFunctions::ComputeBGain(int... | ALGO | 0.999782 | 4.132872 |
9b8638b0-5f94-4056-b36f-b37dc752ed5b | BitSlayer18/Codefoces | 1989B.cpp | #include <bits/stdc++.h>
#define pb push_back
#define fr first
#define sc second
#define mod 1000000007
#define mod2 998244353
#define len(x) x.size()
#define min3(a,b,c) min(a, min(b,c))
#define max3(a,b,c) max(a, max(b,c))
#define all(v) v.begin(), v.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) fo... | ALGO | 0.999906 | 5.755079 |
c42779a1-e54b-4aa3-985f-690dee77937b | raincross7/code-similarity | codes/train_code/problem458/problem458_351.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(obj) (obj).begin(), (obj).end()
#define bit(n) (1LL << (n))
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const ... | ALGO | 0.999872 | 3.796914 |
b544b92a-fadc-47ba-a6b8-639e4d649431 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/abc079/A/2243743.cpp | #include <iostream>
int main(void)
{
int input, a, b, c, d;
std::cin >> input;
a = input / 1000;
b = (input / 100) % 10;
c = (input / 10) % 10;
d = input % 10;
bool good = (b == c) && ((a == b) || (c == d));
std::cout << (good ? "Yes" : "No") << std::endl;
return 0;
} | ALGO | 0.999799 | 4.748657 |
10599b66-4447-42b8-9641-deef4cad1b42 | BanSheeGun/Gun | Unusual/POJ/Finish/p1006.cpp | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
int exgcd(int a, int b, int & x, int & y) {
if (b == 0) {
x = 1;
y = 0;
return a;
}
int tmp = exgcd(b, a % b, x, y);
int x1 = y;
int y1 = x - (... | ALGO | 0.999903 | 3.619759 |
712eb316-81dd-4915-ad9f-a90f48df6247 | skylord18/lc-sols | Two Sum II - Input Array is Sorted.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
int low = 0;
int high = numbers.size() -1;
while(low < high){
if(numbers[low] + numbers[high] == target){
return {low+1,high+1};;
... | ALGO | 0.99982 | 5.822375 |
388bf58e-4ccc-47d2-a914-ea4040f94b76 | aadarshahebsingh/DSA-Problems-starting-21st-March | 0731-my-calendar-ii/0731-my-calendar-ii.cpp | // Logical - Brute Approach
class MyCalendarTwo {
public:
vector<pair<int,int>> vp;
MyCalendarTwo() {
}
bool book(int x, int y) {
for(auto &val:vp){
int a = val.first, b = val.second;
if((x<b) and (y>a)){
int new_x = max(a,x);
int ne... | ALGO | 0.999947 | 5.866351 |
b750d087-9407-4f71-b154-1096bbe94bf3 | shiftcontrol/UnityOpenCV | opencv/src/cxcore/cxmatmul.cpp | #include "_cxcore.h"
namespace cv
{
/****************************************************************************************\
* GEMM *
\****************************************************************************************/
static v... | ALGO | 0.99461 | 6.261239 |
186e99ef-8073-4086-b60b-5bc7a1f08de6 | 7AyushMan7/Ayushman-Tripathi-OATCP | 11-Couting Subgrids/11.cpp | #include <iostream>
#include <vector>
int countSubgrids(std::vector<std::vector<int>>& grid) {
int size = grid.size(); // Since the number of rows and columns are equal
std::vector<int> rowBits(size);
for (int i = 0; i < size; ++i) {
for (int j = 0; j < size; ++j) {
rowBits[i] |= grid... | ALGO | 0.999841 | 6.876047 |
09303480-f94b-49bc-8dac-71bdbfd490ab | ishandutta2007/codeforces | chinese_zjc_/normal/1605/B.cpp | // This Code was made by Chinese_zjc_.
#include <bits/stdc++.h>
// #define debug
int T, n;
char c[1005];
signed main()
{
std::ios::sync_with_stdio(false);
std::cin >> T;
while (T--)
{
std::cin >> n >> c;
int cnt0 = std::count(c, c + n, '0');
std::vector<int> a;
for (int i... | ALGO | 0.999952 | 4.204484 |
abc0f4db-c750-465e-8a79-7d9f4800b730 | Sugar-27/Cpp-primer | Cpp-Primer-master/ch09/ex9_44.cpp | //
// ex9_44.cpp
// Exercise 9.44
//
// Created by XDXX on 4/17/15.
//
// @Brief Rewrite the previous function using an index and replace.
// @See 9.43
//
// Refactored by Yue Wang Oct, 2015
//
#include <iostream>
#include <string>
using std::cout;
using std::endl;
using std::string;
auto replace_with(str... | TOOL | 0.8864 | 5.389416 |
b884cc64-8dc9-4f4d-9365-3b9b8ad21125 | AhmedMohamedAbdelaty/LeetCode-Solutions | 0200-number-of-islands/0200-number-of-islands.cpp | class Solution {
vector<vector<int>> vis;
int n, m;
bool valid(int x, int y, vector<vector<char>>& grid)
{
return x >= 0 && x < n && y >= 0 && y < m && grid[x][y] == '1';
}
public:
int numIslands(vector<vector<char>>& grid)
{
vis.assign(300 + 5, vector<int>(300 + 5, 0));
... | ALGO | 0.99997 | 6.433806 |
89e530b2-9243-4bbc-9299-68b098843d23 | Piotrwroc/Programowanie | Studia PP/Lab5 2.cpp | /*
Autor: Piotr Józefek
Temat: Laboratorium 5 2
*/
#include <iostream>
#include <string.h>
#include <cstring>
using namespace std;
void InitTab(char**& wsk);
void DodajImie(char* buf, char**& wsk);
void UsunNr(int numer, char**& wsk);
void UsunImie(char* buf, char**& wsk);
void WszystkieImionna(char** wsk);
voi... | ALGO | 0.990899 | 3.877887 |
35ae2e8b-c147-492f-87f2-5dcb2974b189 | lolgamer0126/darts-app-flutter-teqstream | 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 |
34f4960f-bcda-4569-a643-6d8982c39112 | aditya-mad/codeforces-solutions | Solutions/1632A - ABC.cpp | #include <iostream>
using namespace std;
int main()
{
int test;
cin >> test;
for (; test--;)
{
int size;
cin >> size;
string ans;
cin >> ans;
if (size == 1 || (size == 2 && ans[0] != ans[1]))
{
cout << "YES" << endl;
}
else
... | ALGO | 0.999678 | 4.052816 |
f4f3264b-db5b-4f2b-a1cb-d74aa085781c | SenitCo/Data-Structure-and-Algorithm | 041_firstMissingPositive.cpp | /*@Description: First Missing Positive
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and uses constant space.
*/
/**
交换数组元素,使得数组中第i位存放数值(i+1)。最后遍历数组,寻找第一个不符合此要求的元素,返回其下标。
整个过程需要遍历两次数组,复杂度为... | ALGO | 0.999975 | 4.942815 |
d23585ce-dbcf-411d-903c-3fb8ec37759f | Bwolfs2/how_to_do_notifier | htd_toggle_button/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.998973 | 6.797273 |
d59215f8-68a4-40f3-a2fe-f4bed7d6c546 | 1103r74t8g/Leetcode | CPP/242. Valid Anagram.cpp | class Solution {
public:
bool isAnagram(string s, string t) {
unordered_map<char, int>mp;
for(char x : s){
mp[x]++;
}
for(char x : t){
mp[x]--;
}
for(auto& x : mp){
if(x.second != 0){
return false;
... | ALGO | 0.999975 | 6.433649 |
5a1b9523-31cb-4a3e-9a9c-0c0edce139bf | ShadowShahriar/cse222 | assignment-01/08-quick-sort.cpp | #include <iostream>
using namespace std;
int partition(int a[], int l, int h)
{
int pivot = a[l];
int i = l;
int j = h;
while (i < j)
{
while (a[i] <= pivot)
i++;
while (a[j] > pivot)
j--;
if (i < j)
swap(a[i], a[j]);
}
swap(a[l], a[j]);
return j;
}
void quickSort(int a[], int l, int h)
{
if ... | ALGO | 0.999766 | 4.80974 |
61f6ccb8-76e6-42a6-8c62-4ff3e5363dfa | abhiXsliet/DSA-Busted-A-Complete-CPP-DSA-Series | Lecture 104 DP Day-3/minimumElementsUsingMemoization.cpp | //https://www.codingninjas.com/codestudio/problems/minimum-elements_3843091
//Time Complexity will be O(X*N) where X = total amount and N = no. of coins
//Space Complexity will be O(X) where X = amount
#include <bits/stdc++.h>
using namespace std;
//Recursion Solution with TLE
int solveRec(vector<int> &num, int x) {... | ALGO | 0.999971 | 5.4649 |
cd1ed37f-bb44-40e2-80fb-ba2eddcc54d8 | ishandutta2007/codeforces | rniya/normal/1592/E.cpp | #define LOCAL
#include <bits/stdc++.h>
using namespace std;
#pragma region Macros
typedef long long ll;
typedef __int128_t i128;
typedef unsigned int uint;
typedef unsigned long long ull;
#define ALL(x) (x).begin(), (x).end()
template <typename T> istream& operator>>(istream& is, vector<T>& v) {
for (T& x : v) is ... | ALGO | 0.999987 | 4.988503 |
e6f25521-1d72-4849-8a15-ed42bb4de25d | Shriya-Jaiswal/DSA_POTD_Questions_solving | 139_Calculate_Money_in_Leetcode_Bank_Leetcode_1716.cpp | #include<iostream>
#include<vector>
using namespace std;
// ▶️ Ask by : edabit 1 | ----> Easy Level
// ➡️ Approach-1 (Just doing what Qn asks - simulation)
// ⏲️ Time Complexity : O(n)
// 🛢️ Space Complexity : O(1)
int totalMoney(int n) {
int result = 0;
int monday_money = 1;
while(n > 0) {
int... | ALGO | 0.999755 | 4.213188 |
14db0d27-98e7-4c31-8bf0-0365eec77713 | TheRakibJoy/Algorithms | Number Theory/LOJ-1014 - Ifter Party.cpp | #include<bits/stdc++.h>
#define perfect int main()
#define ll long long int
#define ull unsigned long long int
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sc scanf
#define scin(x) ... | ALGO | 0.998943 | 3.83029 |
f7c24cdb-43b7-4dc4-b2ca-6d4522125545 | codetalker7/cp-res | CodeChef/MINNOTES.cpp |
/*
template by: codetalker7
editor: sublime text 3
file name: MINNOTES.cpp
date created: 2021-07-03 17:55:38
problem link: https://www.codechef.com/JULY21B/problems/MINNOTES
*/
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<unordered_set>
#include<cmath>
#in... | ALGO | 0.999888 | 4.658176 |
94d61756-7037-4706-8d5c-70228972a958 | abhishekgupta1906/Striver-Sde-sheet-solutions | POTD/scoreofarray.cpp | #include <iostream>
#include <bits/stdc++.h>
#define int long long
using namespace std;
long long findScore(vector<int> &nums)
{
long long ans=0;
int n=nums.size();
set<pair<long long,long long>>st;
for (int i = 0; i <nums.size(); i++)
{
st.insert({nums[i],i});
}
while(!st.e... | ALGO | 0.999906 | 4.56054 |
c77a163f-9cc2-4d3c-9ac3-1365342ce839 | mohammedjasam/Technical-Interview-Guide | LeetCode/leetcode_palindrome-partitioning.cpp | /*
*
* Tag: DP
* Time: O(n^3)
* Space: O(n^2)
*/
class Solution {
public:
vector<vector<string>> partition(string s) {
int n = s.size();
bool dp[n][n];
for(int i = n - 1; i >= 0; i --){
for(int j = i; j < n; j ++){
if(s[i] == s[j] && ((j - i) < 2 || (dp[i + 1][j ... | ALGO | 0.999981 | 6.31404 |
c2598e76-633b-4b81-80c6-b21ef3b2280c | shagun-code/leetcode | 2216-delete-the-middle-node-of-a-linked-list/2216-delete-the-middle-node-of-a-linked-list.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* deleteMiddl... | ALGO | 0.999897 | 5.781754 |
15686e72-f6c4-4827-abd7-d48887cbc80c | zexTira/leetcode-with-cpp | Leetcode/Q.13 Roman to Integer/1.cpp | /*//
// The Hashmap also can be implemented to solve the problem.
// Go throughout the array, check if the char is V/L/D/M, if so directly add corresponding num to the result.
// For char I/X/C, we need to check the following number, in some cases mentioned in the question, we need to subtract a number instead of ad... | ALGO | 0.999572 | 5.896891 |
945d0911-c92d-4b8c-87ce-267954fdfc7e | shakilsustswe/programming | IMPORTANT/minimum_distance.cpp |
/*Edit distance*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int i=0,j;
string c1,c2;
int count[100][100];
cin>>c1;
cin>>c2;
/// int len=max(c1.size(),c2.size())
for(i=-1; i<c1.size(); i++)
{
count[i][0]=i+1;
}
for(i=-1; i<c2.size(); i++)
{
cou... | ALGO | 0.999983 | 3.870384 |
3f94c059-0625-4c4e-8300-886d35ca6210 | mouktikzz/Leet-code | Easy/ExcelSheet.cpp | #include<iostream>
using namespace std;
string convertToTitle(int n) {
string result = "";
while (n > 0){
n--;
char c = 'A' + n % 26;
result = c + result;
n /= 26;
}
return result;
}
int main(){
cout<<convertToTitle(52);
} | ALGO | 0.999683 | 4.43662 |
a936ea43-8067-422d-9b06-37a35b48c026 | vatanaksoytezer/zephyr | rpg_svo/svo/src/bundle_adjustment.cpp | #include <vikit/math_utils.h>
#include <boost/thread.hpp>
#include <g2o/core/sparse_optimizer.h>
#include <g2o/core/block_solver.h>
#include <g2o/core/solver.h>
#include <g2o/core/robust_kernel_impl.h>
#include <g2o/core/optimization_algorithm_levenberg.h>
#include <g2o/solvers/cholmod/linear_solver_cholmod.h>
#include... | ALGO | 0.997566 | 3.286387 |
fcd95b9d-6606-430b-962e-b67b4e360b24 | SatyamJindal/Competitive-Programming | codeforces/Summarize to the Power of Two.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false);
int n;
cin>>n;
vector<ll> a(n);
multiset<ll> st;
for(int i=0;i<n;i++)
{
ll x; cin>>x;
st.insert(x);
a[i]=x;
}
int ans=0;
for(int i=0;i<n;i++)
{
st.erase(st.find(a[i]));
bool k=false;... | ALGO | 0.999767 | 3.772538 |
8e6c5ecd-307e-4e51-8bc7-52401116700f | Penpen7/procon | 0502/D.cpp | #include <bits/stdc++.h>
#define rep(i, z, n) for(ll i = z; i <= n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
using namespace std;
ll res(ll A,ll B,ll x){
return floor(double(A)/double(B)*double(x))-A*floor(double(x)/double(B));
}
int main(){
ll A,B,N;
ll x;
cin >> A >> B >> N;
ll max_... | ALGO | 0.999959 | 3.971131 |
8bd242dd-7f58-4a7f-b59c-0953f158b246 | itlezy/eMule-mods-archive | eMule-0.50a-ZZUL-TRA_2.6_Src/cryptopp/basecode.cpp | // basecode.cpp - written and placed in the public domain by Wei Dai
#include "pch.h"
#ifndef CRYPTOPP_IMPORTS
#include "basecode.h"
#include "fltrimpl.h"
#include <ctype.h>
NAMESPACE_BEGIN(CryptoPP)
void BaseN_Encoder::IsolatedInitialize(const NameValuePairs ¶meters)
{
parameters.GetRequiredParameter("BaseN_... | TOOL | 0.936493 | 7.236782 |
570046a3-a660-4ed9-b574-d87c6c688b14 | rehmanghani2/LAB-8-Programming | Q2.cpp | /* 2. Write a program in C to calculate the sum of numbers from 1 to n using recursion. */
#include <stdio.h>
int n_sum(int );
main()
{
int n;
printf("Enter any n number:");
scanf("%d",&n);
int res=n_sum(n);
printf("\nThe sum of 1 to %d is %d",n,res);
}
int n_sum(int n)
{
if(n>1)
{
return n + n_sum(n-1);
}
re... | ALGO | 0.999759 | 4.118369 |
e996225d-0ff1-4b3c-91f7-7d6de0dc0a21 | daniyalahmed9194/All-Tasks | All Tasks1/pdtask07.cpp | #include<iostream>
using namespace std;
void flowerShop(int redRose,int whiteRose,int tulip);
main()
{
int red_rose,white_rose, Tulip;
cout<<"Red Rose: ";
cin>> red_rose;
cout<<"White Rose: ";
cin>> white_rose;
cout<<"Tulip: ";
cin>> Tulip;
flowerShop(red_rose,white_rose,Tulip);
}
void ... | ALGO | 0.990054 | 4.839103 |
213902cb-ce02-4590-a7f3-af18701457fe | OwenMcGee/Data-Structures-Fall-2019 | Labs/Lab3/Rectangle.cpp | #include <iostream>
#include "Rectangle.h"
bool Rectangle::is_point_within(const Point2D & p) const {
return
(p.x() <= m_upper_right.x() && p.y() <= m_upper_right.y()) || //should be && not ||
(p.x() >= m_lower_left.x() && p.y() >= m_lower_left.y());
}
bool Rectangle::add_point(const Point2D& p){
if(is_po... | ALGO | 0.995812 | 5.269145 |
1d06f4d9-738c-4dc6-9511-f8cf4f1e9fdd | niziul/my-programming-exercises | Materials/C-plus-plus/Basic-knowledge/Lesson-08/Learning-exercises/Exercise-01/Exercise-01/Main.cpp | /*
[ description of the first learning exercise ] :
- Write a function that calculates the roots of the quadratic equation 'ax + bx + c'.
Take as arguments to the function the terms 'a', 'b', and 'c' of the quadratic equation
and show the result inside the function itself.
[ output ] :
```
... | ALGO | 0.989273 | 4.251923 |
c54e1053-61bb-4f1f-b95c-37cedc15f485 | HKPolyU-UAV/COVIS | 3rdPartLib/g2o/g2o/apps/g2o_simulator/convertSegmentLine.cpp | #include <signal.h>
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <cassert>
#include "g2o/core/estimate_propagator.h"
#include "g2o/core/sparse_optimizer.h"
#include "g2o/core/factory.h"
#include "g2o/core/optimization_algorithm_factory.h"
... | ALGO | 0.935909 | 5.368217 |
0d577e9a-326c-4ac9-a86d-076256a8c84f | MashrafeJess/C-Programming-Tutorials | Class&Object/Friend function/p-4.cpp | #include <iostream>
using namespace std;
class multi
{
vector <vector <int> > a;
public :
void input ()
{
int n;
cin >> n;
for(int i = 0;i<n;i++)
{
int n;
cin >> n;
a.push_back(vector<int>());
for(int j = 0;j<n;i++)
{
int x;
cin >> x;
a[i].push_back(x);
}
}
}
void output()... | ALGO | 0.999824 | 3.361117 |
ed53b722-9217-42ca-891a-96e12172d2f6 | BinomialSheep/CompetitiveCpp | AtcoderContest/AHC012/A9.cpp | #include <bits/stdc++.h>
// デバッグ用マクロ:https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
using namespace std;
using namespace chrono;
using ll = long long;
using vi = vector<in... | ALGO | 0.999912 | 4.581515 |
0c41f5ca-6447-4283-8fec-1def60a81cb3 | ishandutta2007/codeforces | lzr_010506/normal/63/C.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int N = 20;
struct Node
{
int num[4];
int a,b;
}a[N];
int ans[4];
int vis[11];
bool ok(int num)
{
memset(vis,0,sizeof(vis));
int t;
for(int i = 0; i < 4; i++)
{
t = num % 10;
if(vis[t]) return false;
ans[i] = t;
vis[t] = ... | ALGO | 0.999793 | 3.400262 |
6fa2aa0a-3504-4d57-84e4-796763a1a751 | cleaton/platform_frameworks_av | media/libstagefright/codecs/m4v_h263/dec/src/deringing_chroma.cpp | #include "mp4dec_lib.h"
#include "post_proc.h"
#ifdef PV_POSTPROC_ON
void Deringing_Chroma(
uint8 *Rec_C,
int width,
int height,
int16 *QP_store,
int,
uint8 *pp_mod
)
{
/*----------------------------------------------------------------------------
; Define all local variables
... | ALGO | 0.998739 | 3.841888 |
eda142f4-4aed-4e6c-8222-56108908ce4a | Satvik01000/CompetitiveCoding | TLE CP 31 Sheet/800/Don't try to Count.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define ll long long
int minPossibleOperations(string x, const string& s) {
int operations = 0;
int maxLength = 25 + s.size(); // Safe upper bound as per constraints
while (x.find(s... | ALGO | 0.999907 | 5.420504 |
5090eb83-a386-4190-8275-f4d0f1483b0a | Sakuralbj/LeetCode | Leet/120.三角形最小路径和 自顶向下.cpp | /*
* @lc app=leetcode.cn id=120 lang=cpp
*
* [120] 三角形最小路径和
*/
// @lc code=start
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int minimumTotal(vector<vector<int>>& triangle) {
int len=triangle.size();
if(len==0){
return 0;
}
if(le... | ALGO | 0.999964 | 6.474018 |
2999c158-2f22-48ba-91a7-69e4e2440c2b | Gencho-Zhilkov/fmi-ip-group-7-2022 | 2022-11-14/exercise_12.cpp | #include <cassert>
#include <iostream>
template <typename T>
void printArray(const T* const xs, const size_t size) {
for (size_t i = 0; i < size; i++) {
std::cout << xs[i] << ' ';
}
std::cout << std::endl;
}
bool find(int x, int *xs, size_t len) {
for(size_t i = 0; i < len; i++) {
if (xs[i] == x) {
return ... | ALGO | 0.998993 | 5.62344 |
eee01f3a-7aea-4ad7-82a9-8ad0dd547ca7 | TUE-EE-ES/HalideAutoGPU | src/Lerp.cpp | #include <algorithm>
#include <cmath>
#include "IROperator.h"
#include "Lerp.h"
#include "Simplify.h"
namespace Halide {
namespace Internal {
Expr lower_lerp(Expr zero_val, Expr one_val, Expr weight) {
Expr result;
internal_assert(zero_val.type() == one_val.type());
internal_assert(weight.type().is_uin... | ALGO | 0.9979 | 7.815636 |
39e3ec94-ea8d-48b1-a5e9-35f5308eab2b | SarabjeetSingh2/DS-A | remove.cpp | class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int i=0,j=nums.size()-1;
while(i<j)
{
if(nums[i]==val)
{
if(nums[j]==val)
{
j=j-1;
}
else{
nums[i]... | ALGO | 0.999893 | 5.997086 |
6b63c395-0885-4ccd-a131-74676d06834a | mrcchef/CP | Contest/code_chef/Lunch/ranking.cpp | #include <bits/stdc++.h>
using namespace std;
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define mii map<ll,ll>
#define pii pair<ll,ll>
#define vi vector<ll>
#define endl "\n"
#de... | ALGO | 0.999956 | 3.533167 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.