uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7b7b821e-2c88-4c68-810e-1a3d6c8384af | batanvlog2503/Code-PTIT-DSA | DSA05014.cpp | #include<iostream>
using namespace std;
const int MOD = 1e9+7;
int main(){
int q;
cin >> q;
while(q--){
long long n;
cin >> n;
long long dp[1005];
dp[0] = dp[1] = 1;
for(int i = 2;i <= n;i++){
dp[i] = 0;
for(int j = 0;j < i;j++){
dp[i] = (dp[i] + (dp[j] * dp[i - j - 1]) % MOD) % MOD;
... | ALGO | 0.999987 | 4.402773 |
0d81baac-91f1-4156-9b64-568f7244267b | Vinit1832/OOPs-Concept | rectangle2.cpp | #include<iostream>
#include<math.h>
using namespace std;
class area
{
private:
int l,b,a;
public:
void input()
{
cout<<"enter the length of rectangle";
cin>>l;
cout<<"enter the breadth of rectangle";
cin>>b;
}
void returnarea()
{
a=l*b;
cout<<"the area of rectangle is:-"<<a<<endl;
}
};
int... | TOOL | 0.926028 | 3.658973 |
fed6e166-2258-4a8c-bd64-ae0c12f3d780 | ANIME-AnimeCoin/Pastel | src/bitcoin-tx.cpp | #include "clientversion.h"
#include "coins.h"
#include "consensus/consensus.h"
#include "consensus/upgrades.h"
#include "core_io.h"
#include "key_io.h"
#include "keystore.h"
#include "primitives/transaction.h"
#include "script/script.h"
#include "script/sign.h"
#include <univalue.h>
#include "util.h"
#include "utilmone... | TOOL | 0.866321 | 5.647724 |
3b7e3555-360b-48b7-a5f1-441c655030ca | justin0u0/LeetCode | problems/0080-remove-duplicates-from-sorted-array-ii/solution.cpp | /**
* Author: justin0u0<<EMAIL>>
* Problem: https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/
* Runtime: 0ms
*/
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
int n = (int)nums.size();
if (n < 3) {
return n;
}
int prev = nums[0];
int count = 1;
... | ALGO | 0.999735 | 6.636577 |
a584c87f-dcdc-49ac-b5a1-8010bbe81cab | piy-crpto/DSA-code | c++/Floyd_triangle.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int count=1;
for(int i = 1; i<=n; i++)
{
for(int j=1;j<=i;j++)
{
cout<<count<<" ";
count++;
}
cout<<endl;
}
return 0;
} | ALGO | 0.999931 | 3.784323 |
cdbf2afe-2f0c-4959-86b3-5c1101f42db6 | shashiranjan567/leetCode-solution | 0232-implement-queue-using-stacks/0232-implement-queue-using-stacks.cpp | /*class MyQueue {
public:
stack<int> st1, st2;
MyQueue() {
}
void push(int x) {
while (!st1.empty()){
st2.push(st1.top());
st1.pop();
}
st1.push(x);
while (!st2.empty()){
st1.push(st2.top());
st2.pop();
}
... | ALGO | 0.998719 | 5.443676 |
12c7daaf-a8c3-40cc-957c-5b6a9b2cee88 | LoreSalazar/Pilas | Ejemplo1_Pilas/Ejemplo1_Pilas.cpp | /* Utilizando pilas, hacer un programa que tenga un men con:
*
* 1) Insertar un caracter a la pila
* 2) Mostrar todos los elementos de la pila
* 3) Salir
*/
#include <iostream>
#include <stdlib.h>
using namespace std;
struct nodo {
char letra;
nodo* siguiente;
};
void agregarPila(nodo*&, char);
void sacarPila(no... | ALGO | 0.986675 | 4.81595 |
e82c53db-50ae-4274-b32a-068dd902890c | YoshikiTakashima/vert | benchmark/cpp_transcoder/COUNT_POSSIBLE_PATHS_TOP_LEFT_BOTTOM_RIGHT_NXM_MATRIX_3/COUNT_POSSIBLE_PATHS_TOP_LEFT_BOTTOM_RIGHT_NXM_MATRIX_3_processed.cpp |
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
using namespace std;
int f_gold ( int m, int n ) {
int path = 1;
for ( int i = n;
i < ( m + n - 1 );
i ++ ) {
path *= i;
path /= ( i - n + 1 );
}
return path;
}
| ALGO | 0.999981 | 5.765722 |
310dff99-bd08-49cd-922d-3a8ee5c587a3 | marcinsokolowski/showspec | bg_bedlam.cpp | #include <math.h>
#include "bg_bedlam.h"
int CBedlamSpectrometer::m_SizeX = 4096;
double CBedlamSpectrometer::start_freq = 0.00;
double CBedlamSpectrometer::stop_freq = 480.00;
int CBedlamSpectrometer::m_nSpectralModelPolyN=10;
double CBedlamSpectrometer::gBedlamQualityLimitDBM_BAD=-37; // see document logbook/20140... | TEST | 0.888063 | 5.505517 |
b0976587-2dac-4797-bf2a-246431e1118b | mytonwalletorg/mytonwallet | mobile/ios/Air/SubModules/RLottieBinding/rlottie/src/vector/vpath.cpp | #include "vpath.h"
#include <cassert>
#include <iterator>
#include <vector>
#include "vbezier.h"
#include "vdebug.h"
#include "vline.h"
#include "vrect.h"
V_BEGIN_NAMESPACE
void VPath::VPathData::transform(const VMatrix &m)
{
for (auto &i : m_points) {
i = m.map(i);
}
mLengthDirty = true;
}
float... | TOOL | 0.91927 | 7.27986 |
e1ab65db-cd6b-4f83-9c30-fe55e42178a8 | abhisheknaiidu/dsa | DSA/Trees/path-sum1.cpp | #pragma GCC optimize("Ofast")
#include <algorithm>
#include <bitset>
#include <deque>
#include <iostream>
#include <iterator>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <unordered_map>
#include <unordered_set>
using namespace std;
void abhisheknaiidu()... | ALGO | 0.999953 | 5.040673 |
e4a9ca25-4b96-4e1d-b4ef-8aa833ab5377 | ishandutta2007/codeforces | suiseiseki/normal/1110/C.cpp | #include <cstdio>
int main(){
int n;
scanf("%d",&n);
int a;
for(int i=1,j;i<=n;i++){
scanf("%d",&a);
if(a==3){
puts("1");
continue;
}
if(a==7){
puts("1");
continue;
}
if(a==15){
puts("5");
continue;
}
if(a==31){
puts("1");
continue;
}
if(a==63){
puts("21");
continue... | ALGO | 0.999625 | 3.047495 |
a216ddea-83ac-41e4-b868-f691ebb1be0a | PLBilodeau/godot | thirdparty/meshoptimizer/stripifier.cpp | #include <assert.h>
#include <limits.h>
#include <string.h>
// This work is based on:
// Francine Evans, Steven Skiena and Amitabh Varshney. Optimizing Triangle Strips for Fast Rendering. 1996
namespace meshopt
{
static unsigned int findStripFirst(const unsigned int buffer[][3], unsigned int buffer_size, const unsign... | ALGO | 0.998842 | 7.64556 |
b835c05b-fd98-4c67-8b9b-ef3a4ec0a156 | wuyuhang05/My-OI-Code | HDU/3183.cpp | #include <algorithm>
#include <iostream>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <cstdio>
#include <bitset>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <map>
#include <set>
#define fi first
#define se second
#define U unsigned
#define P std::... | ALGO | 0.999965 | 3.425585 |
b598093c-69ed-4a06-8e2b-7494f7803462 | namanv3/Lattices | Experiment-1/functions.cpp | #include "functions.h"
mpz_class norm(mpz_class v[], int m) {
mpz_class val = 0;
for(int i = 0; i < m; ++i) val = val + v[i]*v[i];
return val;
}
mpq_class norm(mpq_class v[], int m) {
mpq_class val = 0;
for(int i = 0; i < m; ++i) val = val + v[i]*v[i];
val.canonicalize();
return val;
}
mpz_class dotp(mpz_clas... | ALGO | 0.999511 | 3.687702 |
0a4b36c9-5db1-4fc3-8903-1ffa1facdd4f | shakibamoshiri/1000_examples_with_cpp | std/02_String_Library/null_terminated_string/31_std_strspn.cpp | /// Null-terminate string
/// 31_std::strspn
/// definition in header < cstring >
/// string examination
/**
size_t strspn ( const char* dest, const char* src );
Returns the length of the maximum initial segment ( span ) of the
byte string pointed to by dest. That consist of only the character
found in byte string po... | ALGO | 0.971241 | 4.418829 |
88798ef1-cd40-443f-9b8f-6443684f216c | SaminRahman1/DSA | Basic Data Structures/Module - 14 (Queue)/Implement_queue_using_doubly.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node* next;
Node* prev;
Node(int val)
{
this->val = val;
this->next = NULL;
this->prev = NULL;
}
};
class myQueue
{
public:
Node* head = NULL;
Node* tail = NULL;
i... | ALGO | 0.999863 | 4.426704 |
c1fb8a3f-5e67-4d29-81ad-c95ecd5ae955 | tondra0/fewC-C-Codes | cs2510Assign1(p2).cpp | #include <iostream>
using namespace std;
int main() {
int N;
cout << "How many exercises to input: ";
cin >> N;
int score = 0;
int total = 0;
for(int i = 1; i <= N; i++)
{
int score1;
cout << "Score received for exercise " << i << ": ";
cin >> score1;
score = score + score1;
int t... | ALGO | 0.874585 | 3.795664 |
7c495c9d-76bc-46a7-92fe-f759b30050c1 | hoangminhbao8102/NLLTCT-CTK44 | Lab05/BaiTapThem/Lab05_F_Bai3/Lab05_F_Bai3/Program.cpp | #include <iostream>
#include <conio.h>
using namespace std;
#include "ThuVien.h"
void ChayChuongTrinh();
int main()
{
ChayChuongTrinh();
return 1;
}
void ChayChuongTrinh()
{
char kt;
int n, a[10000];
do
{
system("CLS");
cout << "Nhap so luong phan tu cua mang: ";
cin >> n;
if (n > ... | ALGO | 0.993464 | 3.506471 |
37722e07-3679-4f4e-9793-ce73055699ea | JatinBagai01/OOPS | OOPS 1/virtual-functions.cpp | // C++ program to demonstrate how we will calculate
// area of shapes without virtual function
#include <iostream>
using namespace std;
// Base class
class Shape {
public:
// parameterized constructor
Shape(int l, int w)
{
length = l;
width = w;
}
int get_Area()
{
cout << "This is call to parent class area... | TOOL | 0.963412 | 5.128061 |
5c07521c-8c0c-4b49-9cba-df6b3f94d738 | mohsinenur/URIOnlineJudge | Several_Scores_with_Validation.cpp | #include<iostream>
#include<iomanip>
using namespace std;
main()
{
int X;
float a;
float sNum = 0;
int nCount = 0;
cout << fixed;
top:
cin >> a;
if ((a >= 0.0) && (a <= 10.0))
{
sNum += a;
nCount++;
if (nCount == 2)
{
cout << setprecis... | TOOL | 0.9359 | 4.093495 |
3b205d7d-6af2-448b-9dc6-5f7a09d46272 | satyamdash/DSA-daily | 994-Rotting-Oranges.cpp | class Solution {
public:
int orangesRotting(vector<vector<int>>& grid)
{
int n=grid.size();
int m=grid[0].size();
int tm=0;
vector<vector<int>>Vis(n,vector<int>(m,0));
queue<pair<pair<int,int>,int>>q;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j+... | ALGO | 0.999974 | 6.224082 |
873c8fc8-609d-4b4f-bad9-73e132993df5 | Pranavchiku/Love-Babbar-Solution | Trie/405.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
typedef struct TrieNode{
struct TrieNode *children[26];
//isEndOfWord is true represents the end of a word
bool isEndOfWord;
}TrieNode;
//function to create a new trie node
TrieNode* getNode(){
TrieNode *node = new TrieNode;
fo... | ALGO | 0.999977 | 5.411017 |
34a0d211-3922-4f27-b47f-876c96afda45 | osanseviero/C-training | Foundations/Data Structures/Vectors/8.siege_of_eratosthenes.cpp | #include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int isPrime(int n){
for(int i=2; i<sqrt(n); i++){
if(n%i == 0)
return 0;
}
return 1;
}
vector<int> findPrimes(int n){
vector<int> sieve(n+1);
for(int i = 0; i<=n; i++){
sieve[i] = 1;
}
... | ALGO | 0.999247 | 3.686164 |
4947f386-9225-4862-b33b-9cbd0e07fc8d | SSAFYnity/Job-Preparation-Challenge-5th | Baekjoon/뱀/뱀_주혜련.cpp | #include <iostream>
#include <string>
#include <string.h>
#include <queue>
#include <algorithm>
#pragma warning(disable:4996)
using namespace std;
typedef pair<int, char> pii;
typedef unsigned long long ll;
int N, K, L;
pii tail;
int arr[101][101];
int way[4][2] = { {-1,0},{0,1},{1,0},{0,-1} };
queue<pii> turn;
int f... | ALGO | 0.999927 | 4.079061 |
2a06fe0e-3b86-4010-8b83-9a7b4a8def0d | taylanot/mlcxx | lcpp_bits/examples/simple.cpp | /**
* @file simple.cpp
* @author Ozgur Taylan Turan
* This is a simple program that create a learning curve with and without
* hyper-parameter tunining for a simple case.
*/
#include <lcpp.h>
// Since it is a classification task we use the template parameter
// arma::Row<size_t>. DTYPE is "double" by default f... | DATA | 0.860822 | 7.3115 |
ce26f1a6-1d63-49a8-bee1-9dca5b9189f7 | lixworth/cpp-playground | snippets/stl/map.cpp | //
// Created by Worth Lix on 2024/3/6.
//
#include <iostream>
#include <map>
using namespace std;
int main() {
map<int, string> m0;
// map<pair<int, int>, vector<int>> test;
m0[1] = "12sss3";
m0[2] = "12ss3s3";
m0[4] = "12ss333s3";
m0[4] = "11";
for (const auto &item: m0) {
cout <... | ALGO | 0.9034 | 4.589743 |
ff21d152-e58a-4ee5-804f-4713aa3295ef | Owen-Z/pwd-check-and-create | generator.cpp | #include "generator.h"
#include<iostream>
#include<time.h>
using namespace std;
bool judgeInput(){
string temp;
cin >> temp;
while(temp != "y" && temp != "n"){
cout << "please 'y' or 'n'\n";
cin >> temp;
}
return temp == "y" ? true : false;
}
void initPassword(Password &pwd){
... | TOOL | 0.896971 | 3.527904 |
c6f5c342-3976-4c6f-b322-4334be8a83cb | Gabrielle-OyO/GO | somethinguseless0/The C++ Programming Language/The Assignments/实验4/4-7-2.cpp | #include<iostream>
using namespace std;
class math
{
private:
int x, y;
char ch;
public:
math(int a, char c, int b) { x = a;y = b;ch = c; }
void calculate()
{
switch (ch)
{
case'+':cout << x << ' ' << ch << ' ' << y << '=' << x + y << endl;break;
case'-':cout << x << ' ' << ch << ' ' << y << '=' << x - y ... | ALGO | 0.99985 | 3.454292 |
83286174-8516-46c0-86be-b33614a04a29 | johnny-mdp/Election_prediction_c | Eleccion_Genetica.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
using namespace std;
using namespace std::chrono;
# include <math.h>
#include <vector>
# include <stdlib.h>
# include <stdio.h>
# include <time.h>
#include <new>
#include <ctime>
#include <random>
#include "Red_Neuronal_Genetica.h"
//g++ -st... | ALGO | 0.994212 | 4.094188 |
7c66875c-4d34-4216-86fc-417285e2e7e5 | Erick-Bryan-Cubas/Introducao_a_Programacao_Estruturada_em_C | Aprendizado/Material Didático/C e C - Estrutura de Dados/C e C++ - Estrutura de Dados - Pilhas, Filas, Buscas e Ordenação/C e C++ - Estrutura de Dados - Pilhas, Filas, Buscas e Ordenação/insertion_sort.cpp | #include <iostream>
#include <stdlib.h>
#include <string>
#define TAM 10
using namespace std;
void imprimeVetor(int vetor[]){
int i;
cout << "\n";
for(i = 0; i < TAM; i++){
cout << " |" << vetor[i] << "| ";
}
}
void insertion_sort(int vetor[TAM]){
int i, j, atual;
for(i = 1; i < TAM... | ALGO | 0.999645 | 4.782979 |
a0ccb839-5156-4d46-9c27-6d65e968f552 | mandy-1/DSA-Practice-2022 | Bridge edge in a graph - GFG/bridge-edge-in-a-graph.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
bool dfs(int node ,int parent,vector<int>&dis,vector<int>&low,vector<bool>&vis,int c,int d,vector<int>adj[],int &timer )
{
vis[node]=true;
dis[node]=low[node]=timer++;
for(au... | ALGO | 0.99986 | 6.20309 |
f2cb1caa-4002-4517-bed6-7a356a045843 | AdityaGaur7/Contest_problems | Starter182/cf2.cpp | #include <iostream>
#include <vector>
#define ll long long
#define dl long double
#define vi vector<int>
#define vl vector<ll>
#define vpi vector<pair<int, int>>
#define vpl vector<pair<ll, ll>>
#define pb push_back
#define mp make_pair
#define mii map<int, int>
#define mll map<ll, ll>
#define ff first
#define ss seco... | ALGO | 0.999893 | 4.47624 |
e45a1c4c-0320-4092-a788-937917a71497 | ne7ermore/playground | cpp/graph/clone.cpp | /**
Given a reference of a node in a connected undirected graph, return a deep copy (clone) of the graph.
Each node in the graph contains a val (int) and a list (List[Node]) of its neighbors.
Example:
1 ----------- 2
| |
| |
| |
3 ----------- 4
Input:
{"$id":"1","neigh... | ALGO | 0.999648 | 6.04773 |
c8fd6388-d454-41a3-9fd4-340acbb378fb | heltonricardo/beecrowd-uri | 1-iniciante/1165.cpp | #include <iostream>
using namespace std;
int sqrt(int n) {
return int(n * 0.5);
}
bool prime(int n) {
int i;
if (n == 0 || n == 1) return false;
for (i = 2; i <= sqrt(n); ++i)
if (n % i == 0) return false;
return true;
}
int main(void) {
int n, q, i;
cin >> q;
for (i = 0; i ... | ALGO | 0.999862 | 4.896514 |
5f1efe1e-0489-4d8e-981d-d5ddfbfa993a | alexandraback/datacollection | solutions_5658282861527040_0/C++/Factorial/B.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <set>
#include <map>
#include <sstream>
#include <queue>
#include <stack>
#include <math.h>
#include <utility>
#include <iterator>
#include <fstream>
#include <cstdio>
#include <functional>
using namespace std;
template<class T>
str... | ALGO | 0.997593 | 3.553461 |
17897349-08f7-40bd-87a2-fa68fbdfee62 | hu-macsy/lama_old | scai/partitioning/examples/DemoPartitioningW.cpp | /**
* @file DemoPartitioning.cpp
*
* @license
* Copyright (c) 2009-2018
* Fraunhofer Institute for Algorithms and Scientific Computing SCAI
* for Fraunhofer-Gesellschaft
*
* This file is part of the SCAI framework LAMA.
*
* LAMA is free software: you can redistribute it and/or modify it under the
* terms of ... | ALGO | 0.992851 | 5.554246 |
fff292d9-d097-426c-a6a5-067085a950e4 | Iwaide/AtCoder | diverta2019/c/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { ... | ALGO | 0.999856 | 4.804208 |
73e5a921-b9c9-474e-9a95-0fd0332a8015 | ishandutta2007/codeforces | endagorion/normal/383/C.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(... | ALGO | 0.999933 | 4.301422 |
c14378e9-2368-4c97-b226-bbb5a0d2108c | yuichiro-kurose/kyopro | atcoder/abc354/c/main.cpp | // author: Yuichiro Kurose
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<tuple<int, int, int>> x(n);
set<int> st;
for (int i = 0; i < n; i++) {
int a, c;
cin >> a >> c;
x[i] = make_tuple(a, c, i);
st.inse... | ALGO | 0.999985 | 3.97541 |
1da6a61d-66a0-4a99-855b-c4339706a93f | alemuntoni/meshlab-external-libraries | downloads/boost_1_87_0/libs/graph/example/bellman-ford-internet.cpp | int main()
{
using namespace boost;
// ID numbers for the routers (vertices).
enum
{
A,
B,
C,
D,
E,
F,
G,
H,
n_vertices
};
const int n_edges = 11;
typedef std::pair< int, int > Edge;
// The list of connections betwe... | ALGO | 0.999787 | 5.036477 |
f4290bfa-e8cc-4eed-b0b0-f0dd371bc49d | Alaxe/noi2-ranking | 2017/solutions/C/LLK-Varna/color.cpp | #include<iostream>
#include<cstring>
using namespace std;
int m[100000];
int i[11];
int main()
{
int t,n,z=100000;
cin>>t;
for(int a=0; a<t; a++)
{
cin>>n;
memset(m,0,sizeof(m));
z=1;
for(int b=1; b<=n; b++)
{
int k;
cin>>k;
m[b... | ALGO | 0.999924 | 3.820281 |
3eae1620-f28a-4ee3-930f-43f7c346e4fd | ISOLDE-Project/riscv-llvm | llvm/lib/CodeGen/MachineConvergenceVerifier.cpp | #include "llvm/CodeGen/MachineConvergenceVerifier.h"
#include "llvm/CodeGen/GlobalISel/GenericMachineInstrs.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/MachineSSAContext.h"
#include "llvm/IR/GenericConvergenceVerifierImpl.h"
using namespace llvm;
... | TOOL | 0.85321 | 6.08422 |
56597375-9d5f-4b80-a467-0abefe8c3ad1 | hjiang13/LLMs-in-IR | POJ-104/27/1138.cpp | #include <iostream>
using namespace std;
//*******************************
//**6.cpp?????????***
//**??????1300012993****
//**??:2013.10.10****
//*******************************
int main()
{
int n;
double a, b, c, x1, x2, d, p, q;
char i;
cin >> n;
for(i = 1; i <= n; i++)
{
cin >> a >> b >> c;
d = b * b - 4 * a * c; ... | ALGO | 0.999768 | 3.703811 |
5f6c3e4d-7496-4d46-8763-0301ff8506c3 | RaghavBirla2004/DSA | Linked_List/Easy/7_Intersection_of_Two_Linked_List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
int a = 0,b=0;
ListNode*curr = headA;
while(curr){
a+... | ALGO | 0.999873 | 5.292056 |
79971c68-d23f-48ea-b5ab-813dad8554e5 | pingjuiliao/llvm-vanilla | llvm-project/clang/tools/libclang/CIndexHigh.cpp | #include "CursorVisitor.h"
#include "CLog.h"
#include "CXCursor.h"
#include "CXSourceLocation.h"
#include "CXTranslationUnit.h"
#include "clang/AST/DeclObjC.h"
#include "clang/Frontend/ASTUnit.h"
#include "llvm/Support/Compiler.h"
using namespace clang;
using namespace cxcursor;
using namespace cxindex;
static void g... | TOOL | 0.902016 | 6.512547 |
9c446c20-f31c-4f28-97fd-8927f5b78ea0 | nam-Space/DSA_PTIT | Giải thuật tham lam/DSA03009_SẮP XẾP CÔNG VIỆC 2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
struct Data {
int id, dead, profit;
};
bool cmp(Data a, Data b) {
return a.profit > b.profit;
}
int main(){
int t;
cin >> t;
while(t--) {
int n;
cin >> n;
vector<Data> jobs;
for (int i = 0;... | ALGO | 0.999843 | 4.18342 |
973b12f6-a162-455f-9d91-b738aa049713 | Dayof/integrate-c-python | test-boost/boost_1_60_0/libs/intrusive/example/doc_erasing_and_disposing.cpp | using namespace boost::intrusive;
//A class that can be inserted in an intrusive list
class my_class : public list_base_hook<>
{
public:
my_class(int i)
: int_(i)
{}
int int_;
//...
};
//Definition of the intrusive list
typedef list<my_class> my_class_list;
//The predicate function
struct is_e... | TOOL | 0.892605 | 6.384149 |
499a0a26-d94b-4a3c-949d-5d27f3c3c60a | Reyansh17/DSA | bitmanipulation/question.cpp | #include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
void oddeven(int n){
int bitmask=1;
if((n & bitmask)==0){
//even
cout<<"no. is even"<<endl;
}
else{
cout<<"no. is odd"<<endl;
}
}
int get_i_bit(int n, int i){
int bitmask=1<<i;
if... | ALGO | 0.998442 | 3.798082 |
3958bdb3-67dd-49fe-ac74-4548293c627d | cbftp/cbftp-svn | src/util.cpp | #include "util.h"
#include <sstream>
#include <csignal>
#include <cctype>
namespace util {
Result::Result() : success(true) {
}
Result::Result(bool success, const std::string& error) :
success(success), error(error)
{
}
int getSizeGranularity();
std::vector<unsigned long long int> getPowers();
static unsign... | TOOL | 0.911139 | 6.143897 |
9643fbcb-cb21-465f-8452-c61a7e4461c3 | Shubham28/SPOJ | ONEZERO.cpp | #include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cstring>
#define FOR(A,B,C) for(int A=B;A<C;A++)
#define EFOR(A,B,C) for(int A=B;A<=C;A++)
#define RFOR(A,B,C) for(int A=B;A>=C;A--)
#define PB(A,B) A.push_back(B);
#define SZ(A) int(A.size())
#def... | ALGO | 0.999948 | 4.00886 |
7d86d54a-bd75-4b4a-8279-d47162a2d7dc | yinsel/ShellcodeCryptor | cryptopp/hc256.cpp | // hc256.cpp - written and placed in the public domain by Jeffrey Walton
// based on public domain code by Hongjun Wu.
//
// The reference materials and source files are available at
// The eSTREAM Project, http://www.ecrypt.eu.org/stream/hc256.html.
#include "pch.h"
#include "confi... | ALGO | 0.998905 | 6.296351 |
36aac550-2519-48e7-b42a-d6e11e53d270 | arthurpd/icpc-notebook | misc/dp_optimization/binary_search.cpp | // https://codeforces.com/contest/321/problem/E
#include "../../contest/header.hpp"
/*
Binary Search Optimization for DP:
Optimizes dp of the form (or similar)
dp[i][j] = min_{k < i}(dp[k][j-1] + c(k + 1, i)).
The classical case is a partitioning dp, where k determines
the break point for the next partiti... | ALGO | 0.999948 | 3.192594 |
fa5cbb16-2e3e-4d64-a724-8e673c16162f | timzolleis/hfu-ain-1-programming | tasks/11-23-23/task-06.cpp | //
// Created by Tim on 20.11.2023.
//
#include <cstdio>
#include <math.h>
void zp(int a, int b) {
if (b < a) {
printf("The second number must be greater than the first one!\n");
}
// We now need to find the first number that is a power of 2 and is greater than a
int num = 1;
while (num < a... | ALGO | 0.996017 | 4.510202 |
cb4c0355-ff4e-48d6-acda-ba6b63795cfa | MijaTola/Codeforce | 1173B.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int ans = n / 2 + 1;
cout << ans << "\n";
int i = 1;
for (; i <= n / 2; ++i)
cout << 1 << " " << i << "\n";
for (i = 1; i <= n / 2 + (n & 1); ++i)
cout << ans << " " << i << "\n";
return... | ALGO | 0.999733 | 3.372742 |
b4fda471-c343-4aac-b42f-cd58adaf8392 | bollu/w | cses/counting-rooms.cpp | #include <assert.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric> // for gcd
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <queue>
// https://codeforces.com/blog/entry/11080
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/detail/... | ALGO | 0.999816 | 5.396918 |
3e2ac4b4-e76a-4e35-ba6f-c66b328cbd73 | luiseduardoalencar/leet-code | cpp/data-structure/linkedlist/has-loop.cpp | /**O objetivo é encontrar o valor do meio de uma lista encadeada, sem o atributo length */
#include <iostream>
using namespace std;
class Node {
public:
int value;
Node* next;
Node(int value) {
this->value = value;
next = nullptr;
}
};
class LinkedList {
... | ALGO | 0.999688 | 5.450023 |
b7dce845-ac4b-4f22-9088-3d0530fbe803 | yijiagu/FPEquivalence | CertInstCombine/AbstractState.cpp | //
// AbstractState.cpp
// LLVMCertInstCombine
//
// Created by Gu Yijia on 12/22/17.
//
#include <iostream>
#include "AbstractState.h"
#include "llvm/Support/Format.h"
#define LN2 0.693147180559945309417232121458
/*
TODO: check fadd, fminus do not need to consider subnormal
*/
using namespace raic;
using names... | ALGO | 0.955559 | 5.372992 |
f2bfc162-6c2d-4db5-9bd8-134fc9a35725 | sarvex/leetcode-beef | lcof2/剑指 Offer II 068. 查找插入位置/Solution.cpp | class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int left = 0, right = nums.size();
while (left < right) {
int mid = left + right >> 1;
if (nums[mid] >= target)
right = mid;
else
left = mid + 1;
}
... | ALGO | 0.999896 | 6.423034 |
170e52be-e635-40da-9107-9ccf92b928b3 | programjhlee/Algorithm | 1.Time Complexity/Baekjoon 24266 알고리즘 수업 - 알고리즘의 수행 시간 5/Baekjoon - 24266 알고리즘 수업 - 알고리즘의 수행 시간 5.cpp | /*
Baekjoon 24266 ˰ - ˰ ð 5
https://www.acmicpc.net/problem/24266
2025-04-18 - ù° [ذ]
MenOfPassion(A[], n) {
sum <- 0;
for i <- 1 to n
for j <- 1 to n
for k <- 1 to n
sum <- sum + A[i] A[j] A[k]; # ڵ1
return sum;
}
Ҹ . O(N^3) ð ´..
n Ƚ n^3̴.
*/
#include <iostream>
using namespace std;
int m... | ALGO | 0.999718 | 4.35719 |
8ca8b014-7f1e-49f4-abb3-1add38e9ff3c | LiserverYang/LisEditor | src/config/config.cpp | #include "config.h"
Configtion config = Configtion();
void parse_args(int argc, const char **argv, Configtion &config) noexcept
{
for (int i = 1; i < argc; i++)
{
// arg
if (argv[i][0] == '-')
{
if (0 == strcmp(argv[i], "-ro"))
{
config._readonly... | CONFIG | 0.947117 | 4.444976 |
3f624f32-f136-4597-8de9-6a06dbee16d5 | Guga-TM/22 | lab5/Sort.cpp | #include<iostream>
#include<windows.h>
int comp(const _int8* i, const _int8* j) {
return *i - *j;
}
int main(int argc, char* argv[]) {
HANDLE hReadPipe, hWritePipe;
HANDLE hEnableRead;
hEnableRead = OpenEvent(EVENT_ALL_ACCESS, 0, "EnableRead");
HANDLE hEnableWrite;
hEnableWrite = OpenEvent(EVENT_ALL_ACCESS, 0, "E... | ALGO | 0.997832 | 3.800348 |
72424eed-60a0-4d74-921d-4f8c72683bba | malachias13/SDL-2D_GameEngine | include/glm/test/core/core_func_integer_bit_count.cpp | // This has the programs for computing the number of 1-bits
// in a word, or byte, etc.
// Max line length is 57, to fit in hacker.book.
#include <cstdio>
#include <cstdlib> //To define "exit", req'd by XLC.
#include <ctime>
unsigned rotatel(unsigned x, int n)
{
if (static_cast<unsigned>(n) > 63) { std::printf("r... | ALGO | 0.999334 | 4.846448 |
2a617188-02ee-453f-befe-c22461beb395 | weimeittx/wax-blockchain-bin | src/boost_1_71_0/libs/compute/test/test_insertion_sort.cpp | #define BOOST_TEST_MODULE TestInsertionSort
#include <boost/test/unit_test.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/is_sorted.hpp>
#include <boost/compute/algorithm/detail/insertion_sort.hpp>
#include <boost/compute/container/vector.hpp>
#include "check_macros.hpp"
#include "context_... | TEST | 0.872664 | 7.148776 |
3bf87ecb-e7a5-45fa-b3b9-094ff525227f | WaiCat/OShomwork | 7/srtf.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <deque>
#include <sstream>
#include <string>
#include <algorithm>
#include <cstring>
#include <queue>
#include <limits.h>
using namespace std;
struct Num
{
int index, start, cpu, cor;
Num(int index, int start, int cpu, int cor) : index(index), ... | ALGO | 0.999955 | 3.62893 |
7f5c0d13-42b3-4ffe-9c4e-529c25e31a6f | arshiashirzad/QueraChallenges | KolahBagher/main.cpp | #include <iostream>
using namespace std;
int main() {
int x ;
cin >>x;
string str;
string alaki;
string Arr[x];
int counts[100] = {0};
int uniqueCount = 0;
string uniqueNames[100];
for (int i =0 ;i < x; i++){
cin >> str;
cin >>alaki;
Arr[i]=str;
} for (in... | ALGO | 0.99933 | 4.137677 |
eac71778-cec1-4c9b-a071-76cd0a6bd3ad | CFDEMproject/LIGGGHTS-PUBLIC | src/compute_atom_molecule.cpp | #include <string.h>
#include <stdlib.h>
#include "compute_atom_molecule.h"
#include "atom.h"
#include "update.h"
#include "modify.h"
#include "compute.h"
#include "fix.h"
#include "input.h"
#include "variable.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
enum{COMPUTE,FIX,VARIABLE};
/* --------... | TOOL | 0.958136 | 6.140354 |
92bc4525-347d-4318-b5ae-0f3e78514d95 | ahmadjutt483/ROLL-NO-096-AHMAD-RAZA-BAJWA | TASK 12 part 2.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* left;
Node* right;
int height;
Node(int value) {
data = value;
left = right = nullptr;
height = 1;
}
};
// Get height of node
int getHeight(Node* node) {
return (node == nullptr) ? 0 : node->hei... | ALGO | 0.999782 | 5.636678 |
86ee3422-f52d-479a-aafc-77372f611aee | FanYucai/Pintools | pin-3.2-81205-gcc-linux/source/tools/SimpleExamples/catmix.cpp | /*! @file
* This file contains a static and dynamic instruction category mix profiler
*/
#include "pin.H"
#include <list>
#include <iostream>
#include <fstream>
#include <stdlib.h>
/* ===================================================================== */
/* Commandline Switches */
/* ============================... | TOOL | 0.953138 | 7.022831 |
ef882fcd-8779-49bc-b25f-e5a772cd9fac | danielkaijzer/Fall_2023 | LC509_Fibonacci_Number.cpp | #include <iostream>
class Solution {
public:
int fib(int n) {
if (n < 2){
return n;
}
return (fib(n-1)+fib(n-2));
}
}; | ALGO | 0.999736 | 5.6874 |
d18e25d6-46de-4d57-a264-804b5df12689 | uskey512/AtCoder | ABC/121/d.cpp | #include <iostream>
#include <string>
using namespace std;
int bit[64];
void addBitCount(unsigned long long t) {
bit[0] += ((t - 1) / 2 + 1) % 2;
for (unsigned long long k = 63; 0 < k; --k) {
unsigned long long m = (1ULL << k);
if (t & m) {
bit[k] += ((t - m) + 1) % 2;
... | ALGO | 0.99999 | 3.862918 |
09bab6f4-1b4e-49c6-85d8-9da329501a71 | adisarode/cppcodes | Operators/unaryOperator/program5.cpp | #include<iostream>
int main() {
int x=5;
int ans;
std::cout<<x<<std::endl;//5
ans=++x;
std::cout<<x<<std::endl;//6
std::cout<<ans<<std::endl;//6
return 0;
}
| ALGO | 0.996696 | 3.332181 |
6ec88a58-a205-4172-9f50-85a107deaa01 | JuanjoConejo/JocDepedres | JocPedre/JocPedre.cpp | #include <iostream>
using namespace std;
int main() {
// Inicialització de les piles amb 3, 4 i 5 pedres respectivament
int piles[] = { 3, 4, 5 };
int jugadorActual = 1; // Variable que indica el jugador actual, comença amb el jugador 1
cout << "INICI DEL JOC" << endl;
// Bucle principal del joc
... | ALGO | 0.998133 | 4.911574 |
ff4642ab-395c-4695-8984-ad69aa4d3c22 | raincross7/code-similarity | codes/train_code/problem275/problem275_150.cpp | #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
int w, h, n;
cin >> w >> h >> n;
vector<int> x(n);
vector<int> y(n);
vector<int> a(n);
rep(i, n) cin >> x.at(i) >> y.at(i) >> a.at(i);
vector<vector<int>> square(w, vector<int>(h));
rep(i, n... | ALGO | 0.999505 | 3.913267 |
50b9c11b-3b7e-4f4d-ad4c-d7a595c56ca0 | liuxueyang/cpp | codeforces/problemset/1676f.cpp | // Date: Sun Dec 10 11:26:31 2023
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include ... | ALGO | 0.999944 | 4.365304 |
7e18a7a2-7656-43d9-b267-91244018dae8 | frcepeda/Contest-Archive | Code Jam/2014/Round 2 2014/Bsmall.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
#define MAXN 1010
int T;
int N, A[MAXN];
int tmp[MAXN], _ans[MAXN];
bool isUpDown(){
int i;
for (i = 0; i < N-1 && tmp[i] < tmp[i+1]; i++);
for (; i < N-1 && tmp[i] > tmp[i+1]; i++);
return i == N-1;
}
int cost(){
int i, j, c = 0;
int tmp2[MAXN];
f... | ALGO | 0.999599 | 4.001905 |
c4a02683-376b-43b0-946b-499ed1f4a590 | pg1049/geodesic | include/igl/marching_tets.cpp | #include "marching_tets.h"
#include <unordered_map>
#include <vector>
#include <utility>
#include <cstdint>
#include <iostream>
template <typename DerivedTV,
typename DerivedTT,
typename DerivedS,
typename DerivedSV,
typename DerivedSF,
typename DerivedJ,
ty... | ALGO | 0.999239 | 6.21566 |
9502b101-e00a-45b2-bb63-f6a298dfda10 | Lib1221/solution | leetcode/cplusplus_solution/two_sum_II.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
int x=numbers.size();
int low=0;
int high = x-1;
while(low<=high){
if(numbers[low]+numbers[high]==target){
return {low+1,high+1};
}
else if(numbers[low]+... | ALGO | 0.999913 | 6.30735 |
dd8b7481-c0f9-4acc-9906-a4fac713f6be | Pritha18/CPPCoding | Pritha/14.Function/14.2.2.cpp | //14.2.2. Write a function that reads two integers and returns Substraction
#include <iostream>
using namespace std;
int subtract()
{
int x, y;
cout << "Enter two integer variables: ";
cin >> x >> y;
int difference = x - y;
return difference;
}
int main(int argc, char const *argv[])
{
int difference = subt... | ALGO | 0.968299 | 4.473593 |
65e6a1ef-2705-45fb-9883-8b23a003dc7e | DusteDdk/audacityhacks | libraries/lib-time-and-pitch/StaffPad/TimeAndPitch.cpp | #include "TimeAndPitch.h"
#include <algorithm>
#include <array>
#include <cassert>
#include <random>
#include <stdlib.h>
#include <utility>
#include "CircularSampleBuffer.h"
#include "FourierTransform_pffft.h"
#include "SamplesFloat.h"
#include "SimdTypes.h"
using namespace staffpad::audio;
namespace staffpad {
na... | ALGO | 0.992839 | 5.828148 |
797985e0-adbf-4042-932f-1e5401da8b23 | transfer-learning/llvm-tl45 | libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.difference/set_difference.pass.cpp | // <algorithm>
// template<InputIterator InIter1, InputIterator InIter2, typename OutIter>
// requires OutputIterator<OutIter, InIter1::reference>
// && OutputIterator<OutIter, InIter2::reference>
// && HasLess<InIter2::value_type, InIter1::value_type>
// && HasLess<InIter1::value_type, InIte... | TEST | 0.936158 | 6.525198 |
aac4445e-7ac4-4b97-b169-7e9a505bef8b | DinukiFernando/Questions-about-pointers | Homework 8 Q9.cpp | /*a program to store n elements in an array and print the elements using pointer */
#include<iostream>
using namespace std;
int main(){
int data[5];
cout<<"Enter 5 elements: "<<endl;
for(int i=0;i<5;i++){
cin>>data[i];
}
int *dataPtr=data;
cout<<"You entered: ";
for(int j=0; j<5;j++){
cout<<endl... | ALGO | 0.974779 | 3.349733 |
79fb6188-cbbb-4866-988e-8df9a3170ade | jjoyce0510/javascript-interp | Parser.cpp |
//
// Parser.cpp
//
//
// Created by Pierce Cunneen on 4/10/2016
//
//
#include <math.h>
#include <string>
#include <vector>
#include "Token.h"
#include "Parser.h"
#include <stack>
#include "tokenize.h"
using namespace std;
//parses the text based on a vector of token pointers passed in - returns the root node of ... | ALGO | 0.928661 | 5.868821 |
589062b8-1bc1-4c0c-a9bf-cf851ea3d53c | Kaloyan98/fmi_Object_Oriented_Programming | Exercises/week_03/IntegerStack.cpp | #include <iostream>
const int MAX_LENGTH = 1024;
class MyIntegerStack {
private:
int arr[MAX_LENGTH];
int lastIndex;
public:
MyIntegerStack() {
lastIndex = 0;
}
int getLength() {
return lastIndex;
}
void push(int element) {
arr[lastIndex] = element;
lastIndex++;
}
int pop() {
if (lastIndex == 0... | TOOL | 0.936626 | 5.45011 |
cf1923d2-8b3e-4a5c-822b-191d992e92d7 | gexiannan2/testwebsocket | include/boost_1_85_0/libs/compute/perf/perf_uniform_int_distribution.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/container/vector.hpp>
#include <boost/compute/random/default_random_engine.hpp>
#include <boost/compute/random/uniform_int_distribution.hpp>
#include "perf.hpp"
namespace compute = boost::compute;
... | TOOL | 0.895638 | 3.90948 |
a38ede78-8a63-4f5e-9abc-f99304125f96 | vineethkumart/snippet | graph/bellman_ford.cpp | /*
* Single source shortest path on a graph with -ve edge weight - O(VE)
* */
/* Dijkstra works in VlogV time like sorting as its greedy in nature. but works only on +ve edge weight graph
* This is a greedy approach and local optimal solution leads to global optimal as there are no -ve edge weights */
/* Bellman F... | ALGO | 0.99997 | 5.258433 |
9f7675d0-a284-4f1f-bf27-ae92aa709d77 | parkes811-inu/codetree-TILs | 240218/부분 문자열의 개수/number-of-substrings.cpp | #include <iostream>
using namespace std;
string a, b;
int cnt;
int main() {
// 여기에 코드를 작성해주세요.
cin >> a >> b;
for(int i = 0; i < a.size() - 1; i++) {
if(b[0] == a[i] && b[1] == a[i + 1]) {
cnt++;
}
}
cout << cnt;
return 0;
} | ALGO | 0.999985 | 4.307753 |
11bd90f7-e07d-456a-8e45-7ed153bbcd1f | cicuvc/LLVM-LA32R | clang/lib/StaticAnalyzer/Core/Z3CrosscheckVisitor.cpp | #include "clang/StaticAnalyzer/Core/BugReporter/Z3CrosscheckVisitor.h"
#include "clang/StaticAnalyzer/Core/AnalyzerOptions.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SMTConv.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/SMTAPI.h"
#incl... | ALGO | 0.960934 | 7.681513 |
c3d857da-b15b-4fb2-82be-73b0898424a8 | ishandutta2007/codeforces | nikolapesic2802/normal/1102/D.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define ll long long
#define pb push_back
#define sz(x) (int)(x).size()
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(), x.end()
using namespace std;
using namespac... | ALGO | 0.999991 | 4.146707 |
50c2cc9f-0d57-4a64-875c-f1da9a3f9c36 | hachemite/c-Structure_de_donnees | cour et serie/cours_LDC_23_24.cpp | #include <stdio.h>
#include <stdlib.h>
// Dfinition de la structure d'un lment
typedef struct Element {
int donnee; // Donne stocke dans le nud
struct Element* ptr_precedent; // Pointeur vers le nud prcdent dans la liste
struct Element* ptr_suivant; // Pointeur vers le nud suivant dans... | ALGO | 0.998938 | 3.935007 |
305940bc-463a-4df5-93ab-5fea34ae9c1e | klasa3D/Prace2023 | Wiktor Dąbrowski.cpp | #include <iostream>
using namespace std;
//#include <ctime>
/*class samochod {
public;
};*/
int main()
{
srand(time(NULL));
int tab[100];
for (int i = 0; i < 100; i++) {
tab[i] = rand() % 99 + 1;
tab[0] = 999;
tab[99] = 999;
cout << tab[i] << ",";
}
}
| ALGO | 0.991168 | 3.460104 |
9ca03f6e-aaef-4e2b-a388-4d213fcb4dfc | raaakibul/Data-Structure-and-Algorithm | Algorithm/binary_search.cpp | #include<bits/stdc++.h>
using namespace std;
int binarySearch(int a[], int size, int target) {
int left = 0;
int right = size - 1;
while(left <= right) {
int mid = left + (right - left) / 2;
if(a[mid] == target)
return mid;
else if(a[mid] < target)
left = m... | ALGO | 0.999889 | 6.336245 |
a9b01acc-8827-4ad9-8719-a21ee4a2d46d | pnnv/hyprland-dotfiles | VSCodium/User/History/-7262231b/1329.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int32_t main() {
ios::sync_with_stdio(false); cin.tie(0);
int n, m; cin >> n >> m;
vector <vector <pair <int, int>>> g(n);
for(int i = 0; i < m; i++) {
int a, b; char c; cin >> a >> b >> c;
g[a - 1].push_back({b - 1, int(c - 'a')});
}
ve... | ALGO | 0.999943 | 4.928187 |
4ea3dba2-88c7-4143-8256-f5f84427d1e0 | Geeteshsood/leetcode | 1143-longest-common-subsequence/1143-longest-common-subsequence.cpp | class Solution
{
public:
int inor(int i1, int i2, string &text1, string &text2, int n1, int n2, vector<vector<int>>&v)
{
if(i1>=n1 || i2>=n2)
{
return 0;
}
if(v[i1][i2]!=-1)
{
return v[i1][i2];
}
if(text1[i1] == text2[i2])
{
v[i1][i2... | ALGO | 0.999987 | 5.976741 |
d45703d0-03fe-4728-b237-919215ceedc9 | Uvacoder/aaa-projects-collect | C++/Tree Isomorphism I.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
map<vector<int>,int> mp;
int idx = 0;
int dfs(int s, int p, vector<int> adj[]) {
vector<int> v;
for (auto i: adj[s]) {
if (i != p)
v.push_back(dfs(i, s, adj));
}
sort(v.begin(), v.end());
if... | ALGO | 0.999923 | 5.188097 |
3df8c6e8-c1ea-4f91-b799-6036615018fc | armaan-monga/DSA | 0242-valid-anagram/0242-valid-anagram.cpp | class Solution {
public:
bool isAnagram(string s, string t) {
if (s.length() != t.length())
return false;
sort(s.begin(), s.end());
sort(t.begin(), t.end());
if(s==t) return true;
else return false;
}
}; | ALGO | 0.999987 | 6.03933 |
cea5de4c-e071-4f90-a8b2-2bf3b9d9455b | Foam2702/vietpham | DSA/5.5/(Week04)Sort/20120155/Bai1.1/Source.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<int> interchangesort(vector<int>&arr)
{
int size = arr.size();
for (int i = 0; i < size - 1; i++)
{
for (int j = i + 1; j < size; j++)
{
if (arr[i] > arr[j])
{
swap(arr[i], arr[j]);
}
}
}
return arr;
}
void ExportArr(vector<int> ... | ALGO | 0.999875 | 3.873645 |
bfe1a975-72af-47c3-947b-fa99a5181d08 | ghc4/aulas | CPP/Sources/Financeira/Investimento.cpp | #include <iostream>
using namespace std;
int main() {
int n;
double i, pv, pmt, fv;
cout << "N: "; cin >> n;
cout << "I: "; cin >> i;
cout << "PV: "; cin >> pv;
cout << "PMT: "; cin >> pmt;
fv = pv;
while(n-- > 0) {
fv = fv*(1+(i/100))+pmt;
}
cout << "FV : " << fv <<... | ALGO | 0.993859 | 3.639352 |
e80c6f6b-ede1-4152-a947-b7dc9759ce42 | lighted-zsz/c-learing | water-flower-num.cpp | # include <iostream>
using namespace std;
int main(){
//ˮɻ
int a,b,c,d;
cout<<"please inter a num";
cin>>d;
a = d%10;
b = (d/10)%10;
c = d/100;
if(d == a*a*a+b*b*b+c*c*c){
cout<<d<<" is the flower number";
}
elsez
cout<<d<<"is not a flower number";
}
| ALGO | 0.998991 | 3.715248 |
2c51d4b3-c03d-4da0-89f6-ce9536d7fc81 | Pulkit-Pandey-09/MY-DS-ALGO-CODES | 62-unique-paths/62-unique-paths.cpp | class Solution {
public:
int solve(int i, int j, int m, int n, vector<vector<int>> &dp)
{
// base case
if(i >= m || j >= n) return 0;
if(i == m-1 && j == n-1) return 1;
if(dp[i][j] != -1) return dp[i][j];
return dp[i][j] = solve(i+1, j, m, n, dp) + solve(i, ... | ALGO | 0.999972 | 6.431992 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.