uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
bf42d477-0890-4893-9e96-6c568a058da2 | kierandrewett/browser-chrome-experiment | accessible/ipc/win/RemoteAccessible.cpp | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
#include "Accessible2.h"
#include "RemoteAccessible.h"
#include "ia2AccessibleRelation.h"
#include "ia2AccessibleValue.h"
#include "IGeckoCustom.h"
#include "mozilla/a11y/DocAccessibleParent.h"
#include "... | TOOL | 0.855771 | 7.229713 |
189c8cae-7893-42dd-9323-90e340a8cff5 | stalgatuly/Data_Structures | Singly_LinkedList.cpp | using namespace std;
//====================================
class Node
{
private:
int elem; //data element
Node* next; //Link (pointer) to the next Node
public:
Node(int elem) : elem(elem), next(NULL)
{}
friend class MyLinkedList ;
};
//=====================================
class MyLinkedList
{
privat... | ALGO | 0.995687 | 4.16398 |
8758f0c1-a901-4020-ae59-d2762921f561 | brianhsu7476/CF | 1893/C.cpp | #include <bits/stdc++.h>
#define int long long
#define double long double
#define endl '\n'
#define rep(i,n) for(int i=0; i<(int)(n); ++i)
#define fup(i,a,b) for(int i=(a); i<(int)(b); ++i)
#define fdn(i,a,b) for(int i=(a); i>(int)(b); --i)
#define vi vector<int>
#define pb push_back
#define ins insert
#define SZ(a) (i... | ALGO | 0.999915 | 3.95207 |
d96468fd-152c-4d8c-a3f2-a2ec4bf88328 | Crespo-dong/PointCloudLibrary | surface/src/on_nurbs/fitting_surface_pdm.cpp | #include <stdexcept>
#include <pcl/surface/on_nurbs/fitting_surface_pdm.h>
using namespace pcl;
using namespace on_nurbs;
using namespace Eigen;
FittingSurface::FittingSurface (int order, NurbsDataSurface *m_data, Eigen::Vector3d z)
{
if (order < 2)
throw std::runtime_error ("[FittingSurface::FittingSurface] Er... | ALGO | 0.999627 | 5.461195 |
8b7a4664-b0e3-4854-835b-f5c97336dcb7 | AnthonyDas/AcceleratedCpp | AcceleratedCpp/Source/String/find_urls.cpp | #include <string>
#include <vector>
#include <algorithm> // find_if
// (p.107)
bool not_url_char(char c) {
// Characters in addition to alphanumeric that can appear in a URL
static const std::string url_ch = "~;/?:@=&$-_.+!*'(),";
return !(isalnum(c) || find(url_ch.begin(), url_ch.end(), c) != url_ch.end());
}
//... | TOOL | 0.96907 | 4.940687 |
3c856645-6dbf-40f4-865b-ac6c062d1a6b | imakshug/placement_25 | coding/5. Conversions/Fahrenheit_to_Celsius.cpp | //Fahrenheit to Celsius Conversion
#include <iostream>
using namespace std;
float fahrenheitToCelsius(float fahrenheit) {
return (fahrenheit - 32) * 5.0 / 9.0;
}
// Usage
int main() {
float fahrenheit = 98.6;
cout << fahrenheit << " degrees Fahrenheit is " << fahrenheitToCelsius(fahrenheit) << " degrees C... | ALGO | 0.96794 | 6.106791 |
c635c194-d53f-4c14-819f-31be4811da9c | heiseish/Competitive-Programming | kattis/kastenlauf/kastenlauf.cpp | /**
you can do it too because you are not a failure like me.
*/
#include <bits/stdc++.h>
#define forn(i, l, r) for(int i=l;i<=r;i++)
#define all(v) v.begin(),v.end()
#define pb push_back
#define nd second
#define st first
#define debug(x) cout<<#x<<" -> "<<x<< endl
using namespace std;
typedef long long ll;
typedef l... | ALGO | 0.999956 | 3.174884 |
05cc0c71-4839-4249-af65-45e884f37eab | muniss950/leetCode | numsquare.cpp | #include <bits/stdc++.h>
#include <functional>
#include <queue>
#include <vector>
using namespace std;
class Solution {
public:
int helper(int num,int left,int curr,vector<vector<int>>&memo){
cout<<left<<" "<<curr<<endl;
if(memo[left][curr]!=-1){
return memo[left][curr]+num;
}
if(left==0){
... | ALGO | 0.999929 | 4.528791 |
61a0f353-61c5-4bac-96c4-8d6440dd89cc | OyunErbabi/KluLuleburgazMyo | 2.Donem/VeriYapilari/Ders6.cpp | #include <iostream>
using namespace std;
struct node
{
int data;
struct node * next;
};
struct node*basaekle(int key, struct node*head)
{
if(head==NULL)
{
struct node*temp = new node();
temp->data=key;
temp->next=NULL;
head=temp;
}
else
{
struct no... | TOOL | 0.984205 | 3.764029 |
6509a734-6be7-4336-902b-782f2c29f8eb | ajaiswal96/15418-Final-Project | Box2D/Collision/Shapes/b2ChainShape.cpp | #include <Box2D/Collision/Shapes/b2ChainShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <new>
#include <memory.h>
#include <string.h>
b2ChainShape::~b2ChainShape()
{
b2Free(m_vertices);
m_vertices = NULL;
m_count = 0;
}
void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count)
{
b2Asser... | ALGO | 0.962866 | 6.794376 |
0981e41c-1b77-4348-b950-d32d136b7843 | MyVeryTinyBrain/DX9-KatanaZero | box2d/b2_collide_circle.cpp | #include "box2d/b2_collision.h"
#include "box2d/b2_circle_shape.h"
#include "box2d/b2_polygon_shape.h"
void b2CollideCircles(
b2Manifold* manifold,
const b2CircleShape* circleA, const b2Transform& xfA,
const b2CircleShape* circleB, const b2Transform& xfB)
{
manifold->pointCount = 0;
b2Vec2 pA = b2Mul(xfA, circle... | ALGO | 0.997978 | 7.741599 |
5b537157-0d36-46e8-93bc-1afd89b70379 | SamLiu666/AI_for_learning | books/C++ 5th/11关联容器/11.cpp | /*
* @Description:
* @Version: 2.0
* @Autor: lxp
* @Date: 2021-10-30 11:32:43
* @LastEditors: lxp
* @LastEditTime: 2021-10-30 12:08:59
*/
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
using namespace std;
class Families
{
public:
using Child = pair<string, string>;
usi... | ALGO | 0.993584 | 4.705936 |
13e96e04-bf6e-4b43-b51b-8056e9ba5684 | haru210/atcoder | ABC305/D.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int inf = 2147483647;
const long long l_inf = 9223372036854775807;
ll a[200100];
int r;
int l;
int main()
{
int n, q;
int startnum;
int time;
cin >> n;
rep(i, n) cin >>... | ALGO | 0.999968 | 4.254236 |
295ffd30-06c0-4251-babc-1b0f54a12ed2 | trailofbits/llvm-wedlock | libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp | // <algorithm>
// template<LessThanComparable T>
// pair<const T&, const T&>
// minmax(const T& a, const T& b);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
template <class T>
void
test(const T& a, const T& b, const T& x, const T& y)
{
std::pair<const T&, const T&> p = std::minmax(a, b);... | TEST | 0.967983 | 5.767272 |
db67c5c8-99fe-457c-879f-7886ea1be92e | deepeshahirwar/CSES | Sorting_Searching/A_Line_trip.cpp | //A. Line trip
#include<bits/stdc++.h>
#define ll long long
#define pb() push_back()
#define mod 1e9 + 7
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
using namespace std;
int main() {
fastread();
int t; cin>>t;
while(t--){
int n,x; cin>>n>>x;
i... | ALGO | 0.99986 | 4.12558 |
643f8e0a-177e-4902-a22d-db4713655bb2 | AlsQardhawy/Projek-SDA | Program Double LinkedList.cpp | /* ===============================
== PROGRAM DOUBLE LINKED LIST==
======BY : LAMHOT SITORUS======
=============================== */
#include<iostream>
#include<conio.h>
#include<stdlib.h>
#define true 1
#define true 0
using namespace std;
typedef struct node *simpul;
struct node
{
char Isi;
simpul kanan;... | ALGO | 0.99908 | 4.386206 |
a044217c-271c-4e11-af25-e8a9cfc61a79 | NerdPotatoo/Problem-Solving | VJudge/LONG_CONTEST_3/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve()
{
// CODE HERE
int t;
cin>>t;
while(t--)
{
string s;
cin>>s;
if(s.size()>10){
cout<<s[0]<<s.size()-2<<s[s.size()-1]<<'\n';
}
else{
cout<<s<<'\n';
... | ALGO | 0.999416 | 4.830936 |
3db0f568-c51b-4a9a-8b30-9816c9c31d57 | jconsidi/dfa-games | src/restart_difference.cpp | // restart_difference.cpp
#include <cstdlib>
#include <iostream>
#include "DFAUtil.h"
#include "DifferenceRestartDFA.h"
#include "test_utils.h"
int main(int argc, char **argv)
{
if(argc < 4)
{
std::cerr << "usage: restart_difference GAME_NAME LEFT_HASH RIGHT_HASH\n";
return 1;
}
std::string ... | ALGO | 0.909536 | 5.940396 |
78012a63-9d5d-4815-9b58-b626535aa04b | sarvex/leetcode-io | solution/0300-0399/0357.Count Numbers with Unique Digits/Solution.cpp | class Solution {
public:
int countNumbersWithUniqueDigits(int n) {
if (n == 0) return 1;
if (n == 1) return 10;
int ans = 10;
for (int i = 0, cur = 9; i < n - 1; ++i) {
cur *= (9 - i);
ans += cur;
}
return ans;
}
}; | ALGO | 0.999911 | 7.229005 |
3b4444c8-ed4c-4753-bca0-aff20fa3f167 | pkbmh/Codeforces-Solutions | Technocup_2019_r3/a.cpp | // C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#i... | ALGO | 0.999951 | 3.708918 |
a8d7b482-b6df-416e-b75c-fe29cbc8a6e1 | mahyarsamani/Bitonic-Sort-Using-Batcher-Network | shared_memory/test.cpp | #include <iostream>
using namespace std;
int main (void){
unsigned int stageSize = 128;
for (int index = 0; index < stageSize; index++){
int addrOut = index;
printf("addrOut: %2d", addrOut);
int firstBit = addrOut % 2;
int lastBit = addrOut / (stageSize / 2);
int ad... | ALGO | 0.991996 | 3.034293 |
f046c985-eb97-4fa8-a344-6c6070c1a0b0 | eecrazy/ACM | 动态规划/hoj 1316Human Gene Functions.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int nValue[5][5]=
{
{5, -1, -2, -1, -3},
{-1, 5, -3, -2, -4},
{-2, -3, 5, -2, -2},
{-1, -2, -2, 5, -1},
{-3, -4, -2, -1, -100}
};
int Translate(char ch)
{
switch(ch)
{
case 'A':
return 0;
case 'C':... | ALGO | 0.999811 | 3.962221 |
fc1e91b3-cc61-4137-bb48-ec21852a3daf | Zhenfeng-Liang/DesignPatterns | Chapter_2_Encapsulation/SimpleMCMain2.cpp | // This file was created to show a simple implementation of a Monte Carlo call option pricer
//
// Zhenfeng Liang
//
// 1/9/2015, in Elmhurst
/*
requires
PayOff1.cpp
Random1.cpp,
SimpleMC.cpp,
*/
#include "SimpleMC.h"
#include<iostream>
using namespace std;
int main()
{
double Expiry;
double Strike... | ALGO | 0.98446 | 5.438886 |
94a46f86-b01f-4ebd-b627-285464398d03 | johirul398/C-C-Problem- | Untitled4.cpp | #include <bits/stdc++.h>
using namespace std;
// function to convert
// Hexadecimal to Binary Number
void HexToBin(string hexdec)
{
long int i = 0;
while (hexdec[i]) {
switch (hexdec[i]) {
case '0':
cout << "0000";
break;
case '1':
cout << "0001";
... | ALGO | 0.996232 | 6.186075 |
275a9a32-c97e-4d98-bb17-8461ea5e1820 | AvulaCharan06/DataStructures_and_Algorithms | 0735-asteroid-collision/0735-asteroid-collision.cpp | class Solution {
public:
vector<int> asteroidCollision(vector<int>& asteroids) {
int n = asteroids.size();
vector<int> st;
for(int i =0; i<n; i++){
if(asteroids[i] > 0) st.push_back(asteroids[i]);
else{
while(st.size() !=0 && st.back() > 0 && st.back(... | ALGO | 0.999962 | 5.685557 |
b6a9d69c-d2ee-4bc4-b234-103a707db35b | realAYAYA/UnrealEngine-ToonLit | UnrealEngine/Engine/Plugins/Enterprise/DatasmithImporter/Source/DatasmithImporter/Private/UVTools/UVGenerationFlattenMapping.cpp | #include "UVTools/UVGenerationFlattenMapping.h"
#include "Algo/Sort.h"
#include "Async/ParallelFor.h"
#include "Containers/Map.h"
#include "Containers/Set.h"
#include "Engine/EngineTypes.h"
#include "Engine/StaticMesh.h"
#include "Math/Box2D.h"
#include "Math/ConvexHull2d.h"
#include "Math/Quat.h"
#include "Math/Rotat... | ALGO | 0.98429 | 6.862145 |
5b018f69-05ea-4242-839c-35455d912244 | KevinDeng9071/ACM_exercise-code | bookcodes/ch2 数学基础/uva10870.cpp | // UVa10870 Recurrences
// Rujia Liu
#include<iostream>
#include<string>
#include<cstring>
using namespace std;
const int maxn = 20;
typedef long long Matrix[maxn][maxn];
typedef long long Vector[maxn];
int sz, mod;
void matrix_mul(Matrix A, Matrix B, Matrix res) {
Matrix C;
memset(C, 0, sizeof(C));
for(int i =... | ALGO | 0.999913 | 4.088543 |
298b551b-e719-4244-8fae-3318f3add05f | kunaldas01/Cpp-Programs | 07_StringsAndCharacterArray/03_BiggestNumfrStr.cpp | // Form the biggest number from a numeric string
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string str;
cin >> str;
sort(str.begin(), str.end(), greater<int>());
cout << str << endl;
return 0;
}
| ALGO | 0.991536 | 5.36601 |
c4dc0d7e-c984-4481-aa62-b59683336228 | Muakjwa/Depth_Foveated_Compression | opencv-4.x/modules/features2d/src/affine_feature.cpp | /*
Guoshen Yu, Jean-Michel Morel, ASIFT: An Algorithm for Fully Affine
Invariant Comparison, Image Processing On Line, 1 (2011), pp. 11-38.
https://doi.org/10.5201/ipol.2011.my-asift
*/
#include "precomp.hpp"
#include <iostream>
namespace cv {
class AffineFeature_Impl CV_FINAL : public AffineFeature
{
public:
... | ALGO | 0.992387 | 6.87281 |
7413e17c-4fd1-4627-b0a5-9dd4e5bc06a3 | realharryhero/newllvmproject | libc/src/math/generic/f16mulf128.cpp | #include "src/math/f16mulf128.h"
#include "src/__support/FPUtil/generic/mul.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float16, f16mulf128, (float128 x, float128 y)) {
return fputil::generic::mul<float16>(x, y);
}
} // namespace ... | ALGO | 0.957687 | 6.50735 |
3775567b-9b1d-4232-95bb-9e3719c5840f | Algebra-hy/Codeforces | 1967c.cpp | #include <cstdio>
const int S=400005,mod=998244353;
int n,a[S],b[S],k,inv[S];
int ksm(int a,int x) {
int s=1;
while (x) {
if (x&1) s=1ll*s*a%mod;
a=1ll*a*a%mod;x>>=1;
}
return s;
}
int main() {
inv[0]=inv[1]=1;
for (int i=2;i<S;++i)
inv[i]=(1ll*mod-mod/i)*inv[mod%i]%mod;
... | ALGO | 0.999973 | 3.822506 |
dd594e97-0a11-4dcf-98b8-a2824ff85d26 | LingmoOS/LingmoOS | shell/bc/OCRServer/3rdparty/opencv-4.5.4/modules/photo/src/merge.cpp | #include "precomp.hpp"
#include "opencv2/photo.hpp"
#include "opencv2/imgproc.hpp"
#include "hdr_common.hpp"
namespace cv
{
class MergeDebevecImpl CV_FINAL : public MergeDebevec
{
public:
MergeDebevecImpl() :
name("MergeDebevec"),
weights(triangleWeights())
{
}
void process(InputArray... | TOOL | 0.952198 | 5.431395 |
28019ddf-53f0-4bf3-a35b-3d2342c58827 | kurarrr/contests | src/minpro2018c.cpp | // https://beta.atcoder.jp/contests/yahoo-procon2018-qual/submissions/2083392
#include "bits/stdc++.h"
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,n,0)
#define pb push_back
... | ALGO | 0.999787 | 3.699792 |
12628acc-3414-4c15-86c9-fc0b52feb357 | Hasil-Sharma/leet-code | two-sum-iv-input-is-a-bst-3.cpp | // https://leetcode.com/problems/two-sum-iv-input-is-a-bst/description/
/**
* 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:
stack<TreeNode*> fwd, ... | ALGO | 0.999994 | 6.199335 |
f7824b42-aefd-4810-9c50-fa1637450204 | ishandutta2007/codeforces | noam527/normal/1161/B.cpp | #include <bits/stdc++.h>
#define CHECK cout << "ok" << endl
#define finish(x) return cout << x << endl, 0
typedef long long ll;
typedef long double ldb;
const int md = 1e9 + 7;
const ll inf = 1e18;
const int OO = 0;
const int OOO = 1;
using namespace std;
int n, m;
vector<pair<int, int>> a, b;
vector<int> pos[100005];... | ALGO | 0.999994 | 3.805648 |
0eb6a173-6f6f-459c-8560-28b5e6980840 | KakaC009720/CPP_train | tree/226. Invert Binary Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999955 | 6.502923 |
3e80ed22-f994-4140-976d-90359a0ba2f9 | EganJ/MazeRobot | MapMaze/RobotFunctions.cpp | #include "RobotFunctions.h"
#include <Arduino.h>
unsigned stateL = 0;
unsigned stateR = 0;
void setupRobot() {
for (int i = 0; i < 4; i++) {
pinMode(leftPins[i], OUTPUT);
pinMode(rightPins[i], OUTPUT);
}
pinMode(LW, INPUT);
pinMode(LC, INPUT);
pinMode(RC, INPUT);
pinMode(RW, INPUT);
}
bool sensor... | ALGO | 0.960859 | 4.853408 |
d57e1050-189d-4e13-9d2f-24e52a039868 | ZeyuT/CarND-MPC-Project | src/Eigen-3.3/bench/spbench/sp_solver.cpp | // Small bench routine for Eigen available in Eigen
// (C) Desire NUENTSA WAKAM, INRIA
#include <iostream>
#include <fstream>
#include <iomanip>
#include <Eigen/Jacobi>
#include <Eigen/Householder>
#include <Eigen/IterativeLinearSolvers>
#include <Eigen/LU>
#include <unsupported/Eigen/SparseExtra>
//#include <Eigen/Sp... | ALGO | 0.992317 | 4.29849 |
638bb23b-f54d-4cb3-abd6-a1221b96c498 | abhinavmalhotra01/leetcode | 2390-removing-stars-from-a-string/2390-removing-stars-from-a-string.cpp | class Solution {
public:
string removeStars(string s) {
stack<char> st;
for(int i=0;i<s.size();i++){
if(s[i]!='*'){st.push(s[i]);}
else{
st.pop();
}
}
string out;
while(!st.empty()){out.push_back(st.top());st.pop();}
... | ALGO | 0.999944 | 6.182867 |
b61f3fb7-18d8-4e52-9fb4-a029dd70942b | shantanu-777/Leetcode-Daily | 2232-adding-spaces-to-a-string/adding-spaces-to-a-string.cpp | class Solution {
public:
string addSpaces(string& s, vector<int>& spaces) {
const int m = spaces.size(), n = s.size();
string t(n + m, ' ');
int j = 0; // Pointer for spaces
for (int i = 0; i < n; i++) {
if (j < m && i == spaces[j]) {
t[i+j] = ' '... | ALGO | 0.999691 | 6.568049 |
f45a5096-aa7c-4b94-9778-778342f8df67 | avsavushkiny/HelloStudent | set-2_result/set-2.cpp | #include <iostream>
using namespace std;
int a, b, result;
int main(void)
{
a = 5;
b = 2;
a = a + 1;
result = a - b;
cout << "Result = " << result << endl;
return 0;
} | ALGO | 0.996326 | 3.510315 |
eb0ecfee-0ab3-46bb-ae7d-7c3d4a623450 | YW8862/class | test/mian.cpp | /*
* @Author: YW8862 <EMAIL>
* @Date: 2025-03-20 20:37:07
* @LastEditors: YW8862 <EMAIL>
* @LastEditTime: 2025-03-22 14:56:00
* @FilePath: \test\mian.cpp
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
#include <iostream>
#i... | TOOL | 0.888532 | 5.313362 |
5b110e52-1c30-4b4d-b336-864d4fcadb5f | ry0u/AOJ | Volume2/0263/a.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <cstring>
#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
vector<bitset<16> > v,c;
int memo[31][1<<16];
int n,m;
int dfs(bitset<16> t,int i)
{
... | ALGO | 0.999569 | 3.354573 |
8e9c3afe-7972-4f89-8186-facf0f78c8a3 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_12409_0.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int l, u = 0, r, leght = 0, num;
int f[10] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
cin >> l >> r;
l++;
for (int i = l; i < r; i++) {
num = i;
memset(f, 0, sizeof(int) * 10);
while (num != 0) {
f[num % 10]++;
if (f[num % 10] > 1) goto... | ALGO | 0.999911 | 3.725415 |
6d0cfd3c-a7bd-474c-81e5-5dd8d3a5b2af | amanss00/ForNewbies | longestCommonSUbsequence.cpp | #include <bits/stdc++.h>
using namespace std;
int longestCommonSubsequence(string s1, string s2)
{
int x = s1.size(), y = s2.size();
vector<vector<int>> dp(x + 1, vector<int>(y + 1, 0));
for (int i = 1; i <= x; i++)
{
for (int j = 1; j <= y; j++)
{
if (s1[i - 1] == s2[j - 1... | ALGO | 0.999882 | 5.44252 |
0d5c6e40-4746-482b-84c8-35cb3d244def | qubard/leetcode-solutions | solutions/135.candy.cpp | class Solution {
public:
vector<int> tmp;
int candy(vector<int>& ratings) {
tmp = vector<int>(ratings.size(), 1);
// Left pass
for (int i = 1; i < ratings.size(); i++) {
if (ratings[i] > ratings[i-1]) {
tmp[i] = max(tmp[i-1]+1,tmp[i]);
}
... | ALGO | 0.999998 | 6.176683 |
9de3c963-0e0c-4595-8543-d15f284ce51f | pithreeone/Navigation_Project | navigation/navigation-stack/base_local_planner/src/simple_trajectory_generator.cpp | #include <base_local_planner/simple_trajectory_generator.h>
#include <cmath>
#include <base_local_planner/velocity_iterator.h>
namespace base_local_planner {
void SimpleTrajectoryGenerator::initialise(
const Eigen::Vector3f& pos,
const Eigen::Vector3f& vel,
const Eigen::Vector3f& goal,
base_local_pl... | ALGO | 0.998561 | 6.353277 |
775cb7da-321f-4345-9708-c138bd705017 | SumitM28/Cpp | 27_Tries/02_prefix.cpp | // find longest common prefix.
#include <iostream>
#include<vector>
using namespace std;
class TrieNode{
public:
char data;
TrieNode* children[26];
int countChild=0;
bool isTerminal;
TrieNode(char ch){
data=ch;
for(int i=0;i<26;i++){
children[i]=NULL;
}
... | ALGO | 0.999921 | 5.014141 |
d61219c2-fe34-425b-a861-67ada405bc9d | Sianooo/C-plus-plus- | Code bloks (dzial 1)/NWD/main.cpp | #include <iostream>
using namespace std;
int NWD(int a, int b)//nagwek funkcji
{
int nwd;
while(a!=b)//warunek
{
if(a>b)//
{
a=a-b;
}
else
{
b-=a;
}
}
nwd=a;
return nwd;
}
int main()//wywyoujemy fukcje
{
int x,y;//dek... | ALGO | 0.998664 | 4.122554 |
e4bad638-5108-4477-ab9a-b2e05bae505d | 20116lee/2025Cprograming | 이유빈/p107.cpp | #include<stdio.h>
int n;
int f(int k){
int s=0;
for(int i=1;i<=k;i++)
s+=i;
return s;
}
int main(){
int res;
scanf("%d",&n);
res=f(n);
printf("%d\n",f(n));
} | ALGO | 0.999697 | 3.709548 |
d50eb51b-750b-40b7-a5e0-cb871a706753 | Sabbir943/codeforces_newcomers | pro11.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long a,b;
char s;
cin>>a>>s>>b;
if(s=='+')
{
cout<<a+b<<endl;
}
else if(s=='-')
{
cout<<a-b<<endl;
}
else if(s=='*')
{
cout<<a*b<<endl;
}
else if(s=='/')
{
cout<<a/b<<en... | ALGO | 0.999942 | 3.733666 |
59e7e593-ce11-4314-b67e-012d3b10515c | ehntoo/virtualbox-mirror | src/VBox/Runtime/common/string/strpbrk.cpp | /* $Id$ */
/** @file
* IPRT - strpbrk().
*/
/*********************************************************************************************************************************
* Header Files *
***********... | TOOL | 0.961777 | 5.519227 |
46f3a819-9cb9-4ee6-bfd4-273c560ce396 | murodjon-umar0v/TUIT-DASTURLASH-MT | 1-semestr/7.2.cpp | #include <bits/stdc++.h>
using namespace std;
void removeForInc(int arr[], int n)
{
int l = 1;
for (int i = 1; i < n; i++) {
if (arr[l - 1] <= arr[i]) {
arr[l] = arr[i];
l++;
}
}
for (int i = 0; i < l; i++)
cout << arr[i] << " ";
}
int main(){
int n;
cin >> n;
int a[n];
for(int i=0; i<n; i++){
... | ALGO | 0.999949 | 4.361627 |
4b0e1759-f796-46ac-b80f-656d2178f8a1 | tmuttaqueen/MyCodes | Online Judge Code/codeforces/Educational Codeforces Round 64/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ld long double
#define intl long long
#define pii pair<int,int>
#define xx first
#define yy second
#define mp make_pair
#define pb push_back
#define SZ(x) (int)(x).size()
#def... | ALGO | 0.99986 | 3.637599 |
44e0be77-0930-4d9a-8fb9-addecadb8e5e | oanoan16/Code-Cpp | CTDL_GT/DAS01009_XauABDacBiet.cpp | #include <bits/stdc++.h>
#define faster() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define base 1000000007
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef vector <int> vi;
typedef vector <string> vs;
vs sbir;
bool check(string s, int k){
int c=... | ALGO | 0.999901 | 4.497403 |
c11f9a74-9df2-4bfb-b3ab-fe604d715152 | nijatkazimli/cpp-programming | Mask_and_Signal/mask.cpp | #include <iostream>
using namespace std;
#include "mask.h"
// to do
Mask::Mask(int c, double* w) : size(c), coeff(nullptr) {
if (w) {
coeff = new double[c];
for (int i = 0; i < c; i++) {
coeff[i] = w[i];
}
}
}
Mask::~Mask() {
delete coeff;
}
ostream& operator<<(ostream& out, const Mask& obj) {
cout ... | TOOL | 0.8996 | 3.361314 |
c709748e-a75f-4a3e-ad79-3c61f98941f3 | sanyache/lecture_c | string/getline.cpp | #include<iostream>
#include<sstream>
using namespace std;
int main(){
string name, first_name, last_name;
//cin>>first_name>>last_name;
//cout<<first_name<<" "<<last_name;
getline(cin, name);
string max_word = "";
string min_word = name;
cout<<name<<'\n';
stringstream ss(name);
s... | ALGO | 0.999162 | 3.48819 |
9635831b-f56b-4d62-9821-88941d36d87f | mimakyuu/AtCoder | ABC/E183 - QueenOnGrid - mint.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
//#define ACL
#ifdef ACL
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
#if __has_include("acl-all.h")
#include "acl-all.h" //on Wandbox
using namespace atcoder;
#endif
#endif //#ifdef ACL
typedef long... | ALGO | 0.999964 | 4.753536 |
5aa33462-da68-4d57-bd6d-2ec10e7fc080 | jsren/llvm-detex | libcxx/src/atomic.cpp | #include <__config>
#ifndef _LIBCPP_HAS_NO_THREADS
#include <climits>
#include <atomic>
#include <functional>
#include <iostream>
#ifdef __linux__
#include <unistd.h>
#include <linux/futex.h>
#include <sys/syscall.h>
#else // <- Add other operating systems here
// Baseline needs no new headers
#endif
_LIBCPP_BE... | TOOL | 0.915009 | 6.924703 |
8a31582a-a8cb-4b1b-bf3f-e6a53ad50939 | rishikakinger/Strivers | arrays/medium/subarrwithsumk.cpp | //difference between subarray and subsequence
//brute is to generate all subarrays and check summation, O(N^3), O(N^2)
//watch sum of positives and negatives again (arrays-easy)
/*
☆。*。☆。
★。\|/。★
*Focus on thenegative*
★。/|\。★
☆。*。☆。
*/
#include<vector>
#include<bits/stdc++.h>
#include<iostream>
using namespace st... | ALGO | 0.999927 | 5.573536 |
d37658db-cfee-4d49-922f-2a0bbc3268b1 | asrivast28/cs6290-projects | project3/sim/sim.cpp | #include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <strings.h>
#include "hash_table.h"
#include "processor.h"
#include "memory.h"
#include "module.h"
#include "mreq.h"
#include "settings.h"
#include "sim.h"
#include "types.h"
extern Sim_settings settings;
/** Fatal Error. */
void fatal_error (const c... | TOOL | 0.857972 | 4.050212 |
16478885-ac7a-444e-8d66-65c05b44be2b | estherfs/OOP_Bonus | basic_36.cpp | #include <iostream>
using namespace std;
int main(){
int n;
while( cin >> n)
{
if( n%400==0 || ( n%4==0 && n%100!=0 ) )
cout << "Bissextile Year" << endl;
else
cout << "Common Year" << endl;
}
return 0;
} | ALGO | 0.999654 | 5.312232 |
730489e0-d01a-443d-9e00-b50079ec0a78 | aditiraj2006/DSA-C- | Lecture064 Tree Interview Questions Day2/verticalTraversal.cpp | #include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
return temp;
}
// F... | ALGO | 0.999949 | 6.253019 |
0fd63fa8-a1b8-45e2-9e51-ef6d33ede87b | Amarjeet264/DSA-problems | 1446-angle-between-hands-of-a-clock/angle-between-hands-of-a-clock.cpp | class Solution {
public:
double angleClock(int hour, int minutes) {
double hangle= ((hour%12)/12.0)*360.0 + 0.5*minutes;
double mangle= (minutes/60.0)*360.0;
double ans=abs(mangle-hangle);
return min(ans, 360.0-ans);
}
}; | ALGO | 0.999906 | 5.6115 |
abffb25f-0491-448d-98a5-dd78214239ee | Jasleen8801/Design-and-Analysis-of-Algorithms | lab 5/dp2.cpp | // Longest Common Subsequence
#include <bits/stdc++.h>
using namespace std;
string solve(string s1, string s2, int n, int m){
int dp[n+1][m+1];
for(int i=0; i<=n; i++)
dp[i][0] = 0;
for(int j=0; j<=m; j++)
dp[0][j] = 0;
for(int i=1; i<=n; i++){
for(int j=1; j<=m; j++){
if(s1[i-1] == s2[j-1])... | ALGO | 0.999943 | 5.347044 |
8a799232-1401-48bd-aa01-49ab4b2bbe65 | codesniper99/Coding-Competitions | March Long Challenge 2.3.18/Minions and Chef bananas/main.cpp | //SOLVED USING BINARY SEARCH!!! :D
//AKHIL'S CODE
#include <iostream>
#include<stdio.h>
#include<bits/stdc++.h>
#define ll long long int
#define li long int
using namespace std;
int main()
{
ios::sync_with_stdio(0);
int t;
cin>>t;
while(t--)
{
ll n;
cin>>n;
ll h;
c... | ALGO | 0.999938 | 3.566154 |
9e6f7bfa-edc3-41d8-97bb-c170e453c7fa | AvilovaEM/tasks | yellow/1week/base_reg.cpp | #include<iostream>
#include<string>
#include<map>
#include<vector>
#include<tuple>
#include<algorithm>
/*
enum class Lang {
DE, FR, IT
};
struct Region {
std::string std_name;
std::string parent_std_name;
std::map<Lang, std::string> names;
int64_t population;
};
*/
bool operator==(const Region& lhs, const Re... | ALGO | 0.992916 | 4.414445 |
9cba6a79-c57f-4e3d-a35d-84900b92ed59 | prsabahrami/competitive-programming | codeforces/1003/B.cpp | #pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
typedef pair<ld,ld> pld;
ty... | ALGO | 0.99999 | 3.231565 |
6eacdd1a-d0f9-4cf9-aaa8-0b7a790fd071 | oryxantelope/LeetCode | 090 Subsets II.cpp | /**
* Given a collection of integers that might contain duplicates, S, return all possible subsets.
*
* Note:
* Elements in a subset must be in non-descending order.
* The solution set must not contain duplicate subsets.
* For example,
* If S = [1,2,2], a solution is:
*
* [
* [2],
* [1],
* [1,2,2],
... | ALGO | 0.999527 | 5.998683 |
4b3e4479-f26f-4cd9-b549-8fb5f430901f | sreedhr92/Leetcode-Submissions | codes/accepted_codes/Number of Students Unable to Eat Lunch_434788901.cpp | class Solution {
public:
int countStudents(vector<int>& students, vector<int>& sandwiches) {
int count =0;
int i=0,j=0;
while(1)
{
if(students.size()==0)
break;
if(count>1000)
break;
if(students[0]==sandwiches[j])
... | ALGO | 0.999837 | 5.394671 |
57caa1cc-40f8-4652-8914-d2dcaa75212c | Study-CodingTest/Study | BOJ/아이템 먹기/김소희.cpp | //
// Created by Kim So Hee on 2022/07/07.
//
#include <bits/stdc++.h>
using namespace std;
int N, M, A, B;
/**
* 오른쪽, 위쪽 이동 가능
*/
int inputs[101][101];
int ***dp;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin >> N >> M >> A >> B;
dp = new int **[N + 1];
... | ALGO | 0.99967 | 4.560932 |
19eba4c0-6e12-4c01-88f9-6b9bc635bb7d | itohdak/AtCoder | ABC/new/A-E/14-/141/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
int main() {
int N, M;
cin >> N >> M;
vector<ll> A(N);
rep(i, N) cin >> A[i];
priorit... | ALGO | 0.99998 | 4.210938 |
8122307e-fb95-4d2a-9ea9-9b46e15b9823 | stutimohta20/DSA_CPP | Reversing a stack.cpp | // C++ code to reverse a stack using recursion
#include<bits/stdc++.h>
using namespace std;
stack<char> st;
string ns;
void insert_at_bottom(char x)
{
if(st.size() == 0)
st.push(x);
else
{
char a = st.top();
st.pop();
insert_at_bottom(x);
st.push(a);
}
}
void reverse()
{
if(st.size()>0)
{
char... | ALGO | 0.999892 | 4.917905 |
ef491f20-e40f-4df6-8feb-5361093e67d6 | metehkaya/Algo-Archive | Problems/AtCoder/Contests/Beginner_Contests/Contest_187/D.Choose_Me.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL curr;
int n,ans;
priority_queue<LL> heap;
int main() {
scanf("%d",&n);
for( int i = 0 ; i < n ; i++ ) {
LL x,y;
cin >> x >> y;
curr -= x;
heap.push(2*x+y);
}
while(curr <= 0) {
LL add = heap.top();
heap.pop();
ans++;
curr += ad... | ALGO | 0.999907 | 3.70454 |
4befc14f-2814-4984-b800-197e12de6e44 | typr7/practice | judge/classification_by_algorithm/MST/ZOJ1586.cpp | // Prim
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
using namespace std;
struct Edge {
int t, w;
bool operator< (const Edge& other) const noexcept {
return this->w > other.w;
}
};
const int maxn = 1000 + 5;
vector<Edge> edges[maxn];
int price[maxn];
int d[maxn];
bool vi... | ALGO | 0.999946 | 4.207253 |
c9f4d2e5-61e3-4a59-a676-1729bde1ae78 | kaluginpeter/Algorithms_and_structures_tasks | Yandex/Practicum/Algorightms_and_Data_Structures/1_sprint/D.Хаотичность_погоды/solution.cpp | #include <iostream>
#include <vector>
void solution(int n, std::vector<int>& nums) {
/*
Time Complexity O(N)
Memory Complexity O(1)
*/
int output = 0;
for (int index = 0; index < n; ++index) {
if (
(!index || nums[index - 1] < nums[index])
&& (index + 1 == n || nums[inde... | ALGO | 0.99998 | 5.21573 |
4a90be48-e53f-44ba-8361-7e4bd70a226d | neelaryan2/CompetitiveProgramming | CodeForces/EDU/Disjoint Sets Union/289392C.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "trace.h"
#else
#define trace(args...)
#endif
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using ppi = pair<pii, pii>;
using vi = vector<int>;
#define mp make_pair
#define ub upper_bound
#define lb lower_bound
#define fi f... | ALGO | 0.999983 | 4.308186 |
de1e9dcd-3a95-48ee-ac9a-b683037d852e | maksverver/zatacka | client/bots/Hybrid.cpp | #include "SimpleSearch.h"
#include <stdlib.h>
#include <FL/Fl.H>
#include <stdio.h>
class Hybrid : public SimpleSearch
{
public:
Move move( int timestamp, const Player *players,
int player_index, const Field &field )
{
bool left = Fl::event_key(FL_Left);
bool right = Fl::event_k... | ALGO | 0.955484 | 4.251925 |
0c104207-a2f1-486e-aeac-ad4d5c101a70 | lichkkkk/LeetCode_G-C | 335-SelfCrossing/335SelfCrossingGuang.cpp | class Solution {
public:
const int para_x = 0;
const int para_y = 1;
struct Point{
int x, y;
Point(int _x, int _y) : x(_x), y(_y) {}
};
struct Line{
Point p, q;
Line(Point _p, Point _q) : p(_p), q(_q){};
};
bool isSelfCrossing(vector<int>& x) {
list<Li... | ALGO | 0.999935 | 4.612536 |
ecbb9c0d-1321-4929-8853-42c9df2dc2f2 | afshanayubi/Basic-coding | test3.cpp | #include <iostream>
#include<math.h>
using namespace std;
int main(){
int sum=0;
int n;
cin>>n;
int m=n,r=n;
while(n!=0)
{
n=n/10;
sum++;
}
int p=sum;
sum=0;
while(m!=0){
sum=sum+pow(m%10,p);
m=m/10;
}
if (sum==r)
{
cout<<"true"<<endl;
}
else{
cout<< "false"<<endl;
}
return... | ALGO | 0.99991 | 4.131127 |
d3ccd62a-2dff-4c62-8b29-d3ea81abd6b0 | Sam-555/DSA | Arrays/easy/rotateArray.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void rotate(vector<int>& nums, int k) {
int n=nums.size();
if(n==0) return;
k=k%n;
reverse(nums.begin(),nums.begin()+n-k);
reverse(nums.end()-k,nums.end());
reverse(nums.begin(),nums.end());
}
void printVector(const vec... | ALGO | 0.999492 | 6.34902 |
043dc169-f6ee-44dc-83e1-2d6a54827cba | hyunstory/CodingTestPractice | Baekjoon/CPP/16933.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <cstring>
using namespace std;
struct Ptn{
int x;
int y;
int b;
int cnt;
bool afnn;
Ptn(int x, int y, int b, int cnt, bool afnn): x(x), y(y), b(b), cnt(cnt), afnn(afnn){};
};
const int MAX = 1001;
int dx[] = { 0, 0, 1, -1 }... | ALGO | 0.999852 | 4.09151 |
b4332d33-84f0-4dc2-9694-e7e7dad2a49d | maria-owd/clasa11 | 2023-09-26/functii.cpp | #include <iostream>
using namespace std;
int suma(int x1, int x2) {
int s;
s = x1 + x2;
return s;
}
bool par(int x) {
if (x % 2 == 0) {
return true;
} else {
return false;
}
}
bool prim(int x) {
for (int i = 2; i <= x/2; i++) {
if (x % i == 0) {
return... | ALGO | 0.998879 | 4.136151 |
9061b056-2a5a-45dc-b9b1-10e28faac02d | king-yyf/cpcode | other/cses/1617.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(c) (c).begin(), (c).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define f0(e) for(int i = 0; i < (e); ++i)
#define f1(e) for(int i = 1; i <= (e); ++i)
#define f2(i,e) for(int i = 0; i < (e); ++i)
#define r... | ALGO | 0.999838 | 4.707345 |
32609d66-d4a5-418d-8e4c-45481e4d8c12 | drewm1980/acado | examples/code_generation/nmpc/getting_started_closed_loop.cpp | /**
* \file cstr_mpc_simulation.cpp
* \author Hans Joachim Ferreau, Boris Houska
*/
#include <acado_toolkit.hpp>
#include <include/acado_gnuplot/gnuplot_window.hpp>
extern "C"
{
#include "./getting_started_export/acado.h"
#include "./getting_started_export/auxiliary_functions.c"
} // extern "C"
ACADOvaria... | ALGO | 0.997021 | 5.657724 |
f6b639cb-1a85-4bca-ab85-8c45cc730847 | joelmccl/FINALC- | Module3/Math/src/mathfunc.cpp | /*******************************
Introduction to Programming
Program to demonstrate:
1) Random number generator
2) Different built-in math functions
in math.h
3) For loop usage for recursive operations
Programmer: Eric Foo
********************************/
#include <iostream>
#include <math.h> // include the mat... | ALGO | 0.953298 | 3.714591 |
6c81507a-54c6-4321-a8e5-f2d27a9f3c09 | jdmillard/ecen631 | assignment4/main.cpp | #include <opencv2/opencv.hpp>
#include <string> // needed for setting std::strings and using to_string
#include <fstream>
using namespace cv;
int main(int argc, char** argv )
{
//////// /// ////// // // //
// // // // // // // ////
// // // // // // //
... | ALGO | 0.993636 | 4.939976 |
0d1834cc-06da-4ca7-af4a-59aabed27f31 | CSE71/Coding-in-Cpp | Coding/HR/InterProblems/Maps/Maps Ransom.cpp | void checkMagazine(vector<string> magazine, vector<string> note) {
int n=magazine.size(),m=note.size();
unordered_map<string,int> mp;
unordered_map<string,int> :: iterator it;
for(int i=0;i<n;i++)
{
it = mp.find(magazine[i]);
if(it==mp.end())
{
mp.insert(pair<string,int>(magazine[i],1));
}
... | ALGO | 0.99996 | 4.418801 |
5f7eb3d2-f8f2-4bd9-888b-61d977b0b6ba | voxhugh/algorithm | 二分查找/二分查找.cpp | #include <iostream>
using namespace std;
int binSearch(int a[], int len, int k)
{
int low = 0;
int high = len - 1;
int mid;
while (low <= high)
{
mid = (low + high) / 2;
if (a[mid] == k)
{
return mid;
}
else if (k < a[mid])
{
high = mid - 1;
}
else
{
low = mid + 1;
}
}
return -1;
}
... | ALGO | 0.998496 | 4.187613 |
f2c74acf-e60b-4d43-acce-c6e96f288826 | Choi-SeongJun/DataStructure | LinkedList/CircularLinkedList.cpp | #include <stdio.h>
#include <stdlib.h>
typedef int element;
typedef struct ListNode{
element data;
struct ListNode *link;
} ListNode;
void error(const char *message)
{
fprintf(stderr, "%s\n", message);
exit(1);
}
ListNode *create_node(element data, ListNode *link)
{
ListNode *new_node;
new_node = (ListNode *)m... | ALGO | 0.996543 | 4.227592 |
fe4733a1-4ad4-47d8-8560-06850659982a | ishandutta2007/codeforces | se1ka2/normal/1475/C.cpp | #include <iostream>
#include <map>
using namespace std;
typedef long long ll;
int main()
{
int t;
cin >> t;
while(t--){
ll n, m, k;
cin >> n >> m >> k;
map<int, ll> mpa, mpb;
for(int i = 0; i < k; i++){
int a;
cin >> a;
mpa[a]++;
}... | ALGO | 0.99988 | 3.73414 |
49697fa7-5e37-4fdd-a53d-6b793d8f3437 | 759713112/my_ceph | src/boost/libs/intrusive/example/doc_list_algorithms.cpp | struct my_node
{
my_node *next_, *prev_;
//other members...
};
//Define our own list_node_traits
struct my_list_node_traits
{
typedef my_node node;
typedef my_node * node_ptr;
typedef const my_node * const_nod... | ALGO | 0.985219 | 6.41823 |
36e3a854-0e17-44ab-875a-9a63a0581e97 | ASTHA-CHOUDHARY/MyRepo | WEEK1/W1_code3.cpp | #include<iostream>
using namespace std;
int linear_search(int arr[],int l,int u,int key)//search the key in the interval
{
for(int i=l;i<=u;i++)
{
if(arr[i]==key)
{
return i;
}
}
return -1;
}
int min(int n,int i)//to check if i is not exceeding the upperbound
{
i... | ALGO | 0.999947 | 5.174518 |
3cb0f7aa-4120-412c-acb4-3486bf642f0f | easyNextCoder/CppPrimer | sec10/10-27.cpp | #include<iostream>
#include<iterator>
#include<vector>
#include<list>
#include<algorithm>
using namespace std;
int main() {
vector<int> int_container = {1,2,3,4,5,6,7,8,9,6,5,4,3,2,1};
list<int> lst;
sort(int_container.begin(),int_container.end());
auto last_not_same = unique(int_container.begin(),int_container.en... | ALGO | 0.999859 | 3.576418 |
b4ac026f-6482-48b3-a6dd-c9ac05d91593 | kushnayak/competitive-programming | C++/USACO/Bronze/2017/USOpen/BovineGenomics.cpp | #include <iostream>
#include <fstream>
using namespace std;
int n,m;
string spot[100];
string not_spot[100];
bool valid(int col) {
for (int i=0; i<n; i++) {
char spot_gene = spot[i][col];
for (int j=0; j<n; j++)
if (not_spot[j][col]==spot_gene)
return false;
}
... | ALGO | 0.999813 | 3.869184 |
defd154f-41a3-4e5b-9adc-51bd719a18a9 | SWEG-2015EC-Batch/Codify | ETS1123_15_Rajaf_Dereje/2nd-year 1st-semister/Practical exercise/Activity 4.2/1D array exercises/4.cpp | /*
This program read and adds equivalent elements of the two-dimensional arrays named first
and second. The program should print the resulting data elements in table form.
*/
#include <iostream>
using namespace std;
int main() {
float first[2][4],second[2][4],sum[2][4];
cout<<"Enter you first array of 2 by 4 dimentio... | ALGO | 0.999296 | 4.40451 |
133bf9ca-57c4-494a-9bf9-19c9bd06e6f4 | RALC88/riscv-vectorized-benchmark-suite | _canneal/src/netlist.cpp | #include "location_t.h"
#include "netlist.h"
#include "netlist_elem.h"
#include "rng.h"
#include <fstream>
#include <iostream>
#include <assert.h>
#include <deque>
using namespace std;
void netlist::release(netlist_elem* elem)
{
return;
}
//**************************************************************************... | TOOL | 0.862045 | 4.176008 |
ec0c0f96-3a02-4c46-ae73-9221e85402d5 | OMAIMA-ASSIF/ProblemSolving | DividePlayersIntoTeamsOfEqualSkill.cpp | #include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
long long dividePlayers(vector<int>& skill) {
sort(skill.begin(), skill.end());
int n = skill.size();
long long chemistrySum = 0;
for (int i = 0; i < skill.size() / 2; ++i) {
i... | ALGO | 0.999932 | 5.595957 |
96469c22-d7ce-42d2-a7f4-3b9405bd7555 | buiquochuy2508/DSA_CODE_PTIT | DAYCONCOTONGBANG_S.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, a[35], x[35], s, ok = INT_MAX;
void Try (int i, int sum, int pos){
if (sum == s){
ok = min(ok, i - 1);
return;
}
for (int j = pos; j <= n; ++j){
if (sum + a[j] <= s){
Try(i + 1, sum + a[j], j + 1);
}
}
}
int main(){
ios_base:... | ALGO | 0.999972 | 4.2189 |
fa3269a3-8032-42f7-8ff4-02a5a9a42bc1 | hybridSMT/hybridSMT | source_code/src/test/karr.cpp | #include "util/rlimit.h"
#include "math/hilbert/hilbert_basis.h"
/*
Test generation of linear congruences a la Karr.
*/
namespace karr {
struct matrix {
vector<vector<rational> > A;
vector<rational> b;
unsigned size() const { return A.size(); }
void reset() {
... | ALGO | 0.980488 | 4.498849 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.