uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b08766e6-af58-4e0f-975c-6fc8279b3a26 | Pro-Prompter/BasicCPPProgs | precision.cpp | #include <iostream>
#include <conio.h>
#include <iomanip>
using namespace std;
int main()
{
double r, n1 = 132.364, n2 = 26.91;
r = n1 / n2;
cout << r << endl;
cout << setprecision(5) << r << endl;
cout << setprecision(4) << r << endl;
cout << setprecision(3) << r << endl;
cout << setpreci... | ALGO | 0.982901 | 3.839122 |
aad674bd-6cb8-4378-a2ca-65bfb81f81f3 | SarthakBhatt22601/DS-A-Assignments | Day 7/q2.cpp | class Solution {
public:
vector<int> kWeakestRows(vector<vector<int>>& mat, int k) {
vector<pair<int,int>> v;
for(int i=0;i<mat.size();i++)
{
int count = 0;
for(int j=0;j<mat.size();j++)
{
if(mat[i][j] == 1)
count++;
... | ALGO | 0.999834 | 5.597242 |
20d697d2-bff5-4358-9a70-b3039b2b56ed | iliyian/LuoguOJ | Problems/P3205/main.cpp | #include <bits/stdc++.h>
#define mod 19650827
using namespace std;
int a[1001], f[1001][1001][2];
int main() {
ios::sync_with_stdio(false); cin.tie(0);
freopen("data.in", "r", stdin);
int n;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
memset(f, 0, sizeof(f));
for (int i = 1; i <= n; i++)
... | ALGO | 0.999913 | 4.074192 |
b920e832-327d-45b7-be76-ff9c27e07a7e | KnifeParty12/Back_again | FANG_Mix/Min_Number_Of_Refueling_Stops.cpp | #include <bits/stdc++.h>
#define endl "\n"
#define fast_io \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define loop(i, a, b) for (int i = a; i < b; i++)
#define sloop(str, i, a) for (int i = a; str[i] != '\0'; i++)
#define mod 1000000007
#d... | ALGO | 0.998399 | 3.500189 |
ac923c07-d95f-4bc7-8fc2-56389a7df4c4 | JIghtuse/code-solutions | exercism/cpp/crypto-square/crypto_square.cpp | #include "crypto_square.h"
#include <cctype>
#include <cmath>
#include <tuple>
namespace crypto_square {
std::pair<Size, Size> calculate_size(Size length)
{
auto square_root = std::sqrt(length);
auto rows = std::floor(square_root);
auto cols = std::ceil(square_root);
if (rows * cols != length) {
... | TOOL | 0.994079 | 6.220505 |
fd2fba83-f537-4477-9cc2-0731adffaf38 | raincross7/code-similarity | codes/train_code/problem426/problem426_277.cpp | //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <... | ALGO | 0.999246 | 3.297179 |
443494b2-6deb-42f0-944a-e43e50f54cbb | mohamedramadan14/Uva-Solutions-in-C- | uva 10905.cpp | #include <bits/stdc++.h>
using namespace std;
bool cmp(string a , string b){
return b+a < a+b;
}
int main()
{
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
int n ;
while(cin>>n && n ){
vector<string> v;
string s;
for( int i = 0 ; i < n ; ++i){
cin>>s;
v.push_bac... | ALGO | 0.999936 | 4.403577 |
8f53e400-b630-44d7-9639-830336032c30 | yunshujing/ACM | cf/0903/C_The_Legend_of_Freya_the_Frog.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define endl "\n"
#define mod3 998244353
#define mod7 1000000007
const int N = 1e6 + 10;
const double eps =1e-4;
void solve(){
int x, y, k;
cin >> x >> y >> k;
int cnt=max(2*((x+k-1)/k)-1,2*((y+k-1)/k));
... | ALGO | 0.999872 | 4.090771 |
2a681c1f-35dd-433f-8603-d5456b2fa4c1 | amitasj7/Data-Structure-Algo | stack/Important problem/balanced_parenthesis.cpp | #include <bits/stdc++.h>
using namespace std;
bool balancedParenthesis2(string s)
{
// take i that contain open bracket position
int i = -1;
// traverse string
for (auto &ch : s)
{
// if opening bracket coming
if (ch == '(' || ch == '[' || ch == '{')
{
// increa... | ALGO | 0.968932 | 5.428174 |
ce963a45-63f2-4829-862f-b9aa6f70e225 | NicolasDerumigny/Project2-SAT-Solver | Rendu4/Sources/backtrack.cpp | #include "backtrack.h"
bool checkAssign(){
std::map<unsigned long,union_set<unsigned long> > valToSet;
unsigned long left_nb;
unsigned long right_nb;
for (assignation* ass:assignations){
if (ass->variable != nullptr){//on crée des sets pour chaque élément de la théorie rencontré
lef... | ALGO | 0.99972 | 3.198957 |
3de0abd4-7b2e-4ec9-978e-482d3dd6b763 | pkuzyc/DeepDendrite | src/DeepDendrite/coreneuron/nrnmpi/mpispike.cpp | #include "coreneuron/nrnconf.h"
/* do not want the redef in the dynamic load case */
#include "coreneuron/nrnmpi/nrnmpiuse.h"
#include "coreneuron/nrnmpi/nrnmpi.h"
#include "coreneuron/nrnmpi/nrnmpidec.h"
#include "coreneuron/nrnmpi/nrnmpi_impl.h"
#include "coreneuron/nrnmpi/mpispike.h"
#include "coreneuron/nrniv/profi... | TOOL | 0.933041 | 4.519462 |
bd908b6f-2da6-4c57-9ba7-3fcce70b1f83 | Pyaxy/algorithm-practice | Program_Design/LUOGU/Introduction_4_Array/第k个数.cpp | //#define _CRT_SECURE_NO_WARNINGS 1
//#include<iostream>
//
//using namespace std;
//
//const int N = 1e6 + 10;
//
//int n, k;
//int q[N];
//
//int quick_sort(int l, int r, int k)
//{
// if (l >= r) return q[l];
//
// int x = q[(l + r) / 2], i = l - 1, j = r + 1;
// while (i < j)
// {
// do i++; while (q[i] < x);
// ... | ALGO | 0.999996 | 4.23841 |
1a983b4a-146b-4d58-b7a7-e983c218c27e | Devvarshney11/DSA-Question | Stacks/DeleteMiddleFromStack.cpp | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
using namespace std;
void deleteMiddle(stack<int> &st,int count,int n)
{
if(count == n/2)
{
st.pop();
return;
}
int ele = st.top();
st.pop();
deleteMiddle(st,count+1,n);
st.push(ele);
}
... | ALGO | 0.999838 | 4.808904 |
ab8786ec-49c7-46c7-9133-ca2f202c6349 | raifernando/competitive-programming | gema/exercicios/introducao-c/gangorra.cpp | // GANGORRA
// https://neps.academy/br/exercise/260
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
if (a*b==c*d) {
cout << 0;
}
else if (a*b > c*d) {
cout << -1;
}
else {
cout << 1;
}
} | ALGO | 0.999917 | 4.738971 |
078c1a5d-898a-4be6-b475-1813b13b9f17 | machineCYC/Face-Recognition | 01-Classifier/samples/cpp/minarea.cpp | #include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
static void help()
{
cout << "This program demonstrates finding the minimum enclosing box, triangle or circle of a set\n"
<< "of points using functions: minAreaRect() minEnclosingTr... | ALGO | 0.99699 | 5.684414 |
50db2add-df0c-41ef-a579-4b73c6145263 | prateek-d152/OOP | Algorithms/Sorting.cpp | //Bubble Sort
//Worst/Average: O(n²)
//Best (already sorted): O(n)
//Use When: Teaching/learning or very small datasets.
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n-1; i++) {
for (int j = 0; j < n-i-1; j++) {
if (arr[j] > arr[j+1]) {
... | ALGO | 0.99987 | 6.021238 |
cf1ac78e-52aa-40f8-90dd-3befe530e2f1 | ishandutta2007/codeforces | kotamanegi/normal/1185/D.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include... | ALGO | 0.999954 | 3.742923 |
6bb8a084-9292-4bf8-941e-c45b1a9d87bb | roy-subhojeet/leetcode | 0110-balanced-binary-tree/0110-balanced-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.999895 | 6.657557 |
95204087-989d-4089-88d0-f8f87c74dbb5 | wiserdivisor/recreation | HackerRank/Strings/strings_with_swap.cpp | #include<iostream>
#include<string>
int main()
{
std::string a, b;
char c;
std::cin>>a>>b;
std::cout<<a.size()<<' '<<b.size()<<'\n'<<a+b<<'\n';
//Swapping first char
std::swap(a[0],b[0]);
std::cout<<a<<' '<<b;
}
| ALGO | 0.999174 | 4.283555 |
8c61854b-3cb7-46fa-862f-560a360293be | Tarun097/CppVSWSL | Oct2024/old/dijkstraIntro.cpp | #include<iostream>
#include<queue>
#include<climits>
using namespace std;
/*
(4) /----3----\
0-----\ (3) / \ (2)
| \ / \
(4) | 2------------------5
| / \ /
1-----/ (1) \ / (3)
(2) \----4----/
*/
... | ALGO | 0.999867 | 4.61926 |
fba23cc7-bccb-4446-a481-e19ad2667e69 | oVeron0615/baekjoon | solved.ac - CLASS/CLASS 4/boj_1991.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int SZ = 26;
pair<char, char> graph[SZ];
void preorder(int u)
{
cout << char(u + 'A');
auto [l, r] = graph[u];
if(l != '.') preorder(l - 'A');
if(r != '.') preorder(r - 'A');
}
void in... | ALGO | 0.999986 | 4.278182 |
67a6fa9f-a6c8-418d-861a-6cb4ac362e1c | kitsilanosoftware/EAWebKit | WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp | #include "config.h"
#include "V8DOMWindow.h"
#include "Chrome.h"
#include "ContentSecurityPolicy.h"
#include "DOMTimer.h"
#include "DOMWindow.h"
#include "ExceptionCode.h"
#include "Frame.h"
#include "FrameLoadRequest.h"
#include "FrameView.h"
#include "HTMLCollection.h"
#include "HTMLDocument.h"
#include "MediaPlayer... | TOOL | 0.894272 | 7.023916 |
cb94666b-8341-4534-bf85-c52ad63bfe13 | Branchverse/uni-stg-info2 | 10_blatt/10.3.cpp | #include <iostream>
using namespace std;
const int N = 50;
class Car
{
public:
char name;
int position;
int speed;
void print();
void move();
Car(char name = '*', int position = 0, int speed = 0);
};
void Car::print()
{
cout << "Name: " << name << ", position: " << position << ", speed: " << speed << e... | TOOL | 0.917954 | 5.393893 |
3062c53f-6d25-48aa-be06-9a168ae184ee | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_13036_12.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long mod = 1e9 + 7;
const int inf = 1e9 + 5;
const int N = 1e6 + 5;
int d[10];
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
;
i... | ALGO | 0.99997 | 4.720062 |
0c7fc232-fcde-4eab-a3d4-6f19c4a53e81 | KirilGeorgiev247/My-Data-Structures-Algorithms | Algorithms/Sorting/radixSort.cpp | #include <vector>
#include <algorithm>
using namespace std;
int getMax(const vector<int>& arr) {
return *max_element(arr.begin(), arr.end());
}
// A function to do counting sort of arr[] according to the digit represented by exp.
void countSort(vector<int>& arr, int exp) {
vector<int> output(arr.size());
... | ALGO | 0.999863 | 5.443071 |
eab59bbe-426d-4511-954e-1c78cc74a8d0 | dankhap98/webserver | sources/Configuration.cpp | #include "../includes/Configuration.hpp"
Configuration::Configuration(): path(""), servers() {}
Configuration::Configuration(std::string filepath): path(filepath), servers() {}
Configuration::~Configuration() {
}
void Configuration::setPath(const std::string& filepath) {
this->path = filepath;
}
void Con... | TOOL | 0.972496 | 5.06076 |
f94c7ad1-bc3a-4f64-b8cd-10d31837aeef | ishandutta2007/codeforces | alex_2oo8/normal/1043/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int MX = 300000;
int x[MX], y[MX];
long long ans[MX];
int main() {
int n, m;
ignore = scanf("%d %d", &n, &m);
vector<pair<int, int>> vec;
for (int i = 0; i < n; i++) {
ignore = scanf("%d %d", x + i, y + i);
vec.emplace_back(x[i] - y[i], i);
}
sort(ve... | ALGO | 0.999987 | 4.320827 |
2f352cfc-294a-423a-90d0-b9d429e522bc | Kamran151199/parallel-bsf | adj_list_repr.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <omp.h>
void serialBFSAdjList(const std::vector<std::vector<int>>& graph, int start) {
int n = graph.size();
std::vector<bool> visited(n, false);
std::queue<int> q;
q.push(start);
visited[start] = true;
while (!q.empty()) {
... | ALGO | 0.999944 | 6.314723 |
79e4374d-8098-43e7-b82f-2d74901c8bbd | ankita-2608/DataStructure | MinMaxValTree.cpp | #include<iostream>
using namespace std;
class Node {
public:
int data;
Node* left;
Node* right;
Node(int data) {
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
//minimum value in the tree
Node* minNode(Node* root) {
N... | ALGO | 0.999803 | 4.633885 |
89bc96ce-0d1b-49e1-bed0-704dc6d8fbe6 | rapirent/onlinejudge-competition | icpc/4262.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <vector>
using namespace std;
vector<int> topo;
void dfs(bool edge[][1010],int i,int N, bool visit[])
{
for(int k = 1;k<=N;k++) {
if(edge[i][k]&&!visit[k]) {
visit[k] = true;
dfs(edge,k,N,visit);
}
}
... | ALGO | 0.999949 | 4.907315 |
f4b25ebb-c47c-4086-a59d-db09375de390 | BhaveshPatil12/CPP-OOPS | OOPS110.cpp | #include<iostream>
#include<math.h>
using namespace std;
class Narcissistic {
private:
int start, end;
public:
void getRange() {
cout << "Enter Start : ";
cin >> start;
cout << "Enter End : ";
cin >> end;
}
void isNarcissistic() {
int index, temp, remain, power, sum;
cout << "\nNarciss... | ALGO | 0.998498 | 5.070009 |
931c9a9d-e756-4f3b-b492-4ff2051b54b1 | 2905Yatharth/practice | sq root.cpp | //Square root
long long int floorSqrt(long long int x)
{
long long int l=1,h=x,mid,ans=-1;
while(l<=h){
long long int mid =(l+h)/2;
long long int midSq = mid*mid;
if(midSq == x){
return mid;
}
else if(midSq > x){
h=mid-1;
... | ALGO | 0.99995 | 3.506594 |
35e7f582-5e68-41d2-863e-aed820613da1 | daviolimen/Exercises | USACO_Guide/Silver/Graph_Traversals/rank.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 21;
bool inCycle[MAXN];
int n, m, timer, tin[MAXN], tout[MAXN], parent[MAXN];
vector<int> graph[MAXN];
void dfs(int u, int p) {
if (tin[u]) return;
tin[u] = timer++;
parent[u] = p;
for (auto v : graph[u]) {
if (tin[v] == 0) dfs(v,... | ALGO | 0.999129 | 4.3828 |
ce14f4dc-b9e2-4244-8db9-4d429eb328f0 | kutomei3/OTOG-Answer | Answer/819-TOI18_Garden.cpp | /**
* Author: kutomei3
* date: 21-4-2025
**/
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, q;
cin >> n >> q;
vector<int> vec(n);
for (auto& p : vec) cin >> p;
vector<int> ans(n), s;
f... | ALGO | 0.999982 | 4.740402 |
0658653e-f657-4df8-9643-6f1fcbf2da9c | vivekpisal/Leetcode-Problems | Palindrome String - GFG/palindrome-string.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int isPalindrome(string S)
{
int i=0,j=S.size()-1;
int flag=0;
while(i <= j){
if(S[i] == S[j])
flag=1;
else
... | ALGO | 0.999332 | 5.725399 |
c976d46c-3b61-4954-b5ec-42afad0574ff | ishandutta2007/codeforces | a_g/normal/1658/D1.cpp | #include <bits/stdc++.h>
using namespace std;
const int M = 17;
int main () {
ios_base::sync_with_stdio(0); cin.tie(0);
int T;
cin >> T;
while (T--) {
int l, r;
cin >> l >> r;
vector<int> a(r-l+1);
for (int i = 0; i < r-l+1; i++) {
cin >> a[i];
}
int x = 0;
for (int i = M-1; ... | ALGO | 0.999988 | 4.57777 |
eab9f4f6-2f04-4ee2-8bb9-3b27fecf43cc | Hao940326/2023aaib3 | week13/week13-2.cpp | #include<iostream>
using namespace std;
int helper(int a,int b){
int ans=0,carry=0;
while(a>0||b>0){
int now =a%10+b%10+carry;
carry=now/10;
ans+=carry;
a/=10;
b/=10;
}
return ans;
}
int main(){
int a,b;
while(cin>>a>>b){
if(a==0&&b==0)break;
int ans = helper(a,b);
if(ans==0)cout<<"No carry o... | ALGO | 0.999918 | 3.71883 |
82e07734-c251-42b0-80de-fa7dd2cf5f03 | Ankur8789/LC-my-solutions | 3243-shortest-distance-after-road-addition-queries-i/3243-shortest-distance-after-road-addition-queries-i.cpp | class Solution {
public:
unordered_map<int,vector<int>> adj;
int djk(int n){
vector<int> dis(n,1e9);
dis[0]=0;
queue<int> q;
q.push(0);
while(q.size()){
auto u=q.front();
q.pop();
for(auto v: adj[u]){
if(dis[v]!=1e9)cont... | ALGO | 0.999973 | 5.952353 |
ee9f8339-1234-4442-9307-13682a045d42 | Quangnam1423/data-structure-and-algorithm-go-with-C- | DSA_TONGQUANGNAM/so_thu_tu_to_hop.cpp | #include<iostream>
using namespace std;
int n , k , a[100];
void khoitao()
{
cin >> n >> k;
for(int i = 1;i <= k; i ++ )
{
cin >> a[i];
}
}
int sohoanvi()
{
int cnt(1);
for(int i = n; i >= n - k + 1; i -- )
{
cnt *= i;
}
for(int i = k ; i >= 2; i-- )
{
cnt/=i;
}
return cnt;
}
void nextGen()
{
int... | ALGO | 0.999813 | 3.249334 |
ab2cb67b-8831-4316-bd58-52e3566a72c1 | Divyanshu03chauhan103/LeetCode | 198-house-robber/house-robber.cpp | class Solution {
public:
// int solve(vector<int>& nums, int i,vector<int>&dp) {
// if (i >= nums.size()) return 0;
// if(dp[i]!=-1) return dp[i];
// // Option 1: Rob this house and skip the next
// int rob = nums[i] + solve(nums, i + 2,dp);
// // Option 2: Skip this house
... | ALGO | 0.999811 | 5.672072 |
e6590a10-196f-4ba7-a7f6-ae659358fc56 | jx-qqq/SEIMSBMPUpdate | seims/src/seims_main/modules/hydrology/SUR_SGA/StormGreenAmpt.cpp | #include "StormGreenAmpt.h"
#include "text.h"
// using namespace std; // Avoid this statement! by lj.
StormGreenAmpt::StormGreenAmpt(void) : m_infil(NULL), m_capillarySuction(NULL), m_accumuDepth(NULL),
m_dt(-1), m_nCells(-1), m_pNet(NULL), m_porosity(NULL), m_soilMoisture(NULL... | ALGO | 0.875624 | 3.996596 |
ae228026-5bc5-4484-b419-38a3f0c2e971 | ishandutta2007/codeforces | aryanc403/normal/1538/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repA(i, a, n) for(int i = a; i <= (n); ++i)
#define repD(i, a, n) for(int i = a; i >= (n); --i)
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define dbg(x) cerr<<#x<<" : "<<x<<endl
t... | ALGO | 0.999816 | 3.857656 |
0d1e38dd-e0cb-4449-8775-abaed35e6d1c | zhou-jk/code | HDU/7290/7290.cpp | #pragma GCC optimize("Ofast")
#include<iostream>
#include<cstdio>
using namespace std;
const int MOD=998244353;
int qpow(int a,int b)
{
int res=1;
while(b)
{
if(b&1) res=(long long)res*a%MOD;
a=(long long)a*a%MOD,b>>=1;
}
return res;
}
void solve()
{
int n;
cin>>n;
int an... | ALGO | 0.999721 | 5.245217 |
34217df1-a090-48cd-a300-870790c747ae | 06suraj/GeekforGeeks-And-Leetcode | Weekly Contest 275/2135. Count Words Obtained After Adding a Letter.cpp | class Solution {
public:
int wordCount(vector<string>& startWords, vector<string>& targetWords) {
unordered_map<string,int>target;
unordered_set<string>check;
int ans=0;
for(string s:targetWords){
sort(s.begin(),s.end());
target[s]++;
}
for(str... | ALGO | 0.999898 | 5.474679 |
9e3faa7f-35f2-46db-aaf1-5c996136dbd3 | Ri-Nai/CompetitionCode | OI/School_203/2000_5000/3764.cpp | #include<bits/stdc++.h>
using namespace std;
int n,m,k,dp[1<<16],cnt[16][1<<16],ans[1<<16];
bool mark[20][20];
int solve(int p)
{
if(ans[p])return ans[p];
if(dp[p]<=k)return ans[p]=1;
int res=16;
for(int i=p;i;i=(i-1)&p)
if(i!=p)res=min(res,solve(i)+solve(p^i));
return ans[p]=res;
}
int main()
{
scanf("%d%d%d",... | ALGO | 0.999891 | 4.262082 |
0f32f2ef-14bc-43ac-aa5c-a51c311e969c | priyanshu1621/DSA | 140-word-break-ii/word-break-ii.cpp | class Solution {
public:
unordered_map<string, vector<string>>dp;
vector<string> help(string s, vector<string>& wordDict){
if(s.empty())
return {""};
if(dp.find(s) != dp.end())
return dp[s];
vector<string>subpart, wholepart;
for(string word : wordDict){
... | ALGO | 0.999909 | 6.214548 |
6f618554-0074-4143-a936-6c91e8685ced | chapel-lang/chapel | third-party/llvm/llvm-src/tools/clang/lib/ASTMatchers/ASTMatchFinder.cpp | #include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/PrettyStack... | TOOL | 0.991999 | 7.713377 |
71abf9e6-f039-48d1-8cff-6b6f267230cf | HargovindArora/Programming | Hashing/largestSubarrayWithZeroSum.cpp | #include<iostream>
#include<unordered_map>
using namespace std;
int longestSubarrayWithZeroSum(int *arr, int n){
unordered_map<int, int> mp;
int pre = 0;
int len = 0;
for(int i=0; i<n; i++){
pre += arr[i];
if(arr[i]==0 and len==0){
len = 1;
}
if(pre==0){
... | ALGO | 0.999952 | 5.149068 |
4766df25-ce1a-47f4-894f-58a651d4d83d | hhy5277/algorithm-4 | code12.cpp | /*
Given a Binary Search Tree and a target number,
return true if there exist two elements in the BST such that their sum is equal to the given target.
Example 1:
Input:
5
/ \
3 6
/ \ \
2 4 7
Target = 9
Output: True
Example 2:
Input:
5
/ \
3 6
/ \ \
2 4 7
Target = 28
Output: F... | ALGO | 0.999998 | 6.297199 |
3acafbbb-77c6-486c-a445-8d118f47eb98 | degarashi/spinner | rectdiff.cpp | #include "rectdiff.hpp"
namespace spn {
namespace rect {
void IncrementalRect(const spn::Rect& base, const int dx, const int dy, const Rect_cb& cb) {
// 動いて無ければ何もせず終了
if(dx==0 && dy==0)
return;
// 前後の矩形が重ならない場合、単に移動後の矩形でコールバック
if(std::abs(dx) >= base.width() ||
std::abs(dy) >= base.height())
... | ALGO | 0.979269 | 5.896138 |
eb576a2d-24c5-4992-9473-837d75d665b9 | raincross7/code-similarity | codes/train_code/problem400/problem400_262.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
//#define ll long long
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) R... | ALGO | 0.999955 | 4.021456 |
b3b83aee-d74c-4055-9904-adc765932824 | Indective/TaskMasterpp | libs/json/tests/thirdparty/Fuzzer/FuzzerSHA1.cpp | #include "FuzzerSHA1.h"
#include "FuzzerDefs.h"
/* This code is public-domain - it is based on libcrypt
* placed in the public domain by Wei Dai and other contributors.
*/
#include <iomanip>
#include <sstream>
#include <stdint.h>
#include <string.h>
namespace { // Added for LibFuzzer
#ifdef __BIG_ENDIAN__
# defi... | ALGO | 0.949429 | 7.45007 |
aec2c6bb-9487-4910-bbc8-6469255e273c | revng/llvm-project | clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp | #include "SimplifyBooleanExprCheck.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/Lex/Lexer.h"
#include "llvm/Support/SaveAndRestore.h"
#include <optional>
#include <string>
#include <utility>
using namespace clang::ast_matchers;
namespace clang::tidy::readability {
namespace {
StringRef getText(con... | TOOL | 0.865084 | 6.000107 |
8a539c87-e8bd-4e31-a9ab-45cb19f5e0cb | ishandutta2007/codeforces | timsei/normal/1119/G.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int m, n, hp[N], A[N], B[N], C[N], tot;
int main() {
cin >> n >> m;
int Sum = 0, tot = 0;
vector <int> ans; ans.clear();
for(int i = 1; i <= m; ++ i) {
scanf("%d", &A[i]);
while(A[i] >= n) {
for(int j = 0; j < m; ++ j) ans.push_back(i);
... | ALGO | 0.999993 | 3.127656 |
d9a470bd-6142-4e03-b8b7-d15b64ad20b4 | SocksDevil/AEDA_FEUP_18_19 | Aula_10/src/Aposta.cpp | #include "Aposta.h"
#include <iostream>
#include <sstream>
#include <algorithm>
using namespace std;
bool Aposta::contem(unsigned num) const
{
tabHInt::const_iterator it = this->numeros.find(num);
return (it != this->numeros.end());
}
void Aposta::geraAposta(const vector<unsigned> & valores, unsigned n)
{
this->n... | ALGO | 0.95153 | 5.003149 |
0a8fbb46-5ece-4053-a33b-c15d1cd6711d | defland/bluehostplatform | src/wallet/wallet_ismine.cpp | #include "wallet_ismine.h"
#include "key.h"
#include "keystore.h"
#include "script/script.h"
#include "script/standard.h"
#include "script/sign.h"
#include <boost/foreach.hpp>
using namespace std;
typedef vector<unsigned char> valtype;
unsigned int HaveKeys(const vector<valtype>& pubkeys, const CKeyStore& keystore... | ALGO | 0.991128 | 5.516846 |
a59412dc-5ad5-4eb5-8bd6-feddd07a8873 | sinian666/code_102_8 | cpp_副本7/chapter_array_and_linkedlist/array.cpp | /**
* File: array.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 随机返回一个数组元素 */
int randomAccess(int *nums, int size) {
// 在区间 [0, size) 中随机抽取一个数字
int randomIndex = rand() % size;
// 获取并返回随机元素
int randomNum = nums[randomIndex];
return randomNum;
... | ALGO | 0.942304 | 4.819575 |
9c5b0bda-57d0-4dac-96df-60e80aa85f92 | wells-wei-wei/smplify-x_in_docker | boost_1_72_0/libs/numeric/odeint/examples/mpi/phase_chain.cpp | #include <iostream>
#include <vector>
#include <boost/random.hpp>
#include <boost/timer/timer.hpp>
//[phase_chain_mpi_header
#include <boost/numeric/odeint.hpp>
#include <boost/numeric/odeint/external/mpi/mpi.hpp>
//]
using namespace std;
using namespace boost::numeric::odeint;
using boost::timer::cpu_timer;
using boo... | ALGO | 0.999974 | 5.417043 |
d71dbf60-9523-4b1f-ac87-208bbc0b7653 | sarvex/leetcode-zig | solution/1900-1999/1993.Operations on Tree/Solution.cpp | class LockingTree {
public:
unordered_map<int, int> nums;
vector<int> parent;
vector<vector<int>> children;
LockingTree(vector<int>& parent) {
this->parent = parent;
int n = parent.size();
children.resize(n);
for (int i = 0; i < n; ++i)
if (parent[i] != -1)
... | ALGO | 0.999517 | 5.537601 |
e690549e-f3a4-4e21-96cf-a8fd88ca8f57 | Juhyi/Basic-cpp-2024 | day06/Project1/Project1/06IKnowTempObj.cpp | #include <iostream>
using namespace std;
class Temporary
{
private:
int num;
public:
Temporary(int n) : num(n) // int 1 Ű Է
{
cout << "creat obj: " << num << endl;
}
~Temporary()
{
cout << "destroy obj: " << num << endl;
}
void ShowTempInfo()
{
cout << "My name is " << num << endl;
}
};
int main(voi... | TOOL | 0.871449 | 4.008525 |
960f5286-bbe0-4352-b95c-0c13cebe5fc3 | olena-hul/CourseworkOOP | maze.cpp | #include "maze.h"
Maze::Maze()
{
// The constructor with no parameters. Initializes the fields with initial values
size = 0;
grid = nullptr;
cells = nullptr;
}
Maze::Maze(int _size)
{
// The constructor with _size parameter. Initializes the fields with given values
size = _size;
// Alloc ... | ALGO | 0.953761 | 6.131354 |
93346f5f-3863-4136-a40b-d563d6702336 | Siddhantthakur132/Code-Diary | Two Pointer/Two-Sum.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int, int> mp; // value -> index
for (int i = 0; i < nums.size(); i++) {
int complement = target - nums[i];
if (mp.find(complement) != mp.end()... | ALGO | 0.999858 | 6.671514 |
60061bbc-ca06-4c1f-90f4-0ddcad3dc76b | csci0300/cs300-s25-labs | lab5/multiProcs/revindex_procs.cpp |
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/wait.h>
#include <cstring>
#include "wordindex.h"
// Maximum number of workers processes to use
// [can also configure by running ./revindex_parallel --workers N ...]
#define NUM_WORKERS_DEFAULT 8
// Prototypes for functio... | DATA | 0.996746 | 4.390851 |
4c8d1fdd-e842-4b5e-b7da-69eb160e4102 | alpet83/Xray-NLC7 | 3rd party/FreeImage/FreeImage/Source/OpenEXR/Half/half.cpp | // Primary authors:
// Florian Kainz <<EMAIL>>
// Rod Bogart <<EMAIL>>
//---------------------------------------------------------------------------
//
// class half --
// implementation of non-inline members
//
//---------------------------------------------------------------------------
#include <assert.h>
... | TOOL | 0.883746 | 6.852328 |
50266c33-3183-49b7-93d9-1bd74ba37c35 | ping543f/Computer-Graphics--OpenGL-GLUT | 2d_car_racing_collision_score/Car Racing_Version_2.cpp | /*
Monzur,MD.Shohag (14-27883-3)
Hasan,SM Amit (14-27794-3)
Ghose,Amit (12-21250-2)
Rahman,Md Mahmudur (14-26447-1)
*/
#include <stdlib.h>
#include <windows.h>
#include <string.h>
#include <GL/glut.h>
#include <stdio.h>
#include<time.h>
#include<iostream>
using namespace std;
#pragma region
static int score=0;
int x... | ALGO | 0.970129 | 3.255792 |
23f1cd1e-d748-4d50-8b6b-9cc502d2b0b8 | edugallogithub/gnssdenied_flight_simulation | project_phd/phd/math/pred/pred3v/f_table3V.cpp | #include "f_table3V.h"
// CLASS F_TABLE3V
// ===============
// ===============
const math::logic::PRED_NAME math::f_table3V::_name = math::logic::f_table3V;
/* predicate name */
const std::string math::f_table3V::_st_name = "f_table3V";
/* predicate name string */
math::f_table3V::f_table3V(vec1* points3,
... | ALGO | 0.9752 | 6.205933 |
0a952c2c-eb34-44e7-bf81-ea2f7968b8f3 | WadekarPrashant/GeeksForGeeks-Questions | misc/GFG_Contest/Weekly137-3.cpp | class Solution {
public:
int candyShop(int n, vector<int> &candies) {
unordered_map<int,int>ans;
int i;
for(i=0;i<candies.size();i++){
ans[candies[i]]++;
}
int k=ans.size();
int j=0;
unordered_map<int,int>val;
int sum=0;
int mini=... | ALGO | 0.999972 | 5.386605 |
a12491f4-30b0-42f4-9ddc-cf142e67711a | heavenMOJANG/ICPC | .history/programmes_C_Cpp/AtCoder/abc401/D_20250413145241.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
void solve() {
int n, k; cin >> n >> k;
string s; cin >> s;
int cnt{};
for (int i{}; i < n; ++ i)
if (s[i... | ALGO | 0.999983 | 4.17513 |
989152f2-6f48-4630-9147-25c6ec7279ed | yuta1024/aoj | Volume 0/0046.cpp | #include <cstdio>
int main()
{
double max, min, input;
scanf("%lf", &input);
min = max = input;
while (~scanf("%lf", &input)) {
if (max < input)
max = input;
if (min > input)
min = input;
}
printf("%.1f\n", max-min);
return 0;
}
| ALGO | 0.999745 | 3.739933 |
6fcdc5bc-e582-482e-8535-197080e70696 | srulgerl/Mobile-FlutterLabs | lab11/order_food/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.99863 | 6.776823 |
c7510fd9-9a09-44d1-844c-6fd77541fd13 | di8735/Access | PathFinder.cpp | #include "PathFinder.h"
PathFinder::PathFinder(Map * pMap){
m_pRMap = pMap;
for (int y = 0; y < MAX_X_SIZE; ++y){
for (int x = 0; x < MAX_Y_SIZE; ++x){
m_map.m_tile[x][y] = pMap->m_tile[x][y];
}
}
}
PathFinder::~PathFinder(){
}
int PathFinder::FindPath(float startX, float startY, float destinationX, flo... | ALGO | 0.998994 | 3.622253 |
b7b1e156-ee09-433a-946c-bf2be2b98443 | llvm/clangir | libc/src/math/generic/f16sqrtl.cpp | #include "src/math/f16sqrtl.h"
#include "src/__support/FPUtil/sqrt.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float16, f16sqrtl, (long double x)) {
return fputil::sqrt<float16>(x);
}
} // namespace LIBC_NAMESPACE_DECL
| ALGO | 0.977297 | 6.23711 |
0d2f987e-9dd9-41f1-9c6a-391bdb8afc43 | flexmex01/BOET | CSE 106 - DSA1 Sessional/Offlines/Offline 1 - List/2105139/Arr.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
class list
{
int * arr;
int curr;
int size;
public:
list ()
{
arr = (int*)malloc(10*sizeof(int));
curr = 0;
size = 0;
arr[9]=-969;
}
list (int m)
{
arr = (int*)malloc((++m)*sizeof(int... | ALGO | 0.999249 | 3.643843 |
1bd0af18-a217-4468-a9fa-61d1aeedfef8 | Uauy-Lab/IBSpy | IBScpp/KMC/kmc_tools/parser.cpp | #include "stdafx.h"
#include "parser.h"
#include "tokenizer.h"
#include "output_parser.h"
#include "config.h"
/*****************************************************************************************************************************/
/******************************************************** CONSTRUCTOR ***********... | TOOL | 0.89397 | 4.636821 |
20bc144d-8e57-4b62-846c-bd9dd3b0cc2c | nakib1948/Competitive-programming | A_Pangram.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(i=0;i<n;i++)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define debug cout<<"debug"<<endl;
ll a[27];
int main()
{
///"In the name of Allah,most gracious and most merciful"///
ll i,j,x... | ALGO | 0.999983 | 3.784394 |
f7ce5ccc-e312-4241-ba20-c02c2aa002cb | RaveenaBhasin/Competitive-Programming | 1022-sum-of-root-to-leaf-binary-numbers/1022-sum-of-root-to-leaf-binary-numbers.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.999981 | 6.511389 |
81764b16-4dde-47e2-8262-0b08057d85fc | gedorinku/llvm-65816 | libcxx/test/libcxx/fuzzing/partial_sort_copy.pass.cpp | // UNSUPPORTED: c++03, c++11
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <vector>
#include "fuzz.h"
// Use the first element as a count
extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) {
if (size <= 1)
return 0;
const std::size_t num_results = ... | TEST | 0.984306 | 5.81403 |
91b488a6-e723-4eaf-b063-333df24abe5e | cuongdeptrai827/Algorithms_Sem1 | Lab2/untitled/main.cpp | #include <iostream>
using namespace std;
int xorArray(int arr[], int size) {
int result = 0;
for (int i = 0; i < size; i++) {
result ^= arr[i];
}
return result;
}
int main() {
int n, k;
cin >> n >> k;
int A, B, C, a1, a2;
cin >> A >> B >> C >> a1 >> a2;
int* c = new int[n]... | ALGO | 0.999971 | 4.009151 |
2d2beeed-1447-484b-9931-21af25cbf073 | SaeedJannati/LeetCodeProblems | LeetCodeProblemsCMake/Problems/LeetCode85MaximalRectangle.cpp | //
// Created by saeed on 1/7/25.
//
#include "LeetCode85MaximalRectangle.h"
#include <iostream>
#include <ostream>
#include <stack>
int LeetCode85MaximalRectangle::maximalRectangle(std::vector<std::vector<char> > &matrix) {
int rows = matrix.size();
int cols = matrix[0].size();
if (rows == 1 && cols == ... | ALGO | 0.997986 | 6.470981 |
f308ac58-52dc-4d48-b5b0-4a984f961ca1 | Apress/learn-cocos2d-game-dev-w-ios-5 | CH06_code/Sprites06_With_AnimHelper/libs/Box2d/Collision/b2Collision.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/b2Distance.h>
void b2WorldManifold::Initialize(const b2Manifold* manifold,
const b2Transform& xfA, float32 radiusA,
const b2Transform& xfB, float32 radiusB)
{
if (manifold->pointCount == 0)
{
return;
}
switch (manifold->type)
{
... | ALGO | 0.99965 | 7.767238 |
c140f71a-db0d-4d34-b969-1d54987f74de | bansalmukul-cse/LeetCode-Codes | 2053. Kth Distinct String in an Array.cpp | class Solution {
public:
string kthDistinct(vector<string>& arr, int k) {
unordered_map<string,int> mp;
for(auto i :arr){
mp[i]++;
}
for(auto i:arr){
if(mp[i]==1)
k--;
if(k==0 && mp[i]==1)
{
return i;
... | ALGO | 0.999946 | 5.785228 |
86b08765-23b5-4ea1-8690-43ca3e739b6c | error-loading/Competitive-Programming | Dmoj/ DMOPC '15 Contest 6/P4 - Line Graph.cpp | // https://dmoj.ca/problem/dmopc15c6p4
// DMOPC '15 Contest 6 P4 - Line Graph
/******** All Required Header Files ********/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include ... | ALGO | 0.999886 | 3.394894 |
3d993948-ca7b-4885-837e-499ac13e4b05 | Gunjan-Shekhawat/DSA | Stacks-Queues/Longest valid Parentheses .cpp | /*
Given a string S consisting of opening and closing parenthesis '(' and ')'. Find length of the longest valid parenthesis substring.
Input:
First line contains number of test cases T. Each test case have one line string S of character '(' and ')' of length N.
Constraints:
1 <= T <= 500
1 <= N <= 105
Example:
Inp... | ALGO | 0.999291 | 5.284113 |
7a3d20e3-6866-49f9-bcf1-dcc5c9635985 | gval0/Programming_Abstraction | Assignment1/Assignment1-vs2008/2 - Combinations/Combinations/Combinations.cpp | /*
* File: Combinations.cpp
* ----------------------
* Name: [TODO: enter name here]
* Section: [TODO: enter section leader here]
* This file is the starter project for the Combinations problem.
* [TODO: rewrite the documentation]
*/
#include <iostream>
#include "console.h"
#include "simpio.h"
using namespace s... | ALGO | 0.99887 | 5.871307 |
189d611d-b8b6-4067-aee0-9b4a10fd0cc3 | zim2510/Online-Judge-Solves | 2018/Count the Multiples of 3.cpp | #include <bits/stdc++.h>
#define Read() freopen("in.txt", "r", stdin)
#define Write() freopen("out.txt", "w", stdout)
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define TC(i, a, b) for(int i = a; i<=b; i++)
#define FOR(i, a, b) for(int i = a;... | ALGO | 0.999434 | 4.084334 |
a57722d6-29ed-41b9-b356-b7cea96fe9c0 | schost/NTL-extras | code/lzz_pX_extra/src/lzz_pX_extra.cpp | #include "vec_lzz_p_extra.h"
#include "lzz_pX_extra.h"
NTL_CLIENT
/*------------------------------------------------------------*/
/* constructor inits a few arrays */
/* d is an upper bound on the degrees of the inputs */
/*-------------------------------------------------------... | ALGO | 0.997094 | 3.560685 |
5636766f-9b74-4e81-beed-ba349c05ac9a | Shakib7784/Data_Structure_with_CPP | Module 24_ Mid Exam/8_delete_kth_node.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public :
int value;
Node *Next;
Node(int v)
{
value=v;
Next=NULL;
}
};
void insert_at_tail(Node *&head,int value)
{
Node *newnode = new Node(value);
if(head==NULL)
{
head=newnode;
}
else
{
... | ALGO | 0.999912 | 3.412816 |
474bd9cd-ef60-4249-9c02-d092a1d98e9a | kchang8/cs240_assemblyAssignments | Assignment8/prob2.cpp | #include <iostream>
#include <iomanip>
using namespace std;
float a, b, c;
float four = 4.0, two = 2.0, one = -1.0;
float x1, x2;
void display1()
{
cout << "X1 = " << fixed << setprecision(2) << x1;
cout << " ";
}
void display2()
{
cout << "X2 = " << fixed << setprecision(2) << x2 << endl;
}
int main()
{
cou... | ALGO | 0.995371 | 3.526179 |
87791fd9-accb-4181-9f57-c63a647cc063 | orlitany/Cloud_dictionary | Utils/spams-matlab-v2.5-svn2014-07-04/spams-matlab/decomp/mex/mexSparseProject.cpp | /*!
* \file
* toolbox Linalg
*
* by Julien Mairal
* <EMAIL>
*
* File mexL1Project.cpp
* \brief mex-file, function mexL1Project
* Usage: Y = mexSparseProject(X,param); */
#include <mex.h>
#include <mexutils.h>
template <typename T>
inline void ca... | TOOL | 0.985711 | 4.713337 |
a4a51c06-fcf2-4e91-b1fe-3f57f3b1074c | LomotHo/DataStructLearning | src/example/OrderTree.cpp | #include "../utils/function.h"
//递归实现
//abdhiejcfg
void preOrder(BiTree p)
{
if(p!=NULL)
{
putchar(p->c);//等价于visit函数
preOrder(p->lchild);
preOrder(p->rchild);
}
}
//中序遍历 hdibjeafcg
void InOrder(BiTree p)
{
if(p!=NULL)
{
... | ALGO | 0.999946 | 3.675155 |
2ebf93da-ef72-4cae-b5dc-af1f52c2f98e | m4oughi/100DaysofCode | pureCPP/0037. Day 37/Standard Template Library Basics/015. Associative Containers - Multiset/003. Counting Specific Elements Using count()/main.cpp | #include <iostream>
#include <set>
int main() {
std::multiset<int> numbers = {1, 2, 2, 3, 3, 3};
std::cout << "Number of 2's: " << numbers.count(2) << "\n";
std::cout << "Number of 3's: " << numbers.count(3) << "\n";
return 0;
}
| ALGO | 0.991818 | 5.555668 |
cdf30e32-d2a6-44ad-abbf-a60d95e38ef5 | vliakop/ElectronicVoting | Structures/Fenrir.cpp | #include "Fenrir.h"
// Constructor
Fenrir::Fenrir(unsigned long bf_size) {
voters_bf = new BloomFilter(bf_size);
rbTree = new RBTree();
pcList = new PCList();
size = 0;
disabled = 0;
voted = 0;
}
// Destructor
Fenrir::~Fenrir() {
delete voters_bf;
delete rbTree;
delete pcList;
... | ALGO | 0.910144 | 3.93916 |
262e7253-527f-4223-b03a-111d14102371 | someshjoyguru/dsa-cp | contests/all_submissions/Static_Range_Minimum_Queries.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio() ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define ll long long
class SGTree {
vector<int> seg;
public:
SGTree(int n) {
seg.resize(4 * n + 1);
}
void build(int ind, int low, int high, int arr[]) {
if (low == high) {
seg[... | ALGO | 0.999993 | 4.67651 |
4a5c9c40-fd0f-43aa-a09b-0fb7b30dc7b2 | EunseJang/Algorithm | baekjoon/silver/2343.cpp | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
int main() {
long long N, M;
cin >> N >> M;
vector<long long> blue(N);
long long endSum = 0;
long long start = -1;
for(int i = 0; i < N; i++) {
cin >> blue[i];
endSum += blue[i];
start = max(start, blue[i]);
}
long lon... | ALGO | 0.999986 | 5.122875 |
24d57929-51d3-457d-b1d1-4189f9089bd0 | ishaan49k/codeforces-submissions | C_Sum_of_Substrings.cpp | #include<bits/stdc++.h>
using namespace std;
using namespace chrono;
#define mii map<int, int>
#define pii pair<int, int>
#define pdd pair<double, double>
#define endl "\n"
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define pll pair<lo... | ALGO | 0.999843 | 4.403018 |
f1ee3836-e69b-4c99-8dde-7e9213117faf | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_2668_2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
long long f, t, t0, a1, t1, p1, a2, t2, p2, i, j;
long long tt, ff, minn = 1e5;
scanf("%lld%lld%lld%lld%lld%lld%lld%lld%lld", &f, &t, &t0, &a1, &t1, &p1, &a2,
&t2, &p2);
if (t1 > t2) swap(t1, t2), swap(a1, a2), swap(p1, p2);
for (i = 0; a1 * i... | ALGO | 0.99991 | 3.30755 |
afee11fc-f550-4193-990c-7271a319f7c0 | Adarshsingh2k/Interview-Prepration | Binary Search Tree/basicspart2.cpp | #include<iostream>
using namespace std;
class Node{
public:
int val;
Node *left;
Node *right;
Node(){
val=0;
left=NULL;
right=NULL;
}
Node(int val){
this->val=val;
left=NULL;
right=NULL;
}
};
Node *insert(Node *root,int value){
if(r... | ALGO | 0.999879 | 4.541601 |
e317832f-501d-473c-902c-949c6338429b | egravityo/Desktop | c语言/c语言之路2/Untitled9.cpp | /*⣺Ӽ10ݣ0ĸ*/
#include<stdio.h>
int main()
{
int i;
int count1=0;//
int count2=0;//
int count=0;//0
int arr[10];
for(i=0;i<10;i++)
{
printf("%d\n",i+1);
scanf("%d",&arr[i]);
if(arr[i]>0)
{
count1++;
}
else if(arr[i]<0)
{
count2++;
}
else if(arr[i]==0)
{
count++;
}
... | ALGO | 0.999742 | 3.424211 |
09a6f89f-1f99-49b6-9c9f-f1ba391c3347 | Faragas91/Projects | C++/LeetCode/Easy/Subtract_the_Product_and_Sum_of_Digits_of_an_Integer/Subtract_the_Product_and_Sum_of_Digits_of_an_Integer.cpp | //Given an integer number n, return the difference between the product of its digits and the sum of its digits.
//
//
//Example 1:
//
//Input: n = 234
//Output : 15
//Explanation :
// Product of digits = 2 * 3 * 4 = 24
// Sum of digits = 2 + 3 + 4 = 9
// Result = 24 - 9 = 15
// Example 2 :
//
// Input : n = 4421
// Out... | ALGO | 0.999674 | 6.679486 |
fc2f33a0-afb8-45cc-8ed4-7308c19adb63 | zech-chi/CodeForces | training/A/A_Vanya_and_Fence.cpp | #include <algorithm>
#include <cstddef>
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <vector>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, t, a;
cin >> n >> t;
int res = 0;
for (int i = 0; i < n; i++) {
cin >> a;
... | ALGO | 0.999808 | 3.330291 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.