uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
2c43bd94-2415-4851-a18d-c955eca30737
TomasKozak/BullsnCows
BullCowGame/main.cpp
/* This is the console executable, that makes use of the BullCow class */ #include <iostream> #include <string> #include "FBullCowGame.h" using FText = std::string; using int32 = int; void PrintIntro(); void PlayGame(); FText GetValidGuess(); bool AskToPlayAgain(); void PrintGameSummary(); FBullCowGame BCGame; //...
TOOL
0.85148
5.958827
b834de1a-de31-45b8-8fe4-fe3959af0448
wellexam/leetcode
96.cpp
#include "regular_headers.hpp" using namespace std; int get(vector<int> &ans, int n) { if (ans[n] != -1) { return ans[n]; } ans[n] = 0; for (int i = 1; i <= n; i++) { ans[n] += get(ans, i - 1) * get(ans, n - i); } return ans[n]; } int numTrees(int n) { vector<int> ans(n + ...
ALGO
0.999971
5.119051
847840a5-bed4-4ca0-807a-ed44cfa8fa45
Hertz-Lee/SICNU-OJ-200
G1.cpp
#include<cstdio> int main(){ int n; scanf("%d",&n); if(n==0||n==1) printf("%d",n); else{ bool lights[1000]={}; for(int i=2;i<n;i++) for(int j=1;j<=n;j++) if(j%i==0) lights[j]=!lights[j]; lights[n]=!lights[n]; int sum...
ALGO
0.999984
3.299649
c92f83f4-9168-474f-b44d-5d2e4b17e512
intel/quantum-intrinsics
llvm/lib/CodeGen/MachineSSAUpdater.cpp
#include "llvm/CodeGen/MachineSSAUpdater.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineOperand.h"...
TOOL
0.997344
7.954583
08d092b6-e9c1-45d2-a503-2c2360642dcd
alexandraback/datacollection
solutions_5709773144064000_0/C++/mfatihu/Deneme.cpp
/* * File: main.cpp * Author: mehmetfatihuslu * * Created on April 12, 2014, 4:56 PM */ #include <cstdlib> #include <iostream> #include <fstream> #include <cmath> #include <math.h> #include <iomanip> #include <iomanip> using namespace std; /* * */ int NumDigits(int n) { int digits = 0; if (n <= 0) ...
ALGO
0.999583
3.805295
cb013ba3-d14f-4109-8239-37fe8dc59465
WesleyW8542/csc103Portfolio
08/functions.cpp
#include <iostream> using std::cin; using std::cout; void swap(int& x, int& y); int main() { int a=23,b=77; printf("a == %i, b == %i\n", a, b); swap(a,b); printf("a == %i, b == %i\n",a,b); } /* function to swap contents of two variables: if you call swap(x,y), * then afterwards, y will have x's va...
ALGO
0.986023
4.613076
f248cbdc-849a-4606-8e36-ca82d9265060
atalariq/cp
problems/TLX/courses-competitive/02-matematika-diskrit/A.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define space " " int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); ll A, B, C, D, E, F, pembilang, penyebut; cin >> A >> B >> C >> D; E = A*D+C*B; F = B*D; pembilang = E/gcd(E, F); penyebut = F/gcd(E,F); cout << pembilang...
ALGO
0.999901
5.248234
443bc577-1ffe-4849-99c0-77e35cf66478
Pavitar56/LeetCode
1143-longest-common-subsequence/1143-longest-common-subsequence.cpp
class Solution { public: // int helper(string &t1,string &t2,int idx1,int idx2,vector<vector<int>> &dp) // { // if(idx1 == 0 || idx2 == 0) // { // return 0; // } // if(dp[idx1][idx2] != -1) // { // return dp[idx1][idx2]; // } ...
ALGO
0.999986
6.366925
34c4b334-24ac-4f31-b174-2d6796430c90
chubillkelvin/leetcode
solutions/c++/problems/[0412_Easy] Fizz Buzz.cpp
class Solution { public: vector <string> fizzBuzz(int n) { vector <string> ans; for (int i = 1; i <= n; i++) { if (i % 3 == 0) { if (i % 5 == 0) { ans.push_back("FizzBuzz"); } else { ans.push_back("Fizz"); ...
ALGO
0.99982
6.81814
fc805ad0-3af7-46cd-bda0-22735e0abdb5
aeronzhou/FootballAI
src/FPPositioning.cpp
#include "FieldPlayerState.h" #include "Pitch.h" #include "Team.h" Positioning* Positioning::get() { static Positioning instance; return &instance; } void Positioning::enter(FieldPlayer* player) { player->getSteering()->setArriveOn(); player->setTarget(player->getAssignedRegion()->getCenter()); } void Positionin...
TOOL
0.917424
4.652142
4f8fc2d5-15c3-4888-a581-cb4332f9b48d
Aaron9477/restore
catkin_ws/1wyz_ws_fromTX1_running/src/tld/src/LKTracker.cpp
#include <LKTracker.h> using namespace cv; LKTracker::LKTracker(){ term_criteria = TermCriteria( TermCriteria::COUNT+TermCriteria::EPS, 20, 0.03); window_size = Size(4,4); level = 5; lambda = 0.5; } bool LKTracker::trackf2f(const Mat& img1, const Mat& img2,vector<Point2f> &points1, vector<cv::Point2f> &points...
ALGO
0.992557
4.489127
35658012-35ba-44d2-86ab-cee63d442807
lizhuomao/Llxy_AlgorithmDesign_programming_test
YangZeBin/1051.cpp
#include<iostream> #include<cmath> using namespace std; int main() { double R1, P1, R2, P2, A, B; cin >> R1 >> P1 >> R2 >> P2; A = R1*cos(P1)*R2*cos(P2) - R1*sin(P1)*R2*sin(P2); B = R1*cos(P1)*R2*sin(P2) + R1*sin(P1)*R2*cos(P2); if (abs(A) < 0.01) A = 0; if (abs(B) < 0.01) B = 0...
ALGO
0.999784
3.236409
5b1a2137-4544-4a27-9eec-3b1354649c3e
jojo13572001/VVCSoftware_VTM-VTM-17.0
source/Lib/CommonLib/QuantRDOQ.cpp
/** \file QuantRDOQ.cpp \brief transform and quantization class */ #include "QuantRDOQ.h" #include "UnitTools.h" #include "ContextModelling.h" #include "CodingStructure.h" #include "dtrace_next.h" #include "dtrace_buffer.h" #include <stdlib.h> #include <limits> #include <memory.h> struct coeffGroupRDSta...
ALGO
0.956567
5.697177
c221ce7c-498f-4597-b90b-144932db7c75
munkdar/yuzu-early-access
src/core/file_sys/vfs_vector.cpp
#include <algorithm> #include <utility> #include "core/file_sys/vfs_vector.h" namespace FileSys { VectorVfsFile::VectorVfsFile(std::vector<u8> initial_data, std::string name, VirtualDir parent) : data(std::move(initial_data)), parent(std::move(parent)), name(std::move(name)) {} VectorVfsFile::~VectorVfsFile() = d...
TOOL
0.851599
6.238303
726fc680-48a6-4225-af94-6d67b8868950
openharmony/third_party_boost
libs/compute/perf/perf_bolt_max_element.cpp
#include <iostream> #include <algorithm> #include <vector> #include <bolt/cl/copy.h> #include <bolt/cl/device_vector.h> #include <bolt/cl/max_element.h> #include "perf.hpp" int rand_int() { return static_cast<int>(rand() % 10000000); } int main(int argc, char *argv[]) { perf_parse_args(argc, argv); std...
ALGO
0.951316
5.044326
d08b7c74-f761-495b-a6f4-b4d1b855839c
tickscn/leetcode
19.remove-nth-node-from-end-of-list.cpp
/* * @lc app=leetcode id=19 lang=cpp * * [19] Remove Nth Node From End of List */ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* removeNthFromEnd(ListNode* head, int n)...
ALGO
0.999921
6.363971
be4885b5-d70f-4468-a73c-e1efa3f3b69c
theAdityaRamesh/cpp
leetcode/simplify-path.cpp
class Solution { public: string simplifyPath(string path) { // O(N) time O(N) space // solution using stack // push the folder names into stack // each folder name is sepearated by a / // if we encounter /.. or /. commands // remove elements from the stack ...
ALGO
0.999613
5.782317
a5e564b4-784f-46ad-a506-22b13da649d8
wh04M1i/Leetcode
0605-can-place-flowers/0605-can-place-flowers(1).cpp
class Solution { public: bool canPlaceFlowers(vector<int>& flowerbed, int n) { int count = 0; int size = flowerbed.size(); for (int i = 0; i < size; i++) { if (flowerbed[i] == 0) { if ((i == 0 || flowerbed[i - 1] == 0) && (i == size - 1 || flowerbed[i + 1...
ALGO
0.999995
7.309958
420b5ad1-2606-4216-83ed-1bf12eadea40
MrinalCom/GeeksforGeeksPOTD
Equilibrium Point.cpp
long long sum = 0; for(long long i = 0 ; i<n;i++) sum+=a[i]; long long prevSum = 0; for(int i = 0 ; i<n;i++){ sum-=a[i]; if(prevSum==sum) return i+1; prevSum+=a[i]; } return -1;
ALGO
0.99995
3.14542
318a1e27-0685-4be6-817d-853df35e4b05
yulingtianxia/LeetCode
LeetCode/LeetCode/123 Best Time to Buy and Sell Stock III.cpp
#include "commonheader.h" class Solution { public: int maxProfit(vector<int> &prices) { int size=(int)prices.size(); int buy1=INT_MIN; int sell1=0; int buy2=INT_MIN; int sell2=0; for (int i=0; i<size; i++) { sell2=max(sell2,buy2+prices[i]); buy...
ALGO
0.99977
5.823898
e23a537d-79ba-40d4-9b1b-b51537d9b333
HackersUOP/codeBase
codeBase/HackerCup/2016/2016_Q_1/2016_Q_1.cpp
#include <stdio.h> #include <iostream> #include <vector> #include <map> #include <cmath> #include <climits> #include <algorithm> using namespace std; typedef long long ll; typedef pair<ll, ll> pr; int main() { ios_base::sync_with_stdio(false); ll t; cin >> t; for (ll i = 0; i < t; i++) { vector<...
ALGO
0.999205
4.339242
5e0e5d37-dece-4462-aecd-0a326aaa7be9
nfrik/hardyplus
eigen-eigen-36bf2ceaf8f5/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; int main() { Eigen::MatrixXf mat(2,4); Eigen::VectorXf v(2); mat << 1, 2, 6, 9, 3, 1, 7, 2; v << 0, 1; //add v to each column of m mat.colwise() += v; std::cout << "Broadcasting result: " << std::endl;...
ALGO
0.998488
4.136906
49e8ef53-91c7-4f29-afdd-4226157aa7e0
tanvir-rahman-ewu/UVA-Solutions
939.cpp
#include<bits/stdc++.h> using namespace std; map<string, string> person; map<string, vector<string> > parents; struct desi{ string name; string gene; desi(string a, string b) { name = a; gene = b; } bool operator<(const desi &d) const { return name < d.name; } }; vect...
ALGO
0.999949
4.855861
4c774c88-c66a-4e2a-b242-a28ccd512780
Richard-m-j/LeetCode
432-AllOoneDataStructure/432-AllOoneDataStructure.cpp
// Last updated: 7/24/2025, 8:31:00 AM class AllOne { public: unordered_map<string, int> count; set<pair<int, string>> se; AllOne() { count.clear(); } void inc(string key) { int n = count[key]; count[key]++; se.erase({n, key}); se.insert({n + 1, key}); ...
ALGO
0.999862
6.604791
57d62d46-f0b4-4bdc-95cd-d6f0098fdd73
Sampurankishoresrivastava/DSA
ATram.cpp
#include <iostream> using namespace std; int main() { int n; cin>>n; int a[n][2]; for(int i=0;i<n;i++){ for(int j=0;j<2;j++){ cin>>a[i][j]; } } int t=a[0][1]; int max=a[0][1]; for(int i=1;i<n-1;i++){ t=(t-a[i][0])+a[i][1]; if(t>=max)...
ALGO
0.999813
3.046801
a6863cee-043a-4b76-a47d-90a43a14f208
subnr01/subs-practice
leet_code/arrays/2Darray/Game_of_life.cpp
/* Given a board with m by n cells, each cell has an initial state live (1) or dead (0). Each cell interacts with its eight neighbors (horizontal, vertical, diagonal) using the following four rules: Any live cell with fewer than two live neighbors dies, as if caused by under-population. Any live cell with two or three...
ALGO
0.999925
6.74104
4ad5d39e-4383-4131-9d5e-b490dd82185a
sanketdisale871/DSA
1286-constrained-subsequence-sum/constrained-subsequence-sum.cpp
class Solution { public: typedef int ll; int constrainedSubsetSum(vector<int>& nums, int k) { deque<ll>dq; vector<ll>cpy = nums; ll maxi =INT_MIN; ll n = nums.size(); for(ll i=0;i<n;i++){ ll fntElem = dq.empty()?0:cpy[dq.front()]; cpy[i]=max(cp...
ALGO
0.999965
5.486227
e6cb8e32-97b5-40a8-a22d-24959d819d81
Sudipta-Trisha/AtCoder-Problems-Solutions
AtCoder Beginner Contest 153/A - Serval vs Monster/sol.cpp
/** * author : Sudipta Banik Trisha * created : September 08, 2020 2:24 PM * Problem Name : A - Serval vs Monster * Problem Limit : 2000 ms , 1024 MB * Problem Url : https://atcoder.jp/contests/abc153/tasks/abc153_a * @genarated by : ai-virtual-assistant **/ #include<bits/stdc...
ALGO
0.999655
3.583843
22a5449d-c7f0-4cd5-9229-5e0204146d93
Thaova1770/50_VoAnhThao
Chuong4Fraction/FractionMain.cpp
#include "Fraction.h" #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n; cin >> n; vector<Fraction> fraction; vector<Fraction> fractionUnique; // a for (int i = 0; i < 100; i++) { Fraction f(n); fraction.push_back(f); } // b cout << "Phan so khong vuot qua...
ALGO
0.999376
3.785485
dc723b57-87e8-440a-a12c-5fddf0744b3d
EFTEKHER/c--
4_c++_basics/4_reverse_string.cpp
/* code written by Eftekher Ali Efte from Bangladesh email:<EMAIL> pursuing computer science and engingeering in Ruet */ #include<iostream> #include<stdio.h> #include<bits/stdc++.h> #include<stdlib.h> #define ull unsigned long long int #include<ctype.h> using namespace std; int main() { string str; cin>>st...
ALGO
0.999806
4.423801
8e78b212-febe-4951-b8a8-d28df9662646
kinetic-rb/kinetic-rb.github.io
code/T221276.cpp
#include <stdio.h> #define int long long class matrix { public: int a,b; int c,d; }; matrix multi(matrix x,matrix y) { // 2*2 \u77e9\u9635\u4e58\u6cd5 int newa = (x.a*y.a+x.b*y.c) % 1000000007,newb = (x.a*y.b+x.b*y.d) % 1000000007 , newc = (x.c*y.a+x.d*y.c) % 1000000007, newd = (x.c*y.b+x.d*y.d) % 10...
ALGO
0.999958
4.717957
37da2e31-48cd-4e51-aaf5-69f1713daa52
directpi/MyProjects
CPP_Yandex_Handbook/3.1.4_redactor.cpp
#include <iostream> #include <list> #include <string> #include <utility> int main() { std::list<std::string> v; std::string str, bufer; getline(std::cin, str); while (str != "") { v.push_back(str); getline(std::cin, str); } auto cursor = v.begin(); if (str == "") { ...
TOOL
0.996604
4.888655
ae040c1e-7012-46b0-a9fc-e42db5ae40e5
PradeepS1210/MNC-Interview-Questions
Google/MinimumJumps.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int minJumps(vector<int> &arr) { int n = arr.size(); if (n <= 1) return 0; if (arr[0] == 0) return -1; int maxReach = arr[0]; int steps = arr[0]; int jumps = 1; ...
ALGO
0.999988
5.34795
9a0e109a-5bd4-4cf5-9a53-456d86a7d1a0
lali37/AI-self-driving-car
self-driving-car-master/project_10_MPC_control/src/Eigen-3.3/test/sparse_permutations.cpp
static long int nb_transposed_copies; #define EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN {nb_transposed_copies++;} #define VERIFY_TRANSPOSITION_COUNT(XPR,N) {\ nb_transposed_copies = 0; \ XPR; \ if(nb_transposed_copies!=N) std::cerr << "nb_transposed_copies == " << nb_transposed_copies << "\n"; \ VERIFY( (#XPR...
TEST
0.929552
6.2616
af0c39a4-19f2-45e3-9be4-2641421830fb
m0hitchaudhary/Data-Structures-and-Algorithms
String/decimalToBinary.cpp
#include <iostream> #include<algorithm> using namespace std; string decimalToBinary(int n){ string str = ""; while(n>0){ int rem = n%2; str += to_string(rem); n /= 2; } reverse(str.begin(), str.end()); return str; } int main() { int n; cin>>n; ...
ALGO
0.999929
5.63102
6d6a6c12-6336-4ced-863d-bd8d97ef69c4
trunghai95/MyCPCodes
Codeforces/809A.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 3e5; const ll MODD = 1e9 + 7; int n; ll x[MAXN+2], pow2[MAXN+2], res; void init() { pow2[0] = 1; for (int i = 1; i <= MAXN; ++i) { pow2[i] = pow2[i-1] * 2 % MODD; } } int main() { init(); scanf("%d", &n...
ALGO
0.999976
4.372408
73a6b161-b4b5-4adc-9337-841d9434f7ce
shubham23278/DSA-Practice
LeetCode/Contains Duplicate/Solution.cpp
class Solution { public: bool containsDuplicate(vector<int>& nums) { bool x = false; sort(nums.begin() , nums.end()); for(int i=0 ; i<nums.size()-1 ; i++) { if (nums[i] == nums[i+1]){ x = true; break; } } return x; } };
ALGO
0.999985
5.47273
eb7cd6ed-34f1-4cab-ab88-0534dca012bf
karin0/problems
probs/bzoj1024.cpp
#include <cstdio> #include <algorithm> using std::min; using std::max; double dfs(double x, double y, int k) { // Cut an x * y cake into k parts, min of max(ratio(x0, y0)). if (k == 1) { return (x > y) ? (double)x / y : (double)y / x; } double r = 100000.0, x1, y1; for (int k1 = 1; k1 <= k / 2; ...
ALGO
0.999519
3.701429
2421b685-ec1b-4688-aa84-c7b37150da53
PrithMDP/cplusplus
Mergepoint-linked-list/Mergepoint-linked-list/main.cpp
#include <iostream> using namespace std; //linked list node struct Node { int data; //data in linked list Node* next; //pointer to next node }; // LINKED LIST /* A->B->C->D->E->F->NULL ^ | G->H->I start of L1 is A of L2 is G //ALGO Calculate length of both, start at b...
ALGO
0.999739
4.143
2fb6f8f7-759c-4d7c-bc89-6f99bd3249fa
Lchuxian/SLAM-Environment
OpenCV3_and_OpenCV4_coexist/opencv-4.5.5-build/opencv_contrib-4.5.5/modules/dpm/src/dpm_cascade.cpp
#include "dpm_cascade.hpp" #include "dpm_nms.hpp" #include <limits> #include <fstream> #include <iostream> #include <stdio.h> using namespace std; namespace cv { namespace dpm { void DPMCascade::loadCascadeModel(const string &modelPath) { // load cascade model from xml bool is_success = model.deserialize(mo...
ALGO
0.99573
5.922819
b1d4dad3-4d7a-47f6-878c-08d58ff50a00
abhishekraut1/DSA_Problems
rat_in_a_maze.cpp
#include<bits/stdc++.h> using namespace std; void printVec(vector<string> s){ for(int i=0;i<s.size();i++){ cout<<s[i]<<" "; cout<<endl; } } bool isSafe(vector<vector<int>> v,vector<vector<int>> visited,int x,int y,int n){ if((x>=0 && x<n) && (y>=0 && y<n) && visited[x][y] == 0 && v[x][y] == 1) ...
ALGO
0.99999
4.791592
265b0871-a517-4a0f-bc81-baeece86aa94
Perdente/CF-Expert-Sheet
Problem-C/Binary String Reconstruction.cpp
//https://codeforces.com/problemset/problem/1400/C /*A winner is just a loser who tried one more time*/ #include<bits/stdc++.h> using namespace std; #define int long long int #define double long double #define endl "\n" const int MOD = 1e9+7; const int mx = 2e5+5; // #include <ext/pb_ds/assoc_container.hpp> // #in...
ALGO
0.999481
4.77405
88433678-2e02-40f4-b5bc-5f273f011b95
19Kapil/CPP_LEC
LAB/LAB 5/3a_Conversion_routines_in_source_class.cpp
#include<iostream> #include<cmath> using namespace std; class Polar { protected: float r ,angle; public: Polar() { r = 0; angle = 0; } void getData() { cout<<"Enter the coordinates in polar form "<<endl; cout<<"r :"; cin>>r; cout<<"angle...
TOOL
0.948127
3.853889
6ef2c295-b4aa-486a-9941-ad7b18ab2dbe
csranger/leetcode
source/classification/greedyAlgorithm/PayMoney.cpp
// // Created by zhaohailong on 2020/6/4. // /* ๆœ‰1๏ผŒ5๏ผŒ10๏ผŒ20๏ผŒ100๏ผŒ200ๅ…ƒ็š„้’ž็ฅจๆ— ๆ•ฐๅผ ๏ผŒ็Žฐไฝฟ็”จ่ฟ™ไบ›้’ž็ฅจๆ”ฏไป˜ x ๅ…ƒ๏ผŒๆœ€ๅฐ‘ๆ”ฏไป˜ๅคšๅฐ‘ๅผ ๏ผŸ ๅฐฝๅฏ่ƒฝๅคš็š„ไฝฟ็”จ้ขๅ€ผ่พƒๅคง็š„้’ž็ฅจใ€‚่ดชๅฟƒๆณ•๏ผš้ตๅพชๆŸ็ง่ง„ๅพ‹๏ผŒไธๆ–ญ่ดชๅฟƒ้€‰ๅ–ๅฝ“ๅ‰ๆœ€ไผ˜็ญ–็•ฅ็š„็ฎ—ๆณ•่ฎพ่ฎกๆ–นๆณ•ใ€‚ ไธบไป€ไนˆ่ฟ™ๆ˜ฏๅฏน็š„๏ผŸ ๅ› ไธบไปปๆ„้ข้ขๆ˜ฏๆฏ”่‡ชๅทฑๅฐ็š„้ข้ข็š„ๅ€ๆ•ฐๅ…ณ็ณปใ€‚ ๆ‰€ไปฅ๏ผŒๅฆ‚ๆžœๅขžๅŠ  7 ๅ…ƒ้ข้ข๏ผŒๅฐฑไธๆˆ็ซ‹ไบ†ใ€‚ไพ‹ๅฆ‚ 14 ๆŒ‰็…ง่ดชๅฟƒๅบ”่ฏฅๆ˜ฏ 1ๅผ 10ๅ…ƒๅŠ ไธŠ4ๅผ 1ๅ…ƒ๏ผŒๅฎž้™…ไธŠๆœ€ไผ˜ๆ˜ฏไธคๅผ 7ๅ…ƒๅณๅฏใ€‚ LeetCode322 ้›ถ้’ฑๅ…‘ๆข ๅŠจๆ€่ง„ๅˆ’ */ #include <iostream> using namespace std; int MinN...
ALGO
0.996536
4.577875
6e13c076-e509-483e-aad0-d44609c69521
dhruvk0011/codeforces-questions
watermelon.cpp
#include <iostream> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int w; cin >> w; if (w <= 2 || w % 2 != 0) cout << "NO" << endl; else cout << "YES" << endl; return 0; }
ALGO
0.999875
3.94334
684b290f-b0b5-4efc-a362-f65a93680c83
Henrique-zoo/Programacao-Competitiva
Mashups/D_Quarto/C_gertrudesEOArray.cpp
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { int n, p, aux; cin >> n; cin >> p; for (int i = 1; i < n; i++) { cin >> aux; p &= aux; } cou...
ALGO
0.999913
3.682086
01773333-d613-4de0-a3be-780ebdb90a12
saifur-shamim/Atcoder-Solution
Round Trip 276E.cpp
///Bismillahir Rahmanir Rahim ///Happy Coding #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long int li; typedef double dl; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<pii>vpi; typedef vector<pll> vpl; #defin...
ALGO
0.999979
3.065533
00ca7f72-5fdb-414a-a814-f0e1db983958
eugeneyuchunlin/NCKU-CSIE-Homework
Data-Structure/hw3/prefix.cpp
#include<iostream> #include<string> #include<vector> using namespace std; template<class T> class Stack : public vector<T>{ public: T pop_back(){ if(vector<T>::size() > 0){ T object = *(vector<T>::end()-1); vector<T>::pop_back(); return object; } else thr...
ALGO
0.999507
4.357135
75f54eca-94c9-4f66-9840-4e464eab3327
GT0122/Algorithm_study
Baekjoon/C++/acsBaek/1753_์ตœ๋‹จ๊ฒฝ๋กœ.cpp
#include <iostream> #include <string> #include <queue> #define MAXINT 1000000000; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int v, e, k; int s, d, w; int first, second; int* nodes; vector<pair<int, int>>* vctEdge; vector<pair<int, int>> vctTemp; p...
ALGO
0.999985
3.98489
56909738-c4db-4f33-a46f-f171b9914683
mooleetzi/ICPC
contest/nowcoder-9/test.cpp
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int maxn=1e5+10; struct node{ int l,r,sum,change; }tree[maxn<<3]; int ans=0; typedef long long ll; void pushup(int now){ tree[now].sum=tree[now<<1].sum+tree[now<<1|1].sum; } void pushdown(int now,int len){ if (tree[now].chang...
ALGO
0.99743
3.640533
7c32cb9b-2657-435e-8b97-f2d940e0d6f0
sujalmahalaha/Gfg_Practice
Difficulty: Easy/Stock Buy and Sell โ€“ Max one Transaction Allowed/stock-buy-and-sell-max-one-transaction-allowed.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: int maximumProfit(vector<int> &p) { vector<int>v1,v2(p.size()); int ans=0; v1.push_back(p[0]); v2[p.size()-1]=p[p.size()-1]; for(int i=1; i<p.size(); i++){ v1.pu...
ALGO
0.998357
6.559823
cce0da50-cc93-471d-9bdc-6f7e3b51a1ce
kodefish/ETH-AlgoLab
workspace/cpp_intro/build_the_sum/sol.cpp
#include <iostream> void testcase() { int n; std::cin >> n; // Sum all the numbers int result = 0; for(int i = 0; i < n; i++) { int tmp; std::cin >> tmp; result += tmp; } std::cout << result << std::endl; } int main() { std::ios_b...
ALGO
0.999002
5.661033
6c524046-8374-440b-8c13-e669d0da562e
007havegone/Algorithm
ๆœ€ไผ˜ไบŒๅ‰ๆœ็ดขๆ ‘ไผ˜ๅŒ–/main.cpp
/* ฤฑฮฒสฝสฑไธดำถศฟลปO(n^2) 0 j=i-1 c[i][j]= c[i][k-1]+c[k+1][j]+w[i][j],s[i][j-1]<=k<=s[i+1][j] j>=i */ #include <algorithm> #include <iostream> #include <queue> using namespace std; const int N = 107; int s[N][N]; double w[N][N], c[N][N]; double p[N], q[N]; int n; void optimal_BST(int n) { int i, j, k, d; doub...
ALGO
0.999956
3.308625
9dec6d8c-feb1-4463-b1eb-eec8b7b1d883
Sudip-Chel/DSA-from-Scratch
Array/twoSum.cpp
/*Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Example 1: Input: nums = [2,7,11,15], target...
ALGO
0.999725
5.866637
52884c07-155a-4492-94a7-f594ed91e9d5
upesacm/21DaysOfCode
Devika/Question 16/Solution16.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <stack> using namespace std; int main() { stack <int> s; int n,x,t; cin>>n; while(n--) { cin>>t; if(t==1) { cin>>x; if(s.empty()) s.push(x)...
ALGO
0.999884
4.319314
d81dda0c-b724-4b57-b443-8f55ca62ac03
Micke1995/GraficacionM
Tarea16/rtluz.cpp
// rt: un lanzador de rayos minimalista // g++ -O3 -fopenmp rt.cpp -o rt #include <math.h> #include <stdlib.h> #include <stdio.h> #include <omp.h> #include <stdio.h> #include <time.h> // for clock_t, clock(), CLOCKS_PER_SEC //#define NUM_THREADS 4 #include <cstdlib> double pi=3.14159265358979323846; //Creamos...
ALGO
0.99049
3.692188
39f55860-55c3-4252-8425-6cac46dba1fe
ChaofanChen/ogs5_bhe
UTL/MSHGEOTOOLS/mainConvertGLIVerticalSurfaceToPolygon.cpp
/* * mainConvertGLIVerticalSurfaceToPolygon.cpp * * Created on: Jun 5, 2012 * Author: fischeth */ // stl #include <iostream> #include <vector> #include <string> // FileIO #include "OGSIOVer4.h" #include "OGSMeshIO.h" // GeoLib #include "GEOObjects.h" // MeshLib #include "msh_mesh.h" // MeshLib - folder ...
TOOL
0.872409
4.881996
dfc11afd-ced8-43bb-95ea-5ce9676f7c2c
SonarSystems/Tic-Tac-Toe-Cocos2d-x
C++/[1] Project Setup/TicTacToePractise/cocos2d/cocos/math/CCVertex.cpp
#include "math/CCVertex.h" #include "base/ccMacros.h" NS_CC_BEGIN void ccVertexLineToPolygon(Vec2 *points, float stroke, Vec2 *vertices, unsigned int offset, unsigned int nuPoints) { nuPoints += offset; if(nuPoints<=1) return; stroke *= 0.5f; unsigned int idx; unsigned int nuPointsMinus = nuPoin...
ALGO
0.995722
5.824827
73dd3ba7-cc6f-438d-914e-8fc1dbee3a4a
dungnguyen150699/eclipse_ws
CTDL vs GT/Gen-Hoan Vi(P).cpp
#include<iostream> #include<iomanip> #define MAX 100 /* Nhap n:3 Ket Qua 1:123 Ket Qua 2:132 Ket Qua 3:213 Ket Qua 4:231 Ket Qua 5:312 Ket Qua 6:321 c 2 vng lp chnh ; 1 lan swqp + 1 vng swap */ using namespace std; int x[MAX],n,dem=0; bool ok = true; void init(){ cout << "\n Nhap n:"; cin >> n; for(int i...
ALGO
0.999863
3.791258
af07cd9c-c495-4c9e-bc3c-877e485794b3
RawSharkill/leetcode
72Edit Distance.cpp
// // Created by yutianpig on 18-5-6. // #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; /* class Solution { public: int minDistance(string word1, string word2) { int m=word1.length(); int n=word2.length(); vector<vector<int> > distance(m+1,v...
ALGO
0.999991
5.542145
1e3c3925-9434-41ce-a6a6-803a5be60e20
mashroorzisan/phitron-1st-course
course -data structure/Module-12/3.browser.history.cpp
#include <bits/stdc++.h> using namespace std; class Node { public: string s; Node *next; Node *prev; Node(string s) { this->s = s; this->next = NULL; this->prev = NULL; } }; void insert_tail(Node *&head, Node *&tail, string s) { Node *nn = new Node(s); if (tail ...
ALGO
0.999835
4.548407
75c0e39c-45fe-4d62-9fc5-a5363f1e469c
Raaaaaahul/geekforgeeks
searching/class Solution {.cpp
class Solution { public: int maxArea(vector<int>& v) { int lptr = 0,rptr = v.size() - 1; int width = v.size()-1; int len = v[0]; int area = 0; while(lptr<rptr) { if(v[lptr]<v[rptr]) { lptr++; width--; ...
ALGO
0.999992
6.177137
8c291345-488d-4e57-8bdd-1fc3c2c40f05
buboobear/Compro_Lab15
lab15_2.cpp
#include<iostream> using namespace std; const int N = 5; void inputMatrix(double a[][N]){ for(int i = 0; i < N; i++){ cout << "Row " << i+1 << ": "; for(int j = 0; j < N; j++){ cin >> a[i][j]; } } } void findLocalMax(const double b[][N], bool c[][N]){ for(int i = 0; i < N; i++){ for(int j = 0...
ALGO
0.999959
3.659835
b3a8365a-6bc2-45a6-976f-9c85c7c2532a
Lqs66/boost_1_74_0
libs/math/example/neg_binom_confidence_limits.cpp
// neg_binomial_confidence_limits.cpp // Caution: this file contains quickbook markup as well as code // and comments, don't change any of the special comment markups! //[neg_binomial_confidence_limits /*` First we need some includes to access the negative binomial distribution (and some basic std output of course)...
ALGO
0.999418
7.201398
d078010f-774d-4d79-aa38-75305307852e
NandeeshPuri/CSES
Sorting and Searching/nestedfrangescount.cpp
#include <bits/stdc++.h> using namespace std; #define ar array #define ll long long const int MAX_N = 1e5 + 1; const ll MOD = 1e9 + 7; const ll INF = 1e9; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <class T> using ordered_set = tree<T, null_typ...
ALGO
0.999848
4.031947
04f5c3e0-3e94-4a19-b64e-fc71334c08a7
starsleep/SLAM
Library/eigen-3.4.0/doc/examples/QuickStart_example2_fixed.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; using namespace std; int main() { Matrix3d m = Matrix3d::Random(); m = (m + Matrix3d::Constant(1.2)) * 50; cout << "m =" << endl << m << endl; Vector3d v(1,2,3); cout << "m * v =" << endl << m * v << endl; }
ALGO
0.994494
3.387763
d311edb8-ae89-4e9d-8019-50b70cd7c2b9
William-King-Xeon/CampTraining
Day3/solution&std(2018.4.14)/std/sum.cpp
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> #include <time.h> #include <iostream> #include <algorithm> #include <string> #include <set> #include <map> #include <queue> #include <stack> #include <bitset> #include <vector> using namespace std; #define bll long long #define dou double #de...
ALGO
0.999743
4.179456
8e189e6e-d8f7-4af6-b545-fc823464c48b
Abhi5453Abhi/Leetcode-solutions-2
0189-rotate-array/0189-rotate-array.cpp
class Solution { public: void rotate(vector<int>& nums, int k) { k = k%nums.size(); cout<<k<<endl; reverse(nums.begin(),nums.begin()+(nums.size()-k)); for(int i=0;i<nums.size();i++)cout<<nums[i]<<" "; cout<<endl; reverse(nums.begin()+(nums.size()-k),nums.end()); ...
ALGO
0.999991
5.068717
b54f4f2d-bee9-4d15-80f8-cbde729859aa
GlennSR/Cpp-Course
Statements and Operators/testing_equality.cpp
#include <iostream> using namespace std; int main(){ bool equal {false}, not_equal {false}; cout << boolalpha; // Will display true/false instead of 1/0 for booleans // cout << noboolalpha; // Will display 1/0 for booleans (Standard) int n1{}, n2{}; // cout << "Enter 2 integers separated by spa...
ALGO
0.93942
4.00405
90bd6413-826c-4465-8715-144cd13f236e
purvasingh96/My-Leetcode-Solutions
1755-closest-subsequence-sum/1755-closest-subsequence-sum.cpp
class Solution { public: int minAbsDifference(vector<int>& nums, int goal) { int n =nums.size(); int N = n/2; int N_ = n-N; int res = INT_MAX; vector<int> left, right; for(int mask=0;mask<(1<<N);mask++){ int l=0; for(int i=0;i<=N;i++) ...
ALGO
0.999987
5.737086
77fe13f4-d3cb-473f-82bf-c25439f353fb
Ritik609/Array
arrsort012.cpp
class Solution { public: void sortColors(vector<int>& nums) { int l=0,m=0,h=nums.size()-1; while(m<=h) { if(nums[m]==0) { swap(nums[m],nums[l]); m++;l++; } else if(nums[m]==1) m++; else { ...
ALGO
0.999984
5.968599
5b4814ed-948d-4cec-ab4e-3cb4d50ad016
jxie418/leetcodecpp
containerwithmostwater.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public : int maxArea(vector<int> &height) { int res = 0, i = 0, j = height.size() -1; while(i < j) { res = max(res, min(height[i],height[j]) * (j-i)); if (height[i] < height[j]) { j--; } else { i++; } } ...
ALGO
0.999711
5.513992
766a1d56-7362-46af-80dc-34cd3c0c387b
bloqcoin/boost_1_59_0
libs/algorithm/string/example/rle_example.cpp
// Boost string_algo library example file ---------------------------------// // See http://www.boost.org for updates, documentation, and revision history. /* RLE compression using replace framework. Goal is to compress a sequence of repeating characters into 3 bytes ( repeat mark, character and repetition...
ALGO
0.999491
5.661903
6b5d6d54-cff5-4c2c-9dd6-af51af8dff5a
Jun0S2/AlgorithmStudy
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค/src/ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค_02242022/์™„์ฃผํ•˜์ง€_๋ชปํ•œ_์„ ์ˆ˜_map.cpp
#include <string> #include <vector> #include <unordered_map> using namespace std; //erase ๋ฅผ ์“ฐ๋‹ˆ ํšจ์œจ์„ฑ ํ…Œ์ŠคํŠธ๋ฅผ ํƒˆํƒˆ ํ„ธ๋ ธ๋‹น ^.^ string solution(vector<string> participant, vector<string> completion) { string answer = ""; unordered_map<string, int>name_list; //๋งต - ์ด๋ฆ„, cnt (๋™๋ช…์ด์ธ๋•Œ๋ฌธ,,) for(auto p : participant) name_list[p...
ALGO
0.998462
5.154283
df5aa1d8-3580-457a-a5e4-bc4bee048d08
Xiad32/105_Algorithms
105_Algorithms/16.stable__.cpp
/* * Algorithm: sort_heap * * Example: place the nth element at its right location if the collection * was sorted. Everything before it is less than the nth element (not sorted) * everything after it is more than the nth element (not sorted) */ #include <iostream> #include <algorithm> #include ...
ALGO
0.998554
5.491771
edb36a70-94dd-4450-8553-66d9a68b7f0c
Kangkang-wky/My-LeetCode-Solutions
solution/data_structure/queue/queue.cpp
#include "../include/help.h" /** * @brief ้˜Ÿๅˆ—ๅฎž็Žฐ, ๅฎž็Žฐ้“พๅผ้˜Ÿๅˆ—้ƒจๅˆ† * * @tparam T */ template <typename T> class LinkQueue { public: LinkQueue() { peek = nullptr; rear = nullptr; count = 0; } ~LinkQueue() { while (!empty()) { ...
TOOL
0.959858
3.714351
b1e7d68c-33e7-4767-ba11-80c9fd3aa884
praveen189/CP-DSA
Recursion/subsetVector.cpp
#include <iostream> #include <vector> #include <bits/stdc++.h> using namespace std; void subSetOfVector(vector<vector<int>> &ans, vector<int> ip, vector<int> op) { // bs if (ip.size() == 0) { ans.push_back(op); return; } vector<int> op1 = op; vector<int> op2 = op; op2.push...
ALGO
0.99999
4.363811
1697c5d1-57d3-4f2b-aee6-0ee15d1f65f9
ManhDuc205/Dev
Code C++/1_Array_1D/baitap5.cpp
/* Cho hai mแบฃng, in ra mร n hรฌnh hแปฃp vร  giao cแปงa 2 mแบฃng vร  ฤ‘รฃ ฤ‘ฦฐแปฃc sแบฏp xแบฟp input : Output: 4 5 1 2 3 4 5 6 7 1 2 4 3 2 3 2 3 7 5 6 */ #include <iostream> #include <vector> #include <algorithm> usi...
ALGO
0.999975
3.081926
3b291b58-ac25-4740-b4ea-6e919300a9f4
Carly7766/Game-of-Life
src/CellularAutomata/CellularAutomata.cpp
#include "CellularAutomata.hpp" #include "Coordinate.hpp" void CellularAutomata::generateChunk(const Coordinate &chunkPosition) { for (int y = 0; y < CHUNK_SIZE; ++y) { for (int x = 0; x < CHUNK_SIZE; ++x) { Coordinate cellPosition(chunkPosition.x * CHUNK_SIZE + x, chunkPosition.y * CHUNK_SIZE ...
ALGO
0.991895
5.350458
d2eb9984-aa62-4a5a-b3c9-e0659c34f2cd
e-dzia/sdizo_2
ShortestPath.cpp
// // Created by Edzia on 2017-04-30. // #include <sstream> #include <chrono> #include "ShortestPath.h" #include "GraphList.h" #include "GraphMatrix.h" #include "Array2.h" string ShortestPath::algorithm1(int start, int end) { //Dijkstra /* * Tworzymy dwa zbiory wierzchoล‚kรณw notChecked i checked. Poczฤ…tkowo zbiรณr not...
ALGO
0.998091
3.755469
8ed9cd31-f417-4896-9a11-08020b20c931
mymyuy/ctdl
c6/b8.cpp
#include <iostream> #include <unordered_set> using namespace std; // Function to check if a number satisfies the conditions bool isValidNumber(int num) { unordered_set<int> digits; // To track unique digits while (num > 0) { int digit = num % 10; // Extract the last digit // Check if the digit...
ALGO
0.999927
6.045826
8c9dbed8-61cf-4c27-9313-a7cc104f8f31
farukbaykara/model-predictive-controller
src/mpc/include/mpc/Ipopt-3.12.7/Ipopt/contrib/MatlabInterface/src/ipopt.cpp
#include "mex.h" #include "iterate.hpp" #include "options.hpp" #include "matlabexception.hpp" #include "callbackfunctions.hpp" #include "matlabinfo.hpp" #include "matlabjournal.hpp" #include "matlabprogram.hpp" #include "IpRegOptions.hpp" #include "IpJournalist.hpp" #include "IpIpoptApplication.hpp" #include "IpSolveSt...
ALGO
0.999513
6.553592
b3b826c5-59fb-4959-abb3-40daad67ce2f
mdurasevic/electoral_systems_combination
crp/crp/SumAggregationStrategy.cpp
#include "SumAggregationStrategy.h" std::vector<double> SumAggregationStrategy::aggregate(std::vector<std::vector<double>>& priorities) { std::vector<double> aggregated; aggregated.resize(priorities[0].size(), 0); for(int i = 0; i<priorities.size(); i++) { for(int j=0;j<priorities[i].size();j++) { aggrega...
ALGO
0.999613
5.361013
c065b2da-03e2-4189-83ec-87c460e36224
swampcoin/bwrgocoin
src/swifttx.cpp
#include "swifttx.h" #include "activemasternode.h" #include "base58.h" #include "key.h" #include "masternodeman.h" #include "net.h" #include "obfuscation.h" #include "protocol.h" #include "spork.h" #include "sync.h" #include "util.h" #include <boost/lexical_cast.hpp> using namespace std; using namespace boost; std::m...
TOOL
0.990001
6.119087
4abbe812-3162-432a-a57a-83dc8eb15ba1
anjalirawattttt/leetcode
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance.cpp
class Solution { public: int findTheCity(int n, vector<vector<int>>& edges, int distanceThreshold) { vector<vector<pair<int,int>>> adj(n); for(auto &e:edges){ adj[e[0]].push_back({e[1],e[2]}); adj[e[1]].push_back({e[0],e[2]}); } int ans=-1; int minn=IN...
ALGO
0.999995
6.121821
43b16e01-1f3b-4dcb-994a-188628414ce8
113bommy/PathRepair
variable_trace/cpp/cpp_code/cpp_correct/cpp_correct_test_7_2.cpp
#include <bits/stdc++.h> #pragma GCC optimize(2, 3, "Ofast") using namespace std; template <typename T1, typename T2> void ckmin(T1 &a, T2 b) { if (a > b) a = b; } template <typename T1, typename T2> void ckmax(T1 &a, T2 b) { if (a < b) a = b; } int read() { int x = 0, f = 0; char ch = getchar(); while (!isdi...
ALGO
0.99999
3.420125
c5147e47-1353-4949-8a8c-b2091aa65338
esix/competitive-programming
e-olymp/7xxx/7565/main.cpp
#include <iostream> #include <utility> #include <vector> #include <string> #include <sstream> #include <algorithm> #include <map> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, k; cin >> n >> k; vector< vector<int> > hardness(n); for (int i = 0; i < n; i++) { int ...
ALGO
0.999869
3.611505
fcbc5205-1dd2-44ea-a659-ca730016aa2f
dkim-coder/CodingTest-practice
BaekJoon/pb_19641/main.cpp
#include <iostream> #include <vector> #include <algorithm> #include <stack> using namespace std; /* ๊ฐ ๋…ธ๋“œ left = ๋ถ€๋ชจ ๋…ธ๋“œ์˜ left + 1 ๊ฐ ๋…ธ๋„์˜ right = left + ์„œ๋ธŒํŠธ๋ฆฌ์˜ ๋…ธ๋“œ์˜ ๊ฐœ์ˆ˜ * 2 + 1 */ int n, r; pair<int, int> ans[100001]; vector<vector<int>> v; int go(int node, int pre, int last) { int subSum = 0; for (auto &i : v[n...
ALGO
0.99991
3.954251
fe6519c2-8a5f-4c87-a180-8349c8a4dee1
alokvadera/cpp-dsa1
maximum average subarray.cpp
class Solution { public: double slidingwindow(vector<int> nums, int k) { int i = 0, j = k - 1; int sum = 0; int maxsum = sum; for (int y = i; y <= j; ++y) { sum += nums[y]; maxsum = sum; } j++; while (j < nums.size()) { sum ...
ALGO
0.999848
6.111293
0120368a-b02e-4ac9-a09f-97028b9ecafa
buglabs/android-buglabs-frameworks-base
media/libstagefright/codecs/aacdec/apply_ms_synt.cpp
/* Pathname: ./src/apply_ms_synt.c ------------------------------------------------------------------------------ REVISION HISTORY Description: Updated pseudocode to correct capitalized format for the IF FOR and WHILE statements. Description: Delete local variable start_indx, since it is never used. Who: ...
ALGO
0.997824
6.462323
6edd1051-3ed2-47c0-9226-643dbe5c9ba6
abhikyadav/Coding
Longest Common Subsequence - GFG/longest-common-subsequence.cpp
//{ Driver Code Starts #include<bits/stdc++.h> const int mod=1e9+7; using namespace std; // } Driver Code Ends // function to find longest common subsequence class Solution { public: //Function to find the length of longest common subsequence in two strings. int lcs(int x, int y, string s1, string s2) ...
ALGO
0.999958
6.123423
febeb08f-8f60-4b26-8f27-a50e4c82f35c
lol-boi/uni_res
sem3/DS/lab9/2.cpp.cpp
#include <iostream> using namespace std; struct Node { int data; Node* next; }; class Stack { Node* top; public: Stack() { top = NULL; } void push(int data) { Node* newnode = new Node; newnode->data = data; newnode->next = top; top = newnode; } void po...
ALGO
0.864295
5.161639
48743789-d944-446d-8240-0118491066a7
Zadid13/PracticeField
popinstr2.cpp
#include <bits/stdc++.h> using namespace std; #define optimize() \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl '\n' int main() { optimize(); string s = "ASADAF"; s.pop_back(); cout << s.back() << endl; return 0; }
ALGO
0.863024
3.066651
a230d408-6f7d-462d-98bd-76e126e3405f
thegamer1907/Code_Analysis
Graphs/125.cpp
#include <cstdio> #include <cstring> #include <algorithm> #include <functional> #include <iostream> using namespace std; char que[55]; int main(){ int n,t; scanf("%d %d\n",&n,&t); scanf("%s",que); for(int i=0;i<t;i++){ for (int j=0;j<n;){ if(que[j]=='B'){ ...
ALGO
0.999804
3.505316
47695f5e-6b10-495a-b2c6-1fe3621edb18
mndmdg/entp-s_schedule_management
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
f82d4d24-e447-4b38-a35f-1c580f6be7f5
lbv/pc-code
solved/0-b/ananagrams/ananagrams.cpp
#include <algorithm> #include <cctype> #include <cstdio> #include <cstring> #include <map> #include <string> #include <vector> using namespace std; #define MAXSZ 1000 #define MAXLEN 20 #define cFor(t,v,c) for(t::const_iterator v=c.begin(); v != c.end(); ++v) typedef map<string, int> SIM; typedef pair<string, int>...
ALGO
0.999402
4.004331
d611010f-1a88-424e-a9a7-590704aa8d12
LXavier133/CP-Respostas
CSES/SeS/MaxSubSum.cpp
#include <bits/stdc++.h> using namespace std; #define __ ios_base::sync_with_stdio(false);cin.tie(NULL); #define fl <<"\n" typedef long long ll; int main(){__ ll n;cin>>n; vector<ll> pSum(n+1,0); for(int i=1;i<n+1;i++){ cin>>pSum[i]; pSum[i]+=pSum[i-1];} ll maxSubSum=pSum[1]; ll minSum=pSum[0]; for(int i=1;i<...
ALGO
0.999832
3.342183
252a8b5e-aa39-400e-9af3-c67f4cb2a45b
ahmedbodi/catcoincore
src/util/asmap.cpp
#include <map> #include <vector> #include <assert.h> #include <crypto/common.h> namespace { constexpr uint32_t INVALID = 0xFFFFFFFF; uint32_t DecodeBits(std::vector<bool>::const_iterator& bitpos, const std::vector<bool>::const_iterator& endpos, uint8_t minval, const std::vector<uint8_t> &bit_sizes) { uint32_t va...
ALGO
0.970984
6.21805
5d5dbcb2-1c9d-488a-92f1-c8431ab321d0
Ibrahim-786/cpp-practice
Cpp-Practice/FunctionPointer/FunctionPtr.cpp
#include<iostream> int min(int var1, int var2) { return var1==var2?var1:var1>var2?var2:var1; } int max(int var1, int var2) { return var1==var2?var1:var1>var2?var1:var2; } int main(int argc, char *argv[]) { int (*fptr) (int, int); fptr = max; std::cout<<(*fptr)(10,20)<<"\n"; fptr = min ; std::cout<<(*fp...
ALGO
0.997629
4.526782
ab53554c-b6bb-4c17-95ad-7bb4696ff2d8
Sachin-Rawat07/LearningCplusplus
bitManipulation/setUnset.cpp
#include <iostream> using namespace std; int main(){ int num; cin>>num; int i; cin>>i; int mask=1<<i; if(num & mask ) cout<<"set"<<endl; else cout<<"unset"<<endl; return 0 ; }
ALGO
0.998404
4.238756