uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
88ff2234-cd1f-4a2d-86e4-eb654681c9c7 | orkodip/axi-THINC-WLIC_scheme-based_CLSVOF_method | driver.cpp | #include<iostream>
#include<fstream>
#include<cmath>
#include<string>
#include<csignal>
#define EPS 1e-12
#define TRUNC 1e-16
using namespace std;
int LC=1; //loop condition
void control(int n) //signal control function
{
cout<<"PROGRAM INTERUPTED!"<<endl;
cout<<"Enter 0 to stop: ";
cin>>LC;
if(LC==0) cout<<"STOP S... | ALGO | 0.999689 | 3.805647 |
80c1a723-1f0c-4278-8679-c50371a8e72e | schrummy14/LIGGGHTS_Flexible_Fibers | lib/hotint/HotInt_V1/ElementsLib/beams/Beam2DaFFRF.cpp | #include "rigid2d.h"
#include "femathhelperfunctions.h"
//#include "material.h"
#include "Node.h"
#include "referenceFrame2D.h"
#include "Beam2DaFFRF.h"
//#include "graphicsconstants.h"
//#include "elementdataaccess.h"
//#include "solversettings_auto.h"
//#include "sensors\sensors.h"
void Beam2DA::BuildDSMatrices()
{... | ALGO | 0.990292 | 3.652026 |
affde4ab-9c6d-4f12-a364-29c1b87745be | alexandraback/datacollection | solutions_5639104758808576_1/C++/Lexarx/main.cpp | #include <cstdlib>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include "math.h"
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define fori(i, a, b) for (int i = int(a); i <= int(b); i++)
typedef long long ll;
using namespace std;
int main() {
int ntc;
cin >> ntc;
fori(tc, 1, ntc) {
int n;... | ALGO | 0.997828 | 3.849728 |
51e5a70d-1582-4b69-bfcd-4ad2437bf399 | juliolugo96/competitive-programming | codeforces/implementation/next_round.cpp | # include <bits/stdc++.h>
using namespace std;
int main()
{
short n, k, counter{0};
cin >> n >> k;
short a[n];
for (int i{0}; i < n; i++)
cin >> a[i];
for (int i{0}; i < n; i++)
if (a[i] >= a[k - 1] and a[i] > 0)
counter++;
cout << counter << "\n";
return 0;
} | ALGO | 0.99989 | 3.321812 |
c891f2f3-5e0d-4118-854f-d7ddb4f8027a | OleksandrYu/University | Algotester/algotester_1/main.cpp | #include <iostream>
int main() {
double a,b;
std::cin>>a;
std::cin>>b;
double c = a + b;
std::cout<<c<< std::endl;
return 0;
}
| ALGO | 0.944119 | 3.608591 |
47f92b08-164e-4125-97e5-0fc6cab13818 | navneet96/DSA | Assignment18/Program3.cpp | //3. Write a function to compare two strings.
#include <stdio.h>
#include <string.h>
int compareStrings(const char *str1, const char *str2) {
int i = 0;
while (str1[i] != '\0' && str2[i] != '\0') {
if (str1[i] != str2[i])
return 0;
i++;
}
return str1[i] == str2[i];
}
int mai... | ALGO | 0.999605 | 4.485269 |
c8be640f-03f9-4540-8fb8-60e4a2379982 | ishandutta2007/codeforces | klimoza/normal/1000/C.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <deque>
#include <cassert>
#include <math.h>
#include <random>
using namespace std;
#define PI 3.14159265
typedef long long ll;
const ll INF = 4 * 1e18;
const int INFi = 2 * 1e9;
ll mo... | ALGO | 0.999894 | 3.928474 |
c75f4a04-d471-4c0c-97a5-ba9fda77aba0 | azula1A89/mindmap | thirdparty/layout/libcola/conjugate_gradient.cpp | #include <cmath>
#include <cstdlib>
#include <cassert>
#include <valarray>
#include "libvpsc/assertions.h"
#include "libcola/commondefs.h"
#include "libcola/conjugate_gradient.h"
/* lifted wholely from wikipedia. Well, apart from the bug in the wikipedia version. */
using std::valarray;
static void
matrix_times_v... | ALGO | 0.999438 | 5.945199 |
1800a490-3f29-48d8-8b9f-10f661769c56 | sultancodess/leetcode- | C++/exclusive-time-of-functions.cpp | // Time: O(n)
// Space: O(n)
class Solution {
public:
vector<int> exclusiveTime(int n, vector<string>& logs) {
vector<int> result(n);
stack<int> stk;
int prev = 0;
for (const auto& log : logs) {
vector<string> tokens = split(log, ':');
if (tokens[1] == "star... | ALGO | 0.998455 | 6.839228 |
3fc3435c-4066-430f-8b7a-d62fb02d6702 | qtcyy/LeetCode-Record-3.17 | 数据结构/chapter5/5.1/No3296/main.cpp | #include <functional>
#include <iostream>
#include <queue>
#include <tuple>
#include <vector>
using namespace std;
class Solution {
public:
long long minNumberOfSeconds(int mountainHeight, vector<int> &workerTimes) {
priority_queue<tuple<long long, long long, int>,
vector<tuple<long long, long... | ALGO | 0.999956 | 5.905739 |
f6fdbcc4-4fc1-4a75-adce-41b91501cd59 | TusharCSE35/Online-Programming | Codeforces/Byangs_Additions.cpp | /*********************************************************************************\
* _________ _ _ ________ _ _ __ ________ *
* |___ ___|| | | || ______|| | | | / \ | ____ | *
* | | | | | || |______ | |_____| | / /\ \ | |____| |... | ALGO | 0.999761 | 4.214278 |
2ddf586e-7380-4065-8214-494a2ff7fcfa | izardi/PAT | PAT (Basic Level) Practice (中文)/1071.cpp | #include <cstdio>
int main(int argc, char *argv[])
{
freopen("in", "r", stdin);
int T, K;
scanf("%d %d", &T, &K);
int n1, b, t, n2;
while(K--){
scanf("%d %d %d %d", &n1, &b, &t, &n2);
if(T < t) printf("Not enough tokens. Total = %d.\n", T);
else if((n1 < n2 && b) || (n1 > n... | ALGO | 0.9998 | 3.010639 |
a276ba59-ecc9-411b-a4b3-8281710171e1 | raghvendra240/DSA | 623-add-one-row-to-tree/623-add-one-row-to-tree.cpp | class Solution {
public:
TreeNode* addOneRow(TreeNode* root, int val, int depth) {
if(depth==1){
return new TreeNode(val,root,NULL);
}
queue<TreeNode*>q;
--depth;
q.push(root);
while(q.size()>0){
int n=q.size();
--depth;
... | ALGO | 0.999994 | 6.324712 |
9e00a097-59a3-49c4-a17a-04e32bb7b855 | siddiquimohdhammad/Online-Video-Streaming-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.998859 | 6.785645 |
6bb83b36-f985-4a8a-b05a-01212b76f28d | BrianPRyan/ThirdYear_ComputerScienceDegree | Cpp_Programming/LottoGenerator.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
int number, randomNumber;
int allNumbers[6] = {0,0,0,0,0,0}; //initialise numbers to zero
srand(static_cast<unsigned int>(time(0))); // seed random number generator based on current time
for (int i = 1; i <= 6; ++i)
{
... | ALGO | 0.922183 | 3.920902 |
3bbda7ca-cb3c-42de-9339-f6e6a8f2e92b | QinghaoHu/programming | algo/graph/353/a.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m, cnt, num;
int ver[N << 2], head[N], nxt[N << 2], tot;
int d[N], f[N][20], vals[N];
int root[N];
struct {int lc, rc, dat, pos;} tr[N * 4 * 18];
struct {int x, y, z;} a[N];
void bfs() {
d[1] = 1;
queue<int> q;
q.push(1);
while (!q.empty()... | ALGO | 0.999988 | 4.377225 |
7bf2c1d4-a279-4f3b-a348-9b1006ce4d61 | danyuanwang/XuanWuGame_C | boost/libs/multiprecision/performance/voronoi_performance.cpp | #ifdef _MSC_VER
#pragma warning(disable:4244)
#endif
#include <boost/polygon/detail/voronoi_predicates.hpp>
#include <boost/polygon/detail/voronoi_structures.hpp>
#include <boost/polygon/detail/skeleton_predicates.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#i... | TEST | 0.969011 | 6.788018 |
5cadf038-be08-4a5b-88a8-7cec8c4d6f28 | yyheo/TIL_algo | Baekjoon_cpp/1057_토너먼트.cpp | #include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int total, kim, im, answer = 0;
cin >> total >> kim >> im;
while (kim != im) {
kim = kim / 2 + kim % 2;
im = im / 2 + im % 2;
answer += 1;
}
cout << answer;
return 0;
} | ALGO | 0.999438 | 3.399435 |
ab40b364-dd66-4886-8e6c-8cedb417701b | zukahai/algotithm-training | ictu/p37.cpp | #include <bits/stdc++.h>
using namespace std;
#define Nmax 2009
bool prime[Nmax + 5];
void sang_nt() {
// prime all is true
for (int i = 2; i <= Nmax; i++)
prime[i] = true;
prime[0] = prime[1] = false;
for (int i = 2; i <= Nmax; i++) {
if (prime[i]) {
for (int j = i * i; j ... | ALGO | 0.999906 | 3.322443 |
2af3b635-3cda-4a12-b3a9-dc79407c5c01 | abrowne2/MITIE-pNACL | MITIE/dlib/examples/matrix_ex.cpp | /*
This is an example illustrating the use of the matrix object
from the dlib C++ Library.
*/
#include <iostream>
#include <dlib/matrix.h>
using namespace dlib;
using namespace std;
// ----------------------------------------------------------------------------------------
int main()
{
// Let's begin t... | ALGO | 0.999312 | 4.417058 |
a16eafde-91b8-45ec-a2b7-d674691e0048 | rajesh-1920/Competitive_Programming_Problem_Solving | Vjudge/U_Boxes_Packing.cpp | // Author: Rajesh Biswas
// CF : rajesh-1920
// Date : 21.01.2025
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
//----------------------------(definition section)-----------------------------------------
#define dbg(x) cout << #x << " = " << x << '\n'
#define fi first
#define sc second... | ALGO | 0.999857 | 4.567563 |
600d1a0d-12cd-4b79-b7ac-415c33b170c9 | dengyazhou/Algorithms | NowCoder/NowCoder/BM23.cpp | //
// BM23.cpp
// NowCoder
//
// Created by 邓亚洲 on 2022/5/2.
//
//BM23 二叉树的前序遍历
#include <stdio.h>
//vector 需要引入 <vector>
#include <vector>
//using namespace std; vector 和 std::vector 等价
using namespace std;
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
TreeNode(int x):v... | ALGO | 0.999349 | 5.729104 |
e5d7abb8-3500-4845-a767-31a95e496f28 | formal-verification-research/IVy-Models | routing/time_tests/processor_time/11x11/route.cpp | #define MAX_X 10
#define MAX_Y 10
#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <sstream>
#include <cstdlib>
#include <string>
#include "Utils.hpp"
// Count one_fault;
// Count two_fault;
// #include "Node.hpp"
#include "Route.hpp"
using namespace std;
// string route_default(int cur_x, i... | ALGO | 0.999084 | 4.306236 |
b9a0dcc0-7612-4db0-9f7b-e9c9235dc8ad | RitobrotoMukherjee/DSA-computer-science | recursion/sumOf-N-Number.cpp | #include <iostream>
using namespace std;
int sumOfNBySubstracting(int n)
{
if (n <= 1)
{
return 1;
}
return n + sumOfNBySubstracting(n - 1);
};
int sumOfNByAdding(int n, int times = 1)
{
/**
* > take variable to start from 1;
* > most case time == n return times;
* > return ... | ALGO | 0.999874 | 4.707609 |
2eae5b50-ca51-4ff6-9083-c9f127281b6e | aldragan0/algo-practice | aoc-2022/day14/day14_2.cpp | #include <bits/stdc++.h>
#define NL '\n'
typedef long long ll;
using namespace std;
struct Point {
int x;
int y;
bool valid;
};
bool canMove(int a[1000][1000], Point t, Point dir) {
return a[t.x + dir.x][t.y + dir.y] == 0;
}
void move(Point& t, Point dir) {
t.x += dir.x;
t.y += dir.y;
}
i... | ALGO | 0.99864 | 3.788386 |
ddd653b9-6670-48d2-92f9-b03d0b61608a | mfs6174/mfs6174-ACM | dpstd.cpp | /*
ID: mfs6174
email: <EMAIL>
PROG: ti
LANG: C++
*/
#include<iostream>
#include<fstream>
#include<string>
#include<sstream>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
#include<queue>
#include<deque>
#include<iomanip>
#include<cmath>
#include<set>
#define sf scanf
#define pf printf
#define llg... | ALGO | 0.998764 | 3.276683 |
b5990d78-0bae-4c92-9f22-0cb82f09f26a | Monty05012002/LeetCode | Number of Subarrays of 0's - GFG/number-of-subarrays-of-0s.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
long long int no_of_subarrays(int n, vector<int> &arr) {
// Write your code here.
long long int ans=0,count=0;
int j=0;
while(j<n){
if(arr[j... | ALGO | 0.999907 | 6.745674 |
57512a97-eee2-4ce7-964d-6c8f8c691944 | Pranshu5113/100_days_Coding_Challenge | Que_2.cpp | #include<iostream>
using namespace std;
int main(){
int num;
cout<<"Enter the Number: ";
cin>>num;
if(num%2 == 0){
cout<< "Even";
}
else{
cout<<"Odd";
}
return 0;
} | ALGO | 0.992278 | 3.313801 |
f433572a-f82a-4ffe-a25c-ec4e8edb44eb | didiersmets/Myosotis | extern/meshoptimizer/src/spatialorder.cpp | #include <assert.h>
#include <float.h>
#include <string.h>
// This work is based on:
// Fabian Giesen. Decoding Morton codes. 2009
namespace meshopt
{
// "Insert" two 0 bits after each of the 10 low bits of x
inline unsigned int part1By2(unsigned int x)
{
x &= 0x000003ff; // x = ---- ---- ---- ---- ... | ALGO | 0.999838 | 6.28781 |
850bb9eb-286d-400d-8396-c3cce7b72064 | idlegossip/Codeforces | Codeforces Round #838 (Div. 2)/B. Make Array Good.cpp |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
ll t;
cin>>t;
while(t--)
{
ll n;
cin>>n;
ll a;
vector<pair<ll,ll> >v,ans;
priority_queue<pair<ll,ll> >pq;
for(int i = 0; i < ... | ALGO | 0.99975 | 3.227514 |
c11d867c-2609-4735-b0cc-dffda4dc9c06 | putdata/algorithm-problem-solving | NOJAM/4740.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while(1) {
string s;
getline(cin, s);
if(s=="***") break;
reverse(s.begin(),s.end());
cout << s << '\n';
}
return 0;
} | ALGO | 0.998193 | 3.938611 |
246b3ae2-6ed3-455e-bf64-bc6341b3c8af | zyqaq412/study_code | 作业/操作系统/银行家算法模拟/1.cpp | #include<iostream>
#include<string>
#include<vector>
using namespace std;
#define n 5 //进程数
#define m 3 //资源数量
int available[m] = { 2,3,3 }/*可用剩余资源*/, alloc[n][m]/*已分配资源*/, need[n][m]/*需求(缺少资源)*/, request[n][m]/**/;
vector<int> result;
void init()
{
alloc[0][0] = 2; alloc[0][1] = 1; alloc[0][2] = 2;
alloc[1][0] = 4... | ALGO | 0.999573 | 3.033956 |
fc20546f-8d7a-4e59-8c2e-fc5a3740b248 | darkshuige/codecode | c code/小红的二进制树.cpp | #include<bits/stdc++.h>
#define jiasu ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define int long long
#define endl "\n"
using namespace std;
const int maxn=100005;
vector<int>g[maxn];
int a[maxn],sum[maxn]={0};
signed main()
{
jiasu;
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
char k;
... | ALGO | 0.999663 | 3.841243 |
ae5eaa7c-81c8-44b9-bc0a-49e61da3def6 | open-watcom/open-watcom-v2 | bld/bench/owstl/random.cpp | #include <iostream>
#include "timer.h"
#include <cstdlib>
#include <random>
#include "mt19937ar.c"
static int ans_tr1;
static int ans_orig;
template< typename gen >
double do_tr1( gen &r, long repetitions )
{
long i;
std::cout<<"start\n";
TimerOn( );
for( i = 0; i < repetitions; i++ ){
... | TEST | 0.960813 | 5.354154 |
29c58809-15b7-4a26-8472-2ccdc549a320 | naturalsimplicity/algorithms | contests/stack_queue_deque/h.cpp | #include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
void Solve()
{
stack<int> operands;
string str;
getline(cin, str);
istringstream iss(str);
string operand;
while (iss >> operand) {
if (operand == "+" |... | ALGO | 0.999985 | 5.015244 |
6756d8d1-77fd-4316-b6f0-e655c0ec8158 | DATx-Protocol/DATx | datxchain/libraries/fc/src/crypto/elliptic_secp256k1.cpp | #include <fc/crypto/elliptic.hpp>
#include <fc/crypto/base58.hpp>
#include <fc/crypto/hmac.hpp>
#include <fc/crypto/openssl.hpp>
#include <fc/crypto/sha512.hpp>
#include <fc/fwd_impl.hpp>
#include <fc/exception/exception.hpp>
#include <fc/log/logger.hpp>
#include <secp256k1.h>
#include "_elliptic_impl_priv.hpp"
na... | TOOL | 0.987393 | 7.484205 |
10c45dc7-5254-4312-b4d7-79406ef448bb | pavelsimo/ProgrammingContest | uva/11804_Argentina/P11804_2.cpp | /* @BEGIN_OF_SOURCE_CODE */
/* @JUDGE_ID: 11804 C++ "Brute Force" */
#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cstring>
using namespace std;
#define FOR(i,x,y) for(int i=(int)(x);i<=(int)(y);++i)
#define REP(i,n) FOR(i,0,n-1)
#define FORD... | ALGO | 0.996051 | 4.763478 |
e3e3af56-a4ee-4dda-bb8f-4a0ebc8b80d8 | GambitBSM/gambit_1.0 | contrib/MassSpectra/flexiblesusy/models/SSM/SSM_two_scale_low_scale_constraint.cpp | // File generated at Sat 27 Aug 2016 12:40:28
#include "SSM_two_scale_low_scale_constraint.hpp"
#include "SSM_two_scale_model.hpp"
#include "wrappers.hpp"
#include "logger.hpp"
#include "ew_input.hpp"
#include "gsl_utils.hpp"
#include "minimizer.hpp"
#include "root_finder.hpp"
#include "threshold_loop_functions.hpp"
#... | DATA | 0.900821 | 5.829661 |
c718a35e-7f03-4418-bcac-5101bfd84670 | yhf869252662/LearningQuestionBank | test_2_28/test_3_13.cpp | //#include <iostream>
//#include <math.h>
//
//using namespace std;
//
//int addAB(int A, int B) {
// int flag = 0;
// int ret = 0;
// int c = 0;
//
// for (int i = 0; i < 32; i++)
// {
// if (A & 1 == 1 && B & 1 == 1)
// {
// c = flag;
// flag = 1;
// }
// else if (((A & 1 == 1) && flag == 1) || ((B & 1 == 1) ... | ALGO | 0.999767 | 3.63849 |
bd364edb-798a-4b82-beb8-f17630ad5b22 | jj4jj/dcpots | base/cmdline_opt.cpp | #include <getopt.h>
extern char *optarg;
extern int optind, opterr, optopt;
#include "dcutils.hpp"
#include "cmdline_opt.h"
struct cmdline_opt_impl_t {
int argc;
const char * * argv;
std::multimap<string, string> dict_opts;
std::map<string, string> dict_opts_default;
string usage;
string ... | TOOL | 0.875498 | 5.569915 |
80b24e20-5c98-4bd2-bdb1-3e0627ecf595 | hoangduongngg/Data-Structues-Algorithms | test/Other/so nho nhat va nho thu hai.cpp | #include <iostream>
#include <string.h>
#define MAX 100
using namespace std;
int a[MAX], n, i, j;
void nhap() {
cin >> n;
for (i = 0; i < n; i++) cin >> a[i];
}
void doicho() {
int temp = a[i];
a[i] = a[j];
a[j] = temp;
}
int main() {
int T; cin>>T;
while (T--) {
nhap();
for (i = 0; i < n - 1; i++)
for ... | ALGO | 0.999918 | 3.481261 |
fb7c5e2b-312a-4a67-85ce-19f05f1de98e | Manu-2001/Circuiti-RLC | fase range ristretto/fit.cpp | #include <cmath>
#include <iostream>
#include "TCanvas.h"
#include "TF1.h"
// #include "TFile.h"
#include "TGraphErrors.h"
Double_t sfas_w(Double_t* x, Double_t* par) {
Float_t xx = x[0];
Double_t val = -1 * atan(2 * M_PI * par[0] * xx);
return val * 180 / M_PI;
}
Double_t sfas_t(Double_t* x, Double_t* par) {
... | ALGO | 0.99787 | 4.334723 |
ee93d7a5-c2f1-491e-b644-a40cd176e78d | fofsterss/8-bit-warriors | libs/exprtk/exprtk_simple_example_03.cpp | #include <cstdio>
#include <string>
#include "exprtk.hpp"
template <typename T>
void polynomial()
{
typedef exprtk::symbol_table<T> symbol_table_t;
typedef exprtk::expression<T> expression_t;
typedef exprtk::parser<T> parser_t;
const std::string expression_string =
"25x^5 - 35x^... | ALGO | 0.965319 | 4.59844 |
cafae09c-7f08-4356-9241-e70febbcc0d4 | 149mansi/DSA-CPP | lecture1.cpp/Array.cpp/27 2d array.cpp | // #include<iostream>
// #include<vector>
// using namespace std;
// int main(){
// int brr[3][3]={
// {1,2,3},
// {4,5,6},
// {2,4,8}};
// // row wise print
// // outer loop
// cout<<'row wise print' <<endl;
// for (int i = 0; i <3; i++)
// {
// ... | ALGO | 0.977094 | 4.065511 |
99d09147-d440-4ec2-a1f7-65217666c11c | Dhruvil2511/Leetcode-Grind | Graphs/word_ladder1.cpp | class Solution {
public:
int ladderLength(string beginWord, string endWord, vector<string>& wordList) {
// bfs algo -> because we need shortest path as given in question
// start from begin and keep changing single chars and check if its exits in
// word list so here by we will go... | ALGO | 0.99998 | 5.79499 |
f63d5190-f886-4397-a8e3-16922b938212 | AdarshThakur398/leetcode | 376-wiggle-subsequence/wiggle-subsequence.cpp | class Solution {
public:
unordered_map<string,int> mp;
int checke(vector<int>& nums,int i,int check,int prev) {
if(i==nums.size()) {
return 0;
}
int take=0;
string key=to_string(i)+','+to_string(check)+','+to_string(prev);
if(mp.count(key)) {
... | ALGO | 0.999992 | 5.285015 |
2c796de0-efca-47b0-b854-b432777f7282 | GJAY3072000/Way-To-DSA | Leetcode/509. Fibonacci Number.cpp | class Solution {
public:
int fib(int n) {
if(n<=1)
return n;
else{
return fib(n-1)+fib(n-2);
}
}
}; | ALGO | 0.999726 | 5.580904 |
574f0ee2-fcbf-486a-bf9c-dbf21f679f6b | Anemois/Codeforces | 897_2-C.cpp | //11/8/2023 difficulty:1300
#include <bits/stdc++.h>
#define Anemoi ios_base::sync_with_stdio(false);cin.tie(0);
#define int long long
using namespace std;
bool solve(){
int n;
cin >> n;
vector<int> vect(n);
for(int i=0; i<n; i++)
cin >> vect[i];
int resp;
if(vect[0] != 0){
cout... | ALGO | 0.9993 | 3.566438 |
0e20476e-aefe-40c7-b3b8-90fceb501aa5 | ishandutta2007/codeforces | i_love_tanya_romanova/normal/1033/B.cpp | /*
Walking these dirty streets
With hate in my mind
Feeling the scorn of the world
I won't follow your rules
Blame and lies, Contradictions arise
Blame and lies, Contradictions arise
Nonconformity in my inner self
I won't change my way
It has to be this way
I live my life for myself
Forget your filthy ways
Blame and li... | ALGO | 0.999936 | 4.045872 |
e9e4c238-3bba-47cb-8054-95e3c7efc2af | mcoder2014/myNotes | sources/Leetcodes/src/143_reorder_list.cpp | #include <iostream>
#include <stack>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
c... | ALGO | 0.999971 | 5.81135 |
9e37fa90-ee99-44d6-8c22-42f9aed56726 | lovecpus/ardupilot | libraries/AP_RangeFinder/AP_RangeFinder_VL53L0X.cpp | /*
driver for ST VL53L0X lidar
Many thanks to Pololu, https://github.com/pololu/vl53l0x-arduino and
the ST example code
*/
#include "AP_RangeFinder_VL53L0X.h"
#include <utility>
#include <AP_HAL/AP_HAL.h>
#include <AP_HAL/utility/sparse-endian.h>
#include <stdio.h>
extern const AP_HAL::HAL& hal;
enum regAdd... | TOOL | 0.871018 | 6.822637 |
d0c7d622-f0c4-43ad-8e08-cdc405eefb31 | alejobaenam/Competitive-Programming | USACO/2. Bronze/Getting Started/MeasuringTraffic.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
//No hecho
//freopen("traffic.in", "r", stdin);
//freopen("traffic.out", "w", stdout);
int n; cin >> n;
vector<tuple<string, int, int> > vector1;
for (int i = 0; i < n; ++i) {
string ramp; int lower, upper; cin >> ramp >> low... | ALGO | 0.999551 | 4.362351 |
b05cd7c5-ddbd-4cef-b3de-07794e2ca89f | Dhruv-3241/6Companies30Days | Company-3 (Adobe)/Ques7 (Number of Matching Subsequences).cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
bool check(string s1,string s2){
if(s1.length()<s2.length())return false;
int i = 0, j = 0;
while(i<s1.length() && j<s2.length()){
if(s1[i]==s2[j]){
i++;
j++;
}else... | ALGO | 0.999973 | 5.293714 |
e4f45cb3-0a33-4395-ac0b-e6b340a6b795 | rc420head-M/av | media/libstagefright/codecs/amrwb/src/noise_gen_amrwb.cpp | /*
------------------------------------------------------------------------------
Filename: noise_gen_amrwb.cpp
Date: 05/08/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
---------------------------------------------------------------------... | ALGO | 0.992123 | 5.300778 |
b77ccc65-1022-438a-8c17-1e0e1bd6c9fb | rhasanrakib/Contests-Codes | Battle of brains/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define root sqrt(2.0)
int main()
{
double r,n,ok=0.0,d,len;
int test;
cin>>test;
while(test--)
{
cin>>r;
ok=0.0;
while(r>.0000000001)
{
ok+=r;
r/=root;
}
printf("%.1lf\n",ok);
}
... | ALGO | 0.999545 | 3.422585 |
5b83b720-d6bd-436d-bea6-1c92e3fc72e0 | StravopodisNikos/smm_control | src/updateParams_fasmc_simple.cpp | #include <ros/ros.h>
#include <smm_control/FasmcFuzzyParams.h>
#include <smm_control/FasmcError.h>
#include <smm_control/FasmcAdaptiveParams.h> // Custom message with eta and epsilon
#include <cmath>
#include "smm_control/timing.h"
std::vector<double> eta_0(3, 0.01);
std::vector<double> epsilon_0(3, 0.01);
boost::arr... | ALGO | 0.998698 | 6.590088 |
f8c2da8e-9364-40bf-a6d6-e3ebf39222e9 | gunbbangGY/Programming_in_CPP | find_replace.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cout << "Է : ";
getline(cin, s, '&');
cin.ignore(); // remove following '\n' after '&';
string f, r;
cout << endl << "find : ";
getline(cin, f, '\n');
cout << "replace : ";
getline(cin, r, '\n');
int startIndex = 0;
while (tr... | TOOL | 0.998012 | 4.092687 |
9def9369-169d-4388-8068-bb15f7e3c067 | MeeSeongIm/c_cpp_samples | overload_functions.cpp | // overloading function names
// in C, functions are distinguished only by their name
// in C++, functions are distinguished by their function signatures.
#include <iostream>
using namespace std;
// volume of a cube
int volume( int s ) {
cout << "cube of " << s << endl;
return s * s * s;
}
// volume of a cylinder
... | ALGO | 0.92586 | 5.777268 |
b6058006-28a0-4fb2-ad7d-36d9c3394cd9 | Arhan13/seanprashad-leetcode-patterns | Sliding Window/3. Longest Substring Without Repeating Characters/Codes/1.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int lengthOfLongestSubstring(string s)
{
unordered_map<char, int> ump;
int left = 0;
int right = 0;
int maxLength = 0;
while (right < s.size())
{
// The element is not in the windo... | ALGO | 0.999723 | 5.059968 |
365fe334-0b21-43ad-9d4c-7fdc614999e4 | genericSpecimen/problem-solving | hackerrank/arrays/new_year_chaos.cpp | #include <iostream>
#include <vector>
#include <climits>
void minimum_bribes(std::vector<int>& queue) {
unsigned int min_bribes = 0;
for(int i=queue.size()-1;i>=0;i--) {
if((queue[i] - (i+1)) > 2) {
// person has bribed more than two persons
std::cout << "Too chaotic" << std::en... | ALGO | 0.998872 | 4.636163 |
a3c0ed20-c063-4da7-b28b-153b8d12930d | madmilla/THO78-Roborescue | Src/GUI/simulation/EnvironmentSimulator/simulatemap.cpp | /**
* __
* _________ / /_ ____ ________ ____________ _____
* /___/ __ \/ __ \/ __ \/ ___/ _ \/ ___/ ___/ / / / _ \
* / / / /_/ / /_/ / /_/ / / / __(__ ) /__/ /_/ / __/
* /_/ \____/_.___/\____/_/ \___/____/\___/\__,_/\___/
*
*
* @file SimulateMap.cpp
* @date Created: 22-04-2015
* @version ... | ALGO | 0.933972 | 3.52692 |
7a379a3d-9092-487f-bc00-bcbec3e04dd3 | Gopal2003/Codes | Brain Olympic/YT string/Isomorphic.cpp | #include<bits/stdc++.h>
using namespace std;
/**\
* ! Isomorphic- one to one mapping.
*/
// bool isIsomorphic(string s1,string s2)
// {
// unordered_map<char,char> umap;
// if(s1.size() != s2.size()) return 0;
// for(int i = 0 ; i < s1.size(); i++)
// {
// if(umap.find(s1[i]) != umap.end())
//... | ALGO | 0.999973 | 4.781193 |
fe8351f2-126a-49c9-aec3-e4bfea5f71b0 | ashishsahu1/CPP-Essentials | Recursion-and-Backtracking-LoveBabbar/Session 4 - String/2-SubsequenceString.cpp | #include <bits/stdc++.h>
using namespace std;
void Visualize(string str,string ans,int idx){
cout<<str<<"-"<<ans<<"-"<<idx<<endl;
}
void printSubs(string str, string ans, int idx)
{
// Visualize(str,ans,idx);
// Base case
if (idx == str.length())
{
cout << "Subsequence : "<< ans << endl;
... | ALGO | 0.999734 | 4.704526 |
0866be78-ddd9-49f9-a70e-9aae2cfcbd09 | SaiTp/LeetCode-Codes | 867-transpose-matrix/867-transpose-matrix.cpp | class Solution {
public:
vector<vector<int>> transpose(vector<vector<int>>& A) {
int cc = A.size();
int rr = A[0].size();
vector<vector<int>> res;
vector<int> rv;
for(int r = 0; r < rr; r++)
{
rv.clear();
for(int c = 0;... | ALGO | 0.999932 | 6.201176 |
3777708f-b757-43c6-8b7f-b28e50d637f4 | germanespinosa/cellworld_planner | src/tools/create_belief_state.cpp | #include <chrono>
#include <performance.h>
#include <cell_world.h>
#include <cellworld_planner/prey.h>
#include <cell_world/pose.h>
#include <params_cpp.h>
#include <cellworld_planner/simulation.h>
#include <cellworld_planner/statistics.h>
#include <cellworld_planner/belief_state_variable_time.h>
#include <thread_pool.... | ALGO | 0.997717 | 4.716746 |
5c311fe5-a914-452f-a324-103885f520d5 | banoni-dev/codeforces | cpp/D/1996.cpp |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define lll __int128_t
#define ld long double
#define pb push_back
#define pii pair<int, int>
#define vi vector<int>
#define vll vector<long long>
#define mp make_pair
#define ff first
#define ss second
#define all(c) (c).begin(), (c).end()
#define s... | ALGO | 0.999557 | 4.079566 |
002cb97d-7831-4168-a655-b8e8afaea4fd | Rahul8320/DS_and_Algo | Tree/inorderTraversalIterative.cpp | // preorder traversal of binary tree iterative approach
#include <iostream>
#include <stack>
using namespace std;
struct Node
{
int data;
struct Node *left, *right;
Node(int val)
{
data = val;
left = NULL;
right = NULL;
}
};
void inorder(Node *root)
{
if (root == NUL... | ALGO | 0.999997 | 6.117945 |
849ff918-5fa1-4c2f-9506-3717c84218f0 | weilanhanf/c-pratices | review/算法笔记/算法初步/贪心/PATB1020月饼.cpp | #include<stdio.h>
#include<algorithm>
using namespace std;
//PATB1020±
struct mooncake{
double store; //
double sell; //ۼ
double price; //
}cake[100];
bool cmp(mooncake a, mooncake b) //յɸߵ
{
return a.price>b.price;
}
int main()
{
int i, j, n;
double D, ans=0; // ansΪ
scanf("%d %lf", &n, &D); // nΪ±࣬DΪ... | ALGO | 0.999941 | 3.342116 |
dd0cee5a-9d2e-44b2-840f-3d6735bb7a04 | russelltian/leetcode_collection | leetcode/Algorithm.cpp | #include "Algorithm.hpp"
#include <vector>
#include <cmath>
#include <iostream>
using namespace std;
/*
#33 search in rotated sorted array
[0,1,2,4,5,6,7],[4,5,6,7,0,1,2]
*/
int rotate_array(vector<int>& nums, int target) {
int r = int(nums.size()-1);
int l = 0;
while(l <= r){
int m = (r+l)/2;
... | ALGO | 0.999944 | 4.485232 |
9f490a64-ff5b-4482-84b0-dfc2d0fa84cd | hdsong2/leetcode | src/p0163/cpp/solution.cpp | /**
* You are given an inclusive range [lower, upper] and a sorted unique integer array nums, where all elements are in the inclusive range.
*
* A number x is considered missing if x is in the range [lower, upper] and x is not in nums.
*
* Return the smallest sorted list of ranges that cover every missing number... | ALGO | 0.999577 | 5.879602 |
ebd4a137-8f03-4b4f-99b3-48e855d58842 | ryumme/PP1 | week5/lab5f.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
string s;
int l, r;
cin >> s >> l >> r;
string substring = s.substr(l, r - l + 1);
cout << substring << endl;
return 0;
} | ALGO | 0.985752 | 3.016876 |
861da147-9a8a-44f4-bc50-76aaf84b365d | jeterlab/ionic-mechanisms-underlying-bistability-in-spinal-motoneurons | boost/libs/program_options/src/value_semantic.cpp | #ifndef BOOST_PROGRAM_OPTIONS_SOURCE
# define BOOST_PROGRAM_OPTIONS_SOURCE
#endif
#include <boost/program_options/config.hpp>
#include <boost/program_options/value_semantic.hpp>
#include <boost/program_options/detail/convert.hpp>
#include <boost/program_options/detail/cmdline.hpp>
#include <set>
#include <cctype>
nam... | TOOL | 0.986121 | 7.625994 |
493f21b7-9af0-416f-b576-b76962827b57 | Fz-Faiz/DSA | graph/kahnAlgo.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
//Function to return list containing vertices in Topological order.
vector<int> topoSort(int V, vector<int> adj[])
{
int indegree[V] = {0};
for(int i=0;i<V;i++){
for(auto it: adj[i]){
indegree[it]++;
... | ALGO | 0.999998 | 5.795071 |
528df2fd-d7a1-482d-910c-86c3db6f04ad | imon6898/ACM-Library-master | Geometry/3D Geo.cpp | #include<bits/stdc++.h>
using namespace std;
const double pi = 4 * atan(1);
const double eps = 1e-10;
inline int dcmp (double x) { if (fabs(x) < eps) return 0; else return x < 0 ? -1 : 1; }
inline double torad(double deg) { return deg / 180 * pi; }
struct Point{
double x, y;
Point (double x = 0, double y = 0)... | ALGO | 0.998531 | 3.555701 |
ec3a0543-6aec-476d-9711-63359a6cf4f9 | emgoeddel/ara-planning | src/MazeStates.cpp | #include "MazeStates.h"
#include <cmath>
#include <iostream>
#include <utility>
bool box::operator == (const box& other) const
{
if (x == other.x && y == other.y) return true;
return false;
}
bool box::operator < (const box& other) const
{
return std::make_pair(x, y) < std::make_pair(other.x, other.y);
}
... | ALGO | 0.997109 | 4.994325 |
a2dfbcb2-a750-4c55-969b-88b423e842ec | NesterovN/Homework | 25.01.19/12.cpp | //Нахождение минимальной суммы пары элементов
#include <iostream>
using namespace std;
int main()
{
int sum, y, m;
int *M = new int[5];
int n;
cin >> n;
for (int i = 0; i < 5; i++)
{
cin >> M[i];
}
m = M[0];
cin >> y;
sum = m + y;
M[0] = y;
for (int i = 6; i < n; i++)
{
cin >> y;
if (M[i % 5] < m)
... | ALGO | 0.999706 | 3.205975 |
302cbd00-5d73-426a-b78b-dd991eece9b2 | pegvin/DLLBundler | src/main.cpp | #include <cstdlib>
#include <iostream>
#include <algorithm>
#include <filesystem>
#include "utils.h"
namespace fs = std::filesystem;
#define HELP_MESSAGE "Usage: dllb [-h] [--copy] [--upx] executable\n\n" \
"positional arguments:\n" \
" executable EXE or DLL file to bundle dependencies for\n\n" \
"options:\n" \
" ... | TOOL | 0.968718 | 6.090209 |
52323019-6b15-4ff9-a68d-17019d2cff0d | DanielBrito/competitive-programming | Solutions/URI Online Judge/2753 - Output7.cpp | // https://www.urionlinejudge.com.br/judge/en/problems/view/2753
#include <bits/stdc++.h>
using namespace std;
int main(){
for(int i=97; i<=122; i++){
char c = i;
cout << i << " e " << c << "\n";
// cout << i << " e " << static_cast<char>(i) << "\n";
}
return 0;
} | ALGO | 0.902892 | 3.264181 |
33d44ade-7035-4f55-8286-7b9809389d97 | shakirhms12/DSA | DS&ALGORITHM/pattern01.cpp | //rectangle pattern
#include<iostream>
using namespace std;
int main()
{
int row, coloumn;
cin>>row>>coloumn;
int i;
for(i=0;i<row;i++)
{
for(int j=0;j<coloumn;j++)
{
cout<<'*';
}
cout<<endl;
}
} | ALGO | 0.999588 | 3.549706 |
7a3b2cf7-7606-4d94-b50a-5039d162de8f | raincross7/code-similarity | codes/train_code/problem155/problem155_31.cpp | #include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<numeric>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;
using ll = long long;
class Stream{
public:
Stream(){
}
//配列以外の... | ALGO | 0.99999 | 3.789163 |
df2a9520-653e-4088-81c6-00d80296adf7 | ignotur/NINA | new_main.cpp | #include <iostream>
#include "stars.h"
#include <time.h>
#include <cstdlib>
#include <fstream>
#include <cmath>
#include <cstring>
using namespace std;
int main (int argc, char * argv[]) {
ifstream input ("input.txt");
parametrs_B param_B (&input);
parametrs_lum param_lum (&input);
double T... | ALGO | 0.994165 | 3.150981 |
f29c7594-a0bd-424d-88ee-0aa56dbc64d2 | ADS-bot/Leetcode | 1361-tiling-a-rectangle-with-the-fewest-squares/1361-tiling-a-rectangle-with-the-fewest-squares.cpp | class Solution {
public:
int tilingRectangle(int n, int m) {
return tilingRectangle(n, m, 0, vector<int>(m));
}
private:
static constexpr int kBase = 13;
unordered_map<long, int> dp;
int tilingRectangle(int n, int m, long hashedHeights, vector<int>&& heights) {
if (const auto it = dp.find(hashedHe... | ALGO | 0.999972 | 6.995803 |
f7d3afae-21bb-46e0-ac96-d42c9402331c | Taimoo-r/LeetCode | 1524-string-matching-in-an-array/string-matching-in-an-array.cpp | class Solution {
public:
vector<string> stringMatching(vector<string>& words) {
set<string> st;
int n = words.size();
vector<string> ans;
for(int i = 0 ; i < n ; i++){
for(int j = 0 ; j < n ; j++){
if(i!=j && words[i].find(words[j])!=string::npos){
... | ALGO | 0.999814 | 5.443983 |
df0eef4a-fbab-405f-8444-f4ebceeae8fe | aKiii017/SolSearch | implementation/z3/src/ast/for_each_ast.cpp | #include "ast/for_each_ast.h"
struct ast_counter_proc {
unsigned m_num;
ast_counter_proc():m_num(0) {}
void operator()(ast *) { m_num++; }
};
unsigned get_num_nodes(ast * n) {
for_each_ast_proc<ast_counter_proc> counter;
for_each_ast(counter, n);
return counter.m_num;
}
bool for_each_paramet... | TOOL | 0.866397 | 4.5412 |
11c380e1-ed08-4e58-a761-b714428c2683 | Forrest-Z/Navigation_Box_HASM | Software_stack/src/pcap_streamer/slam_libs/mms_shared/common/libs/nie_cv/src/nie/cv/vo/visual_odometry_mono.cpp | #include "visual_odometry_mono.hpp"
#include <glog/logging.h>
#include <nie/core/algorithm.hpp>
#include <nie/core/geometry/conversion.hpp>
#include <nie/core/scoped_timer.hpp>
#include "ba_problem.hpp"
#include "back_projection.hpp"
#include "visual_odometry.hpp"
namespace nie {
VisualOdometryMono::VisualOdometry... | ALGO | 0.960145 | 6.926051 |
1f1a0129-bb1f-4565-a5d2-327a0f7e5d15 | AbdoWael2003/Graduation-Project-QAgent2.0- | FlowChartGeneration/CPPSamples/Sample1025/sample_code1025.cpp | #include <iostream>
#include <string>
#include <algorithm>
std::string remove_vowels(const std::string& text) {
std::string result;
for (char s : text) {
char lower_s = std::tolower(s);
if (lower_s != 'a' && lower_s != 'e' && lower_s != 'i' && lower_s != 'o' && lower_s != 'u') {
res... | ALGO | 0.958119 | 6.191283 |
4d21bb94-9642-4e53-881a-8b2b125c4b52 | dwip-nandi/CodeChef | B_Comparison_String.cpp | // #include<bits/stdc++.h>
// using namespace std;
// int main(){
// int t;
// cin>>t;
// while(t--){
// int n;
// cin>>n;
// string s;
// cin>>s;
// int ml=0,mr=0;
// for(int i=0;i<n;i++){
// int cl=0,cr=0;
// while(s[i]=='>'){
// ... | ALGO | 0.999883 | 4.268205 |
550e00b7-2cd0-4488-b23c-3f85bbb84547 | Srishtik16/Leetcode-Submissions | 599-minimum-index-sum-of-two-lists/599-minimum-index-sum-of-two-lists.cpp | class Solution {
public:
vector<string> findRestaurant(vector<string>& list1, vector<string>& list2) {
int n = list1.size();
int m = list2.size();
map<string, int> m1, m2;
for(int i = 0; i < n; i++) {
m1[list1[i]] = i;
}
for(int i = 0; i < m; i++) {
... | ALGO | 0.999993 | 5.663178 |
702666de-956c-4fd5-80b9-d284000087b2 | Huuuhi/LeetCode | 滑动窗口/1248.统计优美数组.cpp | //
// Created by GooYu on 2024/6/21.
//
#include "header.h"
/*
* 给你一个整数数组 nums 和一个整数 k。如果某个连续子数组中恰好有 k 个奇数数字,我们就认为这个子数组是「优美子数组」。
* 请返回这个数组中 「优美子数组」 的数目。
* */
#include "header.h"
using namespace std;
class Solution {
public:
int numberOfSubarrays(vector<int>& nums, int k) {
int n=nums.size();
vec... | ALGO | 0.999915 | 5.380624 |
4e8dcff8-e99e-4863-92ca-f82b493a9108 | SayemImran/XPSC | WEEK2/FF.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int n;
cin>>n;
cin.ignore();
string s1, s2;
cin >> s1;
cin.ignore();
cin >> s2;
int even_A_one = 0;
int odd_A_one = 0;
int even_B_zero = 0;... | ALGO | 0.999978 | 4.92999 |
be623fd7-5e5a-4e54-a777-0549b2f5ce9e | raincross7/code-similarity | codes/train_code/problem439/problem439_227.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
vector<long long> x(n);
for(int i=0;i<n;i++){
cin>>x[i];
}
int max=0;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(i==j){
break;
}
int d=x[i]-x[j];
if(d<0){
d=-d;
}
... | ALGO | 0.999891 | 3.823012 |
1c58c11c-c772-4c2e-bec5-9bf1ae2620e7 | luohb92/CourseraProject | 计算导论与C语言基础/Ohter/基础编程练习2/number04.cpp | /**
* 骑车与走路
*/
#include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
for(int i = 0; i < n; ++i){
cin >> a[i];
}
for(int i = 0; i < n; ++i) {
int walkTime = (int)(a[i] / 1.2);
int bikeTime = 27 + 23 + (int)(a[i] / 3);
if(walkTime < bikeTim... | ALGO | 0.999852 | 4.081682 |
fa1a2b4c-26e6-49d4-8eb1-fdcff5d2520d | Manik-Aggarwal/Codestudio | Shortest path in undirected graph/shortest-path.cpp | #include<bits/stdc++.h>
vector<int> shortestPath( vector<pair<int,int>> edges , int n , int m, int s , int t){
unordered_map<int,list<int>> adj;
for(int i=0; i<edges.size(); i++){
int u = edges[i].first;
int v = edges[i].second;
adj[u].push_back(v);
adj[v].push_back(u);
... | ALGO | 0.99999 | 5.158786 |
b607dc42-88ac-4070-8314-adbe539028b7 | Saikiranreddy31/My-Coding-Journey | Cpp_Intoduction_Basic_DSA programs/StringCoversion.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string str = "abhsysccll";
// converting lower case to upper case 'a' - 'A' = 32
for(int i=0;i<str.size();i++){
if(str[i]>='a' && str[i]<='z')
str[i] -= 32;
}
cout<<str<<endl;
// coverting upper case to lowe... | ALGO | 0.998479 | 4.53581 |
c5663510-9453-4edd-b24e-352c1372e000 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3727_3.cpp | #include <bits/stdc++.h>
#define va first
#define vb second
using namespace std;
typedef pair<int,int> pii;
const int MN = 2e5+5;
int N,A[MN],B[MN];
priority_queue<pii> PQ;
int main()
{
cin >> N;
for(int i=0; i<N; i++) cin >> A[i];
for(int i=0; i<N; i++){
cin >> B[i];
if(B[i]<A[i]){
... | ALGO | 0.999948 | 3.386092 |
e8f3e11c-6e21-4a9a-8954-bc184b2e6739 | CompOmics/jwrapper-pepnovo | pepnovo/src/PrmNodeScoreModel.cpp | #include "PrmNodeScoreModel.h"
#include "PrmGraph.h"
#include "QuickClustering.h"
#include "AllScoreModels.h"
void PrmNodeScoreModel::read_score_model(Config *config, const char *name, bool silent_ind)
{
config_ = config;
// resize regional breakage score models according to regional fragment sets
const vector< ve... | ALGO | 0.957431 | 4.346903 |
e9b8db44-6ffc-450e-a7b9-9b22ed9d1ede | ishandutta2007/codeforces | atreus/normal/360/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e4 + 100 + 10;
const ll inf = 1e18;
int n, a[maxn], deg[maxn], b[maxn], w[maxn];
bool mark[maxn];
ll dis[5][maxn];
vector<pair<int,int> > g[maxn];
void dijkstra(int src, int q){
for (int u = 1; u <= n; u++)
dis[q][u] = inf;
d... | ALGO | 0.999912 | 3.62677 |
4cb860ee-f3b4-40e5-9bac-42c78269604e | theshinegupta/LeetCode | 516-longest-palindromic-subsequence/516-longest-palindromic-subsequence.cpp | class Solution {
public:
int longestPalindromeSubseq(string text1) {
string text2=text1;
reverse(text2.begin(),text2.end());
vector<vector<int>> dp(text1.length(),vector<int> (text2.length(),-1));
return maxLen(text1,text2,0,0,text1.length(),text2.length(),... | ALGO | 0.999958 | 6.188507 |
77cf392b-330e-4516-b9c8-63c550172cec | listless-dude/CodeforcesProblems | bear.cpp | #include <bits/stdc++.h>
using namespace std;
// http://codeforces.com/contest/791/problem/A
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int a, b;
cin >> a >> b;
int years = 0;
do
{
a *= 3;
b *= 2;
years++;
} while (a <= ... | ALGO | 0.999775 | 4.225057 |
01bf9891-1057-4df7-9ed8-9b0922ae09af | luatil/cppractice | competitive_programming/google/codejam2021/round_1a/template.cpp | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <typename T> using oset = tree<T,null_type,less_equal<T>,rb_tree_tag, tree_order_statistics_node_update>;
using ll = long long;
using vi = vector<int>;
#define pb push_back
#define rsz resize
... | ALGO | 0.997996 | 4.088785 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.