uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7f8f8fb6-2460-4675-95bf-cad43eade71a | IEIAuto/AutoDRRT | src/autodrrt.core/ros2_opt/src/extra/Lanelet2-master/lanelet2_validation/tools/lanelet2_validate/main.cpp | #include "lanelet2_validation/Cli.h"
int main(int argc, char* argv[]) {
auto config = lanelet::validation::parseCommandLine(argc, const_cast<const char**>(argv)); // NOLINT
return lanelet::validation::runFromConfig(config);
}
| TOOL | 0.885431 | 6.079924 |
00986412-bd25-44f4-84c5-e0683614d497 | GH-Edifire/GH-JK-practice-problems | LeetCode/C++/Problem 38.cpp | // LeetCode: Problem 38
// Jonathan Kosasih
/*
The count-and-say sequence is the sequence of integers with the first five terms as following:
1. 1
2. 11
3. 21
4. 1211
5. 111221
1 is read off as "one 1" or 11.
11 is read off as "two 1s" or 21.
21 is read off as "one 2, then one 1" or 1211.
Given an... | ALGO | 0.999949 | 6.879142 |
5bdaa2f6-03fd-43f1-bef8-0e9cbdcc659c | 0x1d107/stft | unsupported/doc/examples/MatrixSquareRoot.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(2,2);
A << cos(pi/3), -sin(pi/3),
sin(pi/3), cos(pi/3);
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix square root of A is:... | ALGO | 0.999651 | 3.930508 |
cdce09c6-d774-4529-8782-881278a1bd4d | brunorabelo/URI-Online-Judge | Sum of Consecutive Even Numbers/Sum of Consecutive Even Numbers/main.cpp | #include <stdio.h>
int main(int argc, const char * argv[]) {
// insert code here...
int x;
scanf("%d",&x);
while (x!=0) {
int sum=0;
x=x%2==0?x:x+1;
for(int i=0;i<5;i++){
sum+=x+(2*i);
}
printf("%d\n",sum);
scanf("%d",&x);
... | ALGO | 0.999792 | 3.122988 |
beb5922f-66a2-4dcf-8195-07c7d69ee704 | akanksha-chokshi/photo-editor | opencv-python-4.5.3.56/opencv/modules/core/src/conjugate_gradient.cpp | #include "precomp.hpp"
#define dprintf(x)
#define print_matrix(x)
namespace cv
{
double MinProblemSolver::Function::getGradientEps() const { return 1e-3; }
void MinProblemSolver::Function::getGradient(const double* x, double* grad)
{
double eps = getGradientEps();
int i, n = getDims();
... | ALGO | 0.999983 | 6.233156 |
c8679107-8b35-4e56-bd54-70dcde2bfcfa | fierroformo/history-cp | Concursos/OmegaUp/Inter_2019_1/A_arbolNavidad.cpp | #include <bits/stdc++.h>
// https://omegaup.com/arena/problem/Arbol-de-navidad-estrellado#problems
using namespace std;
int main() {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int n;
cin >> n;
int tam = 2*n+1;
int tam2 = n+1;
int ele = -1;
for (int i = 0; i < tam2; i++) {
... | ALGO | 0.999941 | 3.318618 |
2230d51d-318c-43d0-bfcc-727c72722aa9 | TejashwiniV/ADA_Programs | 6/6a_N-Queens.cpp | /*6a.Solving N-Queens Problem using backtracking*/
#include <bits/stdc++.h>
using namespace std;
int x[100];
int flag = false;
bool place(int k, int i){
for(int j=1;j<k;j++){
if(x[j] == i || (abs(i - x[j]) == abs(j-k))){
return false;
}
}
return true;
}
void NQueens(int k,int n)... | ALGO | 0.999661 | 5.583812 |
2ceedc7d-0f9a-409a-95ad-139585f24f25 | LeifKingston/roboc | examples/anymal/trotting.cpp | #include <string>
#include <memory>
#include "Eigen/Core"
#include "idocp/solver/ocp_solver.hpp"
#include "idocp/robot/robot.hpp"
#include "idocp/cost/cost_function.hpp"
#include "idocp/cost/configuration_space_cost.hpp"
#include "idocp/cost/time_varying_task_space_3d_cost.hpp"
#include "idocp/cost/time_varying_com_c... | ALGO | 0.999144 | 5.689092 |
6ac514b2-c45c-4d88-98fb-8d2a442a91d2 | xueyeduling/LeetCode-Problems | leet_code/354maxEnvelopes.cpp | #include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>
using namespace std;
int maxEnvelopes(vector<vector<int>>& envelopes) {
if (envelopes.empty()) return 0;
int n = envelopes.size();
sort(... | ALGO | 0.999938 | 5.757347 |
d2c4c361-af91-4297-a013-b7c87957c2ee | arafat-hasan/problem-solving | Contests/Codeforces/879/A/A.cpp | /*
* FILE: /media/Softwares/Programming/ACM/Contests/Codeforces/879/A/A.cpp
*
* @author: Arafat Hasan Jenin <arafathasanjenin[at]gmail[dot]com>
*
* LINK:
*
* DATE CREATED: 26-10-17 20:53:00 (+06)
* LAST MODIFIED: __last_modified
*
* DESCRIPTION:
*
* DEVELOPMENT HISTORY:
* Date Version Descripti... | ALGO | 0.999976 | 4.081438 |
d5a91ca0-fdc0-4bd9-924f-5dfa897ed709 | MChuduk/OS2 | Laba12/Laba12/Laba12/Laba12.cpp | #include <iostream>
#include <windows.h>
HANDLE hHeap;
int N;
int* array = nullptr;
void PrintArray();
void DrawMenu();
void AddValueRight(int value);
void DeleteValueRight();
void InsertValue(int index, int value);
void DeleteValue(int index);
int main()
{
std::cout << "Array elements count: ";
std::cin >> N;
s... | ALGO | 0.999184 | 4.023295 |
ac29292c-4644-4358-98b5-38c6312d6835 | GrapheneOS/platform_external_dng_sdk | source/dng_spline.cpp | /*****************************************************************************/
/*****************************************************************************/
/* $Id: //mondo/dng_sdk_1_4/dng_sdk/source/dng_spline.cpp#1 $ */
/* $DateTime: 2012/05/30 13:28:51 $ */
/* $Change: 832332 $ */
/* $Author: tknoll $ */
/****... | ALGO | 0.999918 | 6.860136 |
c5cbeaca-08b7-493d-a273-cf4bbf65c08c | Tako-San/ILab | Old_map/old/old_map.cpp | /*#include "map.h"
Map::Map() : root(nullptr)
{
}
Map::Map(size_t key, Data val)
{
root = new Node;
root->set(key, val);
}
Node * Map::add(size_t key, Data val)
{
if(root == nullptr)
{
root = new Node;
root->set(key, val);
return root;
}
else
{
return root-... | ALGO | 0.980124 | 3.569627 |
03a3a0a1-498b-49fa-9999-e63204449d99 | TechTycoon-Jitu/LoveBabbarDSA | Lecture-100-Kosarajus-Algorithm-for-strongly-connected-components/Kosarajus.cpp | #include<bits/stdc++.h>
void dfs(int node,stack<int>&st,unordered_map<int,bool>&vis,unordered_map<int,list<int>>&adj)
{
vis[node] = true;
for(auto i: adj[node])
{
if(!vis[i])
{
dfs(i, st, vis, adj);
}
}
st.push(node);
}
void revdfs(int node,unordered_map<int,bool>&vis,unordered_map<int,list<int>>&adj)
{
... | ALGO | 0.999624 | 5.562452 |
7cefcded-87fe-4a6a-acdc-14fba2dfaaaa | NguyenMinhTri0000/FresherEmbedded_TriNguyen | bai1_Toado2D.cpp | #include <stdio.h>
#include <stdint.h>
#include <math.h>
class Coordinates{
private:
uint8_t coordinateX;
uint8_t coordinateY;
public:
Coordinates( uint8_t x = 0, uint8_t y = 0);
void setCoordinateX( uint8_t x);
void setCoordinateY( uint8_t y);
uint8_t getCoordi... | ALGO | 0.973356 | 4.340003 |
94127e25-4f04-45ed-8aa0-89a5d3b637a7 | Aabhiraj412/Sorting-Techniques-Visualizer | BubbleSort.cpp | #include <bits/stdc++.h>
#include <unistd.h>
using namespace std;
void printVerticalBars(const vector<int> &arr, int cur = -1, int next = -1, unordered_set<int> sorted = {})
{
#ifdef _WIN32
system("cls");
#else
system("clear");
#endif
static int step = 0;
cout << "Step: " << step++ << "\n";
cout ... | ALGO | 0.999521 | 5.191079 |
b67670f3-3428-4ee0-ae09-48471c6e3707 | externref/AdventOfCode | 2024/cpp/day4.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <vector>
const std::string FILENAME = "inputs/2024/day4.txt";
std::vector<std::string> grid;
bool check_direction(int row, int col, int dr, int dc,
const std::string &target, int rows, int cols) {
for (int i = 0; i < target.leng... | ALGO | 0.99586 | 6.333592 |
55a9a88a-4872-4983-971a-f1d06c3836ca | CHiiii5640/2023aaia3 | week14/week14-2.cpp | class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
ListNode *ans=new ListNode(); //dzฦฆns
ListNode *now=ans; //{bnBznnode
int carry=0;
while(l1 != nullptr && l2!= nullptr)//list1xฦปs ans now
{
int here=l1->val+ l2->val +carry;
... | ALGO | 0.999777 | 6.070894 |
1679fcd0-4df3-4a5a-9ff9-3b135e26d588 | dadm-projekt/dadm-cpp | eigen-3.3.7/doc/special_examples/Tutorial_sparse_example_details.cpp | #include <Eigen/Sparse>
#include <vector>
#include <QImage>
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
typedef Eigen::Triplet<double> T;
void insertCoefficient(int id, int i, int j, double w, std::vector<T>& coeffs,
Eigen::VectorXd& b, con... | ALGO | 0.998844 | 5.388735 |
6520d5c0-7e22-4230-a462-5d978c688a89 | zjmoo123/LeetCode | LeetCode/HammingDistance.cpp | #include "stdafx.h"
#include "HammingDistance.h"
#include <iostream>
#include <list>
using namespace std;
HammingDistance::HammingDistance()
{
}
HammingDistance::~HammingDistance()
{
}
int HammingDistance::GetHammingDistance(int x, int y)
{
list<int> vx;
list<int> vy;
int z = 0, m = 0;
while (x != 0 || y != 0)
... | ALGO | 0.999963 | 4.986969 |
09b1c639-783a-49eb-b60a-b93a1e44f3e0 | busecansuuu/saglik_app_buse | flutter_gradient_example/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.998838 | 6.785645 |
06444471-236d-4af4-b4c9-4137dc5cd0e6 | cuzoaru90/programmable-calculator | Calculator.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <math.h>
#include <stdlib.h>
using namespace std;
#include "Expression.h"
#include "BinaryExpr.h"
#include "LogExpr.h"
double UpdateRegister(string a)
{
return atof(a.substr(2).c_str());
}
double determineReceiver(string a, double... | TOOL | 0.875504 | 3.977984 |
ab4c63da-7da5-4140-8c6c-81aea7c2fd27 | diegojoel301/Programacion_Competitiva | ICPC/contest_1/descomponer_tiempo/main.cpp | #include<iostream>
using namespace std;
int main()
{
int N, hrs, min, seg;
cin >> N;
hrs = N / 3600;
min = (N - (hrs * 3600)) / 60;
seg = (N - (hrs * 3600) - (min * 60));
cout << hrs << " " << min << " " << seg << "\n";
return 0;
} | ALGO | 0.976884 | 3.409477 |
06b5ca78-b0f8-44ec-b0b5-1852578cff15 | ShubhamPokhariyal/cpp_questions | cpp_questions/convertToWave.cpp | #include<iostream>
using namespace std;
int main(){
int n;cin >>n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int id = 0;
int wave[n];
for (int i = 1; i < n; i+=2)
{
wave[id] = arr[i];
id++;
wave[id] = arr[i-1];
id++;
}
... | ALGO | 0.999995 | 3.634037 |
286e74be-8465-46d3-8dff-043c9bab4e67 | noureldin-khaled/workspace | C++/UVA/e-Coins.cpp | #include <bits/stdc++.h>
#define INF 1000000000
#define EPS 1e-9
using namespace std;
int n;
double s;
int convensional[45];
int infoTech[45];
int dp[42][301][301];
int rec(int index, int conv, int info);
double calc(int c, int i);
int main()
{
int t;
scanf("%i",&t);
while(t--)
{
scanf("%i%lf",&n,&s);
for (... | ALGO | 0.999747 | 3.324278 |
f2fb6319-4eae-40d7-8ea9-eec945d713d6 | HKJay/2024_data_structure_experiment | 10.2(no filecode).cpp | /*
#include <iostream>
using namespace std;
class HuffmanTree;
template<class T>
class MinHeap
{
public:
explicit MinHeap(int cap = 10);
~MinHeap();
void insert(const T& value);
void remove();
T& getMin();
bool empty() const { return size == 0; };
private:
T* data;
int size;
i... | ALGO | 0.999356 | 4.37685 |
848897f4-9569-4cb5-a172-7f1b7e87d642 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_12508_6.cpp | #include <bits/stdc++.h>
using namespace std;
struct student {
int ab, in;
student(int a, int i) {
ab = a;
in = i;
}
};
bool operator<(student a, student b) { return a.ab > b.ab; }
set<student> _set;
int l_routes[200 * 1000 + 100];
int r_routes[200 * 1000 + 100];
int commands[200 * 1000 + 100];
int mas[20... | ALGO | 0.999997 | 3.390642 |
a2328fab-1ce5-47da-8a28-84e3121d2490 | samuraiexx/competitiveProgramming | cf/699/b.cpp | #include<bits/stdc++.h>
#define st first
#define nd second
using namespace std;
const int N = 1e3 + 1;
int hp[N], vp[N];
vector<pair<int, int>> bombs;
int main(){
int n, m;
bool ok = 1;
cin >> n >> m;
for(int i = 1; i <= n; i++)
for(int j = 1; j <= m; j++){
char c;
cin >> c;
if(c == '*')... | ALGO | 0.99995 | 3.440413 |
7928b40d-5d6f-4c43-91b8-fbaa9e9c7e15 | wincle626/HLS_Bambu | ext/flopoco/src/IntAddition/CarryGenerationCircuit.cpp | #include <cstdlib>
#include <iostream>
#include <sstream>
#include <vector>
#include <math.h>
#include <gmp.h>
#include <mpfr.h>
#include <gmpxx.h>
#include "../utils.hpp"
#include "../Operator.hpp"
#include "CarryGenerationCircuit.hpp"
using namespace std;
namespace flopoco{
CarryGenerationCircuit::CarryGenerationC... | ALGO | 0.967362 | 4.795192 |
eb45e7da-27ea-4bf0-9155-380427564600 | banimania/CompetitiveProgramming | AceptaElReto/ElAlcanceDeLasHistorias.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
int alcance = INT_MIN;
int maximo = INT_MIN;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
if (maximo != INT_MIN) alcance = max(alcance, maximo - x);
maximo = max(x, maximo);
}
cout << alcance << endl;
}
in... | ALGO | 0.999635 | 4.948174 |
65e72a2f-b31f-486b-9405-82cb1d948711 | yangmingchaoyang/C-Data-Structure-and-Algorithm | low/day7/Code06_MadianQuick.cpp | /*
ไธไธชๆฐๆฎๆตไธญ๏ผ้ๆถๅฏไปฅๅๅพไธญไฝๆฐ
*/
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
class MedianHolder {
private:
std::priority_queue<int, std::vector<int>, MaxHeapComparator> maxHeap;
std::priority_queue<int, std::vector<int>, MinHeapComparator> minHeap;
void modifyTwoHeapsSize() {
... | ALGO | 0.999989 | 5.625871 |
4e736747-67ad-44e8-8faa-4a71c230fa75 | AlexM5150/CplusplusCourse | CECS-282/lab5/main.cpp | #include <time.h>
#include <iostream>
#include <algorithm>
using namespace std;
int sort6(int &a, int &b, int &c, int&d, int&e, int &f){
int arr [6] = {a, b, c, d, e, f};
int size = sizeof(arr) /sizeof(arr[0]);
sort(arr, arr+size);
int sum = 0;
cout<< "After sorting:"<<endl;
for (int i = 0; i < 6; i++){... | ALGO | 0.9986 | 3.564393 |
7caf066a-8c9a-4f45-8d15-47f15043e861 | sktasnim2005/CodeForces-Solution | Cloud_Watching.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ii int
#define ss string
#define dd double
void solve() {
ii a,b;
cin >> a >> b;
cout << ((3*a <= b) ? "Rain" : "Dry") << endl;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
// int t;cin >> t;while (t--)
... | ALGO | 0.999751 | 4.329679 |
554d1544-e0b4-4adf-8f9a-5cfed02120b6 | opcoinx/OPCoinX | src/qt/rpcconsole.cpp | #include "rpcconsole.h"
#include "ui_rpcconsole.h"
#include "bantablemodel.h"
#include "clientmodel.h"
#include "guiutil.h"
#include "peertablemodel.h"
#include "chainparams.h"
#include "main.h"
#include "rpc/client.h"
#include "rpc/server.h"
#include "util.h"
#ifdef ENABLE_WALLET
#include "wallet/wallet.h"
#endif //... | TOOL | 0.860568 | 5.921899 |
4ece0791-19aa-410e-8001-292f40159106 | OpenGVLab/InternVL-MMDetSeg | mmcv/mmcv/ops/csrc/parrots/nms_parrots.cpp | #include "nms_pytorch.h"
using namespace parrots;
// Tensor nms(Tensor boxes, Tensor scores, float iou_threshold, int offset);
template <typename T>
void nms_parrots(T& ctx, const SSElement& attr,
const OperatorBase::in_list_t& ins,
OperatorBase::out_list_t& outs) {
float iou_thres... | ALGO | 0.973663 | 6.314246 |
3a5d11a0-723a-44e9-a7f0-ec5a2e400aaf | RISHABH-GUPTA-RG/Competitive-Coding | A_Boy_or_Girl.cpp | #include <bits/stdc++.h>
int main()
{
std::unordered_set<char> f1;
std::string xxx;
std::cin >> xxx;
for (char i : xxx)
{
f1.insert(i);
}
(f1.size() & 1) ? std::cout << "IGNORE HIM!" : std::cout << "CHAT WITH HER!";
} | ALGO | 0.999784 | 4.248819 |
0481b8dd-404a-44e8-b7e6-b6ee196fc652 | PrinceOjha0/introduction-of-c-- | introduction_of_c++/Lecture 4 Patterns/Square Pattern.cpp | /*
Print the following pattern for the given N number of rows.
Pattern for N = 4
4444
4444
4444
4444
Input format :
Integer N (Total no. of rows)
Output format :
Pattern in N lines
Constraints
0 <= N <= 50
Sample Input 1:
7
Sample Output 1:
7777777
7777777
7777777
7777777
7777777
7777777
7777777
Sample Input 1:
6
Sampl... | ALGO | 0.999934 | 4.337284 |
26cae4b2-db3b-4817-964b-775e4d7571f4 | AaronWu-train/EE1004-homework | homework7/hw7_5_set.cpp | /*
* Homework: Homework 7 - Problem 5
* Title: Set Operation
* Author: Aaron Wu (B13901011)
* Date: 2024-11-13
*/
#include <iostream>
#include <iomanip>
#include <set>
using namespace std;
set<int> onion( const set<int> &a, const set<int> &b ) {
set<int> ret = a;
for (const int &i : b) {
ret.insert(i);
}... | ALGO | 0.999727 | 4.622433 |
c35f8ee9-d96e-49c2-b923-e23752ceee9c | RinCloud/TrickCatcher | Datasets/TrickyBugs/GenProgs/dpp_generated_progs_cpp/p03013/p03013_num5_parsed.cpp | #include <iostream>
#include <vector>
using namespace std;
const int mod = 1000000007;
int main() {
int N, M;
cin >> N >> M;
vector<bool> broken(N+1, false);
for (int i = 0; i < M; i++) {
int a;
cin >> a;
broken[a] = true;
}
vector<int> dp(N+1, 0);
dp[0] = 1;
... | ALGO | 0.999981 | 4.53246 |
1c13057d-db14-49f7-9660-8acc98cb7878 | Pratim-Kumar-Hazarika/DSA-Prep | LinkedList/26-Sort-a-LL/main.cpp | #include<iostream>
#include<vector>
#include <queue>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int val){
data = val;
next = nullptr;
}
};
Node* convertToLL(vector<int>&arr){
Node* head = new Node(arr[0]);
Node* current = hea... | ALGO | 0.999988 | 5.734385 |
b29715b1-ced2-4930-8d82-b3255cb6cf0c | ishandutta2007/codeforces | mstczuo/normal/475/B.cpp | # include <iostream>
# include <cstdio>
# include <cstring>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
--n; --m;
char s[30], t[30];
cin >> s >> t;
bool flag = true;
if(s[0] == '>' && t[0] == 'v') flag = false;
if(s[0] == '<' && t[m] == 'v') flag = false;
if(s[n] == ... | ALGO | 0.999981 | 3.120295 |
2d0bad7a-b2b8-44ce-a2f8-e324d50bed5e | thieunguyenhuy/Notebook | Notebook/convex_hull_trick.cpp | struct ConvexHullTrick {
struct Line {
ll m, b;
Line(ll _m = 0, ll _b = 0) {
m = _m, b = _b;
}
ll eval(ll x) {
return m * x + b;
}
};
bool isBad(Line l1, Line l2, Line l3) {
// bad when x of (l1 x l3) < x of (l1 x l2)
assert(... | ALGO | 0.999966 | 5.143318 |
04fc777d-7cc9-4e98-a90c-e63e2f688ff9 | FlashForge/Orca-Flashforge | src/libslic3r/Arachne/BeadingStrategy/DistributedBeadingStrategy.cpp | #include "DistributedBeadingStrategy.hpp"
#include "libslic3r/Arachne/BeadingStrategy/BeadingStrategy.hpp"
namespace Slic3r::Arachne
{
DistributedBeadingStrategy::DistributedBeadingStrategy(const coord_t optimal_width,
const coord_t default_transition_length,
... | TOOL | 0.992985 | 6.358941 |
d1af0b39-74e0-4f11-8396-68b0afd2fe53 | Nitditto/Source-c-ptit | C++ ptit/tinhtongcacsotrogxau.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t; cin>>t;
cin.ignore();
while(t--){
string s; cin>>s;
long long sum=0;
for(int i=0;i<s.length();i++){
if(isdigit(s[i])) sum+=(s[i]-'0');
}
cout<<sum<<endl;
}
}
| ALGO | 0.99923 | 4.884401 |
7e259912-a5dd-458f-afee-db9d0f8d68e8 | cipher135/pcoding | spoj_rectangles.cpp | #include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
int count=0;
int h;
int w;
for(h=1;t-h*h>=0;h++){
for(w=h;t-h*w>=0;w++){
count +=1;
}
}
cout<<count<<endl;
return 0;
} | ALGO | 0.998995 | 3.213523 |
fa5ffcbb-31ae-4536-8328-4d63a90b538d | ankitmohapatra966/GFG_POTD_Solution | Closest Three Sum.cpp | class Solution {
public:
int threeSumClosest(vector<int> arr, int target) {
int dif=INT_MAX,ans=INT_MIN;
sort(arr.begin(),arr.end());
for(int i=0;i<arr.size();i++){
int start=i+1;
int end=arr.size()-1;
while(start<end){
int sum=a... | ALGO | 0.999995 | 6.252069 |
9f6372bf-9e62-4d3b-95c5-8f5429e9a8bd | shreyaschoudhari41/Graph | represent.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,e,a,b;
cin>>n>>e;
// n is used to make n sized vectors
// e is the number of edges
vector<int>graph[n];
for(int i=0; i<e; i++)
{
cin>>a>>b;
graph[a].push_back(b); //for directed graph
// graph[b].pu... | ALGO | 0.999899 | 3.71316 |
8b4f34c9-a4cb-49eb-adba-b151e0b3e1a2 | Mohit-106/DSA_Level_2 | Graph/38_ReconstructItinerary.cpp | // class Solution {
// public:
// void dfs(unordered_map<string,priority_queue<string,vector<string>,greater<string>>>&adj,stack<string>&st,string src){
// if(adj[src].size()==0){
// st.push(src);
// return;
// }
// while(adj[src].size()>0){
// s... | ALGO | 0.999986 | 6.003632 |
bc277407-75fb-46de-91dd-eb4c8be67ad6 | phantom23333/3D-Gaussian-Reconstruction | submodules/tetra-triangulation/CGAL-5.6.1/examples/Surface_mesh_skeletonization/simple_mcfskel_example.cpp | #include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/extract_mean_curvature_flow_skeleton.h>
#include <CGAL/boost/graph/split_graph_into_polylines.h>
#include <fstream>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 ... | ALGO | 0.902215 | 5.761168 |
cce96362-0d46-442b-a069-efdc728c20bb | codewith-usama/FAST-Resources | 2nd Semester/OPP Theory/C++/Class/Static/variables.cpp | #include<iostream>
using namespace std;
class A
{
public:
static int total, sum;
int cost;
A()
{
cost = 0;
++total;
}
A(int cost)
{
this->cost = cost;
sum += cost;
++total;
}
}; int A :: total = 0; int A :: sum = 0;
int main()
{
A ob1;
A ob2;
A ob3(500);
A ob4(550);
cout << "Num of ... | TOOL | 0.945489 | 4.380527 |
d0c32599-a9c3-4f68-b245-2bacdef93828 | Huste6/Thuat_toan_ung_dung | buoi_1/bai1_c2.cpp | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
bool checkphonenumber(const string& sdt){
return sdt.size() == 10;
}
int main(){
string cau; cin >> cau;
map<string,ll> call_from;
map<string,ll> call_time;
ll cnt = 0;
bool ok = true;
while(cau != "#"){
if(cau == "ca... | ALGO | 0.988304 | 3.568242 |
b45d1a11-e31e-408d-b3fd-30ccdb27ef48 | wujor01/Lab2 | Lab2.Bai10/Lab2.Bai10.cpp | #include <iostream>
#include <regex>
#include <string>
using namespace std;
int main()
{
//Kiแปm tra xem chuแปi nhแบญp vร o cรณ phแบฃi chแป gแปm cรกc chแปฏ cรกi in thฦฐแปng vร chแปฏ sแป, vร ฤแป dร i tแปซ 6 ฤแบฟn 20 kรฝ tแปฑ hay khรดng?
/* Description:
1. The \w matches any character in any case any number of times.
2. Then the \.|_ matches if ... | TOOL | 0.948898 | 4.820678 |
80d0b662-c73d-4434-b016-23b24b65c794 | sumit1894/DSA-With-CPP | 8L-Array-1.cpp | #include <bits/stdc++.h>
using namespace std;
void changeArrReference(int arr[], int size)
{
cout << "Function called" << endl;
for (int i = 0; i < size; i++)
{
arr[i] = arr[i] * 2;
}
}
int searchArrLinear(int arr[],int size,int target){
for(int i=0;i<size;i++){
if(arr[i]==target){
... | ALGO | 0.99833 | 4.336837 |
f53e73ba-1191-4ccc-863b-69a2555d8ccb | blockchainhelp-eu/ERC-Node-Install | i18n.cpp | #include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <string>
#include <map>
#include "include_base_utils.h"
#include "file_io_utils.h"
#include "common/util.h"
#include "common/i18n.h"
#include "translation_files.h"
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "i18n"
static c... | TOOL | 0.895744 | 6.175295 |
010667e2-b862-497a-9434-d491ff56dd9f | JpGeorgis/Projects | repos/optim2/projetm1/main.cpp | #include "PSO.h"
#include <time.h>
#include <thread>
#include <iostream>
#include <fstream>
#include<windows.h>
std::vector<double> lb = {};
std::vector<double> ub = {};
int popSize = 50;
int numDim = 10;
int numRun = 20;
const float phi = 3.1415;
std::ofstream fichierSortie;
std::vector<std::string> nomsFichiers = { ... | ALGO | 0.999713 | 4.121901 |
69b0bb8f-bc5d-4d75-8c99-de48e8498491 | Gopal-Dahale/C-plus-plus-STL | List and Forward List STL/forward_list.cpp | // forward list is a singly linked list
// drawback is direct access to element is not possible
#include <iostream>
#include <forward_list>
using namespace std;
// utility function to print forward list
template <typename T>
void print(forward_list<T> &s)
{
for (auto &i : s)
cout << i << " -> ";
cout... | TOOL | 0.998721 | 4.812288 |
c5ef03f7-1d3b-4d39-8168-dfde3cc65f45 | RinCloud/TrickCatcher | Datasets/TrickyBugs/GenProgs/dpp_generated_progs_cpp/p02735/p02735_num7_parsed.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<string> grid(H);
for(int i=0; i<H; i++) {
cin >> grid[i];
}
int count = 0;
for(int i=0; i<H-1; i++) {
for(int j=0; j<W-1; j++) {
if(grid[i][... | ALGO | 0.999731 | 4.578413 |
0def770d-c578-46bd-8fd3-d3baf6045033 | SSKsaan/Problem-Solving | Codeforces/BoyOrGirl.cpp | #include <bits/stdc++.h>
using namespace std;
//#define int long long
#define endl "\n"
#define SSK ios_base::sync_with_stdio(0); cin.tie(0);
int count(char* str)
{
int hash[128] = { 0 };
int i, c = 0;
for (i = 0; i < strlen(str); ++i)
hash[str[i]] = 1;
for (i = 0; i < 128; ++i)
c += hash[i];
return... | ALGO | 0.994725 | 3.98871 |
4e43fdc8-68f8-4095-803a-1ca9812aa69f | StepanPotiienko/Boom-Science-App | 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 |
b600b010-6756-4920-8fa9-ccb15802dcb8 | ishandutta2007/codeforces | rg_gr/normal/1334/F.cpp | // Problem: F. Strange Function
// Contest: Codeforces - Educational Codeforces Round 85 (Rated for Div. 2)
// URL: https://codeforces.com/problemset/problem/1334/F
// Memory Limit: 256 MB
// Time Limit: 3000 ms
//
// Powered by CP Editor (https://cpeditor.org)
// - /
/*
+
++
+++
++++
+++++
++++++
+++++++
++++++++
... | ALGO | 0.999973 | 3.729644 |
ed5bbed3-6b13-4713-9012-65c369a35c32 | SHEWANTSME/PS | BOJ/Bronze:Platinum/33990.cpp | // 3๋ 512 - B3 - 2025.05.25
#include<iostream>
#include<queue>
using namespace std;
int n;
priority_queue <int, vector<int>, greater<int> > pq;
int main(){
cin>>n;
while(n--){
int a,b,c;cin>>a>>b>>c;
if(a+b+c-512<0)continue;
else{
pq.push(a+b+c);
}
}
if(not pq... | ALGO | 0.999638 | 4.110382 |
a615b509-cbcc-4fbf-8a9c-ba9a121081da | marysaka/mina32-llvm | llvm/lib/CodeGen/ProcessImplicitDefs.cpp | #include "llvm/ADT/SetVector.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetSubtargetInf... | TOOL | 0.960578 | 7.633109 |
bffa19ae-9970-47d8-9ea5-091a42296bbd | eloiJhn/T-DEV-600-NAN_2 | 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.9988 | 6.76073 |
7c0265be-fc3d-4f15-b39e-d95b262cdc31 | Vasanth-Korada/DS-Algo-Hacktoberfest | DS-Algo/Searching/staircase_search.cpp | #include<iostream>
using namespace std;
int main(){
int n;
int val = 1;
cin >> n;
int a[10][10];
for(int i = 0;i < n;i++){
for(int j = 0;j < n;j++){
a[i][j] = val;
val++;
}
}
for(int i = 0;i < n;i++){
for(int j = 0;j < n;j++){
cout<<a[i][j]<<" ";
}
cout<<endl;
}
int key;
cout<<"Enter Key... | ALGO | 0.99952 | 3.220956 |
c508a388-4041-4ef4-b8f5-b8a58f838958 | ZhengkaiXu/PAT | 1025.cpp | //
// Created by ZhengkaiXu on 2024/8/21.
//
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int first, k, n, temp;
cin >> first >> n >> k;
int data[100005], next[100005], list[100005];
for (int i = 0; i < n; i++) {
cin >> temp;
cin >> data[temp] >> next[temp];... | ALGO | 0.999965 | 3.496378 |
3412a859-55fd-4510-bad1-63a04b833870 | BonexGoo/Boss2D | Boss2D/addon/opencv-3.1.0_for_boss/samples/cpp/houghlines.cpp | #include BOSS_OPENCV_U_opencv2__imgcodecs_hpp //original-code:"opencv2/imgcodecs.hpp"
#include BOSS_OPENCV_U_opencv2__highgui__highgui_hpp //original-code:"opencv2/highgui/highgui.hpp"
#include BOSS_OPENCV_U_opencv2__imgproc__imgproc_hpp //original-code:"opencv2/imgproc/imgproc.hpp"
#include <iostream>
using namespac... | TOOL | 0.944629 | 5.042792 |
51db2fad-3738-497a-bfe6-5144b2c3bd2f | zyadfahmy2/My-Courses | ProblemSolving/codeforces/sheet3/frequencyArray.cpp | #include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
int n, m;
cin >> n >> m;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
// int count = 0;
// sort(arr, arr + n);
// int j = 1;
// bool flag = false;
// ... | ALGO | 0.999976 | 3.530441 |
81810c29-5479-4ed4-af15-590283093850 | mabiju/b2cpp | C_Control_Statement/UsingOOP/d_jump/d_continue_do_while.cpp | #include <iostream>
using namespace std;
class ContinueDoWhile
{
int a = 0;
public:
void output()
{
do
{
a++;
if (a == 4)
{
continue;
}
else
{
cout << a << endl;
}
}... | ALGO | 0.980435 | 4.422684 |
2cf85708-8604-43f9-b1ff-3cd3a83ff844 | norkish/CS_1181_cpp | f23/ch7/geneticAlgorithm.cpp | #include <iostream>
#include <climits>
#include <random>
using namespace std;
static std::random_device random_dev;
static std::mt19937 rng(random_dev());
int STRING_LEN = 5;
int randomInteger() {
std::uniform_int_distribution<std::mt19937::result_type> dist(0, INT_MAX);
return (int)dist(rng);
}
string get... | ALGO | 0.999279 | 5.240844 |
aabb9fe8-daca-49a6-812f-abaf70ee92ef | jsuwo/cs3307a | lectures/2012-09-24/9-reverse_vector/reverse.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using std::cout;
using std::endl;
using std::reverse;
using std::vector;
main()
{
vector<int> v;
v.push_back(1);
v.push_back(2);
v.push_back(3);
v.push_back(4);
v.push_back(5);
reverse(v.begin(), v.end());
for (int i = 0; i < v.size(); ++i)
... | ALGO | 0.99973 | 4.300767 |
d4fe29d4-d543-4094-b0dc-fb6f6a12a0dd | mfkiwl/AlgorithmsData | DataStructures/Stack/CheckParenthesisBalanced.cpp | /*
https://www.geeksforgeeks.org/check-for-balanced-parentheses-in-an-expression/
Given an expression string exp, write a program to examine whether the pairs and the orders of โ{โ, โ}โ, โ(โ, โ)โ, โ[โ, โ]โ are correct in exp.
Example:
Input: exp = โ[()]{}{[()()]()}โ
Output: Balanced
Input: exp = โ[(])โ
Output: Not ... | ALGO | 0.994721 | 7.055811 |
60e670e7-6b2d-45f5-bd99-4d209fcbabef | vingoh/visual_odometry | src/test2.cpp | #include <algorithm>
#include <atomic>
#include <chrono>
#include <iostream>
#include <sstream>
#include <thread>
#include <dirent.h>
#include "opencv2/opencv.hpp"
//#include <opencv2/core/eigen.hpp>
#include <sophus/se3.hpp>
using namespace std;
using namespace cv;
using namespace Eigen;
using Timestamp_d = double;... | ALGO | 0.992686 | 4.708632 |
a47ce6e8-d4d6-4ef9-93fc-f81cf93fda87 | harshit-21012000/DSA | Arrays/DuplicateInArray/main.cpp | //Find duplicates in an array.
#include <iostream>
using namespace std;
int main()
{
int n;
cout<<"ENTER THE RANGE OF ARRAY : ";
cin>>n;
int a[n];
cout<<"ENTER THE ELEMENTS OF ARRAY : ";
for(int i=0;i<n-1;i++)
{
cin>>a[i];
}
for(int i =0 ;i<n;i++)
{
int... | ALGO | 0.996878 | 3.53722 |
851a8452-f93e-42ed-84ec-52bf30a70106 | nataliekemper/cs184-cel-shader | ext/nanogui/ext/eigen/bench/geometry.cpp |
#include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace std;
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 8
#endif
typedef SCALAR Scalar;
typedef NumTraits<Scalar>::Real RealScalar;
typedef Matrix<RealScalar,Dynamic,Dynamic> A;
type... | ALGO | 0.946707 | 5.941502 |
0226d5a3-cbc9-45d5-a707-d66b61adb797 | KujoStar/OOP | hw4/4-2/OperationMinus.cpp | #include "OperationMinus.h"
using namespace std;
void OperationMinus::UpdateValue(){
this->value_=input1->value()-input2->value();
} | TOOL | 0.943289 | 4.502366 |
5846f066-efc1-491b-8fc9-7a928c421129 | rahulkushwaha12/Programming-Codes | spoj-CATM.cpp | #include<bits/stdc++.h>
using namespace std;
int edge(int xx, int yy,int nn, int mm)
{
if((xx==1&&(yy>=1&&yy<=mm))||(xx==nn&&(yy>=1&&yy<=mm))||(yy==1&&(xx>=1&&xx<=nn))||(yy==mm&&(xx>=1&&xx<=nn)))
{
return 1;
}
else
return 0;
}
int main()
{
int n,m;
cin>>n,m;
int arr[n+1][m+1];
int vim[n+1][m+1],vic1[n+1][m+... | ALGO | 0.999879 | 3.568366 |
e86b3b9c-d6b0-4768-b644-074bd6de0dd2 | okedane/dicoding-flutter-fudamental | notification_app/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.998939 | 6.76775 |
361b75fb-6f2d-4f3a-944b-5b6f40624ab5 | devoln/Intra | Intra/Audio/Synth/Filter.cpp | #include "Filter.h"
#include "Cpp/Warnings.h"
#include "Container/Sequential/Array.h"
#include "Types.h"
#include "Range/Mutation/Transform.h"
#include "Range/Reduction.h"
#include <stdio.h>
INTRA_PUSH_DISABLE_REDUNDANT_WARNINGS
namespace Intra { namespace Audio { namespace Synth {
FilterCoeffs FilterCoeffs::Calcul... | ALGO | 0.976319 | 5.48527 |
1bf03ac3-4439-4fdd-8508-2399c7c2a334 | ishandutta2007/codeforces | rxdoi/normal/449/C.cpp | #include<cstdio>
#include<cstring>
using namespace std;
const int Maxn=1e5+19;
int n,mch[Maxn],is_p[Maxn],Ans,tmp[Maxn],with[Maxn][2];
int main()
{
scanf("%d",&n);
memset(is_p,1,sizeof(is_p));
for (int i=3;i*2<=n;i++)
if (is_p[i])
{
int cnt=0;
for (int j=1;i*j<=n;j++)
{
is_p[i*j]=0;
if (!mch[... | ALGO | 0.999771 | 3.194209 |
7cb0afe9-ad8f-411e-aaf0-1b4c6c251486 | phantom23333/3D-Gaussian-Reconstruction | submodules/tetra-triangulation/CGAL-5.6.1/examples/Orthtree/octree_traversal_custom.cpp | #include <fstream>
#include <iostream>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Octree.h>
#include <CGAL/Point_set_3.h>
#include <CGAL/Point_set_3/IO.h>
// Type Declarations
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
typedef CGAL::Point_set_3<Point> Point_set;
typedef Point... | ALGO | 0.978929 | 6.839749 |
490cc080-4b32-4629-bd61-a8f51f224fba | bustercopley/advent2020 | 07.cpp | #include "precompiled.h"
#include "split.h"
#include "symbols.h"
auto regex1 = re::regex(R"(^(?:([^,.0-9]+) bags contain(.*)|(\d+),(\d+))$)");
auto regex2 = re::regex(R"(^ (\d+) ([^,.0-9]+) bags?[,.](.*)$)");
void parts(std::istream &stream, int part) {
bool test = false;
std::size_t result = 0;
std::size_t exp... | ALGO | 0.883309 | 5.94913 |
be1b2872-39d8-4fc0-94c3-df2694f1238d | ZhiCheng0326/SJTU-Cpp | past_year_exam/2014-2015/chip.cpp | #include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream infile;
ofstream outfile;
infile.open("chip.in");
outfile.open("chip.out");
int N,M, **arr, *temp, price = 0;
infile >> N >> M; //get first line
infile.ignore(1000,'\n');
arr = new int *... | ALGO | 0.999785 | 3.066907 |
3561bc7c-9df3-45c2-9fd7-6b6e9a987262 | hitarth-gg/CP | CodeForces/archive/1771B - Hossam and Friends.cpp | // clang-format off
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
/* ----------------------- int128 ----------------------- */
// typedef __int128 lll;
// istream &operator>>(istream &cin,... | ALGO | 0.999514 | 4.368625 |
89f09afc-639e-480b-bec4-a0d5d9b78af1 | varshithab05/LeetCode-Problems | 1463-the-k-weakest-rows-in-a-matrix/1463-the-k-weakest-rows-in-a-matrix.cpp | class Solution {
public:
vector<int> kWeakestRows(vector<vector<int>>& mat, int k) {
vector<pair<int,int>> soldiers;
// Calculate the sum of soldiers for each row and store in the min heap
for(int row = 0; row < mat.size(); row++) {
int soldierCount = findSoldierCount(mat[row]);
... | ALGO | 0.999985 | 6.304647 |
5b4528b8-5498-44a3-9234-8d3f910d6e69 | DhruvSharma4435/Coding | 0268-missing-number/0268-missing-number.cpp | class Solution {
public:
int missingNumber(vector<int>& nums) {
ios::sync_with_stdio(0);
int xor1 = 0, xor2 =0;
for(auto i : nums)
xor1 = xor1 ^ i;
for(int i = 0; i<= nums.size(); i++)
xor2 = xor2 ^i;
return xor1^xor2;
}
}; | ALGO | 0.999959 | 5.221332 |
9a4f6399-c468-49d6-b541-0094f563621a | egecoding/binary-tool | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
6baa5217-9ba7-4d30-8ddd-06f2106b23e1 | nxplatform/nx-mobile | thirdparty-cpp/boost_1_62_0/libs/multiprecision/example/cpp_int_import_export.cpp | #include <boost/multiprecision/cpp_int.hpp>
#include <iostream>
#include <iomanip>
#include <vector>
#include <iterator>
//[IE1
/*`
In this simple example, we'll import/export the bits of a cpp_int
to a vector of 8-bit unsigned values:
*/
/*=
#include <boost/multiprecision/cpp_int.hpp>
#include <iostream>
#include <... | TOOL | 0.899777 | 5.468755 |
91d16e7a-c34a-4050-8111-87c4adf13698 | Akash52/code-daily | CP/CP-Alogrthim/CPP-Exercise/CH-3/exe_9.cpp | #include<iostream>
using namespace std;
int main()
{
cout << "Spell out a number, please: ";
string text;
cin >> text;
if (text == "zero")
cout << 0 << '\n';
else if (text == "one")
cout << 1 << '\n';
else if (text == "two")
cout << 2 << '\n';
else if (text == "thre... | ALGO | 0.979084 | 3.806166 |
3079213a-8095-48a7-83bb-1bd23578002c | Simon-0801/CodeHome | ่ฎก่ๅฎข/่ฎญ็ป่็ๅจ่ต/15J.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <queue>
#define INF 0x3f3f3f3f
#define mst(a,num) memset(a,num,sizeof a)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repd(i,a,b) for(int i=a;i>=b... | ALGO | 0.996784 | 3.402586 |
a0ca5928-e7f2-4a30-bc04-269e995bc234 | Satyajeet5275/Data_Structures_and_Algorithms-Leetcode | 0721-accounts-merge/0721-accounts-merge.cpp | class DisjointSet
{
public:
vector<int> parent;
vector<int> rank;
vector<int> size;
DisjointSet(int n)
{
rank.resize(n+1,0);
size.resize(n+1,0);
parent.resize(n+1);
for(int i=0;i<=n;i++)
{
parent[i]=i... | ALGO | 0.999983 | 6.022382 |
89360327-93a9-42c1-a288-74fd927e8821 | nkteaching/assignment-2-k180121 | 5.29.cpp | #include<iostream>
using namespace std;
// i 0 to 4
void recurse(int i)
{
if(i > 5)
{
return;
}
else
{
cout << i << endl;
recurse(i+1) ;
}
}
int main()
{
int i=0;
recurse(i);
}
| ALGO | 0.999087 | 3.696074 |
2c0ee6e2-b181-4bf8-a789-4057ea2fbd52 | Anchal07777/DSA-LEETCODE-SOLUTIONS | 0027-remove-element/0027-remove-element.cpp | class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int k = 0;
for (int i = 0; i < nums.size(); i++) {
if (nums[i] != val) {
nums[k++] = nums[i];
}
}
return k;
}
};
| ALGO | 0.998392 | 6.299515 |
569cb4b3-3ebe-45e9-a403-4bdc7a1be4b4 | versenyi98/programming-contests | Other/Szavak/main.cpp | #include <iostream>
#include <map>
using namespace std;
map <char, int> szabad;
int n;
string szo;
string betuk;
string kovetkezo() {
map <char, int> szabad_cp = szabad;
// Nem teljes szรณ kรถvetkezลje
if (szo.length() != n) {
for (auto i : szabad_cp) {
if (i.second) {
re... | ALGO | 0.999984 | 3.998174 |
2644ca1a-29a8-410d-aa3d-c562a84b9979 | Jaechan-So/ps-public | problems/leetcode/2300/2316.cpp | // 2316. Count Unreachable Pairs of Nodes in an Undirected Graph
// https://leetcode.com/problems/count-unreachable-pairs-of-nodes-in-an-undirected-graph/description/
using namespace std;
#include <map>
#include <numeric>
#include <vector>
class Solution {
public:
int getHead(vector<int> &heads, int i) {
int h... | ALGO | 0.999648 | 6.135814 |
1fffe6d2-e8cb-4824-a4a2-74f2d9388c94 | UserBits/OI-Codes | Luogu/P2658ๆฑฝ่ฝฆๆๅๆฏ่ต.cpp | #include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <queue>
#include <cstring>
using namespace std;
const int d[4][2]={{1,0},{0,1},{0,-1},{-1,0}};
int h[505][505],m,n,pi,pj,tx,ty;
bool f[505][505],t[505][505];
namespace my{
#define EOL putchar('\n')
#define SPACE putchar(32)
const int INF=214... | ALGO | 0.999971 | 3.593489 |
f5b19186-652a-476f-8538-5794e0a7746c | robertnen/LeetCode-problems-solved-by-me- | C++/custom_sort_string.cpp | #include <bits/stdc++.h>
/**
* Runtime: beats 100% of users with C++
* Memory: beats 26.14% of users with C++
* Daily problem (Streak 27)
*/
class Solution {
private:
int alphaValues[26];
public:
std::string customSortString(std::string order, std::string s) {
int len = order.length();
std:... | ALGO | 0.999969 | 6.182764 |
f03ce0f7-c409-44bc-8920-6cb89286d811 | bharat1611/VsCodeFiles | C++ Programs/Term Work/Q8.cpp | #include <iostream>
using namespace std;
class user_time
{
int h,m,s,sum;
public:
user_time()
{
h=0;
m=0;
s=0;
}
void getdata()
{
cin>>h>>m>>s;
}
void disp()
{
cout<<h<<":"<<m<<":"<<s<<endl;
}
void add(user_time c1,user_time c2)
{
... | ALGO | 0.959032 | 3.601239 |
e7d9664b-d090-43a0-866c-423bea41edd3 | ishandutta2007/codeforces | penguin1017/normal/1338/C.cpp | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define ll long long
#define lb(x) ((x)&(-x))
#define pii pair<int,int>
#define vi vector<int>
#define pb push_back
#define fi first
#define se second
#define de(x) cout<<#x<<" x"<<endl
#define LCAFA rep(i... | ALGO | 0.999946 | 3.548985 |
90ff04a6-69b8-453c-ac13-f55aa8db1943 | sakshamgoel-github/LeetCode-Solutions | 959RegionsCutBySlashes.cpp | #include <bits/stdc++.h>
using namespace std;
#define turbo ios_base::sync_with_stdio(false);cin.tie(NULL);
class Solution {
vector<int> parent;
vector<int> rank;
int count;
public:
int regionsBySlashes(vector<string>& grid) {
int n = grid.size();
int dots = n + 1;
parent.r... | ALGO | 0.99973 | 4.869563 |
8246ba9e-b46b-486f-888a-389acca47f71 | yashpatle23/Competitive_Programming | codechef/MAXSCORE7.cpp |
#include<bits/stdc++.h>
using namespace std;
int x,y,z;
#define ll long long int
#define int ll
int j,k;
#define loop(y) for (int i = 0; i < y; i++)
int mod=998244353;
// *min_element(arr, arr + n); *max_element(arr, arr + n);
//maxElementIndex = std::max_element(v.begin(),v.end()) - v.begin();
//__gcd(x,y) lcm=x*y/... | ALGO | 0.999963 | 4.800304 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.