uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
45332d5b-f7c1-466b-b8e8-0da84c870b9f | baileymiller/differential_wos | zombie/deps/fcpw/deps/eigen-git-mirror/unsupported/doc/examples/PolynomialUtils1.cpp | #include <unsupported/Eigen/Polynomials>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
Vector4d roots = Vector4d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,5,1> polynomial;
roots_to_monicPolynomial( roots, polynomial );
cout << "Polynomial:... | ALGO | 0.99864 | 4.015535 |
454033a3-e6b5-4e5d-89cb-913ca1b5cc4a | PratheekB/suv | llvm/llvm/tools/llvm-mca/Views/BottleneckAnalysis.cpp | #include "Views/BottleneckAnalysis.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MCA/Support.h"
#include "llvm/Support/Format.h"
namespace llvm {
namespace mca {
#define DEBUG_TYPE "llvm-mca"
PressureTracker::PressureTracker(const MCSchedModel &Model)
: SM(Model),
ResourcePressureDistribution(Model.getNumP... | ALGO | 0.997496 | 7.206413 |
7c308a69-ddad-4ce9-81f3-04dda87f7f5b | whoiami/leetcode_code | deleteDuplicates.cpp | #include <iostream>
using namespace std;
typedef struct ListNode{
int val;
struct ListNode *next;
}ListNode;
ListNode *deleteDuplicates(ListNode *head) {
if(head==NULL)return NULL;
ListNode dommy;
ListNode *pre=&dommy;
dommy.next=head;
while(head!=NULL){
while(... | ALGO | 0.999931 | 4.372357 |
0f6514ca-7ba7-46e6-acca-685a4c0eaf78 | TinkerEdgeR-Android/frameworks_av | media/libstagefright/codecs/amrwb/src/qisf_ns.cpp | /*
------------------------------------------------------------------------------
Filename: qisf_ns.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-----------------------------------------------------------------------------... | ALGO | 0.995864 | 6.456701 |
a1076cb3-adf6-4d4b-9fd7-6b6468bd7c48 | sahilkhan03/CF-Solutions | codeforces/1440/B.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define fast ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define all(x) x.begin(), x.end()
#define F first
#define S second
#define pb push_back
#define pl pair<ll, ll>
#define vl vector<ll>... | ALGO | 0.999969 | 3.818613 |
e48485bb-b772-4095-b392-89e8c50405ac | NK-codeman0001/Leetcode-Submissions | 145-binary-tree-postorder-traversal/145. Binary Tree Postorder Traversal.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.999925 | 5.973692 |
bd2b1008-26bd-4f59-954d-9fac680e096e | BeastBoyAsh/C- | 18.cpp | #include<iostream>
using namespace std;
main()
{
int a,b,c,d,e,f;
cout<<"Enter Your 4 Dingit Number:- " ;
cin>>a;
b=a%10;
a=a/10;
c=a%10;
a=a/10;
d=a%10;
a=a/10;
e=a%10;
f=b+c+d+e;
cout<<"\nSum of digits is:- "<<f;
if (f%2==0)
{
cout<<"\nEVEN";
}
if(f%2!=0)
cout<<"\nODD";
} | ALGO | 0.999837 | 3.676853 |
f9c9d420-b50a-44f1-9fad-73114b6ecd2d | WilsNTHU/Leetcode | 0841-keys-and-rooms/0841-keys-and-rooms.cpp | class Solution {
public:
bool canVisitAllRooms(vector<vector<int>>& rooms) {
int n = rooms.size();
vector<bool> vis(n, false);
queue<int> q;
for(auto &it: rooms[0]){
q.push(it);
vis[it] = true;
}
vis[0] = true;
while(!q.empty()... | ALGO | 0.999951 | 6.277536 |
11317741-71c9-43b1-ae63-2626bc2451fc | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9008_7.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<int> al[100005];
int sz[100005];
double starting_time[100005];
int p[100005];
void dfs(int node) {
sz[node] = 1;
for (int i = 0; i < al[node].size(); i++) {
int child = al[node][i];
dfs(child);
sz[node] += sz[child];
}
}
void dfs1(int node) {... | ALGO | 0.999897 | 3.65992 |
32080987-f396-455b-bfa5-a8200911e4de | sampritipanda/IOI_Repository | CCC/2016/P4.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int grid[10000][10];
int grid2[10000][10];
bool pos[1 << 10][1 << 10];
int vis[10000];
int main() {
for(int i = 0; i < (1 << 10); i++) {
for(int j = 0; j < (1 << 10); j++) {
if(__builtin_popcount(i ^ j) % 2 == 0) pos[i][j] = ... | ALGO | 0.999095 | 3.695338 |
a8809959-231a-40a8-9cf5-807ab6d83fea | veahow/OJProblemSolution | UPC/exam.upc.edu.cn/动态规划-专题/1329.cpp | #include <algorithm>
#include <cstring>
#include <cstdio>
using namespace std;
const int MAXN = 105;
int N;
int num[MAXN][MAXN];
int ans[MAXN][MAXN];
int maxsum(int x,int y);
int main()
{
scanf("%d",&N);
for(int i = 0; i < N; ++i)
for(int j = 0; j <= i; ++j)
scanf("%d",&num[i][j]);
... | ALGO | 0.999902 | 3.769308 |
5884e1bf-2b02-453e-aedb-e2117c629e85 | embracemaking/BTT-SKR-Mini-E3-V3-Firmware-CR10-Smart | Marlin/Marlin/src/lcd/menu/menu_bed_corners.cpp | //
// Level Bed Corners menu
//
#include "../../inc/MarlinConfigPre.h"
#if BOTH(HAS_MARLINUI_MENU, LCD_BED_TRAMMING)
#include "menu_item.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#if HAS_LEVELING
#include "../../feature/bedlevel/bedlevel.h"
#endif
#ifndef BED_TRAMMING_Z_HOP
#define ... | TOOL | 0.938718 | 5.534492 |
d4946c52-55c9-4235-9d46-6a457ceb0893 | Tejender1521/Codeforces-Problem-Set | Translation.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
string str1,str2;
getline(cin, str1);
getline(cin, str2);
reverse(str1.begin(),str1.end());
if (str1 == str2)
{
cout << "YES";
}
else
... | ALGO | 0.999991 | 3.656468 |
e19c6fe8-f11d-4dfe-a0fc-ae8827ac47d9 | Hesper-L/3.Information-and-Computing-Science | ds_code/t4_2/源.cpp | #include <stdio.h>
#include "tree2.h"
#include "tree.h"
int main() {
BiTree T;
printf("ǰ\n");
CreateBiTree(T);
printf("\nǰ\n");
PreOrderTraverse(T);
printf("\n\n");
InOrderTraverse(T);
printf("\n\n");
PostOrderTraverse(T);
return 0;
} | ALGO | 0.999716 | 4.974909 |
c2410422-8738-48c3-b1e4-6af148a53624 | Manas-AI-Taskphase/Souri_Rishik | ROS_TASK/planner_node.cpp | #include <ros/ros.h>
#include <nav_msgs/OccupancyGrid.h>
#include <nav_msgs/Path.h>
#include <geometry_msgs/PoseStamped.h>
#include <queue>
#include <vector>
#include <cmath>
struct Node {
int x, y;
int g, h;
Node* parent;
Node(int x, int y, int g, int h, Node* parent) : x(x), y(y), g(g), h(h), parent... | ALGO | 0.918809 | 6.813885 |
107cad5b-f3f5-4764-9842-2dff8e8e5fc5 | jnprynsh/Learning-Cpp | pointers.cpp | #include<iostream>
using namespace std;
int main()
{
int x=5;
int*ptr=&x;
cout<<&x<<endl<<ptr<<endl;
return 0;
}
| ALGO | 0.988108 | 3.03586 |
290961a7-68d0-4c07-91fe-cf5d91cad44b | ishandutta2007/codeforces | feecie6418/normal/1746/E1.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pr;
int n;
map<int,int> f[100005],A[100005],B[100005];
int G(int x,int y){
if(x+y<=2)return 0;
if(x+y<=3)return 3;
if(f[x].count(y))return f[x][y];
if(x>=30||y>=30){
int u=(x+1)/2,v=(y+1)/2;
return f[x][y]=max(G(y-v,u+v),G... | ALGO | 0.998344 | 3.18421 |
2ac69e4a-e651-47d6-a11a-40035f224895 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6260_11.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
int a[N], sum[N];
int dp[(1 << 20) + 5][2];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
while (cin >> n) {
memset(sum, 0, sizeof(sum));
memset(dp, 0, sizeof(dp));
for (int i = 1; i <= n; i++) {
... | ALGO | 0.999986 | 4.397774 |
b3478f6d-83d2-4cba-a261-30d010e99150 | chengyiwei/algorithm | luogu/noncompetition/P1972/P1972.cpp | #include <bits/stdc++.h>
struct query {
int l, r, id;
bool operator < (const query &A) const {
return r < A.r;
}
};
int main() {
freopen ("P1972.in", "r", stdin);
std::ios::sync_with_stdio(false);
std::cin.tie(NULL); std::cout.tie(NULL);
int n; std::cin >> n;
std::vector<int> ... | ALGO | 0.999982 | 4.555762 |
bd28786b-4ddb-476d-9b6b-80d6649d2377 | Dup4/Leetcode | leetcode/weekly-contest/308/a/solution.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <vector>
#define endl "\n"
#define fi first
#define se second
#define all(x) begin(x), end(x)
#define rall rbegin(a), rend(a)
#define bitcnt(x) (__builtin_popcountll(x))
#define complete_unique(a) a.erase(un... | ALGO | 0.999942 | 5.372154 |
f4ff1137-4a66-4d15-9d05-4256de3bfa6b | DarshanGhorpade/GFG-POTD | 2024/June/21_06_2024_CompareTwoFractions.cpp | /*
You are given a string str containing two fractions a/b and c/d, compare them and return the greater. If they are equal, then return "equal".
Note: The string str contains "a/b, c/d"(fractions are separated by comma(,) & space( )).
Examples
Input: str = "5/6, 11/45"
Output: 5/6
Explanation: 5/6=0.8333 and 11/45=... | ALGO | 0.999365 | 6.189138 |
0b15a93a-e90c-48a1-92dd-cb399cc91824 | Chirag6525/LeetCode | String/ReverseTheWords.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
string reverseWords(string s) {
int i = s.size()-1;
string ans;
while(i>=0){
while(s[i]==' ' && i>=0){
i--;
}
int j = i;
while(s[i]!=' ' && i>=0){
... | ALGO | 0.999952 | 4.898852 |
3bdffdd7-29ad-48e8-844e-3b3190908a75 | MatheusFerreiradeOliveira/Codes | Contests - seletivas/2 seletiva IFCE/KrustalEmMat.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<double, double> dd;
typedef pair<double, pair<int, int > > dii;
vector< dii > EdgeList;
vector< dd > coordPessoas;
vector<int> pset;
void initSet(int N)
{
pset.assign(N,0);
for (int i=0;i<N;i++) pset[i] = i;
}
int findSet(int i)
{
ret... | ALGO | 0.999903 | 4.171639 |
8cd5a3db-bfe0-4fc8-bdb6-1f00fa7d5707 | ishandutta2007/codeforces | oleh1421/normal/1670/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define endl '\n'
using namespace __gnu_pbds;
using namespace std;
typedef long double ld;
typedef long long ll;
//#define int ll
const int N=(1<<19);
const ll mod=1000000007;
int a[N],b[N];
int c[N];
int p[N];
bool used[N];
bool ch[N];
void solve(){
... | ALGO | 0.999979 | 3.674402 |
5c877896-f6a7-4f8b-88a7-79286b419d11 | Manju567/coding_Leetcode-solutions | lcof2/剑指 Offer II 077. 链表排序/Solution.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* sortList(Li... | ALGO | 0.99999 | 5.933962 |
3a0e44e6-f078-4dfc-9b98-669ae5f03650 | sengardeep/leetcode-soln | 0090-subsets-ii/0090-subsets-ii.cpp | class Solution {
public:
void generate(vector<int>&arr,vector<vector<int>>&ans,vector<int>&temp,int idx)
{
ans.push_back(temp);
for(int i=idx;i<arr.size();i++)
{
if(i>idx && arr[i]==arr[i-1]) continue;
temp.push_back(arr[i]);
generate(arr,ans,temp,i+1... | ALGO | 0.999968 | 5.876919 |
6d3ea015-bae3-4a34-8460-7c1096486dc5 | ishandutta2007/codeforces | physics0523/normal/749/E.cpp | #include<bits/stdc++.h>
using namespace std;
//Binary Indexed Tree
long long bsize=131072;
long long sum(long long i,vector<long long> &bit){
long long s=0;
while(i>0){
s+=bit[i];
i-=i&(-i);
}
return s;
}
void add(long long i,long long x,vector<long long> &bit){
while(i<=bsize){
... | ALGO | 0.999726 | 3.705908 |
6f476763-2389-420e-8ab3-816585d3b810 | chriger/distributed_langford_pairing | tbb43_20140724oss/examples/parallel_for/tachyon/src/camera.cpp | /*
* camera.cpp - This file contains all of the functions for doing camera work.
*/
#include "machine.h"
#include "types.h"
#include "macros.h"
#include "vector.h"
#include "camera.h"
#include "util.h"
ray camray(scenedef *scene, int x, int y) {
ray ray1, newray;
vector projcent;
vector projpixel;
flt px, p... | TOOL | 0.854282 | 6.189943 |
059c926e-059a-4b00-8f9a-d0f119b5c011 | LorenaDavis/CPP | Trees/DiameterOfTree.cpp | /*
The question link could be found at = https://leetcode.com/problems/diameter-of-binary-tree/
*/
/**
* 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),... | ALGO | 0.999942 | 6.612586 |
7f2963d4-fe55-4a32-be57-a9f7f0cd88d5 | RicMilos/cn | 2/crc.cpp | #include<iostream>
using namespace std;
int main()
{
int fs,gs;
cout<<"Enter the size of data";
cin>>fs;
cout<<"\nEnter the size of key value";
cin>>gs;
int *f=new int[fs];
int *g=new int[gs];
cout<<"\nEnter the Data\n";
for(int i=0;i<fs;i++)
cin>>f[i];
cout<<"\nEnter key:\n";
for(int i=0;i<gs;i++)
cin>>... | ALGO | 0.999876 | 3.080909 |
57e8f325-d319-471f-9ec7-62581349e166 | Sunny-Saurya/Cpp_Programming | DP/05_Knapsack.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
private:
int solve(int capacity, int index, vector<int> &val, vector<int> &wt){
// base case
// suppose there is only one items
if(index == 0){
if(wt[0] <= capacity){
return... | ALGO | 1 | 5.584702 |
0ce4ccb1-ba83-4851-baf9-85f5cab03c4d | JJPENA666/firts_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.9988 | 6.76073 |
be762910-805b-424b-8013-5a7a6e882606 | nimfochkaa/1.4-2s | 1.4 lab/SetBinary.cpp | #include "SetBinary.h"
using namespace std;
Set::Set(int size) : size(size) {
elements = new int[size]();
}
Set::~Set() {
delete[] elements;
}
void Set::addElement(int index) {
if (index >= 0 && index < size) elements[index] = 1;
}
void Set::removeElement(int index) {
if (index >= 0 && index < size)... | TOOL | 0.928513 | 4.722396 |
befdcb47-7327-4f8f-93d2-4ea018803ab9 | ragu-manjegowda/self-driving-car | Term02-SensorFusion-Localization-and-Control/MPC-Quizzes/polyfit/src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
std::cout << "Column's maximum: " << std::endl
<< mat.colwise().maxCoeff() << std::endl;
}
| ALGO | 0.999341 | 3.779679 |
cf13c38a-850b-480f-9377-a2a6f4973492 | Sa2003hil/DSA | Introdunction to CPP/Hashing/character_hashing.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
string s;
cin >> s;
// pre compute
int hash[26] = {0};
/*
Remember:
Hash always needs a int value in its brackets hash[int value] --> if we write hash[s[i]] --> it will automatically typecast it to ASC... | ALGO | 0.999904 | 4.706692 |
0242702c-b5b0-4d12-a98f-0c5f1878b56e | gemy26/LeetCode | 1895-minimum-number-of-operations-to-move-all-balls-to-each-box/minimum-number-of-operations-to-move-all-balls-to-each-box.cpp | class Solution {
public:
vector<int> minOperations(string s) {
vector <int> prefix((int) s.size() + 1, 0), suffix((int) s.size() + 1, 0), frq(3000, 0), ans(s.size(), 0);
for(int i = 0; i < (int) s.size(); i ++){
if(s[i] == '1'){
frq[i] ++;
prefix[i] = i + 1;
s... | ALGO | 0.999993 | 5.254153 |
0ca73c99-ab0c-480f-80e1-acd58645f2f5 | coreqode/geometry_processing | deps/polyscope/deps/imgui/imgui/misc/fonts/binary_to_compressed_c.cpp | // ImGui - binary_to_compressed_c.cpp
// Helper tool to turn a file into a C array, if you want to embed font data in your source code.
// The data is first compressed with stb_compress() to reduce source code size,
// then encoded in Base85 to fit in a string so we can fit roughly 4 bytes of compressed data into 5 by... | TOOL | 0.956342 | 6.278756 |
24653928-bd2d-4e79-b0f7-3df6c3ed5466 | hirakuuuu/kyopro | ABC/324/abc324_c.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define rrep(i, a, n) for(int i = a; i >= n; i--)
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
// constexpr ll MOD = 1000000007;
constexpr ll MOD = 998244353;
constexpr int IINF = 1001001001;
conste... | ALGO | 0.99996 | 4.58084 |
04ceebd9-f25c-4909-b282-be94db31cf4a | SamuelVargha/udemy_cpp_20_masterclass | S11_loops/L93_decrementing_loops/main.cpp | #include <iostream>
int main (){
const size_t COUNT {5};
// for loops
std::cout << "incrementing for loop:" << std::endl;
for (size_t i{} ; i < COUNT ; ++i){
std::cout << "i : " << i << std::endl;
}
std::cout << std::endl;
std::cout << "decrementing for loop:" << std::endl;
for... | ALGO | 0.967053 | 4.118269 |
0c3fcaca-6389-40d6-a57f-25d8d3c664a9 | chiyeon/woodstock | src/history.cpp | #include "history.h"
#include "game.h"
#include "move.h"
#include <sstream>
#include <time.h>
void History::clear() {
for (int i = 0; i < HASHTABLE_SIZE; ++i) {
RepetitionTable[i].key = 0ULL;
RepetitionTable[i].count = 0;
}
threefold_repetition = false;
log.clear();
}
void History::record(Mo... | TOOL | 0.860602 | 5.600245 |
94f3f15e-99ae-45f0-b6ed-55b52783ba56 | me-vikskr/CSES_Solutions | Introductory_problems/7_Two_Knights.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
for(long long k=1; k<=n; k++){
//(all number of ways to place 2 horse) - (all invalid ways to place 2 horses)
cout<<(k*k)*(k*k-1)/2 - (4*(k-2)*(k-1))<<'\n';
}
return 0;
} | ALGO | 0.999623 | 3.740979 |
e25cead7-342e-468c-a276-d943b9c135d7 | Shreyashpatil056/Codeforces | DAY69/C_Santa_Claus_and_Robot.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> p64;
typedef map<ll,ll> m64;
typedef pair<int,int> p3... | ALGO | 0.999972 | 4.180557 |
2c2aaab2-cec7-43bf-8425-dd7392aaed4c | Hazem-Gamall/DataStructures-for-university-course | linkedlist.cpp | #include <iostream>
#include <vector>
using namespace std;
class Node{
public:
Node(){}
Node(int d) : data(d){}
int data;
Node *next = nullptr;
};
class LinkedList{
public:
LinkedList() : head(nullptr), tail(nullptr), list_size(0) {}
void insert(int d){
Node* tmp = new Node(d);
... | ALGO | 0.996984 | 4.370582 |
7f6b8373-6123-4cef-ad92-f728763cfdd3 | IgorMishurov/my_first_repository | NeuralNet2/Davecpp.cpp | // neural-net-tutorial.cpp
// David Miller, http://millermattson.com/dave
// See the associated video for instructions: http://vimeo.com/19569529
#include <vector>
#include <iostream>
#include <cstdlib>
#include <cassert>
#include <cmath>
#include <fstream>
#include <sstream>
using namespace std;
// Silly class to r... | DATA | 0.96646 | 5.662062 |
c0ec8f56-ad3d-444b-b5e9-ef6a0c116f2d | AnCheny/Dynamic-3D-Reconstruction | 源代码/sinusoidalpattern.cpp | #include "precomp.hpp"
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <fstream>
#include "..\\include\\opencv2\\para_config.h"
void compute_dual_frequency(std::vector<cv::Mat> patternImages1, cv::Mat shadowMask_1, cv::Mat A,
cv::Mat& wrappedPhaseMap_low)
{
int rows = pa... | ALGO | 0.997665 | 4.235676 |
6aca0be1-0105-48b6-a513-1f3132af7610 | Jaku245/SEVA | Payfair.cpp | #include <bits/stdc++.h>
using namespace std;
string cipheredIt(string msg, char encoded[5][5])
{
string cipher = "";
for (int i = 0; i < msg.size(); i += 2)
{
char fl = msg[i];
char sl = msg[i + 1];
int flRow, flCol, slRow, slCol;
for (int j = 0; j < 5; j++)
{
... | ALGO | 0.999964 | 4.848797 |
34c83271-8467-4a5c-bc34-e02ae7ec2e6c | cyprus09/CPP-Algorithms | BinaryTrees/PairSumBinaryTree.cpp | #include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <climits>
#include "binarytree.h"
using namespace std;
void preOrderTraversal(BinaryTreeNode<int>* root, vector<int> &sortedValues){
if(root == NULL){
return;
}
sortedValues.push_back(root->data);
preOrderTraversal(root->left,... | ALGO | 0.999995 | 5.012421 |
43e9e08b-aed3-46f7-954c-99667f2764b1 | G33k1973/CodingGames | AP.cpp | //LONGEST ARITHMETIC PROGRESSION
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define INF 0x3f3f3f3f
int dfs(const std::vector<int>& a, int n, int i, int p, int AP) {
//cout<<AP<<endl;
if (i == n)return 0;
int ans = 0;
int ans1 = 0, ans2 = 0;
for (int j = i; j < n; ++j) {
... | ALGO | 0.99982 | 3.638199 |
09d9144a-b68f-41e6-aa8b-0756b3e11ff3 | newtonkamimura/pca_2024 | general/merge_sort.cpp | /* Universidade de Brasília
* Departamento de Ciência da Computação
* CIC0169 - Programação Competitiva
* Prof. Dr. Vinicius R. P. Borges
*
* Tópico: Divisão e conquista
* Esse código-fonte está associado à implementação do algoritmo de ordenação Merge Sort. Ordenação crescente.
*
* Compilar no terminal: g++... | ALGO | 0.999984 | 5.085159 |
1275b82f-f8e7-49ad-bc1f-902085801526 | amanharitsh123/Algorithms-DataStructures | CodeChef/SPOON.cpp | #include<iostream>
#include<vector>
#include<set>
#include<algorithm>
#include<unordered_map>
#include<map>
#include<ctype.h>
#define all(arr) arr.begin(),arr.end()
using namespace std;
typedef long long int lli;
void lower(string &sl) {
transform(sl.begin(), sl.end(), sl.begin(), ::tolower);
}
template <typename T>
... | ALGO | 0.999216 | 3.337042 |
009d91e5-8079-4573-8410-a243f5b2351c | laragamasantos/LeetCode | runningSumOf1dArrays.cpp | class Solution {
public:
vector<int> runningSum(vector<int>& nums) {
int soma = 0;
vector<int> runningSum(nums.size());
for(int i=0; i<nums.size(); i++){
soma += nums[i];
runningSum[i] = soma;
}
return runningSum;
}
};
| ALGO | 0.999847 | 6.066897 |
c3d2964c-a236-4e3a-b3e5-0ba9eaa3deb9 | Mostafa-ashraf19/Data-Structure-Techniques-Libraries | Tree.cpp | #include "Tree.h"
#include <cassert>
// Use (void) to silent unused warnings.
#define assertm(exp, msg) assert(((void)msg, exp))
void Tree::add(int value)
{
Node* current=nullptr;
Node* prev= nullptr;
Node* pn = new Node;
pn->element = value;
pn->left = nullptr;
pn->right = nullptr;
if (Head == nullptr)
{
... | ALGO | 0.913226 | 4.143907 |
8a739d6e-5d01-4346-a3cf-c2266bd22c3c | Shakthipriyas/c-practical-lab | day0_exp7_binaryto decimal.cpp | #include <iostream>
using namespace std;
// create a class
class Array {
// private data member
private:
int array[10];
// public functions
public:
// getArray() function to get the
// value of the array
void getArray() {
for (int index = 0; index <= 9; index++) {
cout << "array[" << index <<... | ALGO | 0.999054 | 4.262893 |
11cd449e-32bc-42e9-8191-d47c2051cf87 | MRINFINITY99/StriverSdeQuesDSA | trees/17.constructBTFromInansPre.cpp | #include<bits/stdc++.h>
using namespace std;
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),left(left),right(right){}
};
clas... | ALGO | 0.999996 | 5.875257 |
8fcab95a-6fc0-4b8a-be7b-b783bc28c3d3 | ishandutta2007/codeforces | shadowatyy/normal/516/C.cpp | #include <bits/stdc++.h>
#include <unistd.h>
#define ll long long
#define ull unsigned long long
#define inf 1000000007
#define inf16 0x3f3f3f3f
#define INF 1000000000000000007LL
#define VI vector<int>
#define VPII vector<pair<int, int> >
#define VLL vector<ll>
#define PII pair<int, int>
#define PLL pair<ll, ll>
#defin... | ALGO | 0.999907 | 3.515903 |
5a6ad97b-817d-41b0-b018-2e25fe959fac | gauravkumar1999/CS-142 | quicksort.cpp | #include<iostream>
using namespace std;
//partition function
int partition(int *a,int startt,int endd){
//what is pivot
int pivot=a[endd];
int partitionindex=startt;
//we go along array if a[i] is less equal to then put at 1 ,2,3 position as partitionindex place
for(int i=startt;i<endd;i++){
if(a[i]<=pivot){
... | ALGO | 0.999983 | 4.72935 |
acf33073-c0af-4c07-8cfc-20b2e93555f3 | YunWGui/LeetCode-300 | Tree/94_Binary-Tree-Inorder-Traversal.cpp | /*
94. Binary Tree Inorder Traversal
94. 二叉树的中序遍历
Address:
https://leetcode-cn.com/problems/binary-tree-inorder-traversal/
*/
#include <iostream>
#include <vector>
#include <stack>
// #include <mypkg/print.h>
using namespace std;
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x)... | ALGO | 0.999993 | 6.393092 |
526136a1-c8a3-439e-8f76-a59e4c3b522a | mandos1995/PS | 5000 ~ 5999/5086_배수와 약수.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int a, b;
while(true) {
cin >> a >> b;
if (a == 0 && b == 0) break;
if (a % b == 0) cout << "multiple\n";
else if (b % a == 0) cout << "factor\n";
else cout << "neithe... | ALGO | 0.999957 | 4.717939 |
091d8394-94f0-4917-8a4b-b0a170feaf9a | Prachi04Sharma/5th-Training | 173.cpp | /*Given an array in which the elements are in xxxyy format, where first xxx digits represent the
Bracnch code and the yy represents the account id. Find out the No. of accounts in the given branch code Input and Output Format :
The first input n corresponds to the size of the array, the next n lines corresponds to the... | ALGO | 0.998202 | 5.15286 |
829bf2dd-82d3-403e-aebf-3eab5371c036 | raincross7/code-similarity | codes/train_code/problem028/problem028_304.cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#define N 200005
using namespace std;
int n,top;
int s[N],st1[N],st2[N];
bool check(int a){
top=0;
for(int i=1;i<=n;i++){
if(s[i]<=s[i-1]){
if(a==1) return 0;
while(top>0&&st1[top]>s[i]... | ALGO | 0.999991 | 3.717657 |
4e714260-06fa-48ff-a12b-a90413ff5a3a | shuklaabhinavv/dsa-grind | 1323-maximum-69-number/1323-maximum-69-number.cpp | class Solution {
public:
int maximum69Number(int num)
{
vector<int>m;
int co=num;
for(int i=0;co>0;co/=10)
{
int d=co%10;
m.push_back(d);
}
reverse(m.begin(),m.end());
for(int i=0;i<m.size();i++)
{
if(m[i]==6)
... | ALGO | 0.999694 | 6.547524 |
3c5edad0-4ea9-4e91-95c6-6194e7b6a920 | DrSwad/CP | Submissions/World Finals/20/domes.cpp | #include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
typedef long double T; // or long long
typedef complex<T> point;
#define x real()
#define y imag()
typedef pair<point, T> line;
typedef line halfplane;
T dot(point a, point b) {
return (conj(a) * b).x;
}
T cross(point v, point w) {
retu... | ALGO | 0.999513 | 4.871439 |
3d5b1def-93ba-4248-8fdb-2cec606c1868 | deepu-paswan-1123/leetcode-dsa-c- | BinarySearch/BinarySearch.cpp | /*
here we are discussing about the binary search in an array which time complexity is O(logn)
that means it is effcient algorithm to search an element in the array which is better than
linear search but there are some codition in it because the array should be sorted in this
case either ascending or de... | ALGO | 0.999965 | 5.642572 |
7c695336-b726-4ea4-be64-945d156d331b | jackschu/icpcPrep | uvaOnlineJudge/uva11799.cpp | #include <algorithm>
#include <iostream>
#include <iterator>
#include <queue>
#include <vector>
#define DEBUG if (false)
using namespace std;
int main() {
int TC;
cin >> TC;
for(int i = 0; i < TC; i++){
int n;
cin >>n;
vector<int> nums;
nums.reserve(n);
copy_n(istream_iterator<int>(cin), n, b... | ALGO | 0.995894 | 4.465889 |
3f31ae4e-1912-423b-9a2b-fe9273f442c9 | Rylynnn/Arithmetic | Dynamic Programing/01背包/G - Top Secret Task.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int MAXN=155;
const int INF=0x3f3f3f3f;
int n,k,s,ans;
int a[MAXN];
int dp[3][MAXN][MAXN*MAXN/2+5];//dp[i&1][j][l]表示在前i个数选择j个数放在前j个位置且花费为l时的能得到的最小值
int main() {
while(3==scanf("%d%d%d",&n,&k,&s)) {
for(int i=1;i<=n;++i)... | ALGO | 0.999961 | 3.195357 |
44517595-59b6-4c10-b049-56ef3afb3bb7 | sarvex/leetcode-solidity | solution/1100-1199/1115.Print FooBar Alternately/Solution.cpp | class FooBar {
private:
int n;
mutex fooMu, barMu;
public:
FooBar(int n) {
this->n = n;
barMu.lock();
}
void foo(function<void()> printFoo) {
for (int i = 0; i < n; i++) {
fooMu.lock();
printFoo();
barMu.unlock();
}
}
voi... | ALGO | 0.974165 | 6.128963 |
48e57d54-4ff0-43bb-9f26-740473563d2d | chickenlin/leetcode | 881.cpp | class Solution {
public:
int numRescueBoats(vector<int>& people, int limit) {
int back = people.size() - 1;
int front = 0;
int ans = 0;
sort(people.begin(),people.end());
while (front <= back)
{
ans++;
int redund = li... | ALGO | 0.999995 | 5.95508 |
eb8ce87d-aab5-435c-ad0b-d043c5b8b33e | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_1840_9.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
std::ios::sync_with_stdio(false);
int n, m, t, k;
cin >> k;
vector<int> lens(k);
vector<int> sums(k);
vector<int> seqs[k];
for (int i = 0; i < k; i++) {
cin >> lens[i];
seqs[i].resize(lens[i]);
for (int j = 0; j < lens[i]; j++) {
... | ALGO | 0.999983 | 3.540743 |
805def46-3d1d-4d83-a16c-39af78b4a0ce | loveytx/My-learning-journey- | virtual_functions_in_classes_23.cpp | #include <iostream>
#include <string.h>
using namespace std;
//abstract base class-->ye base class baanayi hi isliye gayi hai taaki ye khud kabhi run na ho ye sirf dusri
//classes ke use ke liye banayi gayi hai iske objects nhi baneyenge
class CWH
{
protected:
string title;
float rating;
public:
CWH(stri... | TOOL | 0.992621 | 4.67136 |
72d39b39-948e-435e-86c4-e3efaf9c6e57 | sarvex/leetcode-checked-c | solution/0600-0699/0623.Add One Row to 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.999995 | 6.540254 |
7ddde9b9-a64a-4dce-8101-f476182ff6d4 | edge555/Online-Judge-Solves | UVA/11926 - Multitasking.cpp | #include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL)
#define pf printf
#define sf(num) scanf("%d",&num)
#define sff(num1,num2) scanf("%d %d",&num1,&num2)
#define rep(i,n) for(i=1;i<=n;i++)
#define rep0(i,n) for(i=0;i<n;i++)
#define reps(i,a,n) for(i=a;i<=n;i++)
#define pb push_back
#de... | ALGO | 0.999874 | 3.408064 |
f20303c5-5ace-4215-8497-fa86e4a634a6 | MAKIYAMA-ma/AtCoder | ABC418/A.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#if 1
using mint = modint1000000007;
#else
using mint = modint998244353;
#endif
using ll = long long;
using ull = unsigned long long;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using sl = set<ll>;
using vi = vect... | ALGO | 0.999885 | 4.253349 |
ee2c5c42-9173-4fbf-b87b-9f3a49ddbc8f | markkilgard/NVprSDK | nvpr_examples/skia/experimental/Intersection/CubicUtilities.cpp | #include "CubicUtilities.h"
#include "DataTypes.h"
#include "QuadraticUtilities.h"
void coefficients(const double* cubic, double& A, double& B, double& C, double& D) {
A = cubic[6]; // d
B = cubic[4] * 3; // 3*c
C = cubic[2] * 3; // 3*b
D = cubic[0]; // a
A -= D - C + B; // A = -a + 3*b - 3*c... | ALGO | 0.995956 | 5.473975 |
dd9ba611-6e91-4704-988d-75f50e617c13 | Tagore22/algorithmSolve | algorithmSolve/백준/1774.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;//ũ罺Į Ǯ(̹ )
vector<pair<double, pair<int, int>>> board;
vector<pair<double, double>> points;
int n, m;
class UF
{
private:
vector<int> Parent;
vector<int> Size;
public:
UF(int n);
int GetSize(int now) co... | ALGO | 0.99995 | 4.410239 |
03b24643-b2be-472f-bbd6-e8edd97f8498 | hosogaya/filter | cpp/moving_average_filter/moving_average_filter.cpp | #include "moving_average_filter.h"
MAF::MAF(const unsigned int num) : max_num_(num) {
array_ = new double[num];
}
MAF::~MAF() {
delete [] this->array_;
}
double MAF::average() {
if (num_ == 0) return 0.0;
else return ave_;
}
/**
* @brief Push new value and discard the oldest one.
* Then, ca... | ALGO | 0.968232 | 5.421394 |
d3e3388e-f73d-4aa5-924c-f4ffd3d003a0 | manikanta2901/ubuntu | practice/cpp/GeeksForGeeks/DPseries.cpp/Recursion.cpp/Subsets.cpp | #include<bits/stdc++.h>
using namespace std;
void GenerateSubsets(string s,string answer = "",int i = 0){
if(s.size() == i){
cout << answer << endl;
return;
}
GenerateSubsets(s,answer,i + 1);
GenerateSubsets(s,answer + s[i],i + 1);
}
int main(){
string s;
cin >> s;
Generate... | ALGO | 0.999928 | 4.696858 |
aa0d4741-9838-4c72-b45a-527d65e3761f | wangf98/SPEIT_OJ-Answers | source codes/25_Big_integer_class.cpp | #include<iostream>
#include<cstring>
#include<cmath>
#include<cstdio>
using namespace std;
class bigInteger
{
private:
int data[502];
public:
bigInteger()
{
//length = 1;
memset(data, 0, sizeof(data));
}
bigInteger(const char* l);
int compare(bigInteger n2);
bigInteger& oper... | ALGO | 0.999959 | 3.811893 |
4c402ce4-92e6-44a7-9787-c1bf388ea257 | aralab-unr/CoSM-ICP | external_libraries/pcl_1_9/surface/src/on_nurbs/nurbs_solve_umfpack.cpp | #include <suitesparse/cholmod.h>
#include <suitesparse/umfpack.h>
#include <iostream>
#include <stdio.h>
#include <stdexcept>
#include <pcl/surface/on_nurbs/nurbs_solve.h>
using namespace std;
using namespace pcl;
using namespace on_nurbs;
void
NurbsSolve::assign (unsigned rows, unsigned cols, unsigned dims)
{
m_K... | ALGO | 0.99958 | 4.46631 |
cd2112b1-cc94-47cb-b611-3f7fc86799eb | koralkulacoglu/CompetitiveProgramming | CodeForces/Contests/788/2/D.cpp | /*
ID: Koral Kulacoglu
TASK: test
LANG: C++
*/
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef long double lld;
typedef complex<ld> cd;
typedef pair<int, ... | ALGO | 0.999847 | 4.297639 |
daa3cc01-d0ed-421e-b09c-fd339a0d5a61 | aniruddh-joshi/LeetCode | 1491.cpp | class Solution {
public:
double average(vector<int>& salary) {
double sum=0.0;
int n=salary.size();
int min_salary = salary[0];
int max_salary = salary[0];
for(int i=0;i<n;i++){
sum+=salary[i];
min_salary=min(min_salary,salary[i]);
max_sal... | ALGO | 0.999178 | 5.835585 |
3088bdfb-8022-4cfd-9303-02bf8be45a80 | jash13desai/leetcode | 901-950/911-920/912. Sort an Array.cpp | class Solution {
public:
void merge(vector<int>& nums, int left, int mid, int right) {
vector<int> temp(right - left + 1);
int i = left, j = mid + 1, k = 0;
while (i <= mid && j <= right) {
if (nums[i] <= nums[j]) {
temp[k++] = nums[i++];
} else {
... | ALGO | 0.999999 | 6.106066 |
e0fe1dde-e50b-463a-a0ed-fe0e768848d9 | mmind/mesa-lima | src/intel/compiler/brw_fs_cmod_propagation.cpp | #include "brw_fs.h"
#include "brw_cfg.h"
#include "brw_eu.h"
/** @file brw_fs_cmod_propagation.cpp
*
* Implements a pass that propagates the conditional modifier from a CMP x 0.0
* instruction into the instruction that generated x. For instance, in this
* sequence
*
* add(8) g70<1>F g69<8,8,1>F ... | ALGO | 0.899015 | 7.178545 |
4e3905dd-aae4-4c59-bca2-1af804cdfc06 | blogdefotsec/Unitree_SDK_Extended | original_SDK/unitree_slam/20250609/module/Odometer_service/src/rpg_svo_pro_open/svo_online_loopclosing/src/bow.cpp | /*
* bow.cpp
*
* Created on: Nov 8, 2017
* Author: kunal71091
*/
#include "svo/online_loopclosing/bow.h"
using namespace DBoW2;
// ----------------------------------------------------------------------------
namespace svo
{
void changeStructure(const cv::Mat& plain, std::vector<cv::Mat>* out)
{
out->re... | DATA | 0.948709 | 4.38586 |
bdf00a2b-e22c-4a03-9a36-4ae9737c3561 | notJAYanand/Leetcode | 637-average-of-levels-in-binary-tree/637-average-of-levels-in-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999957 | 6.790812 |
c7c8d11e-e68e-4201-b9b6-97cadf8a1590 | dbhattar/misclib | google/util.cpp | #include "util.hpp"
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <vector>
#include <cstdlib>
#include <ctime>
using namespace std;
vector<int> generateRandomVector(int numItems)
{
srand(time(nullptr));
vector<int> output(numItems);
for(int i = 0; i < numItems; ++i)
{
output... | TOOL | 0.982649 | 4.805521 |
b3d809e9-bf78-47aa-82b6-d789ba98ff91 | programjhlee/Algorithm | 2.Exhaustive Search/Baekjoon 2839 설탕 배달/Baekjoon 2839 설탕 배달.cpp | /*
Baekjoon 2839
2025 04 21
Ʈ Ǫ° ...
5 3kg Ǫ
ڵ
int N; //
int remain = 0; //
int answer = 0; //
while(N % 5 != 0 && N >= 3){ 5 ų Ҷ
N -= 3;
answer += 1;
}
if(N < 3){
cout << -1;
}else if(N==0){
cout << answer;
}else{
answer += N/5;
cout << answer;
}
*/
#include <iostream>
using namespace s... | ALGO | 0.999927 | 4.342867 |
6fd8d03b-a3ff-46d3-93b1-8caeddfe5edd | j-a-i-a-n-a-n-d/DSA | company_ques_randoms/hexaware/hex.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> arr(n, 0);
for (int i = 0; i < n; i++)
cin >> arr[i];
for (int i = 0; i < arr.size() - 1; i++)
{
if (arr[i] < 0)
arr.erase(arr.begin() + i);
}
int k = ... | ALGO | 0.999981 | 4.634995 |
d9f0c7cc-de18-4938-95e4-b7b3a8b91738 | VinInn/ctest | test_SparseMatrix.cpp | #include "SparseMatrix.h"
#include<iostream>
template<typename T, int S>
void print(SparseMatrix<T,S> const & m) {
for (int i=0; i!=S; ++i)
std::cout << m.indeces[i].i << "," << m.indeces[i].j << ":" << m.vs[i] << " ";
std::cout << m.vs[S] << std::endl;
}
int main() {
typedef ROOT::Math::SVector<double,17>... | ALGO | 0.935736 | 3.462551 |
aff84bdc-7ff1-4608-b46c-7163113705eb | leesper/ProgrammingBasics | ch-6/fibo.cpp | //
// 斐波那契数列
//
#include <iostream>
using namespace std;
int fibo(int n);
int main() {
int n;
while (cin >> n) {
cout << fibo(n) << endl;
}
return 0;
}
int fibo(int n) {
if (n == 0 || n == 1)
return 1;
int fn, fn_1 = 1, fn_2 = 1;
for (int i = 0; i < n - 1; i++) {
... | ALGO | 0.999213 | 5.161994 |
f0c809b1-35b3-462b-b4da-a7bb46914c29 | Hans774882968/Some_solutions | 数位dp/poj3252.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cassert>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
//#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i,a,b) for(int i = (a);i <= (b);++i)
#def... | ALGO | 0.999944 | 3.933116 |
5abe708a-4630-4e91-9b54-2bdef153d820 | Manvityagi/Codechef-Codeforces-spoj | CODEFORCES/EDUCATIONAL ROUNDS/92/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define LL long long
#define ULL unsigned long long
#define LB lower_bound
#define MOD1 1000000007
#define MOD2 1000000009
#define loop(i, a, b) for (int i = a; i < b; i++)
LL n, m;
int movex[] = {0... | ALGO | 0.999596 | 4.428124 |
1a1d0b3c-86da-4653-82c8-469a5bd0a41f | zhantong/cppCodes_Answer | chapter5/5.8.13/5.8.13.cpp | /*
P166 5.8.13
ʵstrlenstrcpystrcatstrncatstrcmpԼstrncmp
*/
#include <iostream>
using namespace std;
int strlen1(char s[])
{
int n = 0;
while (s[n] != '\0')
n++;
return n;
}
char *strcpy1(char dest[], char s[])
{
int i;
for (i = 0; s[i] != '\0'; i++)
dest[i] = s[i];
if (i != 0)
dest[i] = '\0';
return dest... | ALGO | 0.972728 | 3.134639 |
ec54e672-5e08-4cae-a84b-eb6537e7bc20 | PtCu/practice | template/杂项/离散化.cpp | #include <bits/stdc++.h>
using namespace std;
//luog1955
const int maxn = 1e6;
int f[maxn];
int discrete[maxn];
//离散化
// 总得来说离散化有三步走战略:
// 1.去重(可以用到unique去重函数)
// 2.排序
// 3.二分索引(可以用到lower_bound函数)
struct node
{
int x, y, e;
} source[maxn];
int find(int x)
{
return x == f[x] ? x : f[x] = find(f[x]);
}
void Un... | ALGO | 0.999933 | 4.041323 |
1e4deb07-9a90-4efe-87ac-a728184a3663 | Ashokav008/LeetCode | 0222-count-complete-tree-nodes/0222-count-complete-tree-nodes.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.999834 | 6.326227 |
730a4fca-c815-4c27-bfa5-9ddc0e17956f | hantwofish/recode | leetcode/leetcode/421数组中两个数的最大异或值.cpp | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int findMaximumXOR(vector<int>& nums) {
if(nums.size()== 1){
return 0;
}
int resu = INT32_MIN;
int N = nums.size();
for(int i = 0 ; i < N ; i++)... | ALGO | 0.99992 | 4.929302 |
2121a782-6729-4214-adfd-64e5778c5e28 | viettrungIT3/Cpp_can_ban_2019 | BAI_TP_MANG_MOT_CHIEU/mang_14.cpp | #include <stdio.h>
#include <conio.h>
#include <iostream>
using namespace std;
void nhap(int *n){
do {
cout<<"Nhap so nguyen n: ";
cin>>*n;
} while ( *n<=0);
}
void nhapMang( int a[], int n){
cout<<"Nhap vao mang "<<n<<" phan tu:\n";
for (int i=0;i<n;i++){
cout<<"\ta["<<i<<"] = ";
cin>>a[i];
}
}
void hi... | ALGO | 0.995174 | 3.422234 |
6915c9e9-48b4-4b49-a1e0-bfd69ad2e94d | JamesDavise/HDFS | cpp_17/011_unordered_map_merge.cpp | #include <iostream>
#include <string>
#include <utility>
#include <unordered_map>
// print out a std::pair
template <class Os, class U, class V>
Os& operator<<(Os& os, const std::pair<U,V>& p) {
return os << '{' << p.first << ", " << p.second << '}';
}
// print out an associative container
template <class Os, c... | TOOL | 0.902345 | 4.696556 |
fc06c88d-1057-4cb1-9bf1-12444b884bf1 | jaynishmehta/LeetCode | 0058-length-of-last-word/0058-length-of-last-word.cpp | class Solution {
public:
int lengthOfLastWord(string s) {
int i=s.size();
i--;
char prev='1';
int ans=0;
while(i>=0){
if(s[i]==' ' && prev=='1'){
i--;
prev='1';
}
else if(s[i]!=' ' && (prev=='1' || (prev!=' '... | ALGO | 0.999868 | 5.51474 |
0165f10b-9d75-46ba-a7d3-4262c987568e | luoan/Accelerated-cpp | 2/2-9.cpp | #include <iostream>
int main()
{
int a, b;
std::cout << "Please input first number: ";
std::cin >> a ;
std::cout /*<< std::endl*/ << "Please input second number: ";
std::cin >> b;
if (a > b)
std::cout << "a is bigger" << std::endl;
else if (a < b)
std::cout << "b is bigger" << std::endl;
else... | ALGO | 0.983667 | 3.33541 |
0339bdb8-219e-4fd8-a46b-60d9fd5a1a59 | udacity/CarND-MPC-Quizzes | global_kinematic_model/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.872456 | 6.245759 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.