uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3c0d6b4f-78ae-4de5-9e6e-d9da93206d47 | harshpandeyxd/AlvaARTesting | src/libs/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
MatrixXf::Index maxIndex;
float maxNorm = mat.colwise().sum().maxCoeff(&maxIndex);
std::cout << "Maximum sum at position " << maxIndex << std:... | ALGO | 0.999809 | 4.220459 |
62ac1efb-e489-47ed-9b69-a2fc5d50a029 | yup1771/DSA_Journey | dfstraversalgraph.cpp | #include<bits/stdc++.h>
using namespace std;
class graph{
public:
unordered_map<int,list<int>> adj;
void creategraph(int u,int v,int direction){
adj[u].push_back(v);
if(direction==0){
adj[v].push_back(u);
}
}
void initialize(map<int,bool> &check,int u,int v){
check[u]=false;
check[v]=false;
}... | ALGO | 0.999968 | 5.010619 |
12018254-be0b-4d34-a73e-5dc585c6bf19 | longpth/RoLabsSlam | ThirdParty/eigen/doc/examples/TutorialLinAlgInverseDeterminant.cpp | #include <iostream>
#include <Eigen/Dense>
int main() {
Eigen::Matrix3f A;
A << 1, 2, 1, 2, 1, 0, -1, 1, 2;
std::cout << "Here is the matrix A:\n" << A << std::endl;
std::cout << "The determinant of A is " << A.determinant() << std::endl;
std::cout << "The inverse of A is:\n" << A.inverse() << std::endl;
}
| ALGO | 0.9998 | 4.587399 |
e8972fb3-86fc-4561-9173-8a6e28ae0aa0 | ishandutta2007/codeforces | ashishgup/normal/733/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
const int N=1e5+5;
int n;
int ans=0, idx1, idx2;
map<pair<int, int>, pair<int, int> > m;
void insert(int a, int b, int c, int i)
{
pair<int, int> p = {b, c};
if(m.fi... | ALGO | 0.999963 | 3.933681 |
0a1a2371-8e91-4698-921a-1eb841719fa6 | george-visconti/codeforces | contest1741/A.cpp | #include <iostream>
#include <algorithm>
#include <set>
#include <vector>
using namespace std;
int main()
{
int nums;
cin >> nums;
string a,b;
char a_last, b_last;
for (int i = 0; i < nums; i++)
{
cin >> a >> b;
a_last = a[a.size()-1];
b_last = b[b.size()-1];
... | ALGO | 0.999979 | 3.810651 |
0201d2e7-adfc-4581-9820-4d5c88350824 | marcossleyther/Cpp_Umg2019 | suma matri.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
int main()
{
int f,c;
int mat1[50][50], mat2[100][100], SuMa[100][100];
cout<<"Cuantas Filas desea: "; cin>>f;
cout<<"Cuantas Columnas desea: "; cin>>c;
cout<<"Ingrese los valores de la primer matriz: \n";
for(int i=0; i<f; i++){... | ALGO | 0.948416 | 3.22122 |
501fa7d2-6dd5-4f48-9e95-bf69ca2de26f | MrMakva/CPP_Standard_Libs | unordered_map.cpp | /*
? insert() – Вставка элемента
Добавляет пару ключ-значение в контейнер.
#include <iostream>
#include <unordered_map>
int main() {
std::unordered_map<std::string, int> umap;
/ Вставка через make_pair
umap.insert(std::make_pair("apple", 50));
/ Вставка через {}
umap.insert({"banana", 30});
... | ALGO | 0.940286 | 4.669426 |
ca43faf1-795d-47b6-adb5-47c727333305 | Kaur-sukhmani/DSA_C- | BinaryTrees/BinarySearchTrees/bst005.cpp | // Kth Smallest Element in a BST
// https://leetcode.com/problems/kth-smallest-element-in-a-bst/
/*
Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree.
Example 1:
Input: root = [3,1,4,null,2], k = 1
Output: 1
Example 2:
Input... | ALGO | 0.999992 | 7.044176 |
9afc0999-832c-4ea1-8444-880842f0ca64 | sichhabra/ParallelRayTracing | raytrace_parallel/raytrace/torus.cpp | #include "algebra.h"
#include "imager.h"
namespace Imager
{
int Torus::SolveIntersections(
const Vector& vantage,
const Vector& direction,
double uArray[4]) const
{
// Set up the coefficients of a quartic equation for the intersection
// of the parametric equation P = ... | ALGO | 0.998775 | 5.896752 |
b04d871f-3cda-4646-8b91-414a40bf28fe | ambuske/350 | CPSC350/assignment2 3/main.cpp | #include "Level.h"
#include <exception>
#include "World.h"
#include "Mario.h"
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main(){
try{
int L; //levels
int N; //dimension
int V; //lives
double cp; //coins percentage
double np; //nothing percentage
double ... | TOOL | 0.88043 | 3.477898 |
e3e83b4f-66c3-4667-968c-3da9f1b6eab0 | neelchoudhury/cp | Codechef and Spoj/L-Z/max_mul_rec.cpp | #include<stdio.h>
#define MAX 10
void multiplyMatrix(int [MAX][MAX],int [MAX][MAX]);
int m,n,o,p;
int c[MAX][MAX];
int main(){
int a[MAX][MAX],b[MAX][MAX],i,j,k;
printf("Enter the row and column of first matrix: ");
scanf("%d %d",&m,&n);
printf("Enter the row and column of second matrix: ");
... | ALGO | 0.998993 | 3.071721 |
21972abd-b8c9-49cb-9524-e78b81160200 | marek22k/crazytrace-test | src/configuration.cpp | #include "configuration.hpp"
// NOLINTBEGIN(cppcoreguidelines-pro-type-member-init)
// _log_level is initialized in a function that is called directly from the
// constructor. If _log_level cannot be initialized, an error is thrown.
Configuration::Configuration(const std::string& filename) :
_node_container(std::m... | TOOL | 0.858168 | 7.722076 |
a2fcd05e-1daf-465b-9e8d-bf6a66818144 | himanishu-2512/LeetCode-Solutions | 797-rabbits-in-forest/rabbits-in-forest.cpp | class Solution {
public:
int numRabbits(vector<int>& answers) {
unordered_map<int,int> m;
int count=0;
for(int i:answers){
if(m[i]==i){
m[i]++;
count+=m[i];
m[i]=0;
}
else{
m[i]++;
... | ALGO | 0.999967 | 5.994909 |
ac1f2390-75c1-4eb2-835b-734e30f6a055 | sinchanarokkad/Data_Structure_and_Algorithms | 036_count_sort.cpp | #include <iostream>
using namespace std;
template <class T>
void Print(T& vec, int n, string s){
cout << s << ": [" << flush;
for (int i=0; i<n; i++){
cout << vec[i] << flush;
if (i < n-1){
cout << ", " << flush;
}
}
cout << "]" << endl;
}
int Max(int A[], int n)... | ALGO | 0.99972 | 5.018302 |
528d4a42-6575-429c-b093-92f9789a254e | ishandutta2007/codeforces | mtsd/normal/601/C.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#includ... | ALGO | 0.999955 | 3.719433 |
92aa0692-b845-4b9a-b1cc-3ab96800924e | AlexanderToapanta/Trabajos-E.D. | Deberes/Listas/Lista_Circular_Doble/main.cpp | #include "Lista_Circular_Doble.cpp"
#include <iostream>
#include <string>
using namespace std;
int menu() {
int opcion;
cout << "\n--- Menú ---" << endl;
cout << "1. Insertar nodo" << endl;
cout << "2. Buscar nodo" << endl;
cout << "3. Eliminar nodo" << endl;
cout << "4. Mostrar lista" << endl... | ALGO | 0.997729 | 5.780137 |
2311d053-6c0d-4c07-8c1c-703ff36efdcb | raincross7/code-similarity | codes/train_code/problem432/problem432_5.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int x, t;
cin >> x >> t;
cout << max(0, x - t) << endl;
}
| ALGO | 0.999775 | 4.365103 |
28693cb0-2de9-4b8b-a8a4-0a897b099109 | ZJU-DAILY/MaxInfBRkNN | MaxInfBRkNN/Tenindra/utility/utility.cpp | #include "utility.h"
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <vector>
#include <iomanip>
#include <sstream>
#include <assert.h>
#include <unordered_set>
#include <algorithm>
namespace utility
{
// kNN1 is the expected results, and kNN2 is the results being tested
b... | TEST | 0.918998 | 7.34168 |
7fc42568-9262-4e4c-92f9-718886c66133 | zyz-2299mod10/DS_OOP | 109350008_program1/programming_HW.cpp | #include <cstdlib>
#include <iostream>
#include <ctime>
using namespace std;
struct airplane_name
{
int id;
int fuel;
int time;
airplane_name* next;
airplane_name(int id_ = 0, int fuel_ = 0) : id(id_), fuel(fuel_), time(0), next(NULL) {};
};
class landing_queue
{
public:
airplane_name* lfront;
airplane_name* ... | ALGO | 0.977694 | 3.119079 |
367a1c45-4c38-4051-b8da-4b6dfa37f635 | Kyun2da/Algorithm | cpp/baekjoon/tree_search/tree_search/소스.cpp | #include <stdio.h>
#include <stdlib.h>
typedef struct treeNode {
char key;
struct treeNode* left;
struct treeNode* right;
}treeNode;
typedef char element;
treeNode* insertNode(treeNode* p, char x)
{ // p Ű Ͽ x ϴ
treeNode* newNode;
if (p == NULL) {
newNode = (treeNode*)malloc(sizeof(treeNode));
newNode->k... | ALGO | 0.999461 | 3.471422 |
0830d45b-8eaa-4b50-9cc8-6291960476f6 | Hemersom/Estrutura-de-dados | 2. Estudos/AO/valores/shell.cpp | #include<stdio.h>
#include<stdlib.h>
#include<time.h>
void sort(int *lista, int tam){
int i, j, gap, k;
}
int main(int argc, char *const _argv[]){
system("chcp 65001");
system("cls");
int tam;
int vet[tam];
srand(time(NULL));
return 0;
} | ALGO | 0.983806 | 3.191105 |
ecabf3ce-3bfd-436c-a3cd-f07d6e4e8382 | isce-framework/isce3-ci-testing | cxx/isce3/matchtemplate/pycuampcor/cuCorrFrequency.cpp | /*
* @file cuCorrFrequency.cu
* @brief A class performs cross correlation in frequency domain
*/
#include "cuCorrFrequency.h"
#include "cuAmpcorUtil.h"
#include "float2.h"
#include <fftw3.h>
namespace isce3::matchtemplate::pycuampcor {
/*
* cuFreqCorrelator Constructor
* @param imageNX height of each image
*... | ALGO | 0.970514 | 6.645554 |
4a35f445-24ee-4ff6-bc88-c1eecb61ef80 | qinzheng93/vision3d | vision3d/csrc/cpu/deformation_graph/deformation_graph.cpp | #include "deformation_graph.h"
namespace vision3d {
inline int ravel_hash_func(const Voxel &voxel, const Voxel &dimension) {
return ((voxel.x * dimension.y + voxel.y) * dimension.z + voxel.z) % HASH_BASE;
}
inline float compute_skinning_weight(float distance, float node_coverage) {
return std::exp(-(distance * d... | ALGO | 0.991228 | 6.340773 |
0148bae0-c271-431f-845c-5dccf8161693 | DeepInMind12345/UEToonShading | Engine/Source/ThirdParty/ICU/icu4c-53_1/source/i18n/collationsettings.cpp | #include "unicode/utypes.h"
#if !UCONFIG_NO_COLLATION
#include "unicode/ucol.h"
#include "cmemory.h"
#include "collation.h"
#include "collationsettings.h"
#include "sharedobject.h"
#include "uassert.h"
#include "umutex.h"
U_NAMESPACE_BEGIN
CollationSettings::CollationSettings(const CollationSettings &other)
... | TOOL | 0.864223 | 7.812856 |
516e6cdd-a512-4593-a4e3-0ecaf37b824f | Hima0X2/lightOJ | Trailing Zeroes (I).cpp | /// BISMILLAHIR RAHMANIR RAHIM
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
const long long int mx=1e8+123;
bitset<mx>is_p... | ALGO | 0.999837 | 4.895298 |
a25f5ce8-7fe1-49fe-a86e-d58a88d959a2 | Anubhav12345678/competitive-programming | gcnsumgvndigsmallestnumber.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
//code
int t,s,l,r,sum;
cin>>t;
while(t--){
cin>>sum>>s;
int sm = sum;
l = pow(10,s-1),r = l*10-1;
if(9*s > sum){
while(l <= r){
int num = l;
while(num > 0){
sum -= num%10;
... | ALGO | 0.999583 | 3.720497 |
ffc15879-eca2-4287-aea6-d8c4251356e8 | mzadfar/OOP | 000_MaxSumSubarrays/test000.cpp | /**
* @file test000.cpp
* @author M. Z.
* @brief Maximum value of all possible subarrays; Time complexity O(n^2)
* @version 0.1
* @date 2025-02-13
*
* @copyright Copyright (c) 2025
*
*/
#include <climits>
#include <iostream>
using namespace std;
int MaximumSumSubarray(int *arr, int n);
int main() {
int a... | ALGO | 0.999887 | 5.912565 |
f0fd7ba9-2369-4a40-8484-d10088b7c229 | OrigamiMaker-Senior-Project/OrigamiMaker | wxWidgets/src/common/quantize.cpp | /* modified by Vaclav Slavik for use as jpeglib-independent module */
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#if wxUSE_IMAGE
#include "wx/quantize.h"
#ifndef WX_PRECOMP
#include "wx/palette.h"
#include "wx/image.h"
#endif
#ifdef __WXMSW__
#include "wx/m... | ALGO | 0.997319 | 7.041672 |
4d1c527b-180b-4075-b75f-35bba097b052 | juanfernandez13/codCad | CodCad_Basico/potenciaSimples.cpp | #include <cmath>
#include <iostream>
using namespace std;
int main(){
double x,y;
cin >> x;
cin >> y;
printf("%.4f",pow(x,y));
return 0;
} | ALGO | 0.999464 | 4.023506 |
bb14e1b4-8c2b-4938-bedf-df3a8eefeed1 | myunbin/PS | BOJ/27730.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
#define fileio() freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)
#define fio() ios_base::sync_with_std... | ALGO | 0.999929 | 4.244908 |
b093ed54-7dfa-4b06-a347-3793981a03fe | Dolev-Oz/PRF_from_PIG | CPP/ECCs.cpp | #include "api.hpp"
std::vector<bit> apply_RS(std::vector<bit> msg) {
assertm(l < 20, "Used l value is too high to use with Reed Solomon");
constexpr std::size_t n = (RS_q - 1);
constexpr std::size_t d = RS_d; // TODO: select dynamically
constexpr std::size_t k = n - d + 1;
/* Finite Field Paramet... | ALGO | 0.999668 | 6.008168 |
bf78a696-0694-4219-8396-60c81be38bed | Daksh302002/DSA | Recursion and Dp/1_to_N.cpp | #include <iostream>
#include <vector>
using namespace std;
void printNos(int n)
{
if (n == 0)
return;
printNos(n - 1);
cout << n << " ";
}
int main()
{
printNos(65);
return 0;
} | ALGO | 0.992905 | 4.057592 |
0662c7e0-9b18-40f8-a18b-78367f98d722 | wang-y-z/leetcode-algorithm | 100.相同的树.cpp | /*
* @lc app=leetcode.cn id=100 lang=cpp
*
* [100] 相同的树
*/
// @lc code=start
/**
* 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), rig... | ALGO | 0.99994 | 6.710937 |
15d076fd-5300-405f-8903-945d7818f244 | KraitOPP/Codeforces | E_Photoshoot_for_Gorillas.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define loop(i, a, b) for(int i=a;i<b;i++)
signed main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin>>t;
while(t--){
auto begin = chrono::high_resolution_clock::now();
... | ALGO | 0.9999 | 3.285456 |
344007af-44c5-4565-b27c-800e6a289fc3 | YaroslavParkhomchuk/HomeWork5 | Task 2.cpp | #include <iostream>
#include <cmath>
#define PI 3.141
using namespace std;
class Shape
{
public:
Shape() {}
virtual void area() const = 0;
virtual void perimeter() const = 0;
virtual ~Shape() {}
};
class Circle : public Shape
{
public:
Circle(double radius) : r(radius) {}
void area() const
... | ALGO | 0.944069 | 3.505217 |
e39df517-4141-4102-bdab-d3e15130b355 | timothygao8710/Competitive-Programming | Algorithm&DS Implementations/combinatorics.cpp | //Author: timg8710
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, int> pii;
#define pb push_back
#define f first
#define s second
const int maxn = 2e5+9; const ll mod = 1e9+7;
ll dp[maxn];
ll binpow(ll base, ll pow)
{
if (pow == 0) return 1;
ll half = binpow(base... | ALGO | 0.999787 | 4.384157 |
0173a76d-ed31-4e35-9af1-b7663dcc6bc3 | junewaves/contests | Codeforces/2020/Educational_94/e.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int consider(int l, int r, vector<int>& a) {
if (r - l == 1) return int(a[l] > 0);
int mn = INT_MAX, cnt = 1;
for (int i = l; i < r; i++) {
if (a[i] < mn) {
mn = a[i];
cnt = 1;
} else if (a[i] == mn)... | ALGO | 0.999983 | 4.271032 |
423777e0-ee29-4c44-b877-ec7b2fb387e4 | jjunseoki/baekjoon | baekjoon/1541x.cpp | #include<iostream>
#include<vector>
#include<string>
using namespace std;
string str;
int result = 0;
bool isMinus;
int main() {
cin >> str;
for (int i = 0; i <= str.size(); i++) {
if (str[i] == '-' || str[i] == '+' || i == str.size()) {
if (isMinus) {
result -= stoi(num);
num =... | ALGO | 0.999976 | 4.237447 |
418acc04-4906-4309-b638-00ef2c660961 | nccaiteam/histopathology_annotation_nia | libs/boost_1_67_0/libs/intrusive/example/doc_rbtree_algorithms.cpp | struct my_node
{
my_node(int i = 0)
: int_(i)
{}
my_node *parent_, *left_, *right_;
int color_;
//other members
int int_;
};
//Define our own rbtree_node_traits
struct my_rbtree_node_traits
{
typedef my_node node;
typedef my_node * ... | ALGO | 0.999844 | 6.599195 |
11d60ea7-d602-42af-aa03-34f52b0a265b | ishandutta2007/codeforces | eddy1021/normal/778/A.cpp | // eddy1021
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
#define mod9 1000000009LL
#define mod7 1000000007LL
#define INF 1023456789LL
#define INF16 10000000000000000LL
#define... | ALGO | 0.999894 | 4.211112 |
3a6db79c-477c-4a70-b744-240b032ce93e | sos0911/PS_Cpluslplus | Algorithm/2019/Mon_08/Alg4803.cpp | // 일반 문제풀이용 템플릿
#include <bits/stdc++.h>
using namespace std;
typedef vector<vector<int>> vvi;
typedef vector<int> vi;
int n,m,nofe,nofv;
bool visit[501]={};
vvi adj;
void solve(int here){
visit[here]=true;
for(int next:adj[here])
if(!visit[next]){
nofe+=2; nofv++;
solve(next);
}
}
int main(){
int rep=1;
... | ALGO | 0.999935 | 4.709754 |
7db5ac1a-e3d2-4f82-b4d0-bb3d7e7c1076 | D3-87087-NikitaJ/Cpp | Assignment_6/A6Q2.cpp |
/*Q2. Write a user defined function factorial() that calculates factorial of given number and it throws
exception if number entered by user is negative. */
#include <iostream>
using namespace std;
int factorial(int n)
{
if (n < 0)
{
throw 0;
cout << "Factorial of a negative number is not defi... | ALGO | 0.971088 | 5.580555 |
e5d9a0a3-4127-4ff4-95d1-06182c2ca01a | PBBx0/CSES | sortings_and_searchings/13.cpp | #include <bits/stdc++.h>
#define sz(n) (int)(n).size()
using namespace std;
using ll = int64_t;
const int N = 2e5;
void solve() {
int n;
cin >> n;
vector<int> a(n);
set<int> s;
for (int& el : a) {
cin >> el;
s.insert(el);
}
unordered_map<int, int> mp;
mp.reserve(n);
... | ALGO | 0.999921 | 4.546502 |
23cd93c0-5ab3-4550-8973-6a853b2ccca9 | CatalinMihai99/Tokern_Ring_Cpp | Token Ring c++/Project10/Source.cpp | #include<iostream>
#include<string>
#include<vector>
#include<string.h>
#include<tuple>
using namespace std;
void creare_calculatoare(vector<string> &v, int nr)
{
for (int index = 0; index < nr; index++)
{
auto s = std::to_string(index+1);
v.push_back("198.192.10." + s);
}
}
void afisare_calculatoare(vector<stri... | ALGO | 0.93586 | 3.844732 |
33a0928e-4a7f-4a37-9126-71b6c8d82599 | Haribala-09/hyprdots | User/History/-4d4b56f2/yDj6.cpp | #include <bits/stdc++.h>
using namespace std;
class node{
public:
int open;
int close;
int full;
node(char a)
{
open=(a=='(');
close=(a==')');
full=0;
}
};
class St{
vector<node> arr;
public:
St(int n)
{
arr=vector<node>(4*n);
}
node combine(no... | ALGO | 0.999891 | 4.110659 |
ae537659-b550-48e4-95e5-b42ff7652f0d | king-yyf/cpcode | codeforce/cr836/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define f0(e) for(int i = 0; i < (e); ++i)
#define f1(e) for(int i = 1; i <= (e); ++i)
#define f2(i,e) for(int i = 0; i < (e); ++i)
#define fr(i,a,b) for (int i=(a)... | ALGO | 0.999374 | 3.83049 |
000afcac-2192-4bc3-87c3-dec1d57da734 | WAVM/Wavix | llvm/lib/CodeGen/GlobalMerge.cpp | #include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/ADT/Twine.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/BasicBlock.h"
#in... | TOOL | 0.995573 | 7.709938 |
1b88ae2c-22db-4a4d-bd7f-a9eaf63069ee | wuiw/HybridDBT-For-RISCV | src/tools/readBytecode.cpp | #include <lib/tools.h>
#include <stdio.h>
#include <stdlib.h>
#include <types.h>
#define SWAP_2(x) ((((x)&0xff) << 8) | ((unsigned short)(x) >> 8))
#define SWAP_4(x) (((x) << 24) | (((x) << 8) & 0x00ff0000) | (((x) >> 8) & 0x0000ff00) | ((x) >> 24))
#define FIX_SHORT(x) (x) = SWAP_2(x)
#define FIX_INT(x) (x) = SWAP_4(... | TOOL | 0.889068 | 3.124766 |
35df7e50-d732-41f7-b294-5040615895f8 | chopralab/candock | lib/program/linkfragments.cpp | #include "candock/program/linkfragments.hpp"
#include <boost/filesystem.hpp>
#include "statchem/helper/grep.hpp"
#include "statchem/helper/path.hpp"
#include "statchem/helper/logger.hpp"
#include "candock/linker/linker.hpp"
#include "statchem/modeler/modeler.hpp"
#include "statchem/fileio/fileout.hpp"
#include "stat... | TOOL | 0.85869 | 4.07219 |
8d49b366-f435-4c15-8396-4cc263f61c3b | devararendy/tcp_proxy | sdk/boost_1_77_0/libs/geometry/doc/src/examples/algorithms/discrete_frechet_distance.cpp | //[discrete_frechet_distance
//` Calculate Similarity between two geometries as the discrete frechet distance between them.
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/linestring.hpp>
int main()
{
typedef boost::geometry:... | ALGO | 0.997548 | 6.731157 |
48725bb7-365a-4a08-8764-233a1ed5e205 | 0206neha/Programing | Searching and Sorting/MergeSort.cpp | #include<bits/stdc++.h>
using namespace std;
void merge(vector<int>&arr,int s,int mid,int e)
{
int n1=mid-s +1;
int n2=e -mid;
int i=0;
vector<int>arr1(n1);
int j=0;
vector<int>arr2(n2);
int k=s;
for(int i=0;i<n1;i++){
arr1[i]=arr[s+i];
}
for(int j=0;j<n2;j++){
... | ALGO | 0.999989 | 4.765214 |
c9f49659-1e2e-42e5-9b08-928fc55c1a28 | nteno555/usaco | Silver/clumsycows.cpp | #include <deque>
#include <stack>
#include <fstream>
#include <bits/stdc++.h>
using namespace std;
string parantheses;
int ans=0;
deque<char> q;
void alg() {
stack<char> s;
for (int i=1; i<parantheses.length(); i++) {
if (q.empty()) q.push_back(parantheses[i]);
else if (parantheses[i] == ')' &... | ALGO | 0.988045 | 4.288016 |
87fe5031-4145-4158-a122-73d24ffafc98 | uncle-lu/surf-the-internet | luogu/8686.cpp | #include <cstdio>
const int N = 1e6+10;
int father[N], n, line[N];
int find_father(int x) {
return father[x] == x ? x : father[x] = find_father(father[x]);
}
int main() {
scanf("%d", &n);
for(int i = 1; i <= 1e6; i++)
father[i] = i;
for(int i = 1; i <= n; i++) {
scanf("%d", &line[i]);... | ALGO | 0.999992 | 4.000384 |
c03d861d-b3b8-4fef-b734-7e8ec5e587fb | tianyi5309/icpc_2018f | mini-contest-1/f.cpp | #include <iostream>
using namespace std;
int main() {
int tcn; cin >> tcn;
while (tcn--) {
// Notice that you would have to move a plate at most once. In any situation in which you move it twice, the first time is redundant.
// Also notice that a lot of plates have to be moved. In fact, everyth... | ALGO | 0.999453 | 3.834506 |
ca36f8ef-8b53-4758-a6db-9efd97477cca | isaaclo97/programacion-competitiva | Problemas/Acepta el Reto/267.cpp | #include <bits/stdc++.h>
#define INF 0x3F3F3F3F
using namespace std;
int main()
{
int l1,l2,dm;
while(scanf("%d%d%d",&l1,&l2,&dm)==3 && (l1!=0 || l2!=0 || dm!=0))
{
int n=4;
if (l1 > dm) {
n += 2 * (l1 / dm);
if (l1%dm == 0) n = n - 2;
}
if (l2 > dm)... | ALGO | 0.999576 | 3.345076 |
547b045b-d6a7-4b45-ab9d-bda2dedbdf8e | MereyPolatkhan/competitive_programming_and_algorithms | _leetcode/125.cpp | class Solution {
public:
bool isUppercase(char c) {
if (int(c) >= 'A' && int(c) <= 'Z') {
return true;
}
return false;
}
char lower(char c) {
return (char)((int)c + 32);
}
bool isChar(char c) {
if ((int(c) >= 'a' && int(c) <= 'z') ||
... | ALGO | 0.99939 | 5.655158 |
31776547-291b-4e5c-8da1-8a028f8cf4fc | Bikranta3121/Placewit | 42. Trapping Rain Water.cpp | class Solution {
public:
int trap(vector<int>& height) {
int n=height.size();
vector<int> left(n,0);
vector<int> right(n,0);
int max_left=0;
int max_right=0;
for(int i=0;i<n;i++)
{
max_left=max(max_left,height[i]);
max_right=max(max_rig... | ALGO | 0.999971 | 6.732647 |
4a336e17-210d-4cbb-a6a6-ac174c73d5fe | xinshuoLei/Computer-Architecture-UIUC | Lab11/utils.cpp | #include "utils.h"
uint32_t extract_tag(uint32_t address, const CacheConfig& cache_config) {
// TODO
if (cache_config.get_num_tag_bits() < 32) {
uint32_t tag_bits = (1 << cache_config.get_num_tag_bits()) - 1;
uint32_t shift_amout = cache_config.get_num_block_offset_bits() + cache_config.get_num_index_bits(... | TOOL | 0.900628 | 5.455953 |
f5e51fe4-9bd4-443a-905c-5d999680d7c4 | hoosong0235/acmicpc | 코딩 테스트 준비 - 연습/브루트 포스 - 기타/2143.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t; cin >> t;
int n; cin >> n;
vector<int> na(n + 1); for (int i = 1; i < n + 1; i++) cin >> na[i];
vector<int> ns(n + 1); ns[0] = 0; for (int i = 1; i < n + 1; i++) ns[i] = ns[i - 1] + na[i];
int m; cin >> m;
vector<int> ma(m + 1); ... | ALGO | 0.999927 | 3.707339 |
b684b787-69d4-4128-befc-0e228fc43339 | pingchungchang/CP | CF1872D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fs first
#define sc second
void solve(){
ll n,a,b;
cin>>n>>a>>b;
if(a == b){
cout<<"0\n";
return;
}
ll L = a*b/__gcd(a,b);
ll c1 = n/a-n/L;
ll c2 = n/b-n/L;
ll ans = (n+n-c1+1)*(c1)... | ALGO | 0.999961 | 4.18022 |
a1f6ade3-d47b-4134-be47-3d8077c503a0 | AhmedZanatii/Mi_Card | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
4466d7f1-2735-4cf5-ac58-163819e8631c | melonattacker/atcoder | contests/tenkei/46.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 1 << 30;
const long long INF = 1LL << 60;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return ... | ALGO | 0.999956 | 4.174598 |
4e3c3fd8-8ee1-4bd7-b1e1-df0ccf8cc7e6 | bioyoshoo/atcoder | Boot-camp/Hard-lap2/92.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> path(N, 0);
for (int i = 0; i < M; i++) {
int a, b; cin >> a >> b; a--; b--;
if (a == 0) path[b]++;
else if (b == 0) path[a]++;
else path[a]++, path[b]++;
}
bool flag ... | ALGO | 0.999997 | 5.015888 |
566eaca0-c70a-4dbf-ab2b-4d066d4a9ae1 | Pranee8632/File_Compressor | huffman.cpp | #include "huffman.hpp"
// The createArr function initializes nodes for ASCII characters, which are represented by values ranging from 0 to 127
//The standard ASCII character set includes 128 characters, represented by the integers 0 through 127
void huffman::createArr() {
for (int i = 0; i < 128; i++) {
ar... | ALGO | 0.997355 | 4.533782 |
181f64ac-db2b-4324-a07c-9b7bb7adcc75 | ameen-sid/Supreme-3.0 | Week - 3/Arrays, Time Complexity & Space Complexity/Assignments/Common_Elements_In_3_Sorted_Arrays.cpp | #include<iostream>
#include<vector>
#include<set>
using namespace std;
// GFG
vector<int> commonElements(int A[], int B[], int C[], int n1, int n2, int n3) {
vector<int> ans;
set<int> st;
int i, j, k;
i = j = k = 0;
while (i < n1 && j < n2 && k < n3) {
if (A[i] == B[j] && B[j] == C[k]) {
st.insert(A[i]);... | ALGO | 0.998691 | 4.306879 |
375f7976-1804-43b3-aab5-56b5c8718a14 | komal-chavan9090/Leetcode_problems_DSA | 0345-reverse-vowels-of-a-string/0345-reverse-vowels-of-a-string.cpp | class Solution {
public:
bool isVovel(char c) {
return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' ||
c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U';
}
string reverseVowels(string s)
{
int i=0;
int j=s.length()-1;
int n=s.length();
... | ALGO | 0.999952 | 6.458764 |
9606d2b4-b673-4605-903f-5da701a2f933 | abdirakhman/Olymp | Atcoder/agc003/A/main.cpp | /**
SXR0aXAkI0JwbXptI3FhI3Z3I293bCNqY2IjUG0jMCNicG0jVHFkcXZvLyNCcG0jQW10bjBhY2phcWFicXZvLyNNYm16dml0MSNWdyNhdGN1am16I2tpdiNhbXF9bSNQcXUjVnd6I0F0bW14MSNQcWEjaXptI2l0dCNicHF2b2EjUXYjYnBtI3BtaWRtdmEjaXZsI3d2I21pemJwMSNFcHcjcWEjYnBtem0ja2l2I3F2Ym16a21sbSNRdiNQcWEjeHptYW12a20jbXtrbXhiI0lhI3BtI3htenVxYmJtYnBHI1BtI3N2d2VtYnAj... | ALGO | 0.999979 | 3.938041 |
00a29956-0b18-4a92-ba2f-40181bedba8d | Atidzhe13/zadacha-1-zoomagazin | zadacha 3 cirk/zadacha 3 cirk.cpp | // zadacha 3 cirk.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <stdio.h>
int main()
{
float money;
printf("money given to lili = ");
scanf_s("%f", &money);
float math;
printf("price of math textbook = ");
scanf_s("%f", &math);
float bu... | ALGO | 0.996504 | 3.076353 |
e6e3c459-f9d1-4d06-89bc-ce2a555d6686 | fractal-platform/fractal-cdt | libraries/libc++/libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex_try_to_lock.pass.cpp | // <shared_mutex>
// template <class Mutex> class shared_lock;
// shared_lock(mutex_type& m, try_to_lock_t);
#include <shared_mutex>
#include <thread>
#include <vector>
#include <cstdlib>
#include <cassert>
std::shared_timed_mutex m;
typedef std::chrono::system_clock Clock;
typedef Clock::time_point time_point;
ty... | TEST | 0.93318 | 5.161785 |
a9197d71-fc5a-4e65-be8e-f77782381a3b | sijaykr/code | comapare.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cout<<"Enter your Numbers::"<<endl
;
cout<<"enter your first number :";
cin>>a;
cout<<"Enter your second number:";
cin>>b;
if(a>b){
cout<<a<<" is greater than"<<b;
}
else{
cout<<b<<" is greater than... | ALGO | 0.997887 | 3.001987 |
05d1c673-3ca9-48c9-ba9b-ce49b2dbc6dc | Anjalisharma011/GeeksforGeeks-questions | Difficulty: Basic/Minimum move to front operations/minimum-move-to-front-operations.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to find the minimum number of moves required.
int minMoves(vector<int> &arr) {
// code here.
int n=arr.size();
int count=n;
for(int i=n-1;i... | ALGO | 0.999842 | 6.48313 |
1c46cfae-92c2-43dd-9050-4addd86015ff | kukjinman/SWstudy | Algorithm_cpp/AlgoSpot/Greedy/Boggle/sol.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
const int BOARD_SIZE = 5;
vector<pair<int, int>> aroundCoordinates = {
make_pair(1, 0), // 우
make_pair(1, 1), // 우상단
make_pair(0, 1), // 상
make_pair(-1, 1), // 좌상단
make_pair(-1, 0), // 좌
make_pair(-1, -1), // 좌하단
... | ALGO | 0.999382 | 5.160434 |
f737f3f8-21b4-4190-97ff-5c1553ec63ca | raincross7/code-similarity | codes/train_code/problem109/problem109_464.cpp | #include <bits/stdc++.h>
#include<iostream>
using namespace std;
int main()
{
stack<char>s ;
string str,m;
cin>>str;
for(int i=0;i<str.length();i++){
if(str[i]!='B')
s.push(str[i]);
else{
if(!s.empty())
s.pop();
}
}
while (!s.emp... | ALGO | 0.999915 | 4.057794 |
5584f4f3-7934-4cea-8873-934fd222ccde | sorteg/Wallbreakers | week1/Arrays/flipping_an_image.cpp | class Solution {
public:
vector<vector<int>> flipAndInvertImage(vector<vector<int>>& A) {
for(int row = 0; row < A[0].size(); row++){
reverse(A[row].begin(), A[row].end());
for(int col = 0; col < A.size(); col++){
if(A[row][col] == 0){
A[r... | ALGO | 0.999727 | 6.398757 |
26e26257-cd79-4324-8166-a76b16b5bf78 | hirezy/ImageProcessing100 | Question_01_10/answers_cpp/answer_9.cpp | #include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
#include <math.h>
// gaussian filter
cv::Mat gaussian_filter(cv::Mat img, double sigma, int kernel_size){
int height = img.rows;
int width = img.cols;
int channel = img.channels();
// prepare output
cv::Mat out = cv::Mat::zeros(h... | TOOL | 0.916613 | 4.888846 |
7041bc28-9c0a-4f27-87e9-384bb4237a80 | yuukidach/OnlineJudge | LeetCode/bit/Q477_TotalHammingDistance.cpp | class Solution {
public:
int totalHammingDistance(vector<int>& nums) {
int len = nums.size();
int res = 0;
for(int i = 0; i < sizeof(int)*8; ++i) {
int bits[2] = {0, 0};
for(int j = 0; j < len; ++j){
if (nums[j] & (1 << i)) bits[1]++;
... | ALGO | 0.999987 | 6.105601 |
709824b0-9350-4b14-9608-22a206a5ef01 | tangziyi001/competitive-programming | DP/PrefixSum/DiamondCollectorBronze.cpp | /*
* USACO 2016 US Open Contest, Bronze 1
* Coded by Ziyi Tang
* Prefix Sum
*/
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <list>
#include <vector>
#incl... | ALGO | 0.999749 | 3.413134 |
f29ae6b7-ae01-431b-acc1-6a6792465fa0 | chieh-eric/CS-Algorithm | Programming/Closet_pair/Solution/bruteForce.cpp | #include <iostream>
#include <math.h>
#include "bruteForce.h"
float dist(Point p1, Point p2)
{
return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
}
float bruteForce(Point p[], int size)
{
int min_val = 100001;
for (int i = 0; i < size; i++)
{
for (int j = i + 1; j < siz... | ALGO | 0.999881 | 4.163041 |
a083f108-e553-4608-9046-7664b8e9b7ba | VenkataAnilKumar/LeetCode | C++/remove-vowels-from-a-string.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
string removeVowels(string S) {
return accumulate(S.cbegin(), S.cend(), string{},
[](const auto &a, const auto &b) {
static const unordered_set<char> lookup = {'a', 'e', 'i', 'o', 'u'};
... | ALGO | 0.99876 | 6.48745 |
01723b14-46a1-4cff-a262-4ec5c95f8faf | ishandutta2007/codeforces | sdya/normal/30/A.cpp | #include <iostream>
#include <string.h>
#include <vector>
#include <string>
#include <cstring>
#include <bitset>
#include <map>
#include <set>
using namespace std;
long long a, b, n;
int main()
{
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
cin >> a >> b >> n;
for (long long i = -2000; i... | ALGO | 0.999959 | 3.491009 |
0062ed19-a016-432f-82f7-66ff65e16d2c | rmottola/Arctic-Fox | intl/icu/source/i18n/visibledigits.cpp | #include <math.h>
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
#include "cstring.h"
#include "decNumber.h"
#include "digitlst.h"
#include "uassert.h"
#include "visibledigits.h"
static const int32_t kNegative = 1;
static const int32_t kInfinite = 2;
static const int32_t kNaN = 4;
U_NAMESPACE_BEGIN
void V... | TOOL | 0.968338 | 7.43853 |
1838729b-088d-4dbf-8302-181aaffc21e9 | wicknix/AF-OSX-PPC | gfx/skia/trunk/src/utils/SkSHA1.cpp | #include "SkTypes.h"
#include "SkSHA1.h"
#include <string.h>
/** SHA1 basic transformation. Transforms state based on block. */
static void transform(uint32_t state[5], const uint8_t block[64]);
/** Encodes input into output (5 big endian 32 bit values). */
static void encode(uint8_t output[20], const uint32_t input[... | ALGO | 0.932012 | 7.223976 |
b671c40b-5859-49ed-9034-5e37795d80ed | KafuuNeko/CoolQCalculator | Calculator-CoolQ/util/kmp.cpp | #include "kmp.h"
#include <string.h>
size_t* KMP_MakeNext(const char* substr, size_t len, bool optimize)
{
size_t* next = new size_t[len];
next[0] = util_kmp::npos;
size_t j = 0;
size_t k = next[j];
while (j < len - 1)
{
if (k == util_kmp::npos || substr[j] == substr[k])
{
++j;
if (k == util_kmp::... | ALGO | 0.998812 | 5.436355 |
25cc9335-bcb7-44d5-aa1b-b34afd6ec02b | AvinandanBose/C_Plus_Plus_Intermediate_II | twodim_recur_15.cpp | // Find Largest Number using Recursion in a 2D array
#include <iostream>
int input(int[][10], int, int);
void display(int, int, int[][10]);
int findLargest(int[][10], int, int, int, int, int);
using namespace std;
int main()
{
int a[10][10];
int m, n;
cout << "Enter row for Matrix A: " << endl;
cin >... | ALGO | 0.99962 | 4.784789 |
16b1f49f-5249-43b0-b7e4-cece15893962 | ajmat6/DSA | L_4Sum.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
// // brute force: using set, sorting and n^4 time
// int n = nums.size();
// set<vector<int>> st;
// for(int i=0; i<n; i++) {
// for(int j=i+1; j<n; j++) {
// for(int k=... | ALGO | 0.999967 | 5.814586 |
7941a5ca-83f6-4b5e-9d25-5e7d150d7492 | DrSwad/CP | Submissions/Codeforces/1796/E. Colored Subgraphs.cpp | #include <bits/stdc++.h>
using namespace std;
void test_case() {
int n;
cin >> n;
vector<vector<int>> adj(n);
for (int i = 0; i < n - 1; i++) {
int u, v;
cin >> u >> v;
u--, v--;
adj[u].push_back(v);
adj[v].push_back(u);
}
auto check = [&](int min_len) {
vector<int> degree(n, 0);... | ALGO | 0.999318 | 5.11562 |
a08ed6ca-4d6c-4525-a5d9-2dc4214b1001 | westsider/UnrealEngine-staging-4.20 | Engine/Source/ThirdParty/openexr/OpenEXR-1.7.1/openexr-1.7.1/exrenvmap/blurImage.cpp | //-----------------------------------------------------------------------------
//
// function blurImage() -- performs a hemispherical blur
//
//-----------------------------------------------------------------------------
#include <blurImage.h>
#include <resizeImage.h>
#include <cstring>
#include "Iex.h"
#include <i... | ALGO | 0.976237 | 6.10308 |
8f650bf7-53c3-4d1e-8a6a-5c96c1052533 | jksgfsdfd/DSA | leetcode/binary_tree/symmetric_tree_recursion.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.423878 |
ae6fabe1-97a6-4d84-b710-dadbd86b947b | WalterKusnezow03/ue_bezier | bezierCurve.cpp | #include "bezierCurve.h"
bezierCurve::bezierCurve()
{
EinheitsValue = 100;
}
bezierCurve::~bezierCurve()
{
}
/// @brief will calculate the bezier tangential spline for you, EXPECTS ANCHORS TO BE ALONG X AXIS!
/// @param ref reference anchor points (p0s and p3s)
/// @param output output vector to save in, MUST BE... | ALGO | 0.990142 | 4.344309 |
39e98401-bf51-4968-80f5-b6d15b396e23 | GoatGirl98/Walkthrough-of-ACCoding-in-BUAA | 2020秋-计算机导论(英文)/C2-2020秋-计算机导论(英文)第二次上机/BUAAOJ3832 高精度 斐波那契.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
#define buf 10000
#define maxn 3000
#define radix 100000000
typedef unsigned long long ll;
char readBuf[buf];
struct BigInteger {
ll num[maxn];
int size;
bool isPositive;
BigInteger() :size(0) {
memset(num, 0, sizeof(num));
}
BigInte... | ALGO | 0.999876 | 4.197494 |
0d2d18d0-6422-4ac8-b5b3-a8dfd29738b0 | FailN0t/sfml_12_2 | sfml_12_2/sfml_12_2.cpp | #include <SFML/Graphics.hpp>
#include <iostream>
using namespace sf;
void circle(Shape& shape) {
shape.setPosition(shape.getPosition().x + 4, shape.getPosition().y + 4);
}
void circleMgnum(CircleShape& shape, CircleShape& shape2, RenderWindow& window) {
if (shape.getPosition().x <= 0) {
shape2.setPosition((float)wi... | TOOL | 0.950579 | 3.564448 |
c1fdfd7f-796e-4cc7-9fd1-f8c005880dc2 | sarvex/leetcode-chicken | solution/0100-0199/0171.Excel Sheet Column Number/Solution.cpp | class Solution {
public:
int titleToNumber(string columnTitle) {
int res = 0;
for (char c : columnTitle) {
res = res * 26 + (c - 'A' + 1);
}
return res;
}
}; | ALGO | 0.999835 | 6.509163 |
04d6564f-2491-4cf1-bcde-72acd35564e7 | linneszyx/CP-Problems | 338-counting-bits/counting-bits.cpp | class Solution {
public:
vector<int> countBits(int n) {
vector<int> ans;
// iterating fromt 0 to n
for(int i = 0; i<=n; i++)
{
// sum is initialised as 0
int sum = 0;
int num = i;
// while num not equals zero
while(num != 0)
{
// ... | ALGO | 0.999986 | 6.294957 |
acc88f92-0be7-44aa-8f4f-9c10d5399f2e | dketterer/advent-of-code-2021 | day06-cxx/main.cpp | #include <fstream>
#include <vector>
#include <iostream>
#include <sstream>
#include <unordered_map>
using namespace std;
long long reproduce(vector<long long> lanternfish, int days) {
for (int day = 0; day < days; day++) {
vector<long long> lanternfish_next(9, 0);
lanternfish_next[8] = lanternfis... | ALGO | 0.996866 | 5.509048 |
2dd83ca5-9941-4332-b396-58eba15afccd | snichols/boost_1_61_0 | libs/graph/example/astar_maze.cpp | // This program uses the A-star search algorithm in the Boost Graph Library to
// solve a maze. It is an example of how to apply Boost Graph Library
// algorithms to implicit graphs.
//
// This program generates a random maze and then tries to find the shortest
// path from the lower left-hand corner to the upper righ... | ALGO | 0.999936 | 6.914523 |
634ca2f9-53ce-4d41-bcaa-bffc5854d1f6 | akanerva/CSES | nearest_smaller_value/main.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* akanerva
* Poistetaan säiliöstä luvut jotka eivät voi olla enää vastauksia.
*
*/
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
set<pair<int, int>> luvut;
for (int i = 1; i <= n; ++i) {
int x;... | ALGO | 0.999951 | 3.881993 |
594faa74-161d-49ee-881e-e10d67790c38 | nicro23/worksheets | p1/fe/test.cpp | #include <iostream>
using namespace std;
int main() {
char text[] = "boogas is an amazing countr source";
int firstWordLength = 0, wordBeforeLastLength = 0, lastWordLength = 0;
int wordBeforeLastIndex = -1;
int spaceCount = 0;
for (int i = 0; text[i] != '\0'; i++) {
if (text[i] == ' ') {
spaceCount++;
}
... | ALGO | 0.999556 | 3.519308 |
dd650c7b-c7af-4923-8520-d76d874a8f2b | diwei00/C_Exercise | 亲密字符串.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
bool buddyStrings(char* s, char* goal)
{
int len1 = strlen(s);
int len2 = strlen(goal);
if (len1 != len2)
{
return false;
}
int flag = 0;
//Ĵ
if (strcmp(s, goal) == 0)
{
char* pa = (char*)malloc(sizeof(char) *... | ALGO | 0.999908 | 3.371782 |
4c41c775-1c7d-49f5-9525-3f053d299e4a | mikelxk/lc | cpp/Array_Hashing/75.sort-colors.cpp | #include "../std.hpp"
class Solution {
public:
void sortColors(vector<int> &nums)
{
multiset<int> ms(nums.begin(), nums.end());
nums = vector(ms.begin(), ms.end());
}
}; | ALGO | 0.999739 | 5.724243 |
e739d52d-05bf-4112-97ce-f14e3e877036 | kikacika/prog | task_list.cpp | #include <iostream>
#include <string>
using namespace std;
struct list {
int inf;
list* next;
list* prev;
};
void push(list*& h, list*& t, int x) {
list* r = new list;
r->inf = x;
r->next = nullptr;
if (!h && !t) {
r->prev = nullptr;
h = r;
}
else {
t->next = r;
r->prev = t;
}
t = r;
}
void inser... | ALGO | 0.999331 | 4.144021 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.