uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
0b4e40c1-9201-419b-9a29-7265035b6dcf | tanvir-50198/Problem_Solving | code_forces_problem_solve/A_Word_Capitalization.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
if (!s.empty()) {
s[0] =toupper(s[0]);
}
cout << s <<endl;
}
| ALGO | 0.994524 | 4.294749 |
51c2b4ba-b2b4-483f-8d91-536ce85f9c58 | libh1004/linh | btvn2/BTVN 4/In Ra Cac So Chan Nho Hon n.cpp | #include <stdio.h>
int main(){
int n,i;
printf("n=");
scanf("%d",&n);
for(i=0;i<n;i++){
if(i%2==0){
printf("cac so chan nho hon la %d \n",i);
}
}
}
| ALGO | 0.997437 | 3.221244 |
b2291d36-6535-4161-9cbd-d4889f4f6431 | AyushMaheshwari2002/LeetCode | 0108. Convert Sorted Array to Binary Search Tree.cpp | /* Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binary search tree.
A height-balanced binary tree is a binary tree in which the depth of the two subtrees of every node never differs by more than one.
Example 1:
In... | ALGO | 0.999999 | 6.83318 |
df532f53-7839-47f3-ae7c-de5e67ef6a96 | parameshkaramsetty/Pro | DSA/Data Structures/Arrays/operations/insertion/insertion_at_end.cpp | // when ever we shift the elements from left to right do it from the end of the array
#include<bits/stdc++.h>
using namespace std;
int insert(int a[],int n,int c,int k){
if(c<n){
a[c]=k;
return c+1;
}
return n;
}
int main(){
int a[6] = {1,2,3,4,5};
int n = insert(a,6,5,8);
// co... | ALGO | 0.999564 | 3.427197 |
057298c3-f19f-4f29-b4d4-c01c0bf78b67 | zunayeds/ostad | Assignments/string.cpp | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
// Task 1
string getShuffledString(string s, int* indices) {
string result = s;
for (int i = 0; i < s.length(); i++) {
result[indices[i]] = s[i];
}
return result;
// Time complexity = O(n)
// Space complexity = O(1)
}
... | ALGO | 0.998906 | 5.964029 |
c43acb6f-184c-4fed-b029-3c86e617a63e | yang48699997/code | cf/round/954/1986D.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
int T;
void solve(){
int n;
string s;
cin>>n>>s;
vector<int> a(n-1);
vector<vector<int>> dp(n,vector<int>(n,-1));
auto dfs=[&](auto &&self,int l,int r)->int{
if(l==r)return a[l];
if(dp[l][r]!=-1)return dp[l][r];
... | ALGO | 0.999872 | 4.586882 |
f242172b-fb69-43bf-8a3e-0e2f543c64a4 | Kiran-Chaitu/LeetCode | 1765-merge-in-between-linked-lists/merge-in-between-linked-lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* mergeInBetw... | ALGO | 0.999985 | 4.824314 |
300f161c-d909-4327-b669-d4d46b8071d6 | HafizulHaque/Coding-Problem-Solving | Contests/yamin03/E.cpp | // accepted
#include <bits/stdc++.h>
using namespace std;
int main(){
//FILE *inp = freopen("input.txt", "r", stdin);
int n, evenOdd = 0, oddEven = 0, evenEven = 0, oddOdd = 0;
int a, b, totalA = 0, totalB = 0;
cin>>n;
while(n--){
cin>>a>>b;
if(a%2==0&&b%2==0) evenEven++;
e... | ALGO | 0.999978 | 4.230479 |
ebec81e6-2fe0-4528-ac52-dca91495d5e1 | baoxuezhao/solution_set | leetcode/Valid Palindrome.cpp | //be careful fo the conditional case in the while
class Solution {
public:
bool isPalindrome(string s) {
const int n = s.size();
if(n == 0) return true;
int l = 0, r = n-1;
while(l <= r)
{
if(!isalphanum(s[l]))
l++;
else if(!i... | ALGO | 0.999635 | 6.057384 |
97b5ff85-7ff4-40cb-99d7-498698a4eb89 | adityagaur0/DSA-Masterclass | 4.CB -Lectures codes/Lec11/binarySearch.cpp | #include <iostream>
using namespace std;
int binarySearch(int arr[],int n,int target){
int start=0;
int end=n-1;
while(start<=end){
//int mid=(start+end)/2;
int mid=start+(end-start)/2;
if(target==arr[mid]){
return mid;
}else if(target>arr[mid]){
... | ALGO | 0.999408 | 5.42341 |
3774c8d8-a8ba-4385-af61-71b8004fb711 | Danielc2016/LeetCodeCpp | 0347_TopK_Frequent_Elements.cpp | class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k)
{
typedef pair<int, int> pairs;
unordered_map<int, int> freq_map;
vector<int> res;
for( auto i : nums)
{
freq_map[i]++;
}
priority_queue<pairs, vector<pairs>, greater<p... | ALGO | 0.999995 | 6.005328 |
06f2b11f-5967-4729-8a6c-e1224ed6b06a | XS-MLVP/picker | src/appimage/configuration.cpp | #include <bits/stdc++.h>
#include <bits/fs_fwd.h>
#include "picker.hpp"
namespace picker::appimage {
/*
* AppImage support explanation:
* This file contains functions to initialize the application image configuration, extract the template and library
* directories from the application image.
* The app... | TOOL | 0.866886 | 7.311819 |
52dc9ea2-ecd6-4235-bc82-c4d059484ed4 | laboptoz/cuViolaJones | opencv/sources/samples/cpp/mask_tmpl.cpp | #include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include <iostream>
using namespace std;
using namespace cv;
int main( int argc, const char** argv )
{
CommandLineParser parser(argc, argv,
"{ i | ../data/lena_tmpl.jpg |image name }"
"{ t | ../data/tmpl.png |template name }"
"{... | ALGO | 0.943645 | 4.281988 |
7611fc11-337b-459b-9811-1503dd55660d | Thiagohnc/Competitive-Programming | URI/2241.cpp | /* Problem: https://www.urionlinejudge.com.br/judge/en/problems/view/2241/ */
#include <bits/stdc++.h>
#include <string.h>
#include <cmath>
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define ull unsigned long long int
#define ll long long int
#define vi vector<int>
#define vii vector<pa... | ALGO | 0.999921 | 3.439961 |
e9c073ad-3a15-40a7-988a-ef439937e95e | Pallabch/DSA | AdityaVerma/RodCuttingProblem.cpp | #include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <unordered_map>
#include <climits>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> p32;
typedef pair<ll, ll> p64;
typedef pair<double, double> pdd;
typedef vector<ll> v64;
typedef vector<int>... | ALGO | 0.999792 | 4.416554 |
38c1b4cf-555e-4efa-9c43-09e767eaf10c | ishandutta2007/codeforces | flowerletter/normal/1556/D.cpp | /*mjytxdy!*/
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = (a); i <= int(b); i ++)
#define per(i, a, b) for(int i = (a); i >= int(b); i --)
#define fi first
#define se second
#define all(s) s.begin(),s.end()
#define trv(i, u, v) for(int i = head[u], v = e[i].to; i; v = e[i = e[i].next].to)
#define sz(s) (in... | ALGO | 0.999912 | 3.156647 |
0f20370a-dcb7-4e45-bebe-7f02657e9b0b | shaheen-rasheed/guvi_projects | seed_program.cpp | #include<iostream>
using namespace std;
int prod(int k)
{
int res=k;
while(k!=0){
res*=k%10;
k/=10;
}
return res;
}
int main(){
int k;
cin >> k;
for(int i=1;i*i<=k;++i){
if(k%i==0){
if(prod(i)==k)
cout << i << endl;
if(k/i!=i && prod(k/i)==k)
cout << k/i << endl... | ALGO | 0.999964 | 4.18182 |
0440648e-6a19-4ff0-9903-9336b04661f4 | PS4-Emu-Dev/DEngine-pcsx4 | DiligentCore/ThirdParty/SPIRV-Tools/source/opt/local_redundancy_elimination.cpp | #include "source/opt/local_redundancy_elimination.h"
#include "source/opt/value_number_table.h"
namespace spvtools {
namespace opt {
Pass::Status LocalRedundancyEliminationPass::Process() {
bool modified = false;
ValueNumberTable vnTable(context());
for (auto& func : *get_module()) {
for (auto& bb : func)... | ALGO | 0.912436 | 7.862739 |
a6802af4-c88a-4635-bd87-5171207a31c5 | granddaifuku/library | test/aoj/DSL_2_F.test.cpp | #define PROBLEM "http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_F"
#include <bits/stdc++.h>
using namespace std;
#include "../../DataStructure/lazy_segment_tree.cpp"
using ll = long long;
const ll INF = 2147483647;
int main() {
int n, q;
cin >> n >> q;
auto f = [](ll a, ll b) { return min(a,... | ALGO | 0.998829 | 4.765697 |
ea82ac97-d802-42a0-b45c-cab487aa26c4 | debug34ed/Rosetta-indivisual | cc/third_party/eigen/doc/examples/TemplateKeyword_flexible.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
template <typename Derived1, typename Derived2>
void copyUpperTriangularPart(MatrixBase<Derived1>& dst, const MatrixBase<Derived2>& src)
{
/* Note the 'template' keywords in the following line! */
dst.template triangularView<Upper>() = src.template... | TOOL | 0.985295 | 5.804369 |
3cc32571-c4a7-456b-95a7-849774801f24 | Shyamsundaryadav23/C-_Project | Assignment_No_11.cpp | /*
Assignment No 11
Problem Statement
Consider an employee database of N employees. Make use of a hash table implementation to
quickly look up the employer's id number.
Name: Shyam Sundar Yadav
PRN: 123B1B267
Batch: D3
Course: Data Structures Laboratory
*/
#include <ios... | ALGO | 0.997455 | 6.879895 |
f73a73f3-3c1b-4b06-8983-49da1243a6cd | 2745518585/code | U1774.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=1000001;
int n;
struct str
{
int k,t;
}a[N];
bool cmp(str a,str b)
{
return a.t>b.t;
}
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;++i)
{
scanf("%d%d",&a[i].t,&a[i].k);
}
sort(a+1,a+n+1,cmp);
priority_queue<int> Q;
in... | ALGO | 0.999962 | 3.160697 |
8ee6f737-979c-421a-88e5-e7f0bf8058f1 | batdefi/UTN- | Mochila.cpp | #include<bits/stdc++.h>
using namespace std;
const int MAXN=1001;
int dp[MAXN][MAXN];
int main(){
int k;
cin>>k;
while(k){
k--;
int s,n;
cin>>s>>n;
vector<pair<int,int> > objetos(n);
for(int i=0;i<n;i++){
cin>>objetos[i].first>>objetos[i].second;
}
for(int o=0;o<=n;o++){
for(int capacidad=0;cap... | ALGO | 0.999568 | 3.666677 |
2f078a6f-df77-46f1-98a0-1220cfd36b3e | dheeraj557/PROBLEM-SOLVING | 136-single-number/136-single-number.cpp | class Solution {
public:
int singleNumber(vector<int>& nums) {
unordered_map<int,int>m;
for(int i=0;i<nums.size();i++)
{
m[nums[i]]++;
}
for(int i=0;i<nums.size();i++)
{
if(m[nums[i]]==1)
return nums[i];
}
return... | ALGO | 0.999959 | 5.476216 |
fe8649f7-d6de-452a-b6b1-b79cb3350ccc | lizarasho/algorithms-itmo | 2-3. Queries on Tree Paths/F - Genealogy.cpp | #include <iostream>
#include <vector>
using namespace std;
struct node
{
node * left;
node * right;
node * parent;
int size;
node() : left(nullptr), right(nullptr), parent(nullptr), size(1) {};
};
vector<node *> pointer;
vector<int> group;
int k;
void set_parent(node * x, node * p)
{
if (x)
... | ALGO | 0.999592 | 4.176791 |
75ff76a7-6c35-4f3a-bc04-f8e7ac5f851b | Varlode/Code | CodeCpp/Codeforces/Normal/1878/d.cpp | #include<bits/stdc++.h>
using namespace std;
int a[300000];
int main() {
int t; cin >> t;
while (t--) {
int n, k; cin >> n >> k;
string str; cin >> str;
vector<int> l(k), r(k);
for (int i = 0; i < n; i++) a[i] = i;
for (int i = 0; i < k; i++) {
ci... | ALGO | 0.999903 | 3.445501 |
14311090-8d11-4519-8c62-c2af444ab20e | BhryanS2/studying-programming | URI/1865.cpp | /*
beecrowd | 1115
Quadrante
https://www.beecrowd.com.br/judge/pt/problems/view/1115
*/
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> PII;
#define REP(i,n) for (int i=0; i<(n); ++i)
#define FOR(var,pocz,koniec) for (int var=(pocz); var<=(koniec); ++var)
#define FORD(var,pocz,koniec) for (int va... | ALGO | 0.998302 | 4.400107 |
0e224e4e-3944-449e-9127-c5c833a2af65 | ajimenezh/Programing-Contests | Topcoder/PairsOfStrings.cpp | #include <iostream>
#include <sstream>
#include <vector>
#include <string.h>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <stdio.h>
using namespace std;
#define rep(it,s) for(__ty... | ALGO | 0.999855 | 4.085835 |
cfc99cf6-edb4-43d1-9fe2-8acbe33b4d30 | Mwako/deps | boost/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 between routers stored in an array.
Edge edges[] = {
Edge(A, B), Edge(A, C),
Edge(B... | ALGO | 0.999748 | 4.852907 |
d60d1f90-373a-459a-93ff-8be43f0c0716 | PLSysSec/hfi_firefox | toolkit/components/terminator/nsTerminator.cpp | /**
* A watchdog designed to terminate shutdown if it lasts too long.
*
* This watchdog is designed as a worst-case problem container for the
* common case in which Firefox just won't shutdown.
*
* We spawn a thread during quit-application. If any of the shutdown
* steps takes more than n milliseconds (63000 by ... | TOOL | 0.887707 | 7.274312 |
455f5aeb-0ca6-4bda-8bcb-4fb565b181a4 | psk001/Leetcode-Problems | 112-path-sum/112-path-sum.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.99995 | 6.075159 |
6177364b-bdea-490b-9d46-ca5721414200 | Dafwan01/lab_desain_dan_analisis_algoritma | Pertemuan empat/Tugas/Tugas 2.cpp | #include <iostream>
using namespace std;
class hp {
private:
string nama[10];
string no[10];
int lop;
public:
hp(string a[], string b[], int z) {
for (int i = 0; i < z; i++) {
nama[i] = a[i];
no[i] = b[i];
}
lop = z;
}
~hp() {
for (int ... | TOOL | 0.851925 | 4.325099 |
73da195d-a25a-4084-9c48-cd9980e8b93a | lex-fr/Genetic-Algorithm | src/main.cpp | #include <iostream>
#include <ctime>
#include <chrono>
#include <bitset>
#include "Sudoku.hpp"
#include "GeneticAlgorithm.hpp"
template<class T>
void runTests(std::ostream &output, GeneticAlgorithm<T> &ga, int repetitions)
{
int durationInit = 0, durationSearch = 0;
int average = 0, best = 10000, nSolve = 0; ... | ALGO | 0.977601 | 5.904152 |
73282f19-4fef-4167-8052-a144a5290a8a | rheasridhar/MAD_Project1 | flashcard_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.998558 | 6.76073 |
12a6af34-14ac-421f-8529-ca8006eda978 | Sameermoyal/11june | main (2).cpp | //5. create a map of name and salary and find if the user input name is exist in map.
#include<bits/stdc++.h>
using namespace std;
int main()
{
map<string,double>nameSalPair={
{"Jhon",50000},
{"Kiran",60000},
{"Tisha",89798},
{"Neha",79794},
{"Aman",68498}
};
string ... | ALGO | 0.940131 | 4.237633 |
d0a554fb-ebc5-41ae-bcff-766c11845a90 | gcosmin1989/CPP_exercises | OOP_Exercises/Circle_exercise_C++/Circle_exercise_C++.cpp | #include <iostream>
#include <cmath>
using namespace std;
class Circle
{
private:
float radius = 0.0;
const float PI = 3.14159;
public:
void set_radius(float radius_val) {
radius = radius_val;
}
float calcArea() {
return PI * pow(radius,2);
}
float calcCirc() {
return... | TOOL | 0.989925 | 5.95895 |
1254b521-af4a-4983-8036-566dcd766600 | NishantKSinha/LeetCode | 0229-majority-element-ii/0229-majority-element-ii.cpp | class Solution {
public:
vector<int> majorityElement(vector<int>& nums) {
// Create a frequency map to store the count of each element
unordered_map<int, int> elementCountMap;
// Iterate through the input array to count element occurrences
for(int i = 0; i < nums.size(); i++... | ALGO | 0.999978 | 6.469372 |
35dfa079-2d5d-471a-8597-072c756d5f75 | amitprat/PracticeCode | arrangeArrSuchThatA[i]BecomesA[A[i]].cpp |
void convert(int a[],int n)
{
for(int i=0;i<n;i++)
{
a[i] += (a[a[i]]%n)*n;
}
cout<<"Original - \n";
for(int i=0;i<n;i++)
cout<<a[i]/n<<" ";
cout<<endl;
cout<<"Mod - \n";
for(int i=0;i<n;i++)
cout<<a[i]%n<<" ";
cout<<endl;
}
//for geeksforgeeks
1) Increase every array element arr[i] ... | ALGO | 0.999981 | 3.445976 |
f67fa382-befe-4394-9b8a-b4d2f7a17a39 | Jeevadharshininanjundan/FullStack- | CompilerServer/codes/5fc59429-8f9e-4a6b-a933-b281dda8690e.cpp | #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b; // Read two integers from input
cout << a + b; // Print their sum
return 0;
}
| ALGO | 0.980729 | 4.7425 |
49b4750e-69dc-4d9f-9675-165c4c043448 | sudouserx/food_delivery_app_flutter | 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 |
aee8aafc-76a3-44d0-868c-5916e9e0f95d | bityj/slam14 | ch03/examples/plotTrajectory.cpp | #include<pangolin/pangolin.h>
#include<Eigen/Core>
#include<unistd.h>
#include <Eigen/Geometry>
using namespace std;
using namespace Eigen;
string trajectory_file = "../trajectory.txt";
void DrawTrajectory(vector<Isometry3d, Eigen::aligned_allocator<Isometry3d>>);
int main(int argc, char **argv){
vector<Isometr... | TOOL | 0.960732 | 3.872628 |
6c54db78-cebb-4fff-9ae6-191b8a323d60 | marianowas11/OurSnake | Snake/Library/PackageCache/com.unity.ide.visualstudio@2.0.11/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.93893 | 6.947423 |
5cfee560-d990-49c2-b5af-1871413580b8 | liangyh911/ATTNChecker | pytorch/third_party/eigen/bench/sparse_cholesky.cpp | // #define EIGEN_TAUCS_SUPPORT
// #define EIGEN_CHOLMOD_SUPPORT
#include <iostream>
#include <Eigen/Sparse>
// g++ -DSIZE=10000 -DDENSITY=0.001 sparse_cholesky.cpp -I.. -DDENSEMATRI -O3 -g0 -DNDEBUG -DNBTRIES=1 -I /home/gael/Coding/LinearAlgebra/taucs_full/src/ -I/home/gael/Coding/LinearAlgebra/taucs_full/build/lin... | ALGO | 0.995739 | 4.173108 |
825832c0-1285-4230-a9fd-5e3bb3191659 | ShaoChenHeng/codeOfACM | search/common/pta77.cpp | #include<cstdio>
#include<cstring>
using namespace std;
int num[1000];
int n,cnt;
void fun( int n, int sum , int cur, int pos)
{
if ( sum == n )
{
cnt ++;
if ( cnt > 1 ) printf(";");
printf("%d=",n);
for( int i = 1; i < pos; i++ )
{
printf("%d", num[i]);
if ( i != pos - 1 ) printf("+");
}
if... | ALGO | 0.999571 | 3.673575 |
f95a618a-4196-4031-973a-e4f0710c343c | PaukIsUha/optimizing_formating_code | predictions/full_output_predicted_submissions/Codenet/p00207/240015030/2.cpp | #include <iostream>
using namespace std;
int Board[102][102];
bool isOK;
int xs, ys, xg, yg;
void DFS(int c, int x, int y) {
if (Board[x][y] != c) {
return;
} else if (x == xg && y == yg) {
isOK = true;
return;
}
Board[x][y] = 0;
DFS(c, x + 1, y);
DFS(c, x, y + 1);
DFS(c, x - 1, y);
DFS(c, x... | ALGO | 0.999674 | 3.902535 |
8b852d49-47f1-4c5f-a7d5-c8376d3dba17 | Mulab11/cntt2016-hw1 | TC-SRM-567-div1-500/zsyzzsoft.cpp | #include <algorithm>
using namespace std;
int cnt[50][26];
class StringGame
{
public:
int n, m;
bool Check(int x)
{
bool win[50] = {0};
win[x] = true;
for(int t = 0; t < 26; t++) //进行足够的比较轮次
{
for(int i = 0; i < 26; i++)
{
bool flag = true;
for(int j = 0; j < n && flag; j++)
flag &= win[j... | ALGO | 0.999967 | 4.216932 |
d213cfd4-4b01-4234-b11c-d5adee5adc62 | eashwaranRaghu/Data-Structures-and-Algorithms | References/Competitive Programming 3/ch4/bfs.cpp | // February 2019 note:
// This code uses new C++17 structured binding
// use this compiler setting "g++ -O2 -std=gnu++17 {cpp17file}"
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii; // In this chapter, we will frequently use these
typedef vector<ii> vii; // three data type shortcuts. They may... | ALGO | 0.999709 | 4.829721 |
9246b69e-6b8e-4c0c-9155-7d5ac8094bf0 | anandhu720/Leetcode-Solutions | 1155-number-of-dice-rolls-with-target-sum/1155-number-of-dice-rolls-with-target-sum.cpp | class Solution {
public:
int mod = 1e9 + 7;
int numRollsToTarget(int n, int k, int target) {
vector<vector<int>> dp(n+1,vector<int>(target+1,-1));
return dfs(n,k,target,dp)%mod;
}
long long dfs(int n,int k,int target,vector<vector<int>> &dp) {
if(n == 0 or ... | ALGO | 0.999995 | 5.9006 |
b266cb3e-c24d-4656-8e2b-957e445a4c75 | cy-org/docs-samples | snippets/cpp/VS_Snippets_Misc/wrl-consume-event/cpp/wrl-consume-event.cpp | // <snippet1>
// wrl-consume-events.cpp
// compile with: runtimeobject.lib
// <snippet2>
#include <Windows.Devices.Enumeration.h>
#include <wrl/event.h>
#include <stdio.h>
using namespace ABI::Windows::Devices::Enumeration;
using namespace ABI::Windows::Foundation;
using namespace Microsoft::WRL;
using namespace Micro... | TOOL | 0.855621 | 6.83794 |
8d13ee5b-d768-490c-bf7f-c0f00b39133f | onbings/dis-client | bofwebrpc/lib/src/bofwebsocket.cpp | #include <bofstd/bofenum.h>
#include <bofstd/boffs.h>
#include <bofstd/bofsocket.h>
#include "bofwebrpc/bofwebsocket.h"
// https://apidog.com/blog/how-to-implement-websocket-_pInput-c/
// https://github.com/iamscottmoyers/simple-libwebsockets-example/blob/master/server.c
// https://github.com/iamscottmoyers/simple-li... | WEB | 0.93338 | 5.009549 |
620b59c7-1bc5-412f-806f-745bfe90bb37 | Pulseczar1/CustomTF-For-The-People-Server-Progs | idmonsters/common.cpp | /*
common.qc - ai replacement functions, less messy and possibly improved upon
TODO: move into another folder and rename to something generic like npc_ai.qc or something
*/
#include "progs.h"
#ifndef PR_COOP_MODE_ENHANCED
//#pragma DONT_COMPILE_THIS_FILE
#else
#include "coop_defs.h"
#include "cpstuff.h"
#include "... | ALGO | 0.950522 | 4.682275 |
c21da139-835a-4265-99e1-2eb4d909c788 | TechAoba/OJ-code | 洛谷/P1108 低价购买.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#define Max(a,b) (a>b?a:b)
#define LL long long
using namespace std;
int A[5005], N;
LL num[5005], way[5005], len=0, ans=0; //num way
int main()
{
int i, j;
scanf("%d", &N);
for(i=1;i<=N;i++) {
scanf("%d", &A[i]);
num[i] = 1; way[i] = 0;
}
for(i=1;i<=N... | ALGO | 0.999697 | 3.197996 |
b645a4ae-4eee-4a15-9812-ee82b0502630 | kukukuu/content | lqcd_mc/lattice_example.cpp | //
// Created by louis on 2021/8/29.
//
#include <iostream>
#include <mpi.h>
#include "target/hip/hipTarget.h"
#include <vector>
// hip header file
#include "hip/hip_runtime.h"
#include "hip/hip_complex.h"
#include "operator.h"
__global__ void transfer_x_f(double *src, double *dest_b, double *U,
... | ALGO | 0.99875 | 3.201367 |
b6e483fb-9574-48b5-afdb-08d0e678e0fb | LukasPtakauskas/Learning-cpp | problems/0x01 QuadraticFormula/main.cpp | #include <iostream>
#include <math.h>
#include <iomanip>
// this solves x =( b+ sqrt(b^2 - a*c) ) / 2*a
int main(int argc, char *argv[]){
double a, b, c; // input the
double x;
scanf("%lf%lf%lf",&a,&b,&c);
x = ( b + sqrt(pow (b,2) - (a*c)) ) / (2*a);
/*
// rounding the number
x = round(x * 1000);
x =... | ALGO | 0.998944 | 3.691267 |
b275f4c4-a12b-40fc-8e2c-9ca3840be3b1 | sarvex/leetcode-nativescript | solution/0500-0599/0501.Find Mode in Binary Search Tree/Solution.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999994 | 6.516222 |
55bcb434-aeed-4377-bbf2-7eccc73a7a3b | Best-Verie/sorting-algorithms-cpp | linearSearch.cpp | //
// Created by DELL on 6/16/2021.
//
#include <iostream>
using namespace std;
int search(int arr[], int n, int x) {
int i;
for (i = 0; i < n; i++) {
if (arr[i] == x) {
return i;
}
}
return -1;
}
int main() {
int arr[] = {2, 3, 4, 10, 40};
int x = 10;
int n =... | ALGO | 0.999575 | 5.43229 |
6d4c97cb-e1d0-40cc-935e-c7f942853a98 | abusomani/Leetcode | Practice/kthLargest(MinHeap).cpp | class KthLargest {
public:
priority_queue<int, vector<int>, greater<int>> MnHp; // min heap
int kth ;
KthLargest(int K, vector<int>& nums) {
kth = K;
int N = nums.size();
for(int i=0;i<N;i++){
MnHp.push(nums[i]);
if(MnHp.size() > K)
Mn... | ALGO | 0.999953 | 5.842616 |
0a783e04-c938-4551-ba41-b9d050b0a118 | youssif-mohamed1/Problem-Solving | Codeforces 800 rated/A - Lucky?.cpp | #include <iostream>
#include <string>
#include <cstring>
#define endl cout<<endl;
#define yes cout<<"YES";
#define no cout<<"NO";
using namespace std;
int main()
{
int n = 0;
cin >> n;
string* arr = new string[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int x = 0,sum = 0;;
for (int i = 0; i < n; i++)
... | ALGO | 0.999621 | 3.744874 |
d2a85e81-e256-45d4-9b3d-a7e77969ab75 | xin3liang/platform_external_chromium_org_third_party_WebKit | Source/core/rendering/line/LineBreaker.cpp | #include "config.h"
#include "core/rendering/line/LineBreaker.h"
#include "core/rendering/line/BreakingContextInlineHeaders.h"
namespace blink {
void LineBreaker::skipLeadingWhitespace(InlineBidiResolver& resolver, LineInfo& lineInfo,
FloatingObject* lastFloatFromPreviousLine, LineWidth& width)
{
while (!res... | TOOL | 0.891394 | 7.619594 |
316d4c0e-196e-4bf3-aa98-be85cf46a693 | Marcos03BR/SoloLearn-CPP | C++ Intermediate/4. Templates, Exceptions, and Files/Template Specialization/Template_Specialist.cpp | // Create the template specialization, so that the code in main executes correctly.
#include <iostream>
using namespace std;
template <class T>
class Div {
public:
Div (T x, T y) {
cout << x / y <<endl;
}
};
template <>
class Div <string>{
public:
Div (string x, string y) ... | ALGO | 0.893184 | 5.150401 |
58f8a0f7-f9dd-49ea-92ba-7f4dcb2b5ee2 | shaafsalman/Data-Structures | Trees/Ds-Solved/.history/Part 4/ethics_20241014222711.cpp | #include <iostream>
#include <memory>
#include <vector>
#include <queue>
#include <functional> // Include this header
#include "../Part 3/avl.h"
using namespace std;
// This function calculates the maximum applicants that you can shortlist
template <class T, class S, class C>
int AVL<T, S, C>::number_to_shortlist(sha... | ALGO | 0.998592 | 5.877214 |
7d6664a2-0b05-4a3f-9619-7ec9648b5ad6 | tedouni/schoolAssignments | C++/orderedLinkedList/OrderedLinkedList.cpp | #include "OrderedLinkedList.h"
OrderedLinkedList::OrderedLinkedList()
{
list=NULL;
}
void OrderedLinkedList:: insert(int x)
{
node* p=list, *q=list, *r;
r=new node;
r->info=x;
r->next=NULL;
while (p!=NULL && p->info<x)
{
q=p;
p=p->next;
}
if ... | ALGO | 0.974764 | 3.820835 |
6903417a-2474-431c-9060-457c5f8fcdce | LLostInDarkness/DSA | assignments/as07/p7_main.cpp | /*
Assignment 7: Binary Search Tree
p7_main.cpp
Tested/Works
Purpose: Input what action you want to do (insert, delete, and more)
*/
#include "bst_Funcs.h"
#include <unordered_map>
#include <iostream>
std::pair<std::string, int> split(std::string line_input, std::string line_split = " ") {
auto index = lin... | ALGO | 0.998227 | 5.410019 |
ade370bb-33ac-4478-bda0-98f1ced77604 | parth-kabra/DSA | GFG/Value equal to index value.cpp | /*
https://practice.geeksforgeeks.org/problems/value-equal-to-index-value1330/1/?company[]=Amazon&company[]=Amazon&problemStatus=unsolved&page=1&query=company[]AmazonproblemStatusunsolvedpage1company[]Amazon
*/
// { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User functio... | ALGO | 0.999722 | 5.138579 |
1ff20ce0-976c-4491-9eec-06bd6973311a | MikheevD/Labs_PSTU_IVT-22-1B | LABS-2-semestr/Lab5/Lab5.cpp | // Pro1.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
#include <iostream>
#include <conio.h>
#include <windows.h>
using namespace std;
double summa(double array[50][50], int m, int i, int j);
bool proverka(double array[50][50], int n, int m);
//-------------------------... | ALGO | 0.999064 | 3.310089 |
82a78469-70ed-4bba-b883-7741effc604f | Bit-Dong/C-plus-plus_based | 蓝桥杯/质数.cpp | /*
֪һ2ڶ 35...
2019Ƕ٣
*/
#include <iostream>
using namespace std;
int main()
{
// ڴĴ
int flag=0;
int num=2;
for(int i=5;i<20000;i++){
flag=0;
for(int j=2;j<i;j++){
if(i%j==0){
flag=1;
break;
}
}
if(flag==0){
num++;
if(num==2019) cout<<i;
}
}
retu... | ALGO | 0.999182 | 4.25707 |
608be472-7ef7-4572-88a3-977d6b7c4b2e | simran1802/Leetcode-September-Challenge | 19.cpp | class Solution {
public:
vector<int> sequentialDigits(int low, int high) {
queue<int> q;
for(int i=1;i<=9;i++){
q.push(i);
}
vector<int> res;
while(!q.empty()){
int f = q.front();
q.pop();
if(f<=high && f>=low){
... | ALGO | 0.999841 | 6.03615 |
7ce07728-3fa6-4482-b99d-ddde4ba899cc | SOAR-Payload-Team/KalmanFilter | KalmanFilterCPP/eigen-3.4.0/eigen-3.4.0/doc/examples/TutorialInplaceLU.cpp | #include <iostream>
struct init {
init() { std::cout << "[" << "init" << "]" << std::endl; }
};
init init_obj;
// [init]
#include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXd A(2,2);
A << 2, -1, 1, 3;
cout << "Here is the input matrix A before decompositi... | ALGO | 0.999106 | 3.757983 |
3ee8faca-8774-4f84-b129-45db7e1c96c5 | fakleingithub/udacity_highway_driving | src/Eigen-3.3/doc/examples/QuickStart_example2_dynamic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXd m = MatrixXd::Random(3,3);
m = (m + MatrixXd::Constant(3,3,1.2)) * 50;
cout << "m =" << endl << m << endl;
VectorXd v(3);
v << 1, 2, 3;
cout << "m * v =" << endl << m * v << endl;
}
| ALGO | 0.998295 | 3.497552 |
58b8f479-c6b2-4715-97ff-22242d60101a | swang109/leetcode | integer_to_english_words.cpp | #include<iostream>
using namespace std;
class Solution {
public:
string digits[20] = {"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"};
string tens[10] = {"Zero", "Ten", ... | ALGO | 0.997302 | 6.409251 |
ab6fb732-a97a-4a8c-a5dc-38d2f5a167df | AbdulRahmanAzam/DSA | FINALS linked list.cpp | #include <bits/stdc++.h>
using namespace std;
// --------------------------------- SINGLY LINKED LIST ---------------------------------
// class Node{
// public:
// int data;
// Node* next;
// Node(int data= 0, Node* next = nullptr) : data(data), next(next) {}
// };
// class SinglyLinkedList{
// ... | ALGO | 0.999442 | 3.977779 |
1c2d235a-aa53-4f80-9355-858464bb011c | VaultaFoundation/mandel-eos-vm | tools/addr2line.cpp | #include <eosio/vm/backend.hpp>
#include <iostream>
#include <iomanip>
#include <cctype>
struct nm_debug_info {
using builder = nm_debug_info;
void on_code_start(const void* compiled_base, const void* wasm_code_start) {
wasm_base = wasm_code_start;
}
void on_function_start(const void* code_addr, c... | TOOL | 0.929632 | 6.507752 |
122e9526-e345-4ecb-91e2-b3747be60277 | OCIoficial/2015-11-Final-Nacional | contest/C - interestelar/attic/generator.cpp | #include <iostream>
#include <cstring>
#include <string>
#include <cstdlib>
#include <vector>
#include <random>
#include <chrono>
#include <set>
using namespace std;
void usage(char *);
void swap(vector<int>&, int, int);
default_random_engine gen;
int main (int argc, char *argv[]) {
/* Input */
int n = 5, s =... | TOOL | 0.948652 | 3.480021 |
2e956688-3d99-4d35-897a-b7b75fadb67c | saurav23/PracticeDSA | Recursion1/countDigits.cpp | #include <iostream>
using namespace std;
// fuction
int count(int n)
{
// base case
if (n == 0)
{
return 0;
}
int smallAns = count(n / 10);
return smallAns + 1;
}
// main
int main()
{
int n;
cin >> n;
} | ALGO | 0.997335 | 3.854324 |
253e1c6f-e49a-4ec9-a660-1273eb497c5c | devtarsem/Data_structures | arrays/duplicated_nums_with_constant_space.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
vector<int> nums = {3,3,3,3,3};
std::sort(nums.begin(), nums.end());
for(int i = 0; i<nums.size()-1; i++){
if(nums[i] == nums[i+1]){
return nums[i];
}
}
} | ALGO | 0.999538 | 3.96521 |
30ed3352-e5ce-48b5-a637-5f9f3ebaf574 | zxuu/BITReexamination | DataStruct/Queue/DogAndCat.cpp | /*
猫狗收容所
*/
#include <iostream>
#include <cstdio>
#include <queue>
using namespace std;
struct animal{
int number;
int order;
animal(int n,int o): number(n),order(o){ //构造函数
}
};
int main(){
queue<animal> cats;
queue<animal> dogs;
int n;
int order = 0;
scanf("%d", &n);
f... | ALGO | 0.999947 | 3.643339 |
c4e1abed-b0f4-4253-9aaa-d68bb53b5010 | sarvex/leetcode-cpp | solution/0500-0599/0576.Out of Boundary Paths/Solution.cpp | class Solution {
public:
int m;
int n;
const int mod = 1e9 + 7;
int f[51][51][51];
int dirs[5] = {-1, 0, 1, 0, -1};
int findPaths(int m, int n, int maxMove, int startRow, int startColumn) {
memset(f, 0xff, sizeof(f));
this->m = m;
this->n = n;
return dfs(startRow... | ALGO | 0.999976 | 5.723844 |
64831a2b-59a2-49f6-8a48-0779d67489f9 | vedantBCodes/Programs-on-CPP | Class programs/perfectNumber.cpp | #include<iostream>
using namespace std;
class perfect_no
{
private:
int num,i,sum=0;
public:
input()
{
cout<<"Enter a number:";
cin>>num;
}
process()
{
for(int i=1;i<num;i++)
{
if(num%i==0)
{
sum=sum+i;
}
... | ALGO | 0.999826 | 4.322833 |
217ba282-0457-449d-a1a8-43ac111dfe35 | beingyasirarfat/ALGORITHM | SORTS/Pigeonhole.cpp | #include<bits/stdc++.h>
using namespace std;
#define whats(x) cout<< #x << " is " << x <<endl;
void PigeonHole(int *arr,int size){
auto min = min_element(arr,arr+size);
auto max = max_element(arr,arr+size);
unsigned int range = *max - *min +1;
vector<int> holes[range];
for(siz... | ALGO | 0.999903 | 4.043016 |
d67df97d-e102-48cb-b1e2-f136b6cac6cd | Shellyda/leetcode-algorithms-challenges | trees/union_find/001_redundant_connection/solution.cpp | #include <unordered_map>
#include <vector>
using std::unordered_map;
using std::vector;
class Solution
{
public:
unordered_map<int, int> parent;
unordered_map<int, int> rank;
vector<int> findRedundantConnection(vector<vector<int>> &edges)
{
int n = edges.size();
for (int i = 1; i <= n; ... | ALGO | 0.999961 | 5.411855 |
5fa537c0-1c5c-459c-a90d-7e3878766b4c | thuylinhptit/CTDL_GT | contest1_part2/DayConLapLaiDaiNhat.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
string a;
int n;
ll dp[1000][1000];
void Solve(){
a = ' ' + a;
ll s = 0;
memset(dp,0,sizeof(dp));
for (int i = 1; i <= n; i++){
for (int j = 1; j <= n; j++){
if(a[i] == a[j] && i != j) dp[i][j] = dp[i-1][j-1] + 1... | ALGO | 0.999939 | 4.744183 |
3345500c-eebb-4db4-a865-16127b904ed7 | kritirikhi/DataStructuresAndAlgorithms | kthSmallerElementSortedMatrix.cpp | // to find kth smallest element from the row and col wise sorted array
// use priority queue(for the better and efficient approach
// for every element at index[row,col] in the matrix the next possible smaller elements are [row,col+1] and [row+1,col]
// pop elements one by one from the heap till we get the kth smallest... | ALGO | 0.999975 | 3.953258 |
f4b89924-5fcd-42d0-8453-6acf202b8dc3 | jatinbharadwaj/Bootcamp | Lec19-Graph/Graph-III/coprocessor.cpp | //coprocessor.cpp
//Dynamic programming in Graphs
#include<bits/stdc++.h>
using namespace std;
const int N = 123456;
int n,m,dp[N];
vector<int> adj[N];
bool c[N];
int dfs(int node){
if(dp[node] != -1) return dp[node];
dp[node] = c[node]; //either 0 or 1;
for(int i:adj[node]){
dp[node] = max(dp[node], dfs(i) ... | ALGO | 0.999969 | 5.002007 |
3c8e58a1-a661-46d5-a04b-216d6c060d7a | minominium/Archive_2018 | 201801 Robocup Rescue/03. Test Softwares/VideoCaller/QZXing/src/zxing/zxing/pdf417/detector/PDF417Detector.cpp | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
#include <algorithm>
#include <limits>
#include <zxing/pdf417/detector/Detector.h>
#include <zxing/pdf417/detector/LinesSampler.h>
#include <zxing/common/GridSampler.h>
#include <zxing/common/detector/JavaMath.h>
#include <zxing/common/detector/M... | ALGO | 0.996351 | 6.334381 |
a79bce41-24fc-41ed-8c99-b0b474b150b1 | alokprinc/CPP_DS_ALGO-main | DP/knapsack/Count_Subsets_with_diff.cpp | #include<bits/stdc++.h>
using namespace std;
int subset_count(vector<int> a,int w){
int n = a.size();
vector<vector<int>> t(n+1,vector<int>(w+1));
for (int i = 0; i < n+1; i++)
{
for (int j = 0; j < w+1; j++)
{
if(i == 0){
t[i][j] = 0;
}
... | ALGO | 0.999979 | 4.716818 |
0afd63dd-4ac6-4b94-a908-48fd8992fdcf | Phoenix009/leetcode-solutions | cpp/3330.cpp | #include <iostream>
using namespace std;
int solve(string word) {
int ans = 0;
char curr_alpha = word[0];
for (int index = 1; index < word.size(); index++) {
if (curr_alpha == word[index]) ans++;
curr_alpha = word[index];
}
return ans + 1;
}
int main() {
cout << solve("abbcc... | ALGO | 0.999905 | 4.62765 |
a2a0a0fe-f0eb-4561-b74f-ccf8cbe07e8a | dshahid380/Algos | Graphs and Tree/dijktras.cpp | #include<bits/stdc++.h>
using namespace std;
const int MAX= 1e5 + 5;
int INF = 1e9 + 7;
vector<int>adj[MAX];
vector<int> vis(MAX), dis(MAX, INF), par(MAX,-1);
int n;
void dijktras(int s){
} | ALGO | 0.999844 | 4.436617 |
d4156f37-ef0c-4dd2-8706-ab84a4b7c3dd | jordicollcaballero/HCORAP | src/encodings/HCORAP/HCORAPEncoding.cpp | //
// Created by jordic on 06/02/24.
//
#include "HCORAPEncoding.h"
#include <vector>
#include <fstream>
using namespace std;
HCORAPEncoding::HCORAPEncoding(HCORAP * instance, bool strat) : strat(strat), instance(instance){
}
SMTFormula * HCORAPEncoding::encode(int lb, int ub) {
SMTFormula * f = new SMTFormu... | ALGO | 0.997335 | 6.061034 |
6ceb620d-061e-4360-b4d0-8ca88fa5d68c | ishandutta2007/codeforces | agua_podrida/normal/1528/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<vvvi> vvvvi;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<vvc> v... | ALGO | 0.999896 | 4.496975 |
5ce487d9-c7d7-406b-b819-7daa36fe16a7 | jiadaizhao/LintCode | 0701-0800/0745-Palindromic Ranges/0745-Palindromic Ranges.cpp | class Solution {
public:
/**
* @param L: A positive integer
* @param R: A positive integer
* @return: the number of interesting subranges of [L, R]
*/
int PalindromicRanges(int L, int R) {
// Write your code here
unordered_map<int, bool> table;
for (int i = L; i <= R;... | ALGO | 0.999744 | 5.878441 |
78892dd0-4103-4413-b34b-9d79087321ad | mtle/solvedProblems | c++/closestIntegerWithTheSameNumberOfBits.cpp | #include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <memory>
#include <limits>
#include <vector>
#include <new>
#include <unordered_set>
#include <unordered_map>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <functional>
#include <iterator>
#include <bit... | ALGO | 0.998697 | 3.816417 |
eb962f14-d9af-4cc4-ba98-7ac03ae6e762 | admin333-paper/3L-Cache | libCacheSim/scripts/LightGBM/compute/perf/perf_stl_unique_copy.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
// create ve... | ALGO | 0.9691 | 5.622078 |
223977fd-cd68-4298-8b6c-26a6eb6d7f2d | himanshu062/leetcode-problems | 268-missing-number/missing-number.cpp | class Solution {
public:
int missingNumber(vector<int>& nums) {
int n = nums.size();
int tsum = (n * (n + 1)) / 2;
int sum = 0;
for (int i = 0; i < nums.size(); i++) {
sum += nums[i];
}
return tsum - sum;
}
}; | ALGO | 0.999938 | 5.956589 |
3f6c0c68-0225-4b88-884a-c14cf2289081 | bokusunny/atcoder-archive | atcoder.jp/tdpc/tdpc_iwi/Main.cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
string S;
vector<vector<long long>> memo;
long long rec(int l, int r) {
if (r - l <= 1) return 0;
if (r - l == 2) return S.substr(l, 3) == "iwi";
if (memo[l]... | ALGO | 0.999971 | 3.999154 |
98449978-7cf7-4bdc-bf02-9e9799d087c4 | radinakazakova/SDA_2024_2025 | Practice/HashTable/LetterCombinations.cpp | class Solution {
public:
vector<string> letterCombinations(string digits) {
vector<string> res;
if (digits.empty()) {
return res;
}
unordered_map<char, string> digitToLetters = {
{'2', "abc"},
{'3', "def"},
{'4', "ghi"... | ALGO | 0.999962 | 7.132636 |
73bf1ae9-1abc-42a8-9503-f1275599e3ad | msyamsula/CP | scc.cpp | // #include<bits/stdc++.h>
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<stack>
#include<queue>
#include<list>
#include<cstring>
#include<string.h>
using nam... | ALGO | 0.999953 | 3.91889 |
3a14aece-5371-41ce-9e0b-b5fd6bec54db | qza36/Sentry_vision | rm_rune/rune_solver/src/curve_fitter.cpp | #include "rune_solver/curve_fitter.hpp"
// std
#include <cmath>
#include <string>
#include <thread>
// third party
#include <fmt/format.h>
// project
#include "rm_utils/logger/log.hpp"
#include "rune_solver/types.hpp"
namespace fyt::rune {
// Fit two curves simultaneously and choose the one with lower cost
// This fu... | ALGO | 0.99937 | 7.915959 |
bd8b6cca-78d1-4a37-a681-b0595319245a | akueisara/algo-box | week 4/inversions/inversions.cpp | #include <iostream>
#include <vector>
using std::vector;
long long merge(vector<int> &a, vector<int> &b, size_t left, size_t ave, size_t right) {
size_t i = left, j = ave, k = left;
long long count = 0;
while (i <= ave -1 && j <= right) {
if (a[i] <= a[j]) {
b[k] = a[i... | ALGO | 0.999899 | 4.440247 |
7902971b-fb97-441e-b782-e1cda598df94 | Mouhaned-55/SuperMarioGame | 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 |
f5fe2114-ef32-4ee9-9645-13e1441ad6da | chrisstaudt/gi-2015 | src/abstractForm.cpp | #include "abstractForm.hpp"
#ifdef DEBUG
#define DEBUG_AF
#endif
int AbstractForm::total_number_of_abstract_forms = 0;
AbstractForm::AbstractForm(string name, vector<Point> points)
{
#ifdef DEBUG_AF
printf("CONSTRUCTOR: %s\n", __PRETTY_FUNCTION__);
#endif
this->name = name;
this->points = vector<Point>(poi... | TOOL | 0.898101 | 5.738858 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.