uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
2da09701-1fc7-4aca-b44c-9de96ef59878 | CyanMARgh/multichess | chess/chess.cpp | #include "chess.h"
#include <vector>
#include <bitset>
#include <algorithm>
std::vector<sf::Vector2i> Board::PossibleMoves(const uint8_t& x, const uint8_t& y) {
Figure figure = map[GetField(x, y)];
std::vector<sf::Vector2i> ans;
using namespace figures;
switch (MASKF & figure) {
case NONE: break;
case ROOK:
... | ALGO | 0.893983 | 3.927373 |
f736372a-7c53-4659-9280-29cfdf2bf198 | vikashmalakar275/Data_Structure_and_Algorithm | takeUforward/Strivers_A2Z_DSA_Course/Patterns/Symmetric-Void_Pattern.cpp | /*
Problem Statement: Given an integer N, print the following pattern :
**********
**** ****
*** ***
** **
* *
* *
** **
*** ***
**** ****
**********
Here, N = 5.
Examples:
Input Format: N = 3
Result:
******
** **
* *
* *
** **
******
Input Format: N = 6
Result:
********... | ALGO | 0.999896 | 5.023897 |
a535ae2d-93ac-4693-abd0-80eb61e68f5b | sihcpro/DetectSimilarCodeWeb | userSource/Example 1/28.t10.296.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble
#define PI 3.14159265
//typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
typedef pair <int, int> pii;
typedef p... | ALGO | 0.999869 | 3.396315 |
7b2f0301-f82e-479a-a495-8cd19730e234 | avinashw50w/practice_problems | Othres/q.cpp | #include<stdio.h>
#include<stdlib.h>
#define getcx getchar_unlocked()
inline int input(){
int n =0;
char ch = getcx();
while(ch<33)
ch=getcx();
while(ch>=33){
n = (n<<3) + (n<<1) + (ch-'0');
ch = getcx();
}
return n;
};
int main(){
int t,n,i,j;
t=input();
int min,arr;
while(t--){
n=input();
min=input... | ALGO | 0.999307 | 3.103265 |
b6ad72fb-4ad4-409b-9d20-e91b7cc5de23 | mmaikel/DEFFEM_Postprocessor | deffem_postprocessor/src/FileParser.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include "enumerate.cpp"
#include <list>
#include <algorithm>
#include <math.h>
#include <iterator>
#include <map>
#include "../headers/FileParser.h"
using namespace std;
using namespace deffem;
ModelInfo FileParser::readSec... | TOOL | 0.924455 | 4.61923 |
1a777e55-52f6-4d7b-9586-8be1df1e042a | Next-Gen-UI/Code-Dynamics | LoveBabbar/14_DP/14_DP/29_max_path_sum_in_matrix.cpp | /*
link: https://practice.geeksforgeeks.org/problems/path-in-matrix3805/1
*/
// ----------------------------------------------------------------------------------------------------------------------- //
int maximumPath(int n, vector<vector<int>> mat)
{
int omax = 0;
vector<vector<int>> dp(n, vector<int>(n... | ALGO | 0.99998 | 5.269028 |
72565643-b325-4fb6-9e6e-281ca4be64ef | svanegas/programming_solutions | UVa/11506 - Angry Programmer/11506.cpp | #include <algorithm>
#include <iostream>
#include <iterator>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#includ... | ALGO | 0.999806 | 4.354847 |
df15e0eb-ec74-4798-aa3c-37dba26f50ca | WULEI7/WULEI7 | PAT往年真题/PAT模拟考试/甲级 2011年秋/C Battle Over Cities (25 分)(并查集).cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn=1010;
vector<int> G[maxn];//ڽӱ
int n,m,k,a,b,c,p[maxn],vis[maxn];
int find(int x)
{
return p[x]==x?x:p[x]=find(p[x]);
}//鼯
void unio(int a,int b)
{
int x=find(a),y=find(b);
if(x!=y) p[x]=y;
}
void init(... | ALGO | 0.999981 | 3.803704 |
b1a976c8-2752-431a-a99f-0fdc2fdd4cea | dmkz/competitive-programming | acmp.ru/1246.cpp | #include <stdio.h>
#include <iostream>
#include <cmath>
#include <cassert>
typedef long long ll;
ll gcd(ll a, ll b) {
return b == 0 ? a : gcd(b, a % b);
}
int main() {
int a, b = 1, c, d = 1;
char buf1[30], buf2[30], op;
scanf("%s %c %s", buf1, &op, buf2);
sscanf(buf1, "%d/%d", &a, &b);
sscan... | ALGO | 0.999944 | 4.985273 |
530e668a-788b-45f1-885e-6c327f0c9e21 | himanshu-rawat/Cplusplus | Daily Code Byte/simpleHCF.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int *numArr = new int[n];
for (int i = 0; i < n; i++)
{
cin >> numArr[i];
}
int lowest = numArr[0];
for (int i = 1; i < n; i++)
{
lowest = min(lowest, numArr[i]);
}
cout << lowest << endl;
... | ALGO | 0.999927 | 4.577612 |
3b8ef64e-29c2-4f98-ae4f-04af012b17bd | gauri-singh/LeetCodeQuestions | 525-contiguous-array/525-contiguous-array.cpp | class Solution {
public:
int findMaxLength(vector<int>& nums) {
unordered_map <int,int> map;
unordered_map <int,int> :: iterator it;
int sum=0,longestSub=0,currSub;
//if number is 1, we add +1
//if number is 0 we subtract -1
//if any time sum =0 , it means perfectly b... | ALGO | 0.99997 | 5.958674 |
f22d2bbc-527f-499c-ad9b-af38c53b9715 | GeorgeWagih-git/chat_list | 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 |
12aad29c-a660-4ee4-bd43-31b1588582bd | bioexcel/bioexcel-code-releases | GROMACS/gromacs-2018.3/src/gromacs/linearalgebra/gmx_lapack/dlaed6.cpp | #include <cmath>
#include "../gmx_lapack.h"
#include "gromacs/utility/real.h"
void
F77_FUNC(dlaed6,DLAED6)(int *kniter,
int *orgati,
double *rho,
double *d__,
double *z__,
double *finit,
... | ALGO | 0.999529 | 3.895819 |
665ba255-4ab4-4520-9e0c-73fbc384416a | applebuddy/BJAlgorithmStudy | BaekJoonPS/BaekjoonAlgorithmPS/Basic/경기결과_5523.cpp | /// MARK: - 경기결과_5523
#if 0
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(0); cin.tie(0);
int T; cin>>T;
int score[2] = {0,0};
while(T--) {
int A,B; cin>>A>>B;
if(A>B) score[0]++;
else if(A<B) score[1]++;
}
printf("%d %d\n",score[0],scor... | ALGO | 0.999553 | 5.062781 |
d96d0752-114a-466a-88c2-2183fad57d5c | ilachill/MK-TFHE | src/libtfhe/boot-gates.cpp | #ifndef TFHE_TEST_ENVIRONMENT
#include <cstdlib>
#include <iostream>
#include <random>
#include <cassert>
#include "tfhe_core.h"
#include "numeric_functions.h"
#include "lweparams.h"
#include "lwekey.h"
#include "lwesamples.h"
#include "lwekeyswitch.h"
#include "lwe-functions.h"
#include "lwebootstrappingkey.h"
#inclu... | ALGO | 0.995594 | 4.780503 |
c47af2bd-89ab-444f-830d-4d141c0d5078 | chaman-aggarwal/DSA-GCL-65 | Session4/C++/ValidAnagram.cpp | https://leetcode.com/problems/valid-anagram/
class Solution {
public:
bool isAnagram(string s, string t) {
if(s.size()!=t.size()){
return false;
}
vector<int> map(26, 0);
for(int i=0; i<s.size(); i++) {
map[s[i]-'a']++;
... | ALGO | 0.99994 | 6.783563 |
5a5acf0f-8936-4445-89c7-5fb414a481d0 | crownengine/crown | 3rdparty/bx/src/dtoa.cpp | #include <bx/cpu.h>
#include <bx/math.h>
#include <bx/string.h>
#include <bx/uint32_t.h>
#include <type_traits>
namespace bx
{
struct DiyFp
{
DiyFp()
{
}
DiyFp(uint64_t _f, int32_t _e)
: f(_f)
, e(_e)
{
}
DiyFp(double d)
{
union
{
double d;
uint64_t u64;
} u = { d };
in... | ALGO | 0.973536 | 5.725668 |
77a24bf0-d8d0-4f72-8866-e06b8cdfbf3d | seraph27/competitve-programming | codeforces/archive/C_Quests.cpp | #include <bits/stdc++.h>
#define ll long long
#define ar array
#define db double
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define rint(l, r) uniform_int_distribution<int>(l, r)(rng)
template<typename T> bool c... | ALGO | 0.999964 | 3.750142 |
0b1c0eef-db4a-4b8d-8e6a-dfc0835e175f | jsliyuan/boolean_functions | some_Tr_un1.cpp | #include "Galois_field.h"
#include "boolean_fun.h"
#include <iostream>
#include <cstring>
#include <fstream>
#include <assert.h>
using namespace std;
int main(){
int n=10;
Field f(10);
BooleanFun g(10);
int al = f.al;
double minU3 = 1;
double curU3;
vector<int> minRes;
ofstream outfile;
string t... | ALGO | 0.998918 | 3.684531 |
1656b466-2d06-4a94-bbb2-0782fdb99909 | cms-dev/con_test | batchgrader/sol/grader.cpp |
#include <stdio.h>
int add(int a, int b);
int main() {
int a, b;
scanf("%d %d", &a, &b);
printf("%d\n", add(a, b));
return 0;
}
| ALGO | 0.975803 | 3.510142 |
5262d4ce-4de4-421c-8d6d-ecf3f1d3b2bb | metahashorg/v8_vm | buildtools/third_party/libc++/trunk/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval_param.pass.cpp | // <random>
// template<class RealType = double>
// class piecewise_linear_distribution
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
#include <random>
#include <vector>
#include <iterator>
#include <numeric>
#include <algorithm> // for sort
#include <cassert>
#include <limits>... | ALGO | 0.999417 | 4.43274 |
721bd62b-3f11-421e-9396-227462a5fa42 | FairOh/android_frameworks_av | media/libstagefright/codecs/amrnb/common/src/l_shr_r.cpp | /*
Filename: /audio/gsm_amr/c/src/l_shr_r.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the L_shr_r function. Sync'ed up
with the current template and fixed tabs.
Description: Updated template. Changed function i... | ALGO | 0.996977 | 7.2722 |
82537890-dfd0-4e71-81c0-b63f66fdc1bf | pank3004/CPP-LANGUAGE | Array/6_Swap_Alternate_elm.cpp | #include<iostream>
using namespace std;
void printArray(int arr[], int n){
for(int i=0; i<n; i++){
cout<<arr[i]<<" ";
}
cout<<"\n";
}
void swapAlternat(int arr[], int n){
for(int i=1; i<n; i+=2){
swap(arr[i-1], arr[i]);
}
}
int main(){
int arrEven[10]={21,34,55,5,6,74,67,52,8,9};... | ALGO | 0.999215 | 4.450099 |
4ff11ff8-4930-4218-bf4c-8531b4ba8647 | AbhineetJain/Algorithmic-Programming | CodeChef/Practice/SNAPE.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<LL> VLL;
#define SI(n) scanf("%d", &n)
#define SLL(n) scanf("%lld", &n)
#define SULL(n) scanf("%llu", &n)
#define sortv(v) sort(v.begin(), v.end())
#define pb(x) push_back(x)
#de... | ALGO | 0.999754 | 3.761029 |
7c25d54e-7ca8-43a8-b43a-01e2fa5d4814 | Binteng16/Air-Quality-Control-UI | 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.998764 | 6.762122 |
d59572a5-50dd-4506-960f-ac5fbdfeee8c | 1zay/ying | libraries/AP_Motors/AP_MotorsHeli.cpp | /*
* AP_MotorsHeli.cpp - ArduCopter motors library
* Code by RandyMackay. DIYDrones.com
*
*/
#include <stdlib.h>
#include <AP_HAL/AP_HAL.h>
#include "AP_MotorsHeli.h"
#include <GCS_MAVLink/GCS.h>
extern const AP_HAL::HAL& hal;
const AP_Param::GroupInfo AP_MotorsHeli::var_info[] = {
// 1 was ROL_M... | TOOL | 0.850748 | 7.53564 |
0661ec73-c249-4c1c-a0a4-57176da28622 | neostreet/poker_odds_calculators | win_pct.cpp | #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
#define MAIN_MODULE
#include "poker_hand.h"
#define MAX_LINE_LEN 1024
static char line[MAX_LINE_LEN];
static char usage[] = "usage: win_pct (-debug) (-saw_flop) (-premium) (-not_premium)\n"
" (-showdown) (-no_showdown) filename\n";
sta... | TOOL | 0.908987 | 4.317564 |
6976ebbf-d95f-479e-aad7-6b4282d06fbf | ishandutta2007/codeforces | yp155136/normal/1023/B.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <utility>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <cassert>
#include <iomanip>
#include <bitset>
using namespace std;
typedef lo... | ALGO | 0.999978 | 3.350449 |
928ed923-c3e3-404f-9c06-57d89531a271 | param3107/Strivers-SDE-Sheet-Challenge | 31IntersectionOfTwoLinkedLists.cpp | #include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
// class Node
// {
// public:
// int data;
// Node *next;
// Node()
// {
// this->data = 0;
// next = NULL;
// }
// Node... | ALGO | 0.999928 | 4.289738 |
cf7ca370-6c59-459c-a880-b7173cc962f9 | 260058433/LeetCode | src/164_MaximumGap.cpp | #include <vector>
#include <algorithm>
using std::vector;
using std::max;
using std::min;
class MaximumGap {
public:
int maximumGap(vector<int> &nums) {
if (nums.size() < 2)
return 0;
int n = nums.size();
int minNum = nums[0], maxNum = nums[0];
for (int i = 1; i < n; ++... | ALGO | 0.999792 | 5.291816 |
746113e3-9acf-4c8f-9f7f-3cb6a8b42cb6 | LuckyN510/CODE_PTIT | C/C03019.cpp | #include<stdio.h>
#include<math.h>
#define ll long long
int tn(int n) {
int lat = 0, tmp = n;
while(n != 0) {
lat = lat * 10 + n % 10;
n /= 10;
}
if(tmp == lat) {
return 1;
} else {
return 0;
}
return lat == tmp;
}
int chiahet(int n) {
int sum = 0;
while(n != 0) {
sum += n % 10;
n /= 10;
}
if(s... | ALGO | 0.999062 | 4.636655 |
a5ef130c-a415-4065-bd29-3b8abfd9e8d3 | hst005/CODZEN-EXAMPLES | DIJKSHTRA'S ALGO.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int findminver(int *d,bool *visited,int n){
int max=INT_MAX;
int ind=-1;
for(int i=0;i<n;i++){
if(!visited[i]){
if(max>d[i]){
max=d[i];
ind=i;
}
}
}
return ind;
}
void dijkshtra(int **edges,int n){
bool *visited=new bo... | ALGO | 0.999987 | 3.941351 |
31740342-751e-42df-9384-2f4e81422d2b | ThisIsGagan19/daily_code_challenge | leetcode/2024_8_august/c++/01_number_of_senior_citizens.cpp | // TIME COMPEXITY
// O(n)
// SPACE COMPEXITY
// O(1)
// CODE
class Solution {
public:
int countSeniors(vector<string>& details) {
int cnt = 0;
for(int i = 0; i < details.size(); i++){
int first = details[i][11] - '0';
int second = details[i][12] - '0';
int age ... | ALGO | 0.998483 | 6.331459 |
07c5f2e5-0912-4679-943b-db749258b9a1 | davidgregoriom/Programacion | C++/Estructura de Datos y Algoritmos/2022/TodaAsignatura/Practicas/P5-EDA/Practica5.cpp | /*
Estructuras de Datos y Algoritmos
Práctica V
Alumnos:
* Alejandro Riego Velasco
* Jesús Cuesta Bartolomé
*/
#include <iostream>
#include <vector>
#include <memory>
#include <algorithm>
using namespace std;
typedef shared_ptr<pair<int,int>> Ficha; //Creamos el tipo "Ficha"
vector<Ficha> Generar... | ALGO | 0.997804 | 5.054508 |
4baed07d-e37e-40d8-bd43-721bf5a18d1f | thanhdat317/code-c-ptit | c06026.cpp | #include<stdio.h>
#include<string.h>
#include<ctype.h>
#include<stdlib.h>
struct word{
char data[100];
int fre;
};
typedef struct word word;
word a[1005];
int sl =0;
int findPos(char c[]){
for(int i = 0 ; i<sl; i++){
if(strcmp(a[i].data,c)==0){
return i;
}
}
return -1;
}
int tn(char c[]){
int l =0, r= str... | ALGO | 0.999824 | 3.306036 |
4fa453d9-00fa-46f1-9117-52aa492d7408 | deep1020/Operating-System-Coursework | Process/multichildren.cpp | #include <iostream>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <cstdlib>
using namespace std;
int main(){
int pid[3];
pid[0] = fork();
if (pid[0] > 0)
{
cout << "[parent] 1 pid = " << getpid() << endl;
pid[1] = fork();
if (pid[1] > 0)
... | ALGO | 0.993734 | 4.505277 |
99db3dfc-c020-4f0b-9ed0-b20d34cddcb0 | Sid1608/coding-blocks | Algorithm-STL/multimaps.cpp | //Author:Siddharth Akar
#include <iostream>
#include<cstring>
//implemeted using self balaning bst
#include<map>
using namespace std;
#define ull unsigned long long int
#define ll long long int
int main()
{
//can have duplicate keys
multimap<char,string> m;
int n;
cin>>n;
for(int i=0;i<n;i++){
... | ALGO | 0.999422 | 3.836894 |
d6f73609-fc70-4d0a-b774-73b836f7e48a | AmamulHaq/NumericalMethod | simson3_8Integration.cpp | #include <bits/stdc++.h>
using namespace std;
//define fuction as asked in question
#define f(x) (cos((x) * M_PI / 180.0))
int main() {
float x0, u, l, h, Y = 0;
int n;
cout << "Enter lower limit (in degrees): ";
cin >> l;
cout << "Enter upper limit (in degrees): ";
cin >> u;
cout << "Ente... | ALGO | 0.999862 | 4.605894 |
c65d0673-1090-4615-950e-11269db2aae0 | svd-prasad/CodeChef | June_LunchTime_2014/CoPrimeTriples/CoPrimeTriples.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
int GCD(unsigned long int a, unsigned long int b)
{
unsigned long int r;
while(b != 0)
{
r = a % b;
a = b;
b = r;
}
return a;
}
int main()
{
unsigned long int i, n, *a, tripl... | ALGO | 0.99989 | 3.901265 |
a890f1d4-c556-4853-b5e5-63545015fb56 | huxingyi/autoremesher | thirdparty/cgal/CGAL-5.1-beta1/examples/Mesh_3/mesh_two_implicit_spheres_with_balls.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Mesh_triangulation_3.h>
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Labeled_mesh_domain_3.h>
#include <CGAL/Mesh_domain_with_polyline_features_3.h>
#include <CGAL/make_mesh_3.h>
// ... | ALGO | 0.997956 | 7.321283 |
69d41848-f981-48f0-ad70-074d84e18b27 | pachauriyash/LeetCode-Solutions | 0061-rotate-list/0061-rotate-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* rotateRight... | ALGO | 0.999992 | 5.922738 |
c80b438c-c073-46aa-be00-75a094bd03ed | JoshuaHernandezAl/ProgrammingOldStuff | Analisis/reglasDeSimpson/NodoP.cpp | #include "NodoP.h"
NodoP::NodoP(void){
sig = NULL;
}
NodoP::NodoP(Termino d, NodoP* s){
dato = d;
sig = s;
}
void NodoP::muestraDatos(void){
cout << "|" << dato << "|";
if(sig == NULL)
cout<< "NULL|";
else
cout<< " -> " << sig << "| ";
}
void NodoP::muestraDato(void){
cout <... | TOOL | 0.881274 | 3.500856 |
ab489e21-d7cb-41e0-96cf-65004a5b584e | kinantanbagaspati/leetcode-submissions | 0885-spiral-matrix-iii/0885-spiral-matrix-iii.cpp | class Solution {
public:
vector<vector<int>> spiralMatrixIII(int rows, int cols, int rStart, int cStart) {
vector<vector<int>> ans;
vector<int> coor; coor.push_back(rStart); coor.push_back(cStart);
ans.push_back(coor);
for(int i=1; ans.size() < rows * cols; i++){
if(i%2){... | ALGO | 0.999885 | 4.642972 |
d6d4a648-3aaf-4217-99b8-33a4a8cc14b9 | honeyvikash/Leetcode_Solved_Problems | 0496-next-greater-element-i/0496-next-greater-element-i.cpp | class Solution {
public:
vector<int> nextGreaterElement(vector<int>& a1, vector<int>& a2) {
// unique hone ka fayda uthate hue yaha
unordered_map<int,int>m;
int n=a2.size();
vector<int>v;
stack<int>st;
for(int i=n-1;i>=0;i--)
{
while(!st.empty() &&... | ALGO | 0.999586 | 5.380049 |
87963d2f-0904-4ac8-8220-72f7da3d3775 | AlexeyZakis/Sports-Programming | LeetCode/c++/205 Isomorphic Strings/main.cpp | // https://leetcode.com/problems/isomorphic-strings/
#include <iostream>
#include <map>
using namespace std;
bool isIsomorphic(string s, string t) {
map<char, int> dict1, dict2;
if (s.size() != t.size()) {
return false;
}
for (int i = 0; i < s.size(); ++i) {
if (dict1.find(s[i]) == di... | ALGO | 0.999762 | 6.486265 |
11652eae-330a-4584-8120-ab870a05da67 | narendravarma2004/DSA0158-C- | Q40.cpp | #include <stdio.h>
#include <string.h>
void frequency_analysis(char *ciphertext, int *freq) {
int len = strlen(ciphertext);
for (int i = 0; i < len; i++) {
if (ciphertext[i] >= 'A' && ciphertext[i] <= 'Z') {
freq[ciphertext[i] - 'A']++;
}
}
}
void substitute(char *ciphertext, c... | ALGO | 0.999957 | 4.384953 |
8c80a653-0e00-4d42-9296-1dfa114ec5b2 | 66kesara99/Hackerrank-Random | Algorithms/Searching/IceCreamParlor/IceCreamParlor.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int t;
cin >> t;
for (int a0 = 0; a0<t; a0++){
int m,n, ans1, ans2;
cin >> m >> n;
int arr[n],unsort[n];
int *p;
for (int i = 0; i < n; ++i)
{
cin >> arr[i];
unsort[i] = arr[i];
}
sort(arr,arr+n);
p = lower_bound (... | ALGO | 0.999992 | 3.531158 |
85f7452d-a6ac-4ca9-82a1-97f4496d647d | KozGit/DOOM-3-BFG-VR | neo/idlib/geometry/Winding2D.cpp | #pragma hdrstop
#include "precompiled.h"
#include "Winding2D.h"
/*
============
GetAxialBevel
============
*/
bool GetAxialBevel( const idVec3& plane1, const idVec3& plane2, const idVec2& point, idVec3& bevel )
{
if( IEEE_FLT_SIGNBITSET( plane1.x ) ^ IEEE_FLT_SIGNBITSET( plane2.x ) )
{
if( idMath::Fabs( plane1.x )... | ALGO | 0.999359 | 3.478541 |
9406fa34-343e-463b-bc8c-9642a5615e63 | SMiles02/CompetitiveProgramming | AtCoder/ABC.cpp | #include <bits/stdc++.h>
#define ll long long
#define sz(x) (int)(x).size()
using namespace std;
int n,k,l,r,m;
int a[200000];
ll count(int cur, int goal)
{
if (cur<=goal)
return 0;
if (cur%goal)
return (cur/goal);
return (cur/goal)-1;
}
bool check(int x)
{
ll ans=0;
for (int i=0;... | ALGO | 0.999971 | 4.051253 |
23f2142c-3edb-4bb5-9381-8aa6221999bf | pbburns/MIMO-Simulation | QR.cpp | /////////////////////////////////////////////////////
// file: QR.h //
// copywrite: Philippe Bergeron-Burns //
// description: Does QR factorization of an //
// arbitrary matrix //
//////////////////////////////////////////////////... | ALGO | 0.999543 | 3.163957 |
19a8fc4b-e1a2-4844-824d-a16ef4ac8912 | zaBogdan/problemeInfo | admiteri_facultati/timisoara/2018/problema_3.cpp | #include <iostream>
using namespace std;
void ordonare(int v[],int n){
bool sortat;
do{
sortat=1;
for(int i=1;i<n-1;i++){
if(i%2==0 && v[i]>v[i+2]){
swap(v[i],v[i+2]);
sortat=0;
}
if(i%2==1 && v[i]<v[i+2]){
... | ALGO | 0.999828 | 3.862232 |
7c111fd2-13a3-45b0-b80e-3d036da3e6cf | prashantmarshal/Code | misc/IncreasingDecreasingSequence.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <stack>
#include <climits>
#include <cmath>
#include <algorithm>
using namespace std;
#define For(i,s,l) for(int i = s; i < l; ++i)
#define scanint(n) scanf("%d", &n)
#define printint(n) printf("%d", n);
int main(){
int T;
scanint(T);
int cu... | ALGO | 0.999732 | 4.140843 |
f229958b-d94e-4b9b-b8c7-2c987dcd2462 | khaledman6122/how-to-C-plus-plus | STL/vector/vector 6.cpp | #include <iostream>
#include <vector>
using namespace std ;
int main()
{
vector <int> vec ;
// 1 2 3 4 5 6 7 8 9 10 //
for(int i=1;i<=10;i++)
vec.push_back(i);
for(int i=0;i<vec.size();i++) cout<<vec[i]<<" ";
cout<<endl;
/*
vec.push_back(11);
vec.push_back(12);
vec.push_back(13);
... | ALGO | 0.945675 | 3.791936 |
7fa20362-f0db-4aa8-9373-49d8f4915c13 | lemon0910/leetcode | Path Sum II/Path Sum II.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<vector<int> > pathSum(TreeNode *root, int sum) {
vector<vector<int> > ret;
vecto... | ALGO | 0.999969 | 5.697024 |
a0f73338-4399-437f-9dde-738a755d3bca | manu-chroma/cp | codeforces/Edu 6/2.cpp | #include<bits/stdc++.h>
using namespace std;
//bad code, array better
int yo(int a) {
switch(a) {
case 1 :
return 2;
case 2:
return 5;
case 3:
return 5;
case 4:
return 4;
case 5:
return 5;
case 6:
return 6;
case 7:
return 3;
cas... | ALGO | 0.999713 | 3.493459 |
c1c1dd6b-f50e-465e-a1b1-b2e6b5e203e4 | Bhavik1603/My-Leetcode-Solutions | My Leetcode Solutions/Squares of a Sorted Array/Squares of a Sorted Array.cpp | // https://leetcode.com/problems/squares-of-a-sorted-array
class Solution {
public:
vector<int> sortedSquares(vector<int>& nums) {
for(int i=0;i<nums.size();i++)
{
nums[i]=pow(nums[i],2);
}
sort(nums.begin(),nums.end());
return nums;
}
}; | ALGO | 0.999839 | 6.085509 |
98a3d6db-a464-40e1-a0c1-2816cdc600c8 | aifamsmax/DSACPP | CP/test.cpp | #include<bits/stdc++.h>
typedef unsigned long long int ll;
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int t;
cin >> t;
while(t--)
{
i... | ALGO | 0.996927 | 4.047103 |
a5ab7631-a324-4db5-8a12-387d7c286b60 | FerranMartinezVives/PRO1 | X63635.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef vector< vector<int> > Matrix;
Matrix read_mat(int m, int n) {
Matrix mat(m, vector<int>(n));
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j) cin >> mat[i][j];
}
return mat;
}
bool are_equal(const Matrix& mat, int i_1, int i_2) {
for ... | ALGO | 0.999737 | 4.280232 |
b6c45894-c3c4-485e-81e8-d7f0af083138 | ihoek/Codeup | 1000번/1276.cpp | #include <iostream>
using namespace std;
int main(){
int n;
int re=1;
cin >> n ;
for(int i=0;i<n;i++){
re*=(n-i);
}
cout << re << endl;
}
| ALGO | 0.999991 | 3.82708 |
c8072def-7429-45a9-9e9e-7b24a04f7228 | pluto2001/C_Coding | Lab2_13.2.cpp | #include <stdio.h>
int main(){
float price,discountprice,a;
printf("Program POS calculation\n");
printf("Enter Price :");
scanf("%f",&price);
printf("Enter Discount price is :");
scanf("%f",&discountprice);
a = 100*(discountprice/price);
if(a<50){
printf("Your Discount is less than.50 percent");
}else... | ALGO | 0.935658 | 3.430678 |
6db85b8d-81bd-4876-aece-d1c8fdbc1ce7 | longdo16/CS386DFP | newdetkdecomp-master/mains/HypergraphStats.cpp | // det-k-decomp V1.0
//
// Reference paper: G. Gottlob and M. Samer,
// A Backtracking-Based Algorithm for Computing Hypertree-Decompositions,
// Submitted for publication.
//
// Note: This program is a prototype implementation and does in no sense
// claim to be the most efficient way of implementing det-k-decomp. Mor... | ALGO | 0.995965 | 3.8104 |
25daa09d-d7c9-4dd1-960f-3f2bd2dbd9d4 | syozo12/condition2 | 5.cpp | #include <iostream>
using namespace std;
int main(){
int a = 18; int b = 12;
bool t = (a > 20 && b < 15)? true : false;
cout <<"Value of t: " << t ;
return 0;
}
| ALGO | 0.982588 | 3.073789 |
89375437-5d20-40ca-8bea-bb9d3f48131c | ishandutta2007/codeforces | matthew99/normal/901/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = (a), i##_end_ = (b); i < i##_end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()
temp... | ALGO | 0.999995 | 3.142913 |
8352eb54-6f76-4299-9946-2c78029b97ed | losvald/algo | acsl/.incomplete/ACSL_the_junior_vampire_slayer.cpp | #include <stdio.h>
#include <conio.h>
#include <string.h>
#include <iostream.h>
#include <functional>
#include <ctype.h>
#include <cmath>
#include <vector.h>
#include <algorithm>
using namespace std;
int val[100], V = 4, id = -1; int umn; char broj[10];
vector<int> v1;
void write() {
char f1[10], f2[10]; int i, br1... | ALGO | 0.996129 | 3.206315 |
b99f44b5-e4d4-45ef-b64e-49a688d9e158 | SojeongLee/SWEA-SW-Expert-Academy- | 백준/2621(카드게임).cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, char** argv)
{
int color[4] = {0}; //R,B,Y,G
int num[10] = {0}; //1~9
vector<int> number;
char c;
int n;
for(int i=0 ; i<5 ; i++)
{
cin >> c >> n;
switch(c)
{
case 'R' : color[0] += 1; break;
case 'B' ... | ALGO | 0.993432 | 3.610494 |
8f52d9e4-fd05-4598-b2f3-3672d23dfddc | thanhdatnguyentk/Helloworld | DSA/Buoi2/test.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (int i = 0; i < (n); i++)
int binary_search(vector<int> &a, int n, int x) {
int l = 0;
int r = n - 1;
while (l <= r) {
int m = (l + r) / 2;
if (a[m] == x) return m;
else if (a[m] < x)
... | ALGO | 0.999751 | 5.860075 |
fe6c0b78-98cb-4f6a-af02-be678f1dca75 | Ricardiam/liretok1 | math/realtime_stats.cpp | /**
* \file
* \brief Compute statistics for data entered in rreal-time
*
* This algorithm is really beneficial to compute statistics on data read in
* realtime. For example, devices reading biometrics data. The algorithm is
* simple enough to be easily implemented in an embedded system.
* \author [Krishna Vedala... | ALGO | 0.996112 | 7.554009 |
3005187a-d380-4f79-9d77-e965fdbeefa3 | Minach2002/updated_deepvoice | 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 |
5c235a5b-687e-4534-af2c-7729ade2cfcc | Alok-Kumar8/C- | pattern4.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main()
{
int n = 4;
int i = 1;
int k = 1;
while (i <= n)
{
int j = 1;
while (j <= i)
{
cout << k;
j += 1;
k += 1;
}
cout << endl;
i += 1;
}
... | ALGO | 0.999924 | 3.887599 |
2afdde15-2cd4-4a6b-9196-338ab7d11ef3 | PedroAngeli/Competitive-Programming | Solutions/Atcoder/Contests/Educational DP contest/h.cpp | #include <bits/stdc++.h>
using namespace std;
int H,W;
const int MAXN = 1e3 + 5;
const int mod = 1e9 + 7;
vector <string> grid;
int dp[MAXN][MAXN]; //guarda quantos caminhos existem até (H-1,W-1) partindo de (i,j)
bool valid(int i,int j){
return i >= 0 && i < H && j>=0 && j < W && grid[i][j] != '#';
}
bool destin... | ALGO | 0.999988 | 5.006755 |
c5778bbe-234c-4b6e-90b6-76740587503c | CallofMan/cpp | calculator with switch.cpp | #include <iostream>
int calculate(int x, int y, char sign)
{
switch (sign)
{
case '+':
return (x + y);
case '-':
return (x - y);
case '*':
return (x * y);
case '/':
return (x / y);
case '%':
return (x % y);
default:
std::cout << "calculate(): Unhandled case\n";
return 0;
}
}
int ma... | ALGO | 0.970344 | 4.877291 |
c620de44-7354-48f4-bf0d-fd33b14995e2 | sarvex/leetcode-c-- | solution/0000-0099/0078.Subsets/Solution.cpp | class Solution {
public:
vector<vector<int>> subsets(vector<int>& nums) {
vector<vector<int>> ans;
vector<int> t;
dfs(0, nums, t, ans);
return ans;
}
void dfs(int u, vector<int>& nums, vector<int>& t, vector<vector<int>>& ans) {
if (u == nums.size()) {
an... | ALGO | 0.999951 | 6.436767 |
4dd42d67-39e3-4065-9b83-8ff5f9735791 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9717_2.cpp | #include <bits/stdc++.h>
#pragma comment(linker, "/stack:64000000")
using namespace std;
const int MAXN = 100000 + 10;
vector<int> g[MAXN];
bool used[MAXN];
int timer, tin[MAXN], fup[MAXN], color[MAXN];
int n, cnt = 0;
set<pair<int, int> > bridges;
void IS_BRIDGE(int a, int b) {
bridges.insert(make_pair(min(a, b), ma... | ALGO | 0.999874 | 4.78197 |
5b5d614a-bbac-466e-b741-d52870444672 | alexandraback/datacollection | solutions_5708921029263360_0/C++/Plyushchenko/cc.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string.h>
#include <cassert>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <set>
#include <map>
#define mp make_pair
#define pb push_back
#define problem "test"
typedef __int128 ll;
t... | ALGO | 0.999408 | 3.226929 |
78d13b4a-823b-4f3e-9756-68f94daddc34 | hjiang13/LLMs-in-IR | POJ-104/69/137.cpp | #include <iostream>
using namespace std;
int main()
{
const int max = 251 ;
int an1[251] = {
0}
, an2[251] = {
0}
;
char line1[251] = {
0}
,line2[251] = {
0}
;
cin>>line1 ;
cin>>line2 ;
int lenth1 = strlen(line1) ;
int lenth2 = strlen(line2) ;
int i = 0 , j = 0 ;
for(i = lenth1 - 1 ; i>= 0 ; i--)
{
an1[j++] = line1[i... | ALGO | 0.999923 | 3.231203 |
8439d707-ac06-4e40-ae99-ec91df0e6063 | Jiwon116/Algorithm | BOJ/1504.cpp | #include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define INF 3e8
using namespace std;
int n, m; // n -> 노드 개수, m -> 간선 개수
int v1, v2; // 반드시 거쳐야 하는 노드
vector<pii> adj[801]; // 연결되어 있는 노드의 정보
int dist[801]; // 최단 거리 테이블
int dijkstra(int start, int end) {
fill(dist, dist + n + 1, INF); ... | ALGO | 0.999937 | 4.713005 |
d9d1647c-b786-4c30-afa8-031acbc00278 | KirilApostolov/CPP_Problems | skok v2.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
long long A, B, N;
cin >> A >> B >> N;
long long arr[N];
for (int i = 0; i < N; i++) cin >> arr[i];
sort(arr, arr + N);
long long pos = 0;
while (pos < N && arr[pos] < A) pos++;
long long jumps = 0, currentPOS = A... | ALGO | 0.999939 | 3.623688 |
807999b1-8e2b-4322-b337-92a18c36ae3d | greenbeanpie/OI-training | NOIP2023-ZJ/ZJ-0353/tribool/tribool.cpp | #include<bits/stdc++.h>
using namespace std;
const int inf=1e9+7;
const int N=3e5+5;
struct node{
int ip;
int x,y;
}g[N];
int fa[N];
int c,t,n,m;
int f[50],vis[N];
int cc[50];
int ans=inf;
void check()
{
int k=0;
for(int i=1;i<=n;i++)
cc[i]=f[i],k+=(f[i]==0);
for(int i=1;i<=m;i++)
{
if(g[i].ip<2)
cc[g[i].x... | ALGO | 0.999716 | 4.790718 |
61d971cd-7c3f-44f9-9ad6-2a39f6b56aac | firdauskedir/DSA-Lab-assignments | graph_practice/map_of_highest_peak.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
vector<vector<int>> highestPeak(vector<vector<int>>& isWater) {
int m = isWater.size(), n = isWater[0].size();
vector<vector<int>> height(m, vector<int>(n, -1));
queue<pair<int, int>> q;
// Start from all water cells (height 0... | ALGO | 0.999997 | 6.800967 |
aef1ce50-c40d-4a1d-bff0-22641cbae286 | ymaxgit/cntk | Source/Readers/ReaderLib/TruncatedBpttPacker.cpp | #define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <cmath>
#include "TruncatedBpttPacker.h"
#include "ReaderUtil.h"
#include <algorithm>
namespace CNTK {
using namespace std;
// Represents a slot where we accumulate sequences from which the minibatch is created.
// The number of slots equals n... | ALGO | 0.969362 | 4.479752 |
a962f18d-03ef-416e-8de5-f68be0c2241e | ishandutta2007/codeforces | 6aren/normal/1515/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
vector<int> power_2(n + 1);
vector<vector<int>> C(n + 1, vector<int>(n + 1));
power_2[0] = 1;
for (int i = 1; i <= n; i++) power_2[i] ... | ALGO | 0.999992 | 5.249577 |
3c262aaa-1307-4f34-aa8a-cc78d657921e | samarth-thaker/Data-Structures-Algorithms | TakeYouForward/Arrays/2ndLargest.cpp | class Solution {
public:
// Function returns the second
// largest elements
int print2largest(vector<int>arr) {
int i, first, second;
int n = arr.size();
// There should be at least two elements
if (n < 2) {
return -1;
}
first = second = INT_MIN;
for (i = 0; ... | ALGO | 0.99963 | 4.775262 |
ce29c547-7f91-4162-81f9-10d249395edf | CodeBees/CEFWebkitBrowser | DuiLib/Utils/Utils.cpp | #include "stdafx.h"
#include "Utils.h"
namespace DuiLib
{
/////////////////////////////////////////////////////////////////////////////////////
//
CPoint::CPoint()
{
x = y = 0;
}
CPoint::CPoint(const POINT& src)
{
x = src.x;
y = src.y;
}
CPoint::CPoint(int _x, int _y)
{
x = _x;
y = _y;
}
CPo... | TOOL | 0.912159 | 5.081103 |
956232dc-fd42-4b38-9c82-c85f398ae00d | CoffeeandMath/CylindricalShells | CylindricalSystem/eigen-3.3.9/failtest/jacobisvd_int.cpp | #include "../Eigen/SVD"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
JacobiSVD<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| ALGO | 0.900012 | 3.327923 |
bd0c1182-f1a4-4e3d-92bc-9899740621fc | shubhampawar672/DSA | nextSmallerElement.cpp | //next smaller element to the right
#include<iostream>
#include<stack>
#include<vector>
#include<algorithm>
using namespace std;
void nextSmallerElement(vector<int>arr,int sz,vector<int>&ans)
{
stack<int>st;
for(int i=sz-1;i>=0;i--)
{
while(!st.empty() && st.top()>=arr[i])
{
st.... | ALGO | 0.999995 | 4.725797 |
27d51d36-4c44-488f-ba43-7f0d1fd24a92 | GuillermoGAndres/HackerRank | compareTriplets/compareTriplets.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> readInputsTerminal();
void printDataStructure(vector<vector<int>> dataStructure);
vector<int> compareTriplets(vector<int> array1, vector<int> array2);
int main(){
vector<vector<int>> dataStructure = readInputsTerminal();
printDataStru... | ALGO | 0.999879 | 4.365947 |
2c362c28-dd08-4261-8d91-80b328d309c3 | mlbrock/MlbDev2 | Utility/ResourceLimits.cpp | // ////////////////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////////////////
// MLB Utility Library Module File
// ////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////... | TOOL | 0.905663 | 6.641786 |
b4291a8f-39ee-4a19-ad46-2672eed67e67 | Panterrich/ParallelProgramming | tasks/task_sort/task_sort.cpp | #include <vector>
#include <type_traits>
#include "user_mpi.h"
static constexpr size_t N = 1000;
template <typename T>
void merge(T* array, int left, int mid, int right, std::vector<T>& buffer) {
int left_size = mid - left + 1;
int right_size = right - mid;
for (int i = 0; i < left_size; i++)
{
... | ALGO | 0.999305 | 4.839562 |
5180811a-2f01-49e7-b511-8bcea9c19fa3 | tahsinsoha/Problem-solving- | Codeforces/three indices.cpp | #include<bits/stdc++.h>
using namespace std;
long long arr[1000007];
long long cs[1000007];
long long ps[1000007];
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
for(int i=1; i<=n; i++)
{
cin>>arr[i];
}
int f=0;
for(int i=2... | ALGO | 0.999636 | 3.321316 |
4b8bab91-0270-4679-852b-d6d50d0c3047 | raincross7/code-similarity | codes/train_code/problem445/problem445_109.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
if(A >= 10) {
cout << B << endl;
}
else {
cout << B + 100 * (10 - A) << endl;
}
} | ALGO | 0.999272 | 3.664157 |
95a3aad2-671b-4288-a019-e6df7c293680 | quarkslab/LLDBagility | FDP/virtualbox/src/VBox/Runtime/common/string/memchr.cpp | /* $Id: memchr.cpp $ */
/** @file
* IPRT - CRT Strings, memcpy().
*/
/*********************************************************************************************************************************
* Header Files ... | TOOL | 0.926967 | 5.889107 |
ac2af13a-1398-4e65-9936-45b0773b7eff | kamilszymczak1/my_solutions | poi/XXIV/podzielnosc.cpp | #include <iostream>
#include <vector>
#define MAX_B 1000000
#define inf 10000000000000
using namespace std;
typedef long long ll;
int a[MAX_B];
ll b;
vector<ll>amount(0);
vector<int>number(0);
int Query(ll val);
int main() {
ios_base::sync_with_stdio(0);
int k;
ll val, sum = 0;
cin >> b >> ... | ALGO | 0.999949 | 3.627884 |
cfeb0269-7acd-4683-91cc-c18b2dee0f9b | Boltzee/First_one | yet another counting problem.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
cin>>T;
cin>>T;
while(T--){
int a,b,q,lcm,j=0;
cin>>a>>b>>q;
if(a==b){
for(int i=0;i<q;i++){
cout<<"0 ";
}cout<<"\n";
continue;
}
int ans[q];
lcm=(a*b)/(__gcd(a,b));
int cont=0;
for(int i=1;i<=lcm;i++){
if((i%a)... | ALGO | 0.999645 | 3.102223 |
0c8dc2d5-be45-407c-91c5-6df8d263c885 | raincross7/code-similarity | codes/train_code/problem260/problem260_277.cpp | /* Reason this implementation is slow:
we did not maintain a binary heap structure when we insert value
only rely on maxHeapify and buildMaxheap to
build up it again and again
*/
#include<cstdio>
#include<cstring>
#define MAX 2000001
#define NIL 0
int pq[MAX];
int sizeOfHeap = 0;
int getLeft(int node) {
if (node *... | ALGO | 0.999713 | 3.846588 |
2d3de21c-d9ba-4cc1-baf5-ec82d0332f26 | ojasvagupta/Leetcode | 0105-construct-binary-tree-from-preorder-and-inorder-traversal/0105-construct-binary-tree-from-preorder-and-inorder-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.999991 | 6.480618 |
f9f396d8-897e-4362-aec9-104ec5fc5d95 | ishandutta2007/codeforces | sirshokoladina/normal/150/B.cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <utility>
#include <cstdlib>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <memory.h>
#include <ctime>
#include <cctype>
using namesp... | ALGO | 0.999997 | 4.026707 |
72a4cc3c-e7f4-4c89-88d4-c359de805d14 | prateek27/Coding-Problems | Coding/Spoj/TowerOfHanoiMoves.cpp | #include<iostream>
using namespace std;
long long unsigned counter;
long long unsigned moves(int n,char,char,char);
int main(){
int n,t;
cout<<"TOWERS OF HANOI REVISITED :";
cin>>t;
while(t--){
cin>>n;
moves(n,'A','C','B');
cout<<counter<<endl;
counter=0;
}
return 0;
}
long long unsigned moves(int n,char from,char to... | ALGO | 0.999834 | 4.437671 |
538d5acd-0ab1-49d6-969a-fe8c7bc51848 | KienHoSD/UIT-homework | coding_beginner(NMLT)/fraction.cpp | #include <iostream>
using namespace std;
int gcd(int a, int b) {
if (b == 0) return a;
return gcd(b, a % b);
}
int phanso(int a, int b,int c,int d){
int gcdab;
int solan=0;
while(true){
if(a==c&&b==d||solan==1000000) break;
solan++;
a++;b++;
gcdab=gcd(a,b);
i... | ALGO | 0.999917 | 4.697443 |
44cd6d1f-4f4a-4d4e-a3bf-8d8cbf6fea85 | Sampurankishoresrivastava/DSA | leetcode/contest./100161. Divide Array Into Arrays With Max Difference.cpp | class Solution {
public:
vector<vector<int>> divideArray(vector<int>& nums, int k) {
int n=nums.size();
if(n%3!=0){
return {};
}
sort(nums.begin(),nums.end());
vector<vector<int>> ans;
for(int i=0;i<n;i+=3){
... | ALGO | 0.999954 | 5.530618 |
a59b7ab8-2aca-4b8c-8c64-210647e167ca | ishandutta2007/codeforces | emptyhope/normal/1504/C.cpp | #include<bits/stdc++.h>
#define For(i,a,b) for(register int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(register int i=(a);i>=(b);--i)
//#define int long long
using namespace std;
inline int read()
{
char c=getchar();int x=0;bool f=0;
for(;!isdigit(c);c=getchar())f^=!(c^45);
for(;isdigit(c);c=getchar())x=(x<<1... | ALGO | 0.999958 | 3.308653 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.