uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
c7dbd2bd-6e30-4b31-b341-aa1d7476dddc | kang9366/Algorithm | SWEA_17319.cpp | #include <iostream>
#include <string>
using namespace std;
bool compare(string str, int N){
string str1, str2;
for(int i=0; i<N/2; i++){
str1 += str[i];
str2 += str[i+N/2];
}
if(str1==str2){
return true;
}else{
return false;
}
}
int main(){
int TC, N;
... | ALGO | 0.999638 | 4.398979 |
f0910843-6655-4348-be53-b74f6991e201 | yingling-group/lammps-mspin | src/OPENMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include "pair_lj_charmm_coul_charmm_implicit_omp.h"
#include "atom.h"
#include "comm.h"
#includ... | ALGO | 0.999415 | 7.506141 |
a9e95170-d95e-482f-acf7-ffefeebe752a | ishandutta2007/codeforces | antontrygubo_o/normal/1673/A.cpp | #include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
using namespace __gnu_pbds;
using namespace std;
using ll = long long;
using ld = long double;
typedef tree<
... | ALGO | 0.999982 | 5.493771 |
89365824-56c1-48d9-8659-17b77a4a463a | lnxdx/SPOJ | AIBOHP - Aibohphobia.cpp | // IN THE NAME OF GOD
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 6111;
int dp[N][N];
string s;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--)
{
cin >> s;
int n = s.size();
for (int l = 1;l <= n;l++)
for (int i = 0;i + l - 1 < n;i++)
... | ALGO | 0.999926 | 4.181764 |
24a334ff-b03c-4bb7-b9fa-47b2a012a7bf | ibankgroup/Ibank | src/addrman.cpp | #include "addrman.h"
using namespace std;
int CAddrInfo::GetTriedBucket(const std::vector<unsigned char> &nKey) const
{
CDataStream ss1(SER_GETHASH, 0);
std::vector<unsigned char> vchKey = GetKey();
ss1 << nKey << vchKey;
uint64_t hash1 = Hash(ss1.begin(), ss1.end()).Get64();
CDataStream ss2(SER_... | ALGO | 0.971193 | 6.271472 |
2c20ea04-9db9-4250-94fa-e8b0b2e21832 | allenxun/NOI | code/ch0105/03.cpp | /*
* @Author: allen
* @Date: 2023-08-11
*
* 03:均值
*
* 总时间限制: 1000ms 内存限制: 65536kB
*
* 描述
* 给出一组样本数据,计算其均值。
*
* 输入
* 输入有两行,第一行包含一个整数n(n小于100),代表样本容量;第二行包含n个绝对值不超过1000的浮点数,代表各个样本数据。
*
* 输出
* 输出一行,包含一个浮点数,表示均值,精确到小数点后4位。
*
* 样例输入
* 2
* 1.0 3.0
*
* 样例输出
* 2.0000
*
* 提示
* ... | ALGO | 0.999761 | 5.417967 |
8f0ef068-fc81-4718-8df6-601d2d8694e4 | shekhardase/Daily_Practice | Daily_Questions/Heap/2593.cpp | // class Solution {
// public:
// long long findScore(vector<int>& nums) {
// priority_queue<pair<long long, long long>,
// vector<pair<long long, long long>>,
// greater<pair<long long, long long>>>
// pq;
// int n = nums.size();
// ... | ALGO | 0.999988 | 5.976307 |
f6293b62-9c88-4973-8d4e-b1f0892c25a8 | AtomicOrbital/Data-Structure | Leo cau thang.cpp | #include<bits/stdc++.h>
using namespace std;
void solve(){
int n;
cin >> n;
int dp[n+1];
dp[0] = 1;
dp[1] = 1;
for(int i=2; i<=n; i++){
dp[i] = dp[i-1] + dp[i-2];
}
cout << dp[n];
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int test = 1;
// cin >> test;
while(test--){
solv... | ALGO | 0.99989 | 4.623887 |
f1a4ec56-0029-4ee8-9f6b-5d4a7582e017 | metehkaya/Algo-Archive | Problems/LeetCode/Solutions/0315.Count_of_Smaller_Numbers_After_Self.cpp | class Solution {
public:
int query( int x , vector<int>& tree ) {
int ans = 0;
while(x) {
ans += tree[x];
x -= (x & (-x));
}
return ans;
}
void update( int x , int n , vector<int>& tree ) {
while(x <= n) {
tree[x]++;
x +... | ALGO | 0.999967 | 5.753497 |
714715d3-3cbb-4635-90f3-1b0ef2e00c9a | raincross7/code-similarity | codes/train_code/problem461/problem461_17.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
using namespace std;
int main() {
int n;
cin >> n;
vector<long> el(n,0);
for(int i = 0; i < n; i++)
cin >> el[i];
sort(el.begin(), el.end());
int nC = -1;
nC = el[n-1];
int k = -1... | ALGO | 0.999954 | 3.933901 |
91d96c60-e35d-4a7b-bee1-4f4d91686954 | fuqinho/POJ | 3616/main.cpp | #include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cmath>
#include <string>
#include <cstdio>
using namesp... | ALGO | 0.999532 | 4.110013 |
ffe30934-924d-4feb-b0b5-7459160f7396 | DmitrySigaev/ImageNest | imago/src/complex_contour.cpp | #include "complex_contour.h"
#include "settings.h"
#include "approximator.h"
#include "algebra.h"
#include "log_ext.h"
#include <opencv2/opencv.hpp>
using namespace imago;
ComplexContour::ComplexContour(void)
{
}
ComplexContour::~ComplexContour(void)
{
}
ComplexNumber& ComplexContour::getContour(size_t shift)
{
re... | ALGO | 0.996531 | 4.352667 |
32332fbd-a877-433d-95d3-5d08615efe98 | AdityaaSunny/Codes | 22-generate-parentheses/generate-parentheses.cpp | class Solution {
public:
#define ll long long
vector<string> ans;
void helper(ll open, ll close, ll total, string x) {
if(x.size() == total) {
ans.push_back(x);
return;
}
if(open < total / 2) {
x += '(';
helper(open + 1, close,... | ALGO | 0.999732 | 5.793588 |
645b14d2-b399-444e-bd9e-d12045a5a8db | Nakib-Arman/CSE314---OperatingSystem | 3.IPC/.history/main_20250626212258.cpp | #include <iostream>
#include <chrono>
#include <pthread.h>
#include <random>
#include <vector>
#include <unistd.h>
using namespace std;
#define MAX_PHASE1_TIME 20
#define MAX_PHASE2_TIME 20
#define SLEEP_MULTIPLIER 1000
pthread_mutex_t phase1_mutex;
auto start_time = chrono::high_resolution_clock::now();
long long g... | ALGO | 0.985605 | 4.236377 |
f1798211-dcd9-413a-85e4-b30ad86d00dc | desparza22/delaunay_3d | clibs/eigen-3.4.0/doc/examples/Tutorial_BlockOperations_block_assignment.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
Array22f m;
m << 1,2,
3,4;
Array44f a = Array44f::Constant(0.6);
cout << "Here is the array a:" << endl << a << endl << endl;
a.block<2,2>(1,1) = m;
cout << "Here is now a with m copied into its cent... | ALGO | 0.968814 | 3.304946 |
c78ab8a6-5f06-4ded-88b1-52cef6bf154f | aokblast/LeetCode_Problem_Solving | Eazy/1337_The_K_Weakest_Rows_in_a_Matrix.cpp | //sort
//Runtime 8
//Memory Usage 10.6
class Solution {
public:
vector<int> kWeakestRows(vector<vector<int>>& mat, int k) {
int n = mat.size();
vector<pair<int, int>> ps(n);
for(int i = 0; i < n; ++i){
int cnt = 0;
for(const int v : mat[i])
cn... | ALGO | 0.999967 | 5.754101 |
0b2e5cbb-c52c-4541-8f6e-ecb9dc4f59f6 | ARYAN-khatri83/DSA | Day-9/Max prod sum.cpp |
// Brute TC-O(N3)
#include<bits/stdc++.h>
using namespace std;
int maxProductSubArray(vector<int>& nums) {
int result = INT_MIN;
for(int i=0;i<nums.size()-1;i++) {
for(int j=i+1;j<nums.size();j++) {
int prod = 1;
for(int k=i;k<=j;k++)
prod *= nums[k];
... | ALGO | 0.999923 | 5.861936 |
1656b157-5aef-427c-955c-e5da67e34406 | zhangzhenghsy/SymBisect | lib/Solver/CexCachingSolver.cpp | #include "klee/Solver/Solver.h"
#include "klee/ADT/MapOfSets.h"
#include "klee/Expr/Assignment.h"
#include "klee/Expr/Constraints.h"
#include "klee/Expr/Expr.h"
#include "klee/Expr/ExprUtil.h"
#include "klee/Expr/ExprVisitor.h"
#include "klee/Support/OptionCategories.h"
#include "klee/Statistics/TimerStatIncrementer.h... | ALGO | 0.998611 | 7.804592 |
a32529f8-2d00-4792-aa2b-64e0a7570ad8 | Yashwanth-M-R/CPP-Skill-Lync | forEach.cpp | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
void myfunc1(int i){
cout<<i<<" ";
}
void myfunc2(pair<char, int> p){
cout<<p.first<<" -> "<<p.second<<endl;
}
int main() {
vector<int> numbers{1, 2, 3, 4, 5};
map<char, int> myMap;
cout<<"Displaying th... | TOOL | 0.967345 | 4.179357 |
0d492f80-4af1-4c8e-9d55-2ea8ae29ac32 | kazuuuuuuuuuuuu/leetcode_solution | 53.cpp | // 贪心算法 -> 如果当前的subarray的和是负数就丢掉 重新开始 -> 只会让之后的和变小
class Solution {
public:
int maxSubArray(vector<int>& nums)
{
int ans = INT_MIN;
int sum = 0;
for (auto num : nums)
{
sum += num;
ans = ans>sum?ans:sum;
if(sum<0)
sum = 0;
... | ALGO | 0.999995 | 5.859224 |
f8e98ad4-040f-4969-be78-a8f8f046acd1 | Illidian4368/main | watchman/fs/ParallelWalk.cpp | #include "watchman/fs/ParallelWalk.h"
#include <fmt/core.h>
#include <folly/concurrency/UnboundedQueue.h>
#include <folly/executors/CPUThreadPoolExecutor.h>
#include <folly/system/HardwareConcurrency.h>
namespace watchman {
template <typename T>
using Queue = folly::UMPMCQueue<std::optional<T>, true /* MayBlock */>;
... | TOOL | 0.982801 | 7.820769 |
72537c3a-71c0-41d5-aa92-bc1dc3157a0a | ishandutta2007/codeforces | se1ka2/normal/1295/C.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main()
{
int w;
cin >> w;
for(int c = 0; c < w; c++){
string s, t;
cin >> s >> t;
vector<int> a[26];
for(int i = 0; i < (int)s.size(); i++){
... | ALGO | 0.999938 | 3.973437 |
3b30f9f0-dc84-43a8-a1ce-8bc41e51e4ee | Zimse12345/Code | AtCoder_Contest/ABC211/A.cpp | #include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdlib>
#include <ctime>
#define ll long long
#define ull unsigned long long
using namespace std;
int read(){
int __x=0,__y=1;ch... | ALGO | 0.997945 | 3.39537 |
f2852bc4-7b2b-4c6c-9deb-261d0dd310ac | raincross7/code-similarity | codes/train_code/problem107/problem107_153.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
int a, b;
int n;
int maze[22][22];
int x, y;
int dp[22][22];
int main()
{
while(cin >> a >> b, a){
rep(i, a) rep(j, b) maze[i][j] = false;
rep(i, a) rep(j, b) dp[i][j] = 0;
cin >> n;
rep(i, n){
cin >> x >> y... | ALGO | 0.999117 | 3.900409 |
bde8526b-1cbb-44b1-bb9a-bab2054d615f | thegamer1907/Code_Analysis | DP/1426.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a[10000],cont=0,num=0,ans=0;
scanf("%d",&n);
for(int i=1; i<=n; i++)
{
scanf("%d",&a[i]);
if(a[i]==1)
cont++;
}
if(cont==n){
printf("%d",n-1);
}
else{
for(int i=1; i<=n;... | ALGO | 0.999967 | 3.505064 |
f255bb96-e3e5-40af-9cc0-f52a9908c22c | zychaoqun/monocular_vo | monovo_test/3rdparty/eigen3/doc/examples/Tutorial_ArrayClass_interop.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
MatrixXf n(2,2);
MatrixXf result(2,2);
m << 1,2,
3,4;
n << 5,6,
7,8;
result = (m.array() + 4).matrix() * m;
cout << "-- Combination 1: --" << endl << result << endl << e... | ALGO | 0.999571 | 4.541172 |
ba35239b-c372-411e-bfae-cde7e34e5699 | peiswang/caffe4video | src/caffe/layers/bnll_layer.cpp | #include <algorithm>
#include <vector>
#include "caffe/layer.hpp"
#include "caffe/vision_layers.hpp"
namespace caffe {
const float kBNLL_THRESHOLD = 50.;
template <typename Dtype>
void BNLLLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
vector<Blob<Dtype>*>* top) {
const Dtype* bottom_data = bot... | DATA | 0.92679 | 6.879836 |
121525ec-72fd-4e93-a376-0867758fea22 | AliceTony/algorithm | leetcode/leetcode lcp 33.cpp | class Solution {
private:
typedef pair<int, int> PII;
public:
int sum(int bucket, int vat) {
return ceil(vat / (bucket * 1.0));
}
int storeWater(vector<int>& bucket, vector<int>& vat) {
int cnt = 0, ans = INT_MAX;
int n = bucket.size();
priority_queue<PII, vector <PII>, l... | ALGO | 0.999965 | 5.698109 |
03a9cb35-8315-4341-9ed0-3224c7e18390 | raincross7/code-similarity | codes/train_code/problem027/problem027_98.cpp | #include<iostream>
using namespace std;
char getGrade(int a,int b,int c);
int main() {
int a,b,c;
while (1) {
cin >> a >> b >> c;
if ( a == -1 && b == -1 && c == -1 ) break;
cout << getGrade(a,b,c) << endl;
}
return 0;
}
char getGrade(int a,int b,int c) {
if ( a == -1 || b == -1 ) return 'F';
el... | ALGO | 0.999718 | 3.811594 |
b438ca64-ab35-4f32-944a-f37153e7cbf1 | BryanHdezL/Codeforces | 231A_Team.cpp | // Librerias.
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
// Macros
#define IO ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
// Funcion principal.
int main() {
IO;
// Variables
int n, p, v, t, suma = 0, cont = 0;
cin >> n;
// Numero de problemas.
while (n--) {
... | ALGO | 0.999086 | 4.15352 |
57b4dc6f-5068-4b01-9bb5-0b6dc91ea345 | aqfaridi/Competitve-Programming-Codes | SPOJ/SPOJ/TRGRID.cpp | /**
* SPOJ Problem Set (classical)
* 5976. Traversing Grid
* Problem code: TRGRID
*
* Starting at the top left corner of an N*M grid and facing towards
* the right, you keep walking one square at a time in the direction
* you are facing. If you reach the boundary of the grid or if the
* next square you are abou... | ALGO | 0.999861 | 3.279971 |
5cd02d14-2d08-4512-80b3-bc800d262188 | samsank06/my-learnings | oops-c++/friend_oper_over.cpp | #include<iostream>
using namespace std;
/*
Friend function with operator overloading:
in oper overloading when we use friend one explicit argument should be provided,
when binary operator is overloaded 2 explicit args must be provided.
*/
class friendOverLoading2;
class friendOverLoading{
int money1;
... | ALGO | 0.973483 | 4.162362 |
e13de071-b842-4865-8119-f1b580d0a3ab | tarik1bosunia/cp_algorithms | Number Theory/5 modular arithmatic/3_Binomial_Coefficient_using_modulo_inverse.cpp | #include<bits/stdc++.h>
#define REP(i,n) for(int i = 1; i <= n; i++)
#define P 1000000007
#define pb push_back
#define ff first
#define ss second
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define lli long long int
#define INF 1000000000
#define endl '\n'
const double PI = 3.14159265358979... | ALGO | 0.999923 | 4.006506 |
2a90d51c-3cbf-4698-a39d-44ea79255a05 | NaDaPuPu/https---github.com-NaDaPuPu-baekjoon | 2042_1.cpp | #include <iostream>
#include <math.h>
#include <vector>
using namespace std;
typedef long long ll;
ll init(vector<ll> &arr, vector<ll> &tree, int node, int start, int end)
{
if (start == end)
return tree[node] = arr[start];
int mid = (start + end) / 2;
return tree[node] = init(arr, tree, node * 2, start, mid)... | ALGO | 0.999748 | 4.72013 |
b319b146-848a-424c-95a7-f038672fec97 | FiloSanza/ComputerGraphics | Engine/src/Geometry/Shapes.cpp | #include "Shapes.h"
#include <numbers>
namespace Geometry {
std::vector<Engine::Vertex> Shapes::circle(Engine::Vertex center, float radius, int n_points, glm::vec4 color)
{
const float center_x = center.position.x;
const float center_y = center.position.y;
std::vector<Engine::Vertex> vertices;
vertices.push... | TOOL | 0.917228 | 7.628639 |
6273290a-2054-42e0-839b-d035ee8d4dc8 | ishandutta2007/codeforces | icecream2001/normal/163/E.cpp | #include<bits/stdc++.h>
#define LD long double
#define LL long long
#define pb push_back
#define pii pair<int,int>
using namespace std;
const LL INF=1e18;
const int inf=1e9+9;
//const LD PI=acos(-1.0);
//const LL M=998244353;
LL M=1e9+7;
//const LL P=998244353;
const int N=1e6+10;
const LD eps=1e-11;
const LD eps2=1e-1... | ALGO | 0.999967 | 4.053221 |
395c8fde-544f-4489-9df4-194365e47e1e | ishandutta2007/codeforces | ormlis/normal/1626/F.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
#define rep1n(i, n) for (int i = 1; i <= (n); ++i)
#define repr(i, n) for (int i = (n) - 1; i >= 0; --i)
#define pb push_back
#define eb emplace_back
#define all(a) (a).begin(), (a).end()
#define r... | ALGO | 0.999974 | 4.056278 |
d8b356bf-783c-4311-86fa-f92f3636996a | Vivashwan/LeetCodes | 1817-finding-the-users-active-minutes/1817-finding-the-users-active-minutes.cpp | class Solution {
public:
vector<int> findingUsersActiveMinutes(vector<vector<int>>& logs, int k) {
unordered_map<int, set<int>>mp;
for(auto it: logs)
{
mp[it[0]].insert(it[1]);
}
vector<int>res(k, 0);
unordered_map<int, int>mp1;
for(auto it: mp... | ALGO | 0.999645 | 5.86969 |
1887fa40-b501-40e8-b30c-be9eff2ab001 | ishandutta2007/codeforces | hoyitio/normal/1438/A.cpp | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define lowbit(x) ((x)&(-(x)))
#define mid ((l+r)>>1)
#define lson rt<<1, l, mid
#define rson rt<<1|1, mid+1, r
#define fors(i, a, b) for(int i = (a); i < (b); ++i)
using namespace std;
int main()
{
int T; cin>>T;
while(T--){
int n;
... | ALGO | 0.998919 | 3.575662 |
4725951c-2fa3-42ae-a55a-3cc7e3501d68 | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J01000/explore/explore.cpp | #include<bits/stdc++.h>
using namespace std;
bool chk(int x,int y,int n,int m){
if(1<=x&&x<=n&&1<=y&&y<=m) return 1;
return 0;
}
int d[5][5]={{0,1},{1,0},{0,-1},{-1,0}};
char a[1005][1005];
bool vis[1005][1005];
int t;
int main(){
freopen("explore.in","r",stdin);
freopen("explore.out","w",stdout);
cin>>t;
while(t... | ALGO | 0.999856 | 3.471595 |
2161c644-bf44-4850-99e0-5973cd5f02de | chandhukeenz/DS-and-Algorithms | 100daysofcode/rotate linked list by k.cpp | /*Rotate Linked List
Input: head = [1,2,3,4,5], k = 2
Output: [4,5,1,2,3]
*/
/**
* 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... | ALGO | 0.999982 | 5.864545 |
9256dba9-4707-4334-9332-55a35ccf93cf | yveslox/Genesisras | practice-code-purple/cpp-programming/n-swap-two-num-var.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,temp;
cout<<"Enter the first number : ";
cin>>a;
cout<<"Enter the second number : ";
cin>>b;
cout<<"Values Before swapping : "<<endl;
cout<<"Frist number = "<<a<<endl;
cout<<"Second number = "<<b<<endl;
temp = a;... | ALGO | 0.994626 | 3.849056 |
2ec1b6c7-2b7c-49cb-8c13-d3d3e15ddc6c | Lokiscripter/Leetcode_practice | 2038-remove-colored-pieces-if-both-neighbors-are-the-same-color/2038-remove-colored-pieces-if-both-neighbors-are-the-same-color.cpp | //
// Created by loki on 2022/3/22.
//
#include "../common.h"
bool winnerOfGame(string colors) {
if (colors.size() < 3){
return false;
}
int a_count = 0;
int b_count = 0;
stack<char> s;
colors += 'C';
for (int i = 0; i < colors.size(); ++i) {
int count = 0;
char las... | ALGO | 0.996463 | 5.259452 |
47d504ee-7f10-476d-b749-a825907467d4 | ChandanPaul84/MAX_NUM | MAX_NUM/main.cpp | #include <iostream>
#include <string.h>
void returnNextMaxNum(char arr[]);
void reverse(char *arr,int i, int len);
void returnNextMaxNum(char arr[]){
int len = (int)strlen(arr);
int i,j;
for(i= len-1; i>0; i--){
if(arr[i] <= arr[i-1]){
continue;
}
break;
}
for(j... | ALGO | 0.999707 | 4.44698 |
22f9e120-329b-4ccf-a257-bc7c98408fc4 | rishitabura/daa-lab | divide and conquer/mojority_element/sorting.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int sorting(int a[], int n)
{
sort(a, a+n);
int count = 1;
for (int i = 1; i < n; i++)
{
if (a[i - 1] == a[i])
{
count++;
}
else
{
if (count > n / 2)
{
... | ALGO | 0.999916 | 4.606405 |
4d63ed0c-4603-4fa8-8ec0-745a4e1a446d | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4801_1.cpp | #include <bits/stdc++.h>
using namespace std;
int S, N, M, X, Y, a[305][305], b[305][305], c[200005], p[605][605];
struct st {
int x, y, c;
st(int _x = 0, int _y = 0, int _c = 0) { x = _x, y = _y, c = _c; }
bool operator<(const st& B) const {
return p[x - X + N][y - Y + M] < p[B.x - X + N][B.y - Y + M];
}
}... | ALGO | 0.999614 | 3.485914 |
5405f2eb-caeb-4e34-815b-3cbe038bdcbe | thavananh/PTTKGT_GIUAKY_2024 | DeQuy/DynamicPrograming/BaloCoChiPhi.cpp | #include <iostream>
#include <vector>
#include <map>
using namespace std;
long deQuy(vector<int>& giaTriToiDa, vector<int>& weight, int maxWeight, int indexMonDo, map<pair<int, int>, int>& ghiNho) {
if (ghiNho.count({maxWeight, indexMonDo}) != 0)
{
return ghiNho[{maxWeight, indexMonDo}];
}
... | ALGO | 0.999951 | 5.281101 |
94e83edc-069a-414c-9e1b-b4f2d700418a | PavanNettam/The-LeetCode-GFG-Repo | Distance from the Source (Bellman-Ford Algorithm) - GFG/distance-from-the-source-bellman-ford-algorithm.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
/* Function to implement Bellman Ford
* edges: vector of vectors which represents the graph
* S: source vertex to start traversing graph with
* ... | ALGO | 0.999879 | 5.703759 |
d42feeff-67b6-4d3c-91dc-36d7749fd384 | dedinside4/Chislodrobilka_2000_24_rus | wk_02_prac.cpp | #include <fstream>
#include <random>
int check(bool* sample, int K){
for(int i = 0; i < K; i++){
if(not sample[i]){
return 0;
}
}
return 1;
}
int main(){
std::ofstream out_file;
out_file.open("data1.txt", std::ios::out | std::ios_base::trunc);
//std::ofstre... | ALGO | 0.987566 | 3.797097 |
d81d8489-c3b9-4ef5-af8b-ba4d5baf362a | ufidon/cpp | lectures/evennumberedexercise/Exercise02_10.cpp | #include <iostream>
using namespace std;
int main()
{
cout << "Enter the amount of water in kilograms: ";
double mass;
cin >> mass;
cout << "Enter the initial temperature: ";
double initialTemperature;
cin >> initialTemperature;
cout << "Enter the final temperature: ";
double finalTemperature;
cin ... | ALGO | 0.996377 | 3.839403 |
cb76ae0f-da0b-45b2-afca-c05499bb9601 | TinkerBoard-Android/rockchip-android-prebuilts-ndk | r21/sources/third_party/shaderc/third_party/spirv-tools/source/fuzz/shrinker.cpp | #include "source/fuzz/shrinker.h"
#include <sstream>
#include "source/fuzz/pseudo_random_generator.h"
#include "source/fuzz/replayer.h"
#include "source/spirv_fuzzer_options.h"
#include "source/util/make_unique.h"
namespace spvtools {
namespace fuzz {
namespace {
// A helper to get the size of a protobuf transform... | ALGO | 0.980272 | 3.440338 |
6bdd2cf6-0efb-4b80-bdde-e498a97e126a | Shrutigupta03/Leetcode-questions | 0872-leaf-similar-trees/0872-leaf-similar-trees.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.999905 | 6.330401 |
bd89cf7f-4db0-4e34-851c-b5071df38c63 | ritikasrv12/DSA-LeetCode | Hard/Tree/Distribute coins 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.999996 | 6.421633 |
16462a78-ad0b-4f61-a9e4-eda97feaeceb | Saksham-Mishra03/leetcode-practice | detect capital.cpp | class Solution {
public:
bool detectCapitalUse(string word) {
string str1 = word,str2 = word,str3;
for(int i = 0; i<word.length();i++)
{
str1[i] = toupper(str1[i]);
str2[i] = tolower(str2[i]);
}
str3 = str2;
str3[0] = toupper(str3[0]);
... | ALGO | 0.999877 | 5.782966 |
2c63d4b2-02b0-44eb-9ec1-934c38f882db | KhaiJP/AtCoder | ABC/<100/090/C++/B.cpp | #include<iostream>
#include<string>
using namespace std;
#define rep(i, s, t) for(int i = (s); i < (t); ++i)
bool isPalindromic(int n){
string s = to_string(n);
int l = s.size();
rep(i,0,l/2)if(s[i] != s[l-i-1]) return false;
return true;
}
int main(){
int A, B; cin >> A >> B;
int answer = 0;
rep(i,A,B+... | ALGO | 0.999809 | 4.26794 |
d40a9857-772d-472f-ad6e-a2224b03694f | ihsanulcode/Dataque-DSA-Batch-02-Fall2022 | LAB/Lab 13/Task 1/binarysearchtree.cpp | #include "binarysearchtree.h"
#include "quetype.cpp"
#include <iostream>
using namespace std;
template <class ItemType>
TreeType<ItemType>::TreeType()
{
root = NULL;
}
template <class ItemType>
void Destroy(TreeNode<ItemType>*& tree)
{
if (tree != NULL)
{
Destroy(tree->left);
Destroy(tree->r... | ALGO | 0.979105 | 4.895636 |
28cd0a3c-c612-4a5a-93d0-9b1b40a52faf | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_4095_3.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int dp[maxn][30];
char str[maxn];
char s[maxn];
bool flag[27][27];
int main() {
int i, j, k;
while (scanf("%s", str) != -1) {
fill(flag[0], flag[27], 0);
fill(dp[0], dp[maxn], maxn);
scanf("%d", &k);
while (k--) {
scanf("%s... | ALGO | 0.999818 | 3.896775 |
9715aa80-a071-4678-8bf7-41fd0958e997 | ermakov0/ivt-cpp | 03-4-switch-char.cpp | /**
* Л/р 3 Ветвящийся вычислительный процесс
*
* Мини-калькулятор
*
* ПРИМЕРЫ:
```
Введите строку в формате "(число) (оператор) (число)", где допустимый оператор [+-/*^]: 2.3 + 3
2.300 + 3.000 = 5.300
```
```
Введите строку в формате "(число) (оператор) (число)", где допустимый оператор [+-/*^]: 3 ^ 3
3.000 ^ 3.0... | ALGO | 0.975404 | 5.504204 |
fffc7da2-e756-4050-a3a3-d76f8d464789 | Kujakuh/EssentiaEngine | thirdparty/opencv-4.10.0/modules/imgproc/src/sumpixels.dispatch.cpp | #include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
#include "opencv2/core/hal/intrin.hpp"
#include "sumpixels.simd.hpp"
#include "sumpixels.simd_declarations.hpp" // defines CV_CPU_DISPATCH_MODES_ALL=AVX2,...,BASELINE based on CMakeLists.txt content
namespace cv {
#ifdef HAVE_OPENCL
static bool ocl_integr... | ALGO | 0.990366 | 4.261605 |
73726024-cac1-48f5-99e4-fd144dffab60 | AlexYiningLiu/Concurrency-Examples | Asynchronous/lockBothMutexes.cpp | #include <iostream>
#include <thread>
#include <mutex>
// In the following deadlock-free code, std::lock is used to ensure that the mutexes are always locked in the same order, regardless of the order of the arguments. Note that std::adopt_lock option allows us to use std::lock_guard on an already locked mutex.
std::... | ALGO | 0.996881 | 6.320144 |
40c3e722-e654-427c-8cfa-a3f20c46c552 | cartcrypto/cart | src/consensus/merkle.cpp | #include "merkle.h"
#include "hash.h"
#include "utilstrencodings.h"
/* WARNING! If you're reading this because you're learning about crypto
and/or designing a new system that will use merkle trees, keep in mind
that the following merkle tree algorithm has a serious flaw related to
duplicate tx... | ALGO | 0.999927 | 7.565377 |
999dba2f-8db2-460c-ae47-811c70cf6c06 | martbudr/Algorithms | dijkstra_2021.cpp | //27.02.2021
#include <iostream>
#include <climits>
#include <vector>
#include <queue>
using namespace std;
struct wierz {
bool odwiedzony;
vector<int> sasiedzi,// do ktorych wierzcholkow prowadza krawedzie
wagi_kraw;// wagi poszczegolnych krawedzi prowadzacych do sasiadow
};
int dijkstra(int wierz_p... | ALGO | 0.999933 | 4.650836 |
7ac49c3a-c054-44cb-a45f-0dbe06462de3 | Sachin737/Cses-Solutions | Introductory Problems/4_IncreasingArray.cpp | // Sachin Mahawar
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef vector<pair<ll, ll>> vpll;
typedef vector<vector<ll>> vvll;
#define ff(i, x, n) for (ll i = x; i < n; i++)
#define fb(i, n, x) for (ll i = n; ... | ALGO | 0.99992 | 4.417284 |
5ed41773-0992-437d-a255-7ec5f98af298 | wbs0829/sudoku | SudokuMaker.cpp | #include "SudokuMaker.h"
void SudokuMaker::Copy(const SudokuMaker & other)
{
SudokuBase::Copy(other);
status = other.status;
}
SudokuMaker::Status SudokuMaker::GetStatus()
{
return status;
}
SudokuMaker::SudokuMaker(const SudokuMaker & other)
{
Copy(other);
}
SudokuMaker & SudokuMaker::operator = (c... | ALGO | 0.955226 | 4.79306 |
2a663e04-3e32-4f51-a43e-9f0bdd77307a | vishal112005/c-program | vishal.c program/table.cpp | #include<iostream>
using namespace std;
class Table
{
public:
int num,i,t;
void setValue()
{
cout<<"enter the number:";
cin>>num;
}
void printTable()
{
for(i=1;i<=10;i++)
{
t=num*i;
cout<<num<<"*"<<i<<"="<<t<<endl;
}
}
};
int main()
{
Table t1;
t1.setValue();
t1.p... | TOOL | 0.991442 | 3.290443 |
356d5b4d-49e1-4a21-91f7-290392c9b219 | haphop228/spbu-modern-programming | projects/scl_homework/src/long_number/long_number.cpp | #include "long_number.hpp"
namespace AKrivoshein {
// ----------------------------------------------------------
// DONE
// ----------------------------------------------------------
LongNumber::LongNumber() {
//std::cout << "Default constructor" << std::endl;
//std::cout << "2" << std::endl;
numbers_ = ne... | TOOL | 0.966821 | 3.545833 |
17affd80-1ecb-4130-89ed-b64aa6f6af6c | vickymhs/CodeForces-Submissions | wordtoolong.cpp | #include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
int c,b,j,k,i,n[101],x;
char a[101][101];
cin>>x;
for(i=0;i<x;i++)
scanf("%s",&a[i]);
for(i=0;i<x;i++)
{
n[i]=strlen(a[i]);
}
for(c=0;c<x;c++)
{
if(n[c]>10)
{
for(j=1;j<n[c];j++);
cout... | ALGO | 0.999696 | 3.196139 |
9c2d0771-5b95-455d-8f8e-ffcc037352b4 | caihongdepiaoyi/MyObfuscator | Transforms/src/Utils.cpp | #include <vector>
#include "llvm/IR/Instructions.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Support/raw_ostream.h"
#include "Utils.h"
using std::vector;
using namespace llvm;
LLVMContext *CONTEXT = nullptr;
void ... | TOOL | 0.865058 | 5.991887 |
12ceafae-b2c6-4c35-9d19-101f76962a9c | stephen-cusi/OpenCSGO | src/engine/cl_texturelistpanel.cpp | #include "client_pch.h"
#ifdef _PS3
void CL_CreateTextureListPanel( vgui::Panel * ) {}
void CL_TextureListPanel_ClearState() {}
void VGui_UpdateTextureListPanel() {}
#else
#include "ivideomode.h"
#include "client_class.h"
#include "icliententitylist.h"
#include "vgui_basepanel.h"
#include <vgui_controls/Controls.h>
#in... | TOOL | 0.888277 | 6.183381 |
0c207c6c-288a-4af7-9fb4-3708f614896f | NIWAFisheriesModelling/SPM | src/Profiles/CProfile.cpp | // Local Headers
#include "CProfile.h"
#include "../World/CWorld.h"
#include "../Estimates/CEstimateManager.h"
#include "../Estimates/CEstimate.h"
#include "../Helpers/CError.h"
#include "../Helpers/CComparer.h"
//**********************************************************************
// CProfile::CProfile()
// Default... | TOOL | 0.894777 | 6.920598 |
bedfbec8-4158-49b1-875f-a58d44099b76 | pritmanvar/DSA-with-CPP | CodeChef/Make Them Equal.cpp | // Problem Link : https://www.codechef.com/START33B/problems/MTE
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
for (int z = 1; z <= t; z++){
int n;
cin >> n;
vector<in... | ALGO | 0.99978 | 4.988487 |
c972dbca-ec2f-4e9f-be65-3c9984c89e9b | svetlana-popova/homework | nextSmaller.cpp | #include <iostream>
using namespace std;
void GetlineForInt(int a[], int&);
void DisplayArray(int a[], int);
void BubbleSort(int[], int);
void Swap(int&, int&);
void CopyArray (int[], int[], int);
bool CompareArrays(int[], int[], int);
void FindNextSmaller(int[], int);
int main()
{
const int N = 10;
int a[N] = { 0 ... | ALGO | 0.999913 | 3.670141 |
68c78416-2a9a-4028-9eb2-5683cab76a15 | krucios/advent_of_code_2023 | 23.cpp | #include <iostream>
#include <cassert>
#include <sstream>
#include <fstream>
#include <utility>
#include <numeric>
#include <string>
#include <vector>
#include <array>
#include <queue>
#include <regex>
#include <map>
#include <set>
#include <bit>
using namespace std;
static constexpr array<int, 4> dx = {-1, 0, 1, ... | ALGO | 0.999972 | 4.479597 |
dec48d39-8130-4901-88c9-812f9460c1b1 | nmpogg/CodePTIT | c/so dep 2.cpp | #include <stdio.h>
#include <math.h>
int prime(long long n){
if(n < 2) return 0;
for(int i = 2; i <= sqrt(n); i++){
if(n % i == 0) return 0;
}
return 1;
}
int sum(int n){
int sum = 0;
while(n > 0){
sum += n % 10;
n /= 10;
}
return sum;
}
int main(){
long long n;
scanf("%lld", &n);
for(long long i ... | ALGO | 0.999536 | 4.923205 |
96294404-9ab2-4a97-b90f-b1a74b48b837 | JungMYEONG-jin/cpp_for_professor | 알고리즘/Octal_Hex_Decimal.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <memory>
#include <map>
#include <cmath>
using namespace std;
void createMap(map<char, int>* m)
{
(*m)['0'] = 0;
(*m)['1'] = 1;
(*m)['2'] = 2;
(*m)['3'] = 3;
(*m)['4'] = 4;
(*m)['5'] = 5;
(*m)['6'] = 6;
(*m)['7'] = 7;
... | ALGO | 0.985852 | 3.989502 |
28ed0bcc-cae4-46be-b843-baa801687085 | izardi/PAT | PAT (Basic Level) Practice (中文)/1094.cpp | #include <cstdio>
#include <cstring>
bool isPrime(int n){
if(n <= 1) return false;
for(int i = 2; i * i <= n; ++i)
if(n % i == 0)
return false;
return true;
}
int main(int argc, char *argv[])
{
freopen("in", "r", stdin);
int L, K;
char s[1005];
scanf("%d %d", &L, &K);
... | ALGO | 0.999423 | 3.760721 |
5bc31adf-5d76-4412-8694-b18960d82a2a | Ifham-Hashir/college-practical | OS/7fifopagereplacement.cpp | //Aim: Write a program to demonstrate the use of FIFO page replacement algorithm.
//Theory: The FIFO (First-In-First-Out) page replacement algorithm replaces the oldest page in memory when a new page needs to be loaded, ensuring that the first page to enter memory is the first to be replaced. This algorithm is simple ... | ALGO | 0.999558 | 6.469697 |
344b407b-2e63-48c9-87e9-973c822540ee | atheeq2003/DSA-CP | DSA-Series/1_Patterns/11_Pattern.cpp | /*
1
2 3
4 5 6
7 8 9 10
*/
#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int value = 1;
for(int i = 0; i < n; i++) {
for(int j = 0; j < i + 1; j++) {
cout << value << " ";
value++;
}
cout << endl;
}
} | ALGO | 0.999946 | 4.492119 |
4ad6652a-9db4-468c-b0e4-4162b26f7119 | tkarthikeyan132/DAA_Lab | Lab4/mergesort(twoway).cpp | #include<iostream> // implementation of two way merge sort
#include<bits/stdc++.h>
using namespace std;
void mergesort(int arr[],int,int);
void merge(int lrr[],int,int rrr[],int,int acrr[]);
int main()
{
int n;
cout<<"Enter the value of n:";
cin>>n;
int A[n];
cout<<"Enter the elements:";
for(int... | ALGO | 0.999936 | 4.498668 |
06ba52b9-f38d-4961-9b0e-7f1567adbd26 | igortakeo/Competitive-Programing | AtCoder/ABC 160/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
if(s[2] == s[3] and s[4] == s[5]) cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
} | ALGO | 0.999932 | 3.299282 |
88b7876d-a53b-42ac-b75c-8abbcfbeca89 | iamsinghashutosh/Codeforces-Solutions | math/D_Little_Girl_and_Maximum_XOR.cpp | /*
GOOD is not Enough
You've got to be GREAT.
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
// #include<boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define mod 1000000007
#define FAST ios::sy... | ALGO | 0.999707 | 3.537165 |
3f45b92c-174e-429f-9a5a-6d67cbb0642b | thgus/Algorithm | cpp/PrefixSum/4902.cpp | /*
4902번: 삼각형의 값
https://www.acmicpc.net/problem/4902
*/
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#define sync_off \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
using namespace std;
void print_vec(vecto... | ALGO | 0.999111 | 4.414294 |
3633f901-037b-41a8-8487-471f08040374 | wanimaru47/AOJ | volume23/aoj2321.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
while (cin >> N, N) {
vector<int> v(N);
vector<long long int> score(N);
for (int i = 0; i < N; i++) {
int t;
cin >> t >> score[i];
int s = 0;
for (int j = 0; j < t; j++) {
... | ALGO | 0.999651 | 3.947327 |
bc73fe6d-8e4c-4c7a-8558-887a8ca99ab1 | LordOfDragons/dragengine | src/modules/physics/bullet/Bullet/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp | #include "btCollisionDispatcher.h"
#include "LinearMath/btQuickprof.h"
#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/BroadphaseCollision/btOv... | ALGO | 0.9876 | 6.856391 |
13ccddbd-be40-4c4e-9854-9bdd91e8143e | ssun-g/solution | HackerRank/30_Days_of_Code/Day_26_Nested_Logic.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int da ,ma, ya, de, me, ye;
scanf("%d %d %d %d %d %d", &da, &ma, &ya, &de, &me, &ye);
int ddiff = da-de;
int mdiff = ma-me;
int ydiff = ya-ye;
if(ydiff > 0) printf("10... | ALGO | 0.999846 | 3.549304 |
639da917-f519-4bff-ac48-6d02cb940dc9 | rathi062/codes | codeforces/258_Div2_b.cpp | #include<iostream>
#include<list>
#include<string>
#include<cstring>
#include<sstream>
#include<cctype>
#include<string.h>
#include<algorithm>
#include<cmath>
#include<stack>
#include<fstream>
#include<cstdlib>
#include<vector>
#include<map>
#include<set>
#include<utility>
#include<iomanip>
#include<queue>
using names... | ALGO | 0.999901 | 3.03179 |
69971948-990c-4823-8111-c7753d7dbe44 | parva-jain/Codeforces-Contests | Codeforces Round #694(Div. 2)/C++ Solutions/Strange list.cpp | // you CANNOT GIVE UP just because things get hard;
//Amaaan Khiljiii iet_davv;
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef std::vector<ll> vi;
typedef pair<ll, ll> pi;
#define ull unsigned long long
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define boht... | ALGO | 0.999818 | 3.254842 |
1c0e1a68-a0c8-4cf5-81c2-4acb4461d724 | djleamen/old-snippets | c++/academia/postsecondary/programmingworkshop/WordCounter.cpp | // Description: This program reads a file and counts the number of times each word appears in the file.
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <algorithm>
#include <cctype> // Include for std::tolower
using namespace std;
class WordCounter {
private:
string word;
in... | TOOL | 0.999573 | 5.992723 |
bbde9b5f-df39-4986-884d-db287ab1629c | commoncar/commoncar-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.998762 | 6.786404 |
ee257aaa-332a-4913-9619-d1305f6c768a | combofish/leetcode-solutions-cpp | src/LeetCode-Random-1/test_817.cpp |
#include "combofish_utils.hpp"
int numComponents(ListNode* head, vec_t& nums){
unordered_set<int> uset;
for(const int &i: nums)
uset.insert(i);
IC(uset);
int res = 0;
ListNode* curr = head;
while(curr != nullptr){
if(uset.find(curr->val) != uset.end() && (curr->next == nullptr || uset.find(curr-... | ALGO | 0.995477 | 5.109947 |
7222b715-c60c-4237-83ed-ada45149a1f9 | karnapathak/gem5_dev | src/systemc/tests/systemc/misc/unit/data/general/int_to_bits/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.958359 | 5.367876 |
f27b96c2-9813-4d68-90c4-9f437b223343 | omkargade04/DSA-Cpp | CodeForces/codeforces871.cpp | #include<bits/stdc++.h>
using namespace std;
// BLANK SPACE----------------------
// void omkar(vector<int>&v,int n){
// int zero_cnt = 0;
// int max_zero_cnt = 0;
// v.push_back(1);
// for(int i=0;i<=n;i++){
// if(v[i] == 0){
// zero_cnt++;
// }
// else{
// ... | ALGO | 0.999689 | 5.20435 |
fe68ae48-39aa-493d-901c-00ba62412622 | chaturvedij/ACC45DAYSOFCODE | FLOW006.cpp | // We have populated the solutions for the 10 easiest problems for your support.
// Click on the SUBMIT button to make a submission to this problem.
#include <iostream>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n,sum = 0,r;
cin>>n;
while(n!=... | ALGO | 0.99864 | 5.567465 |
4b2c2157-03f4-4945-b324-18ae19e4679a | subratamondalnsec/Pw-cpp-code | 23Graph/dpp/23network-delay-time_Leetcode-743.cpp | /* Problem Link - https://leetcode.com/problems/network-delay-time/
By subrata mondal */
#include <iostream>
#include <vector>
#include <list>
#include <climits>
#include <queue>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
using namespace std;
class Solution {//using vector in destation
#d... | ALGO | 0.99999 | 6.601425 |
635a5c98-0996-4373-b146-7faa49aa0c69 | Sabbarish-S/Cplusplus | fibonacci.cpp | #include <bits/stdc++.h>
using namespace std;
int fibonacci(int n)
{
if(n <= 1)
{
return n;
}
int curr = 0;
int prev2= 0;
int prev1 = 1;
for(int i = 2; i<= n; i++)
{
curr = prev1+prev2;
prev2=prev1;
prev1=curr;
}
return curr;
}
int main()
{
... | ALGO | 0.999986 | 5.058121 |
3e7bda6e-9af1-4e9c-901e-3e18b281d7df | zihaomu/opencv_lite | 3rdparty/MNN/source/backend/cpu/compute/StrassenMatmulComputor.cpp | #include "StrassenMatmulComputor.hpp"
#include "DenseConvolutionTiledExecutor.hpp"
#include "CommonOptFunction.h"
#include "backend/cpu/CPUBackend.hpp"
#include <string.h>
#include <limits.h>
#include "core/AutoStorage.h"
#include "core/Macro.h"
#include "core/Concurrency.h"
#include "core/TensorUtils.hpp"
//#define MN... | ALGO | 0.999193 | 5.556068 |
4404a228-b731-4ac7-a1a0-b5a794fcfa47 | shaurya127/Leetcode_Solution | N meetings in one room - GFG/n-meetings-in-one-room.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the maximum number of meetings that can
//be performed in a meeting room.
int maxMeetings(int start[], int end[], int n)
{
vector<pair<int,int>>v;
... | ALGO | 0.999932 | 5.8375 |
a5cee021-ef2d-4f4a-89d0-d32d6d91b734 | cosmicray001/academic | cse419/HackerRank/simple-array-sum/8885928_AC_0ms_0kB.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int x = 0, sum = 0;
scanf("%d", &x);
int n[x];
for(int i = 0; i < x; i++)
{
scanf("%d", &n[i]);
sum = sum + n[i];
}
printf("%d\n", sum);
return 0;
}
| ALGO | 0.999627 | 3.207159 |
80fce2d6-fc23-4c80-8d92-060e58790dda | coouir/codetree-TILs | 241223/약수가 세 개인 수/numbers-with-three-divisors.cpp | #include <iostream>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
int start, end, count = 0;
cin >> start >> end;
for (; start<=end; start++) {
int cnt = 0;
for (int i=1; i<=start; i++) {
if (start%i == 0) {
cnt++;
}
}
if (... | ALGO | 0.999938 | 4.424197 |
250a42fe-f49d-40fb-9ceb-5e31d40e2e01 | denis-gubar/Leetcode | all/2402. Meeting Rooms III.cpp | static unsigned long long freeRooms[2];
static int const BIT_COUNT = sizeof(freeRooms[0]) * 8;
class Solution {
public:
enum State
{
ADD,
REMOVE
};
struct Event
{
long long time;
State state;
int index;
friend bool operator< (Event L, Event R)
... | ALGO | 0.999839 | 5.699526 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.