uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
0288b6a1-c1e9-4189-8e50-5d765fd43c64 | siddharth7901/cpp_concepts | tut17.cpp | #include<iostream>
using namespace std;
inline int product(int a, int b){
//do not recomended ti use below lines with inline functions
// static int c=0; //this executes only once
// c = c + 1; //Next time this function is run, the value of c will be retained
return a*b;
}
float moneyReceived(int curr... | ALGO | 0.986291 | 3.595568 |
1155c94f-80dd-4ce8-ab48-ff84f995973f | MahinAshraful/CodeWatch_Data | sample-data/p00005/s786395565.cpp | #include <iostream>
using namespace std;
long gcd(long a, long b) {
if (a < b)
swap(a, b);
if (b == 0)
return a;
return gcd(b, a % b);
}
long lcm(long a, long b) {
return (a * b) / gcd(a, b);
}
int main() {
long a, b;
while (cin >> a >> b)
cout << gcd(a, b) << " " << lcm(a, b) << endl;
return 0;
} | ALGO | 0.999624 | 5.076246 |
847b68d9-4182-4277-977b-7d0597763c27 | Devil-DevR/Codeforces | A_Life_Without_Zeros.cpp | #include <bits/stdc++.h>
using namespace std;
void fastIO() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
}
long long remove(long long x){
long long res=0;
while(x>0){
int temp=x%10;
if(temp){
res=res*10+temp;
}
x/=10;
}
return res;
}
long l... | ALGO | 0.999973 | 4.662845 |
ccc6ff3f-584c-4c17-b9af-e4af38da4063 | gusdn6763/Algorithm_Baekjun | (17298)오큰수.cpp | #include <iostream>
#include <string>
#include <stack>
#include <vector>
using namespace std;
int main()
{
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int nCount = 0;
cin >> nCount;
stack<int> nValue;
vector<int> vTmp(nCount);
vector<int> v(nCount);
for (int i = 0; i < nCount; i++)
{
int nTmp = 0;
... | ALGO | 0.999985 | 4.616292 |
8dae6dfe-2ba1-42e6-90bd-2866d63e833c | Luxi-Zhao/appearance-mimicking-surfaces | libigl/include/igl/lbs_matrix.cpp | IGL_INLINE void igl::lbs_matrix(
const Eigen::MatrixXd & V,
const Eigen::MatrixXd & W,
Eigen::MatrixXd & M)
{
using namespace Eigen;
// Number of dimensions
const int dim = V.cols();
// Number of model points
const int n = V.rows();
// Number of skinning transformations/weights
const int m = W.cols... | ALGO | 0.997338 | 5.107077 |
9871ec57-66f2-4764-9716-004a4f7bdbba | TheFenrisLycaon/DSA-C-- | cp/CodeForces/0500-0599/552C.cpp | #include <iostream>
#include <vector>
int main(){
int64_t w, m; std::cin >> w >> m;
std::vector<int64_t> digits;
bool possible(true);
while(m > 0){digits.push_back(m % w); m /= w;}
for(size_t p = 0; p < digits.size(); p++){
if(digits[p] <= 1){continue;}
else if(digits[p] > 1 && di... | ALGO | 0.999946 | 4.449958 |
7c8ea569-c3a5-448b-87e0-d619e50ddcb9 | im0qianqian/snippets | poj/1703 Find them, Catch them.cpp | /*
POJ 1703 Find them, Catch them
*/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
#define maxx (1<<30)
int n,m;
int set[200010];
int setfind(int d)
{
if(set[d]<0)return d;
return set[d]=setfind(set[d]);
}
int main()
{
int t;
scanf(... | ALGO | 0.999813 | 3.593246 |
b978e08f-4bdf-405a-ae0f-8e4e052614e2 | yash-dhingra/DS_Codes | DS_Lab/Week_4_Lab_A/q4.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
struct Node
{
int data;
Node *next;
};
class Linked_List
{
Node *head;
public:
void push(int data)
{
Node *new_node = new Node;
new_node->data = data;
new_node->next = head;
head = new_node;
}
vo... | ALGO | 0.999879 | 4.22217 |
276e3a5e-591a-49b3-916e-53075c23c60c | agrachiv/kuznechik | kuznechik.cpp | #include "kuznechik.h"
void encrypt_file( const char* input_file_name, const char* output_file_name, const char* key_1, const char* key_2)
{
kuznechik encryptor( input_file_name, block( key_1), block( key_2));
encryptor.encrypt_data( output_file_name);
}
void encrypt_file( const char* input_file_name, const c... | ALGO | 0.993084 | 3.92181 |
4f063886-12aa-4154-a947-b260a0b1a7b2 | byte19/Leetcode | First and last occurrences of x - GFG/first-and-last-occurrences-of-x.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
int bSearch(int arr[],int n,int x){
int i = 0, j = n-1;
while(i<=j) {
int mid = (i+j)/2;
if(arr[mid]==x) return mid;
if(arr[mid] > x) j = mid-1;
else i = mid+1;
... | ALGO | 0.999858 | 5.867962 |
9a765377-3efc-45a4-9e30-d117bc29f772 | mkalte666/laa | src/state/state.cpp | #include "state.h"
#include "dsp/smoothing.h"
#include "dsp/windows.h"
State::State(size_t fftLen) noexcept
{
data.uniqueCol = ImGui::GetColorU32(ImGuiCol_Text);
data.fftLen = std::min(LAA_MAX_FFT_LENGTH, std::max(LAA_MIN_FFT_LENGTH, fftLen));
data.input.resize(data.fftLen);
data.reference.resize(data.... | TOOL | 0.890986 | 5.910877 |
dab3fb9f-b86b-4c7c-9bcb-c8250b944740 | Sagarpatil1206/All_cpp_codes | ass3dsa.cpp | #include <bits/stdc++.h>
#include <stack>
#include <vector>
using namespace std;
class conversionInToPost
{
stack<char> st;
public:
string s;
int precedance(char);
bool associativity(char);
string infixToPostfix(string);
void displayStack();
string InfixToPrefix(string);
int postfixCa... | ALGO | 0.998931 | 4.433913 |
1854a0a4-5cb3-4703-b0e2-74cf4d3785bb | Sl07h/nstu_numerical_methods | 1/slae.cpp | #include "head.h"
#include "slae.h"
// Output dense matrix A
void SLAE::writeMatrixtoFile(std::ofstream& fout, char *str) {
fout << std::fixed << std::setprecision(std::numeric_limits<real>::digits10 + 1) << str << endl;
for (int i = 0; i < A.size(); ++i) {
for (int j = 0; j < A.size(); ++j) {
fout << A[i][j] ... | ALGO | 0.999341 | 3.721548 |
3151d6fd-ce75-4760-aca1-8360bdb0ec9c | adammb86/ProgramBukuCdanCPP | Bahasa C++/Bab 10/Program 10.7/upperstring.cpp | //Program 10.7
//Nama File: upperstring.cpp
//Program fungsi upper case string C++
#include <cstdlib>
#include <iostream>
#include <string.h>
using namespace std;
int main(int argc, char *argv[])
{
char string[31];
cout<<"Masukkan string: ";
fflush(stdin);cin.get(string,30);
strupr(string);
cout<... | TOOL | 0.924509 | 4.67332 |
f6af96a3-ec59-4b33-af61-b66becf8f2e7 | hoarffrost/loving-DSA | Time and Space Complexity/Time_Complexity/Assaignment/Rotate_array.cpp | #include <iostream>
using namespace std;
void rotate(int *input, int d, int n)
{
//Write your code here
int *ptr=new int[n];
int k=0;
for(int i=0;i<n;i++){
if(i<(n-d)){
ptr[i]=input[i+d];
}
else{
ptr[i]=input[k];
k++;
}
}
for(int i=0;i<n... | ALGO | 0.99954 | 4.218288 |
2d9ed0e1-b403-41ee-bbb1-792d88747dd6 | deepin-community/libktorrent | src/upnp/upnprouter.cpp | #include <cstdlib>
#include <QDir>
#include <QDomElement>
#include <QNetworkRequest>
#include <QStringList>
#include <KIO/Job>
#include <KLocalizedString>
#include "httprequest.h"
#include "soap.h"
#include "upnpdescriptionparser.h"
#include "upnprouter.h"
#include <peer/accessmanager.h>
#include <torrent/globals.h>... | WEB | 0.932306 | 4.811825 |
c9b4d151-1c77-472f-8ac6-11af2748c53f | gskabdwal/LeetCode | 0015-3sum/0015-3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
int n = nums.size();
vector<vector<int>> ans;
sort(nums.begin(), nums.end());
for(int i=0; i<n; i++){
if(i!=0&&nums[i]==nums[i-1]) continue;
int j = i+1, k= n-1;
w... | ALGO | 0.999936 | 6.111786 |
05e2ccd0-d5a1-4129-8eea-3659d4bf921b | goldensang/goldensangvn | CP/CSES/1661.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
map<ll , ll> m;
ll n , a[200005] , k , res;
int main()
{
m[0] = 1;
cin >> n >> k;
for(int i = 1;i <= n;i++){
cin >> a[i];
a[i] += a[i - 1];
res += m[a[i] - k];
m[a[i]]++;
}
cout << res;
}
| ALGO | 0.999951 | 3.717519 |
fcbba627-d75b-4243-b5e1-948136638bcc | Willendless/trivial_software_hardware_algorithm | hspa_ahg/hspa_ahg.cpp | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <memory.h>
#include <queue>
#include <algorithm>
#include <climits>
#include <assert.h>
using namespace std;
#define MAX_TASKS 50
#define MAX_CPUS 50
#define MAX_EXECUTORS 5
#define BUF_SIZE 2048
#define MAX(a1,a2) ((a1>=a2)?(a1):(a2))
enum TaskStat... | ALGO | 0.999478 | 3.421343 |
533dd8ac-a2d4-4f24-87d8-82d4e2daac2d | Tecla/Rayito | Rayito_Stage7_QT/RaytraceMain.cpp | #include <string>
#include <iostream>
#include <sstream>
#include "rayito.h"
#include <QThread>
using namespace Rayito;
// A few debug print helpers, in case we need them.
std::ostream& operator <<(std::ostream& stream, const Color& c)
{
stream << '(' << c.m_r << ", " << c.m_g << ", " << c.m_b << ')';
retu... | TOOL | 0.894217 | 7.069475 |
5009b88f-1018-42ae-90ec-0d6577857dcc | starlordvk/github-upload | gcd_euclid.cpp | #include <iostream>
int Gcd(int m, int n)
{
if (n == 0) return m;
while (n > 0)
{
int r = m % n;
m = n;
n = r;
}
return m;
}
int GcdRecursive(int m, int n)
{
if (n == 0) return m;
return GcdRecursive(n, m % n);
}
int main()
{
std::cout<<"Hello World\n";
std... | ALGO | 0.999463 | 5.760059 |
6c8a3bfd-8ba5-4a34-8d0d-75d09b4cfb2c | kchan139/data-structures-and-algorithms | Advance Sorting/quicksort.cpp | template <typename E>
void qSortHelper (List<E> & L, int i, int j)
{
if (j <= i) return;
int pIndex = (i + j) / 2;
swap (L, pIndex, j);
L.moveToPos (j);
E value = L.getValue ();
int k = partition (L, i - 1, j, value);
swap (L, k, j);
qSortHelper (L, i, k-1);
qSort... | ALGO | 0.999972 | 4.866915 |
06ae81b3-1fc9-4a75-8a7f-0962671bcb3b | Mydeen0302/Data_Structure | DSA/SQ/prefixintoinfix.cpp | #include<bits/stdc++.h>
using namespace std;
string convert(string s)
{ stack<string>st;
int i=s.size()-1;
while(i>=0)
{ if ((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z') || (s[i] >= '0' && s[i] <= '9'))
{
st.push(string(1,s[i]));
}
... | ALGO | 0.999967 | 4.53863 |
d51e92f4-cd83-49ba-a79f-56d1f4dc9df9 | ShabbirHasan1/litepool | third_party/boost_1_83_0/libs/compute/perf/perf_stable_partition.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/stable_partition.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);... | ALGO | 0.992287 | 6.12738 |
eeb0c0d2-4b90-4bdc-8987-f10ef80d3117 | renbaoshuo/OI-codes | Luogu/P1075/P1075.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
cin >> n;
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
cout << n / i << endl;
exit(0);
}
}
return 0;
}
| ALGO | 0.999963 | 4.11468 |
c366438a-edab-48db-bc9b-5b50ce46cff2 | darmenmuratbekov/PP1 | Final2020_g1/f.cpp | #include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;
int main() {
// already solved this is problem
int x;
cin >> x;
string a,b;
vector<pair<string, string> > add;
string dd;
vector<pair<string, string> > add... | ALGO | 0.999957 | 4.520386 |
a7beaed5-59e2-4f74-99d3-4b1194fb4858 | kgajwan1/challenge_coding | day1/question8_1.cpp | #include<bits/stdc++.h>
int countsteps(int n)
{
if(n<0)
{
return 0;
}
if(n == 0|| n ==1)
{
return 1;
}
else
{
return countsteps(n-1)+countsteps(n-2)+countsteps(n-3);
}
}
int main()
{
int n =10;
std::cout << countsteps(n);
} | ALGO | 0.999969 | 4.595966 |
96d1103c-c925-456c-87fc-dd60fa9c3b7e | pachoGit/pachoAdvent | 2021/11/11.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <algorithm>
typedef std::pair<int, int> Posicion;
void ver_mapa(std::map<Posicion, int> &mapa, int columnas)
{
int i = 1;
for (auto &punto : mapa)
{
std::cout << punto.second;
if (i == columnas)
{
... | ALGO | 0.994718 | 5.271443 |
434a6582-fc12-4d57-8ad1-032a627b9089 | shoutagit/AtCoder | 過去問A問題/A - Entrance Examination.cpp |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;
int main(){
double t, x;
cin >> t >> x;
double ans=t/x;
cout << ans << endl;
} | ALGO | 0.998604 | 3.217489 |
dcacee74-2669-4849-87dc-14246b676555 | radtek/manager | visual_tesseract/tesseract_3.04/wordrec/lm_pain_points.cpp | #include "lm_pain_points.h"
#include "associate.h"
#include "dict.h"
#include "genericheap.h"
#include "lm_state.h"
#include "matrix.h"
#include "pageres.h"
namespace tesseract {
const float LMPainPoints::kDefaultPainPointPriorityAdjustment = 2.0f;
const float LMPainPoints::kLooseMaxCharWhRatio = 2.5f;
LMPainPoints... | ALGO | 0.959853 | 5.359716 |
e41d7e5d-d703-4c6f-aef5-d3de9aae4b1a | js061097/LeetCode | 51. N-Queens/nQueens.cpp | class Solution {
public:
vector<vector<string>> solveNQueens(int n) {
vector<vector<string>> res;
vector<string> sub_res;
string dots(n,'.');
vector<int> board(n,-1);
//placing the first queen
for(int i=0;i<n;i++){
board[0] = i;
backtrack(i,0,1... | ALGO | 0.999947 | 5.652127 |
ba9270e5-8d98-4eda-8f70-d4c3d2348670 | PetrVevoda/smallupbp | embree-2.0/embree/bvh4mb/bvh4mb_builder.cpp | #include "bvh4mb_builder.h"
#include "../builders/heuristics.h"
#include "../geometry/triangles.h"
namespace embree
{
template<typename Heuristic>
BVH4MBBuilder<Heuristic>::BVH4MBBuilder(TaskScheduler::Event* event, BVH4MB* bvh, const size_t minLeafSize, const size_t maxLeafSize)
: geom(bvh->geom), trity(bvh->... | ALGO | 0.99562 | 6.987234 |
8937a955-0789-4cc7-bd3b-7fd8f7fa1497 | cooler-SAI/WS548-v4 | dep/acelite/ace/ACE_crc_ccitt.cpp | // $Id: ACE_crc_ccitt.cpp 96017 2012-08-08 22:18:09Z mitza $
#include "ace/ACE.h"
namespace
{
/*****************************************************************/
/* */
/* CRC LOOKUP TABLE */
/* =========... | TOOL | 0.996727 | 6.793255 |
a21a159f-48f0-4a45-b9a6-dba661b11ec0 | arungangaji/codelib | Math/Polynomial Factorization.cpp | #include<bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
using vi = vector<int>;
// credit- ksun
std::ostream& operator << (std::ostream& o, const vi& v) {
o << "(";
for (int i = int(v.size())-1; i >= 0; i--) {
int c = v[i];
if (c == 0) continue;
if (i < int(v.size()) - 1) {
o << ... | ALGO | 0.999896 | 5.320686 |
ad626b37-b78f-4c46-8d31-b980c61de1ce | haHung-pre/DSA-PTIT | GENERATION/CTDL_001 - THUẬT TOÁN SINH.cpp | #include<bits/stdc++.h>
using namespace std;
int n,a[10005],final=0;
void ktao(){
for(int i=1;i<=n;i++){
a[i]=0;
}
}
void sinh(){
int i=n;
while(i>0&&a[i]==1){
a[i]=0;
i--;
}
if(i==0)final=1;
else{
a[i]=1;
}
}
bool check(){
int l=1,r=n;
while(l<=r){
if(a[l]!=a[r])return false;
l++;r--;
}
re... | ALGO | 0.999981 | 3.431498 |
f110f295-833a-48dc-9785-7915c598a29a | omrajhalwa/Cpp-CodeforcesQsoln | p55.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int s,n,l=101,k;
cin>>n;
vector<int>a;
for(int i=0;i<n;i++){
cin>>s;
a.emplace_back(s);
}
for(int j=0;j<=n-2;j++){
int i=0;
while(a[i+j]!=a[i+1+j]){
if(a[i+j]>a[i+1+j]&&a[i+j]!=a[i+1+j]){
a[i+j]=a[i+j]-a[i+1+j];
}else if(a[i+1... | ALGO | 0.999949 | 3.367953 |
c7d8c272-2862-41da-a949-e6ee5ce94caf | Md-Merazul-Islam/XPSC-Batch-3 | Weekly Task/7th week/day-01/Online_or_Offline.cpp |
#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265359
#define dmin 1e-9
#define ll long long
#define dd double
#define pq priority_queue
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define pb push_back
#define in insert
#define vi vector<int>
#define vpi vector<pair<int, int>>
#define mp ma... | ALGO | 0.998312 | 4.276539 |
95c60589-291b-485d-ae06-4a867d76ff80 | pablopalou/ICPC | fraizen/C++/UVa/DataStructures/11577.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fr(a,b) for(int i = a; i<b; i++)
#define rep(i,a,b) for(int i = a; i<b; i++)
#define fre(s) for(auto e:s)
#define cout(x) cout << x << "\n";
// Copiar obligatoriamente 0
void solve() {
string s; getline(cin,s);
map<char, int> m;
//... | ALGO | 0.999933 | 4.088498 |
1163f888-8b01-4fd1-81f6-565e08809114 | AimenYaseen/SPD-CCI2023 | homework_11/part_2/problem_2/1_merge_sorted_list/merge_sorted_list.cpp | using namespace std;
#include <list>
#include <iostream>
list<int> mergeSortedLists(const list<int> list1, const list<int> list2)
{
list<int> mergeList;
auto l1 = list1.begin();
auto l2 = list2.begin();
while(l1 != list1.end() && l2 != list2.end())
{
if(*l1 <= *l2)
{
... | ALGO | 0.999882 | 6.126981 |
08e32d63-cb8b-4c75-a35d-f57d0e34c658 | YuchanJung/ps | dp/tree/[백준]15681. 트리와 쿼리/solution.cpp | #include <bits/stdc++.h>
using namespace std;
int n, r, q, a, b;
vector<int> adj[100001];
int visited[100001], cnt[100001];
void dfs(int root) {
cnt[root] = 1;
for (int i = 0; i < adj[root].size(); i++) {
int next = adj[root][i];
if (!visited[next]) {
visited[next] = true;
... | ALGO | 0.999915 | 4.506195 |
3b4a6611-20af-43f6-bd8d-8b7bad0e8a3f | fakarnanta/philomath | philomath/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.997859 | 6.76073 |
fac41099-5595-4040-84f5-e94c31e39fb6 | yu1mu/algorithm-baekjoon | 0x09_bfs/7576.cpp | #include <iostream>
#include <queue>
#include <utility>
using namespace std;
int main(void){
ios:: sync_with_stdio(0);
cin.tie(0);
int board[1002][1002];
int dist[1002][1002];
pair<int, int> dir[4] = {
pair<int, int>(-1, 0),
pair<int, int>(1, 0),
pair<int, int>(0, -1),
... | ALGO | 0.999053 | 4.466463 |
40036ab3-465e-406b-8114-8fb54a55a452 | iamdin/leetcode | union-find-hard/803.打砖块.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
#define it insert
#define pob pop_back
#define pub pus... | ALGO | 0.999765 | 4.660362 |
83b416f1-5c46-4d0e-b4a5-c4db5b28a022 | liuhuoer/AlgorithmNotes | PAT/1905/3/B1007.cpp | # include <cstdio>
# include <cmath>
using namespace std;
bool isPrime(int a)
{
if(a <= 1)
return false;
int n = sqrt(a);
for(int i = 2; i <= n; ++i)
{
if(a % i == 0)
return false;
}
return true;
}
int main()
{
int n, count = 0;
scanf("%d", &n);
fo... | ALGO | 0.999472 | 4.484416 |
fe560019-0211-4a63-83c8-c78c64cad5fe | hmtrung2305/usaco_guide | usaco/silver/prefixsum/more_on_prefix_sums/276c.cpp | #include <bits/stdc++.h>
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
int lengthArr, numQuery;
std::cin >> lengthArr >> numQuery;
std::vector<int> arr(lengthArr);
for (int &num : arr) {
std::cin >> num;
}
std::vector<int> prefixSum(lengthArr);
while (numQuery--) {
int left, right;
std... | ALGO | 0.999931 | 4.729918 |
22d241ef-79d9-4f1d-8005-a2d73c02a07f | advayaggarwal/Data-Structures-Algorithms | Leetcode/617.cpp | class Solution {
public:
TreeNode* mergeTrees(TreeNode* root1, TreeNode* root2) {
if (!root1)
{
return root2;
}
if (!root2)
{
return root1;
}
root1->val += root2->val;
root1->left = mergeTrees(root1->left, root2->left);
... | ALGO | 0.999989 | 6.31446 |
eda68f48-344d-4ed4-abfb-a62dd5d8b1fd | WeslySloan/C-Plus-Plus-Lecture2 | Program/Class3th (Circle Linked List)/Source.cpp | //#include <iostream>
//
//using namespace std;
//
//template <typename T>
//
//class CirclLinkedList
//{
//
//private:
// int size;
//
//public:
// struct Node
// {
// T data;
// Node* next;
// };
//
// Node* head;
//
// CirclLinkedList()
// {
// size = 0;
// head = nul... | TOOL | 0.996678 | 4.491463 |
5155fa22-65f6-4d0a-b06d-4814c3b8d434 | shubhamskq/LeetCode | 118. Pascal's Triangle.cpp | class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> r(numRows);
for(int i = 0 ; i < numRows ; i++)
{
r[i].resize(i+1);
r[i][0] = r[i][i] = 1;
for(int j = 1 ; j < i ; j++)
r[i][j] ... | ALGO | 0.999983 | 5.530175 |
d36d4a30-e36d-422f-b1b4-e905635e2be0 | Aldebaran638/luogu | 2025lanqiao/P12137.cpp | // 这题解的解题方法太妙了
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int n;
ll s, result, mid;
ll p = 1e9 + 7;
signed main(int argc, const char *argv[])
{
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif
cin >> n;
for (int i = 0; i < n; i++)
cin >>... | ALGO | 0.9999 | 4.448829 |
10f1c7bf-66fd-4572-8f84-f41065ff83b5 | Kai-Heng/Coding-Challenges | short_palindrome/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <fstream>
#include <functional>
#include <algorithm>
using namespace std;
int shortPalindrome(string s) {
long long numOfWays = 0;
const int MOD = 1e9 + 7;
vector<int> unique_letter(26, 0);
vector<vector<int>> unique_... | ALGO | 0.999972 | 5.278268 |
627d40f4-89bf-4df2-88a0-fa4581ad6c3f | ishandutta2007/codeforces | i_love_tanya_romanova/normal/722/D.cpp | /*
What brings this anger? To kill us and lie
Now we have hunger, our children will die
And they anchor, our strength to the ground
And will this banker, steal without sound
They fought a battle, to erase our race
They promised death, in a fiery place
In the middle of the night, the sirens calling
In the middle of th... | ALGO | 0.999997 | 3.73363 |
38f0f28e-63e3-4c0a-bc37-3b979a139a14 | notaravin/Crypto-Ciphers | Myszkowski.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
string myszkowskiCipherEncrypt(string text, string key) {
string result = "";
int cols = key.length();
int rows = (text.length() + cols - 1) / cols;
vector<vector<char>> matrix(rows, vector... | ALGO | 0.999975 | 5.321711 |
d0709cf6-105a-42ba-b679-ec23c30e459f | the-known-anon/Codes_for_practice | toll_gate.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
int main() {
int n,m,x;
cin>>n>>m>>x;
int be=0;
int ab =0;
int a[m];
for(int i=0;i<m;i++){
cin>>a[i];
}
for(int i=0;i<m;i++){
if(a[i]<x){
be++;
}
else if(a[i]>x){
... | ALGO | 0.999979 | 3.830892 |
0d934e4e-aa8e-4dfb-90d5-824d784aa690 | suxutao/LeetcodeList | cn/3224-minimum-array-changes-to-make-differences-equal .cpp | #include "../../../stdc.h"
using namespace std;
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
public:
int minChanges(vector<int>& nums, int k) {
int n=nums.size(),ans=n/2,t;
vector<int>v(n/2);
unordered_map<int,int>m;
for (int i = 0; i < n / 2; ... | ALGO | 0.999984 | 5.24499 |
68453153-d602-49c5-9d59-866b5a02fcb3 | mahisewinet/competitive-programming | move_zeros.cpp | class Solution {
public:
void moveZeroes(vector<int>& nums) {
int n= nums.size();
if(n==0 || n==1)
return ;
int left=0, right=0;
int temp;
while( right< n){
if(nums[right]==0)
right++;
else{
temp= nums[right]... | ALGO | 0.999957 | 6.521325 |
049e6917-f468-4cfa-a12c-5e448e769c1e | cechallenge/2025 | llvm/libc/src/math/nvptx/tanhf.cpp | #include "src/math/tanhf.h"
#include "src/__support/common.h"
#include "declarations.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float, tanhf, (float x)) { return __nv_tanhf(x); }
} // namespace LIBC_NAMESPACE_DECL
| ALGO | 0.911353 | 7.143403 |
399c3895-25dd-4c5d-bb4e-1437b7dd5411 | im2sh/Algorithm | Solve/1769 : 3의 배수.cpp | #include <iostream>
#include <string>
using namespace std;
string number;
int ret;
void FastIO() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
}
void Init() {
cin >> number;
}
void solve() {
while (int(number.size()) != 1) {
int sum = 0;
for (unsigned i... | ALGO | 0.999968 | 4.278705 |
a52e4bf8-3167-4d87-ba0e-63bd1009a1cb | AngelZihan/Diversified-Top-k-Route-Planning-in-Road-Network | eKSP.cpp | #include "graph.h"
int Graph::eKSPNew(int ID1, int ID2, int k, vector<int>& kResults, vector<vector<int> >& vkPath, double t, int& countNumber, int& popPath, vector<float>& sim, float &SimTime)
{
//Shortest Path Tree Info
countNumber = 0;
bool bCountNumber = true;
popPath = 0;
int popPathTest = 0;
... | ALGO | 0.9997 | 3.008386 |
fbc58526-6e52-43db-a627-cf197e0bab57 | r-lyeh-archived/crawler | libs/math/eigen/bench/vdw_new.cpp | #include <iostream>
#include <Eigen/Core>
using namespace Eigen;
#ifndef SCALAR
#define SCALAR float
#endif
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef REPEAT
#define REPEAT 10000
#endif
typedef Matrix<SCALAR, Eigen::Dynamic, 1> Vec;
using namespace std;
SCALAR E_VDW(const Vec &interactions1, const Vec &inter... | ALGO | 0.999642 | 3.509 |
3bcc5841-0154-4a8a-9a74-dac5165fbc04 | Adii-Khandelwal/LeetCode-Solutions | 0219-contains-duplicate-ii/0219-contains-duplicate-ii.cpp | class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
unordered_map<int,int> mp;
int n = nums.size();
for(int i=0; i<n; i++)
{
// mp.count() will tell whatever ith index that I want, have I seen it before?
if(mp.count(nums[... | ALGO | 0.999903 | 6.196942 |
1bf7e72a-c7d9-4dfb-b27b-f79580ade855 | Purvesh271/CPP | for i.cpp | #include <iostream>
using namespace std;
int main (){
int i,n;
cout<<"Enter n: ";
cin>>n;
for(i=1;i<=n;i++)
{
cout<<i<<endl;
}
return 0;
}
| ALGO | 0.992938 | 3.398 |
4d1d9480-cd73-41f3-8e1b-aaeb7868d2e9 | yezhenbang/leetcode | 18.cpp | #include "pch.h"
class Solution18 {
public:
void threeSum2(vector<int>& nums, int left, int right, int target, vector<vector<int>>& rst) {
if (right - left + 1 < 3)
return;
for (int i = left; i < right - 1; i++)
{
if (i > left && nums[i] == nums[i - 1])
continue;
int l = i + 1, r = right;
while... | ALGO | 0.999954 | 5.351669 |
d0bd1505-26fa-4831-8031-27ec5c1214f8 | iamrichardwhite/algorithm | usaco-training/hamming.cpp | /*
ID:selfcon2
LANG:C++
PROG:hamming
*/
#include <fstream>
using namespace std;
ifstream fin("hamming.in");
ofstream fout("hamming.out");
int n,b,d,tot,ans[1000];
int check(int x)
{
int i,t,flag,okay=1;
for(i=0;i<tot;i++)
{
t=x^ans[i];flag=0;
while(t){flag+=t-((t>>1)<<1);t=t>>1;}
if(flag<d){okay=0;break;}
}
... | ALGO | 0.999436 | 3.491915 |
a8c36198-8365-4789-a453-f2d22449e5ee | aadityab7/Practice | 404. Sum of Left Leaves.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.999977 | 6.525058 |
9acd6b6d-cbb0-485e-bd05-8917ef3aea64 | nka21/atcoder | abc/abc232/a/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int a = s[0] - '0';
int b = s[2] - '0';
cout << a * b << endl;
} | ALGO | 0.999647 | 4.175023 |
7c45f486-43ae-4eb9-bcd1-e1555ed06672 | alexz429/CompetitiveProgramming | C++/Leetcode/767. Reorganize String.cpp | class Solution {
public:
int arr[26];
string reorganizeString(string s) {
string output = "";
for(char next: s){
arr[next - 'a']++;
}
set<pair<int,int>> pq;
for(int i=0;i<26;i++){
if(!arr[i])continue;
if(arr[i] > (s.size()+1)/2){
... | ALGO | 0.999997 | 5.976378 |
4a5e14c9-c515-446c-a70c-740592fe94c8 | gabearwin/solution-OJ | OJ/back/1435.cpp | #include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
int c,i;
while(scanf("%d",&c)!=EOF){
for(i=0;i<c;i++){
int j,a[102]={0},n,v,w;
scanf("%d %d %d",&n,&v,&w);
for(j=0;j<n;j++){
scanf("%d",&a[j]);
}
sort(a,a+n)... | ALGO | 0.99986 | 3.161605 |
6817b88f-8567-43c8-b0b7-c0345b2702b5 | moheladwy/Solutions_Codeforces_Problems | A/Buy-a-Shovel.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int shovelPrice, differentCoin;
cin >> shovelPrice >> differentCoin;
if (shovelPrice % 10 == 0 || shovelPrice % 10 == differentCoin)
{
cout << 1;
ret... | ALGO | 0.999384 | 3.438786 |
7c11c4d8-d719-4587-b5bf-6bc0c3724bc2 | sachinb20/RoboMaster | navigation_stack-main/visual_odom/src/pose_pkg/src/test.cpp | #include<stdio.h>
#include <iostream>
#include <math.h>
#include<nav_msgs/Odometry.h>
#include<vector>
#include <tf/transform_broadcaster.h>
#include <tf/transform_listener.h>
#include<geometry_msgs/PoseStamped.h>
#include<geometry_msgs/PoseWithCovarianceStamped.h>
#include "tf/tf.h"
#include <opencv2/opencv.hpp>
#i... | TOOL | 0.923791 | 3.829037 |
d296a804-8496-470c-ad07-1091365570e1 | Gtupxx/ccpp | earn/505/4rectangle.cpp | #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
class Rectangle
{
public:
Rectangle(double x1_, double y1_, double x2_, double y2_, double x3_, double y3_, double x4_, double y4_);
bool check(double x1_, double y1_, double x2_, double y2_, double x3_, double y3_, double x4_, dou... | ALGO | 0.960083 | 3.516022 |
8ef82afd-4ae1-46b7-b90b-df639cd11f40 | szy-bro/struktury_danych | Projekt 1/src/Tablica.cpp | #include <iostream>
#include <algorithm>
#include <stdexcept>
class DynamicArray
{
private:
int *data;
int size;
int capacity;
void resize(int newCapacity)
{
int *newData = new int[newCapacity];
std::copy(data, data + size, newData);
delete[] data;
data = newData;
... | TOOL | 0.93648 | 6.030786 |
f5ccbef9-1b86-410f-955f-506bd455bcfc | ShailzaThakur7/Leetcode | 0283-move-zeroes/0283-move-zeroes.cpp | class Solution {
public:
void moveZeroes(vector<int>& nums) {
int left=0;
for(int right=0;right<nums.size();right++){
if(nums[right]!=0){
swap(nums[right],nums[left]);
left++;
}
}
}
}; | ALGO | 0.999963 | 6.380908 |
98e0270f-9c7b-4ad7-8253-c3c19a76cf47 | sagpant/extreme_3d_faces | lib/3rdParty/Eigen/doc/examples/TutorialLinAlgRankRevealing.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
A << 1, 2, 5,
2, 1, 4,
3, 0, 3;
cout << "Here is the matrix A:\n" << A << endl;
FullPivLU<Matrix3f> lu_decomp(A);
cout << "The rank of A is " << lu_decomp.rank() << endl;
c... | ALGO | 0.999716 | 3.720849 |
f57a18e3-8a77-4353-926b-fb6873a6c607 | HPUedCSLearner/hobbies | parallel-BilibiliSite/07/06_ndarray/02/main.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <array>
#include <benchmark/benchmark.h>
#include <x86intrin.h>
#include <omp.h>
// L1: 32KB
// L2: 256KB
// L3: 12MB
constexpr size_t nx = 1<<13;
constexpr size_t ny = 1<<13;
std::vector<float> a(nx * ny);
void BM... | TEST | 0.967591 | 5.477781 |
80881d0c-ce46-4fff-bb03-a1d0f36a1a76 | spranay007/leet | 3508-number-of-bit-changes-to-make-two-integers-equal/number-of-bit-changes-to-make-two-integers-equal.cpp | class Solution {
public:
int minChanges(int n, int k) {
int temp = n^k;
int count = 0;
if((n&k)!=k){ // to handle cases which are not possible as we set 1 to 0 not vice sersa
return -1;
}
while(temp > 0){
if(temp &1){
count++;
... | ALGO | 0.99999 | 5.819397 |
63579cb7-e079-4702-877e-67c1b485b3fd | Nitesh-Bhardwaj-git/cpp | GCD.cpp | #include <iostream>
using namespace std;
int gcd(int a, int b) {
if (b == 0) {
return a;
} else {
return gcd(b, a % b);
}
}
int main() {
int num1 = 48;
int num2 = 18;
cout << "The GCD of " << num1 << " and " << num2 << " is " << gcd(num1, num2) << endl;
return 0;
} | ALGO | 0.997439 | 5.766977 |
4a246fb1-cea5-4b81-92b2-5fcdf0ec6042 | ishandutta2007/codeforces | i_love_tigersugar/normal/489/F.cpp | #include<bits/stdc++.h>
#define MAX 505
#define FOR(i,a,b) for (int i=(a),_b=(b);i<=_b;i=i+1)
#define FORD(i,b,a) for (int i=(b),_a=(a);i>=_a;i=i-1)
#define REP(i,n) for (int i=0,_n=(n);i<_n;i=i+1)
using namespace std;
typedef long long ll;
const ll INF=(ll)1e18+7LL;
const int LIM=(int)1e9+7;
int n,m,mod;
char a[MAX]... | ALGO | 0.999993 | 4.036742 |
a790336f-6ca7-43b1-ba16-d59694dd7b58 | slitvinov/lammps-sph-multiphase | src/USER-CUDA/pair_tersoff_cuda.cpp | /* ----------------------------------------------------------------------
Contributing author: Paul Crozier (SNL)
------------------------------------------------------------------------- */
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "pair_tersoff_cuda.h"
#include "cuda_data.h... | ALGO | 0.947706 | 6.386035 |
2ca138c7-bc03-404a-ba7e-443beec4e5b6 | ishandutta2007/codeforces | xyf007/normal/150/B.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <numeric>
constexpr int kMod = 1e9 + 7;
int n, m, k, fa[2001], sz[2001];
int Find(int x)
{
if (x == fa[x])
{
return x;
}
return fa[x] = Find(fa[x]);
}
void Merge(int x, int y)
{
int fx =... | ALGO | 0.999998 | 4.693661 |
a944a49e-5a07-44e7-9e22-9146e4cdb946 | Akil0814/Cpp | School/CS1B/2/11_4.cpp | /*
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
Example:
Input: [100, 4, 200, 1, 3, 2]
Output: 4 (The longest sequence is [1, 2, 3, 4])
*/
#include<iostream>
#include<vector>
using namespace std;
void sort(int arr[],int x)
{
int tmp=0;
int j=0;
for(int ... | ALGO | 0.999931 | 5.351748 |
62cc91b7-2a42-48d1-b9e6-353224843d46 | mrreyesm/sak_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.998689 | 6.787361 |
fdf804c0-1f25-4cd5-8869-8bba8a0cca29 | Hardik2972/DSA | special_algorithm/segment_question.cpp/magicalgarden.cpp | #include<bits/stdc++.h>
using namespace std;
int recursion(int i,int j,int k,vector<int>& dest,int n,int m,vector<vector<vector<int>>>& dp){
if(k==0 && i==dest[0] && j==dest[1]) return 1;
else if(k<0 || (i==dest[0] && j==dest[1])) return 0;
if(dp[i][j][k]!=-1) return dp[i][j][k];
int ways = 0;
for(i... | ALGO | 0.999975 | 3.666638 |
cfeaf6f0-9898-4f05-9f03-09cb78650989 | n-taha/C- | Introduction/condition.cpp | #include<iostream>
using namespace std;
int main(){
int x;
cin >> x;
if(x % 2 == 0){
cout << "Even Number" << endl;
}else{
cout << "ODD Number" << endl;
}
return 0;
} | ALGO | 0.999832 | 4.675304 |
9abf4033-56e4-485d-9f3e-082338d4eba6 | Kabir-Ehsan/Transformer_on_FPGA | attention_layer/addNorm2.cpp | #include "addNorm2.h"
#include "TNN_5_2.h"
// ADD & NORMALIZE-02
void addNorm2(fp3 (*ff_out2)[EMBEDDING_DIM], fp1 (*LN_out1)[EMBEDDING_DIM], int seq_out, int embed_out)
{
add_norm_seq2: for(int i=0;i<SEQ_LEN;i++)
{
if(i<(seq_out))
{
add_norm_embed2: for(int j=0;j<EMBEDDING_DIM;j++)
{
if(j<(embed_out))
... | ALGO | 0.994003 | 3.839451 |
4267e545-d837-45e2-b790-3934cf698e59 | raincross7/code-similarity | codes/train_code/problem031/problem031_261.cpp | #include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <math.h>
#include <map>
#include <bitset>
#include <cmath>
#include <set>
#include <utility>
#define INF 1000000000000
#define MOD 1000000007 //10^9+7:合同式の法
using namespace std;
typedef long long ll;
//マクロ
#define REP(i,n) fo... | ALGO | 0.999626 | 3.300039 |
cba6d2ab-4686-4a70-9b2b-c91da0b31a43 | atedesch1/challenges | leetcode/climbing-stairs.cpp | #include <vector>
class Solution {
public:
int climbStairs(int n) {
if (n == 0) return 0;
auto cache = std::vector<int>(n, -1);
return climbStairsRecursive(n, cache);
}
int climbStairsRecursive(int n, std::vector<int>& cache) {
if (n == 1) return 1;
if (n == 2) r... | ALGO | 0.99999 | 6.726834 |
2259dc2d-4dca-4b4c-8cda-f39038c24fa8 | SumiranBhattarai/Coding-Challange | Geeks For Geeks/Arrays/9.cpp | #include <bits/stdc++.h>
using namespace std;
using namespace chrono;
class Solution_BRUTE
{
public:
int count(int A, int B, int N)
{
int c = 0;
// code here
for (int i = A; i <= B; i++)
{
int count = 0;
for (int j = 1; j <= i; j++)
{
... | ALGO | 0.999774 | 5.565005 |
b12292bb-13da-4746-a427-192476ba0534 | ishandutta2007/codeforces | xiaowuc1/normal/825/B.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>
using namespace std;
// BEGIN NO SAD
#define rep(i, a, b) for(int i = a; i < (b); ++... | ALGO | 0.999899 | 4.756151 |
9a492749-1392-4293-b8d9-5a5a38b5f9d1 | Manav-Aggarwal/competitive-programming | CodeChef/Cooling Pies.cpp | #include <bits/stdc++.h>
using namespace std;
bool wayToSort(int a, int b) {return (a > b); }
int main()
{
//freopen("test.in", "r", stdin);
int T;
cin >> T;
while(T--)
{
long long int N, count = 0, i, j;
cin >> N;
int weights[N], limits[N];
for(i = 0; i < N; i++)
... | ALGO | 0.999983 | 3.503684 |
104d079b-78c0-425a-b7ec-d725a45fea49 | sarvex/leetcode-malbolge | solution/0100-0199/0105.Construct Binary Tree from Preorder and Inorder Traversal/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.999987 | 6.505227 |
7c59ed65-9bcd-4b1c-a1b5-b7bffa2c3b53 | eemoreira/biblioteca-de-problemas | icpc/subre2013/a.cpp | #include<bits/stdc++.h>
using namespace std;
void solve() {
int a, b, c;
cin >> a >> b >> c;
if (a != b && a != c) {
cout << "A\n";
}
else if (b != a && b != c) {
cout << "B\n";
}
else if (c != a && c != b) {
cout << "C\n";
}
else {
cout << "*\n";
... | ALGO | 0.999968 | 4.553605 |
ca2e1cd8-c286-48a0-858e-ce58e793e54d | swag-lang/swag | llvm/llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp | #include "Opts.inc"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/config.h"
#include "llvm/DebugInfo/Symbolize/DIPrinter.h"
#include "llvm/DebugInfo/Symbolize/Markup.h"
#include "llvm/DebugInfo/Symbolize/MarkupFilter.h"
#include "llvm/DebugInfo/Symbolize/SymbolizableModule.h"
... | TOOL | 0.951892 | 5.253726 |
ae2602c5-28f7-4585-971c-a69a7ce10f6a | aditiiilaturkar/DSA_- | 144-Binary-Tree-Preorder-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.999989 | 6.006179 |
46aa1d73-eaf6-4062-b368-ce75ca110b44 | remidbs/TP1-INF560 | demo/DemoMVPBlock.cpp | // basic packages
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
// project packages
#include "Vector.hpp"
#include "MatrixDense.hpp"
#include "DataTopology.hpp"
#include "BlasMpi.hpp"
// third-party packages
int main (
int argc,
char** argv ) {
// ----------------------------------------... | ALGO | 0.985521 | 4.138421 |
9a3a424a-76eb-4c90-9838-f9cc1e1a8709 | MinJun-S/slsm-tree | (test) basic-LSM-tree/main.cpp | /*
basic LSM ڵ
*/
#include <iostream>
#include <vector>
#include <fstream>
#include <string>
#include "lsm_tree.h"
#include "sys.h"
#include "unistd.h"
#include "B+ Tree.h"
using namespace std;
void command_loop(LSMTree& tree) {
char command;
KEY_t key_a, key_b;
VAL_t val;
string file_path;
... | TOOL | 0.942986 | 4.378601 |
eb79df73-6afe-42bd-84d3-f45c7aa67825 | Baconm145/MSHP_Homework | 24_04_2018/double_array5/main.cpp | #include <iostream>
using namespace std;
const int ROWS = 100;
const int COLS = 100;
int main()
{
int N;
//int M;
int sub = 1;
cin >> N;
//cin >> M;
int array[ROWS][COLS] = {};
for ( int height = 0; height <= N - 1; ++height ) {
for ( int length = 0; length <= N - 1; ++length ) {
... | ALGO | 0.99993 | 3.137745 |
e2c4e3a9-7833-4d85-9ae0-f3e677f2beb0 | n0maru/NN | DeepLearningFromScratch/SoftmaxCrossEntropyError.cpp | #include "SoftmaxCrossEntropyError.hpp"
#include "Common.hpp"
#include "Debug.hpp"
#include <sstream>
double loss_layer::SoftmaxCrossEntropyError::Forward(const Matrix& pred, const Matrix& answer)
{
this->pred = pred;
Common::softmax(this->pred);
this->answer = answer;
return Common::cross_entropy_error(t... | ALGO | 0.970241 | 5.639002 |
50ae6a65-0a17-4d5f-a9dd-9634f3f9c0ef | vatsal-sodha/30days-coding-challenge | code/Day6-10/character-pattern-3.cpp | #include <iostream>
using namespace std;
int main(){
int t;
cin>>t;
while(t-->0){
int l,c,k=1;
cin>>l>>c;
c=c*3+1;
l=3*l+1;
int total=l*c,i=0,r=0;
while(total-->0){
if(r%3==0){
cout<<"*";
i++;
if(i==c){
cout<<endl;
r++;
i=0;
}
}
else{
if(i==0 || i=... | ALGO | 0.999801 | 3.346983 |
562e2eb7-3004-4d1e-93da-44a2022ca3b8 | lyh-source/Multi-scale-Anisotropic-Rough-Surface-MARS-Algorithm | include/igl/topological_hole_fill.cpp | #include "topological_hole_fill.h"
template <
typename DerivedF,
typename Derivedb,
typename VectorIndex,
typename DerivedF_filled>
IGL_INLINE void igl::topological_hole_fill(
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<Derivedb> & b,
const std::vector<VectorIndex> & holes,
Eigen::P... | ALGO | 0.902253 | 5.358499 |
4dd06dd8-d6fa-440c-9177-a5c93c11cfd0 | AgeMagi/CP | Toki/Programan Kompetitive/Bab 3 Brute Force/Jawbreaker2.cpp | #include <bits/stdc++.h>
using namespace std;
int N;
int M;
int Matriks[26][26];
int Sudah[26][26];
int banyak;
void Jawbreaker(int i, int j, int x) {
if (Sudah[i][j]) {
return;
} else {
if (Matriks[i][j] == x) {
Sudah[i][j] = true;
banyak++;
if (i > 0) {
Jawbreaker(i - 1, j, x);
}
if (j > ... | ALGO | 0.999976 | 3.194746 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.