uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
53e02104-fcd4-4278-af1d-66967884a902 | GuacheSuede/MSSubmission1234567890 | submission/sma/boost_1_69_0/libs/graph/example/copy-example.cpp | int
main()
{
using namespace boost;
typedef adjacency_list < vecS, vecS, directedS,
property < vertex_name_t, char > > graph_t;
enum
{ a, b, c, d, e, f, g, N };
graph_t G(N);
property_map < graph_t, vertex_name_t >::type
name_map = get(vertex_name, G);
char name = 'a';
graph_traits < graph_t >:... | ALGO | 0.958751 | 4.487548 |
ea274b04-b8d0-4aa8-99ab-7a10682cd1a2 | Harizmudrik/141_ConditionalStatement | file4.cpp | #include <iostream>
using namespace std;
float FungsiHitungRerata(float p, float q){
return (p+q) /2;
}
string FungsiCekStatus(float r){
if (r >= 60) {
return "Lulus";
} else {
return "Tidak Lulus";
}
}
int main() {
float Nilai1, Nilai2;
cout << "Masukkan nilai 1 : "... | ALGO | 0.996392 | 4.686643 |
641dd10b-10d8-41bd-b2a8-010b6955ef8d | akshay11l7/Codeforces-Solutions | A/tozero.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n, k;
cin >> n >> k;
if (n % 2 == 0) {
cout << (int)ceil((double)n / (k - 1)) << endl;
} else {
int a = n - k;
cout << (int)ceil((double)a / (k - 1) + 1) << endl;
}
}
int main() {
int t;
cin >> t;... | ALGO | 0.999891 | 4.776878 |
72694036-4b53-43ca-b5e8-180775f8b1b9 | leo4048111/One-Leetcode-Everyday | 934-shortest-bridge.cpp | // https://leetcode.cn/problems/shortest-bridge/
class Solution {
public:
const static inline vector<int> dirs = {-1, 0, 1, 0, -1};
int shortestBridge(vector<vector<int>>& grid) {
int n = grid.size();
queue<pair<int, int>> q;
function<void(int, int)> dfs = [&](int i, int j) {
... | ALGO | 0.999916 | 6.025789 |
9aeb35e9-fce1-4092-af5a-b7e5ccb8922d | shashankyadav-iiit/DSA | graph/dfs_graph.cpp | #include<bits/stdc++.h>
using namespace std;
void dfs(int node, vector<int> &visited, vector<vector<int>> &graph){
visited[node] = 1;
for(int i = 0;i<graph.size()+1;i++){
if(graph[node][i] == 1 and !visited[i]){
dfs(i,visited,graph);
}
}
}
vector<int> dfsTraversal(vector<vector... | ALGO | 0.999965 | 4.752697 |
5fc80f95-f224-487c-864b-16052aeb02eb | byam/algorithms | atcoder/contest/arc/arc134/b.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
//#include <atcoder/all>
// using namespace atcoder;
using namespace std;
// func
#define rep(i, first, last) for (int i = (first); i < (last); i++)
#define rrep(i, last, first) for (int i = (last); i >= (fi... | ALGO | 0.999995 | 4.523271 |
da774334-30d8-46ee-b07a-6af18396d7ca | PGSkep/Physics-Animation-Vk- | Physics and Animation/_Lib/include x64/bullet/ThirdPartyLibs/Wavefront/tiny_obj_loader.cpp | // Erwin Coumans: improved performance, especially in debug mode on Visual Studio (25sec -> 4sec)
//
// version 0.9.5: Parse multiple group name.
// Add support of specifying the base path to load material file.
// version 0.9.4: Initial suupport of group tag(g)
// version 0.9.3: Fix parsing triple 'x/y/... | TOOL | 0.916211 | 5.175294 |
da9f5583-5424-498c-b97e-1b20be9bc11b | surepay123456/leetcode_train | src/leetcode/src/图论/ACM模式岛屿数量-深搜版.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <utility>
#include <vector>
using namespace std;
vector<vector<int>> direction = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
void dfs(vector<vector<int>>& map, int curX, int curY,
vector<vector<bool>>& visited) {
for (int i =... | ALGO | 0.999842 | 5.407943 |
295b5f53-6679-4583-8d70-6c26e2097e2a | proydakov/codeforces | Codeforces_Round_#423/A/solution.cpp | #include <cstdint>
#include <iostream>
int main()
{
std::ios::sync_with_stdio(false);
int64_t n; int64_t a; int64_t b; int64_t half = 0;
std::cin >> n;
std::cin >> a;
std::cin >> b;
int64_t counter = 0;
for(int64_t i = 0; i < n; i++) {
int64_t val;
std::cin >> val;
... | ALGO | 0.999842 | 3.718604 |
492c315f-aee6-4306-bc7a-2397c1d0a310 | mewmintlabs/mewmint | src/kernel/coinstats.cpp | #include <kernel/coinstats.h>
#include <chain.h>
#include <coins.h>
#include <crypto/muhash.h>
#include <hash.h>
#include <logging.h>
#include <node/blockstorage.h>
#include <primitives/transaction.h>
#include <script/script.h>
#include <serialize.h>
#include <span.h>
#include <streams.h>
#include <sync.h>
#include <t... | TOOL | 0.864576 | 7.396273 |
1f5e65fd-0b9a-48a5-bcce-574ba3351417 | liuhuanjim013/pcl-fork | gpu/people/src/bodyparts_detector.cpp | /*
* Software License Agreement (BSD License)
*
* Copyright (c) 2011, Willow Garage, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code mu... | DATA | 0.926379 | 5.774457 |
3008068d-7e81-4311-846d-5fd1340e0cdf | lasjg72/CompetetiveProgramming | program/Atcoder/ABC/ABC222/A.cpp | #include <iostream>
#include <algorithm>
#include <tuple>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <cassert>
using namespace std;
using ll = long long;
int main()
{
string s;
cin >> s;
int num = 4-s.size();
string ans;
for(int i =... | ALGO | 0.999661 | 4.092029 |
051514c1-4b5c-4954-b7b6-8654a34bc25a | 1JI0O/noipprograms | 20191214/kth(暴力).cpp | #include<queue>
#include<cstdio>
#include<iostream>
using namespace std;
priority_queue<int> q;
int n,k,tmp,ans;
char pd='0';
int b[100002];
int ab[100002];
void pprint()
{
for(int i=1;i<k;i++)
{
b[i]=q.top();
q.pop();
}
ans++;
ab[ans]=q.top();
for(int i=1;i<k;i++)
q.push(b[i]);
}
int main()
{
//freope... | ALGO | 0.999596 | 3.179952 |
aebf9cd7-ae11-4742-953e-7da63678612f | mrreda1/problem-solving | codeforces/XORXOR.cpp | #include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define make_unique(x) sort(all(x)), x.erase(unique(all(x)), x.end())
using namespace std;
template <typename T> T nxt();
template <typename T> class is_iterable {
public:
template <typename U>
static auto test(U... | ALGO | 0.999974 | 4.611472 |
ae1e46a5-2594-404f-8a19-c69cec7be71c | trueos/trueos-ports | www/logtools/files/patch-clfdomainsplit.cpp | --- clfdomainsplit.cpp.orig 2016-12-25 15:08:38 UTC
+++ clfdomainsplit.cpp
@@ -1,15 +1,18 @@
-#include <stdio.h>
-
+#include <cstdio>
+#include <cstdlib>
#include <unordered_map>
#include <unistd.h>
#include <cstring>
#include <vector>
-#include <ctype.h>
+#include <cctype>
+#include <string>
#include "logtools.... | TOOL | 0.954087 | 4.401296 |
5de2b2fa-e49e-4938-a3f5-19ce48771ef9 | sushil2817/DSA-in-CPP | Sorting and Searching/Exponential&UnboundedSearch.cpp | // search in infinite array (unbounded array)
// O(logi) is the position of the target element in the array
#include<iostream>
using namespace std;
int bs(int a[], int start, int end, int x){
while(start<= end){
int mid = (start+end)/2;
if(a[mid]==x){
return mid;
}
el... | ALGO | 0.999697 | 4.129304 |
d3b3a3df-9e1b-4845-8a99-d343680c7641 | sabujsarker382/codeforce_problem | A_Array_Coloring.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;cin>>t;
while(t--){
int n;
cin>>n;
int c=0,d=0;
for(int i=0;i<n;i++){
int a;
cin>>a;
if(a%2==0){
c++;
}
else{
d++;
... | ALGO | 0.998916 | 4.656167 |
51909a19-152e-4d7b-8543-b0ba53367176 | maximilianheer/coyote_dev | hw/services/network/hls/ip_handler/ip_handler.cpp | #include "ip_handler_config.hpp"
#include "ip_handler.hpp"
#include "../ethernet/ethernet.hpp"
#include "../ipv4/ipv4.hpp"
/**
* Detects the MAC protocol in the header of the packet, the Ethertype is written etherTypeFifo
*/
template <int WIDTH>
void detect_eth_protocol( hls::stream<net_axis<WIDTH> >& dataIn,
... | TOOL | 0.877275 | 5.061381 |
58ac9224-ffa2-4552-8c5c-46406552369d | aaiss0927/Tutoring_DataStructure | 24실습/Week_4/Week_4_4.cpp | #include <iostream>
using namespace std;
class arrayQueue {
private:
int* arr;
int capacity;
int f;
int r;
int s;
public:
arrayQueue(int capacity) {
this->capacity = capacity;
arr = new int[capacity];
f = r = 0;
s = 0;
}
bool empty() {
return (s == 0);
}
bool full() {
return (s == capacity);
... | ALGO | 0.999961 | 3.887225 |
1f0b5071-ca65-4750-9db1-672e5f6b17c8 | charliealpha094/Programing---Principles-and-Practices-cpp | chapterFour/numeric_example_vector/main.cpp | // Done by Carlos Amaral (2023/08/05)
// Read an amount of temperatures and calculate the median and average
#include "std_lib_facilities.h"
int main()
{
// Variable (and vector) declaration
vector<double> temps;
double sum = 0;
// User input and place it into vector
cout << "Please, introduce s... | ALGO | 0.998954 | 5.956916 |
45a4d12e-484e-400f-8193-2d0602b21be5 | Hsin-Hung/N-body-simulation | src/cpu/nBody.cpp | #include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <math.h>
#include "nBody.h"
#include "directSum.h"
#include "barnesHut.h"
#include "constants.h"
NBody::NBody(int n, int a, int s) : nBodies(n)
{
if (s == 0)
{
initSpiralBodies();
}
else if (s == 1)
{
initRandomB... | ALGO | 0.999468 | 3.273665 |
1c4ad753-207f-4b3b-9eac-74154e2a8cdd | Vincent-28/VGit | Lab 4/trapezoid.cpp | //Name: Vincent L Sang
//Email: <EMAIL>
//Date: March 1st, 2024
#include <iostream>
//library
using namespace std;
//std
int main() {
int w, h;
// cout << "Input width: ";
cin >> w;
//width
// cout << "Input height: ";
cin >> h;
//height
if (w < 2 * (h - 1) + 1) {
cout << "Impossi... | ALGO | 0.904939 | 4.335016 |
79dccfa1-ab79-456a-8975-9931bd1d06cc | rlatkdgus2627/Military_PS | 3015.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll n, x;
ll ans;
ll cnt;
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
cin >> n;
stack<pair<ll, ll> > S;
for(int i = 0; i < n; i++){
cin >> x;
while(!S.empty() && S.top().first < x){
ans += S.top().second;
S.pop();
}
cnt = 1;
... | ALGO | 0.999833 | 3.819034 |
1eed671c-bb1c-4731-bcf5-5a003e6c8083 | commoncoder73/dsa-16jan2025 | cpp/23_BestSum/solution.cpp | #include <bits/stdc++.h>
using namespace std;
// Assume that target is N and total elements in nums array is M
// TC: O(M^N)
// SC: O(N)
// Given nums only contains positive number
int maxPossibleLength(vector<int> nums, int target) {
if (target < 0) {
return -1;
}
if (target == 0) {
return 0;
}
int... | ALGO | 0.999947 | 5.775738 |
f3614c2b-32a6-406c-b5d3-b72a294443ba | ankit-prasadx/Basics | Java/GenericClass.cpp | #include<iostream>
using namespace std;
template <class T>
class Array
{
public:
T *Arr;
int Size;
Array(int length)
{
Size = length;
Arr = new T(Size);
}
void Accept()
{
cout<<"Enter the Values\n";
for(int i = 0; i < Size; i++)
{
c... | ALGO | 0.865574 | 4.379201 |
399dee4b-1f6b-409a-80d0-a57c54383575 | DevelMango/mango | src/qt/transactionrecord.cpp | #include "transactionrecord.h"
#include "base58.h"
#include "Darksend.h"
#include "Instantx.h"
#include "timedata.h"
#include "wallet.h"
#include <stdint.h>
/* Return positive answer if transaction should be shown in list.
*/
bool TransactionRecord::showTransaction(const CWalletTx& wtx)
{
if (wtx.IsCoinBase()) ... | TOOL | 0.853085 | 5.311092 |
b9b7b8ce-7780-4a6c-8cce-5a9c568e744e | ishandutta2007/codeforces | lyc_music/normal/1627/E.cpp | //~~
#include<bits/stdc++.h>
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp make_pair
#define mt make_tuple
#define pa pair < int,int >
#define fi first
#define se second
#define inf 1e18
#define mod 998244353
#define int ll
#define N 400005
using namespace std;
inline ... | ALGO | 0.999907 | 3.978848 |
390c2ac5-25dd-4021-a134-8f94283e2c4c | Ryansmg/CodingPractice | .contests/Codeforces/2024/Codeforces_949_virtual/A.cpp | #pragma region macros
//@formatter:off
#define GCC_OPTIMIZE_ENABLE false
#define ENABLE_CPP20_MACRO true
#include <bits/stdc++.h>
using namespace std;
#if GCC_OPTIMIZE_ENABLE
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#endif
#ifdef LOCAL
#define lfastio print()
#else
#define lfastio fastio
#end... | ALGO | 0.999167 | 5.351485 |
580abbe3-584d-4db9-a1e3-e2468d31d168 | youbeen2798/Baekjoon-Problems | 1743_음식물 피하기_BFS.cpp | #include <iostream>
#include <queue>
using namespace std;
int n, m, k;
int r, c;
bool map[101][101];
bool visited[101][101];
queue <pair<int, int>> q;
int dx[4] = { 1,-1,0,0 };
int dy[4] = { 0,0,1,-1 };
int cnt = 0;
void bfs(int x, int y) {
visited[x][y] = 1; //visited[2][2] = 1
q.push(make_pair(x, y)); //2 2
cn... | ALGO | 0.999836 | 4.060349 |
7725d2ae-a144-4252-abc6-389a2c0ce523 | juane619/ETSIIT-1-MP | gestionDeProyectos/makes/proyecto2/src/central.cpp | /**
* @file central.cpp
* @brief Calcula círculo con centro en medio de dos círculos y radio la mitad de la distancia
* @author Agarrido
* @warning Módulo no definitivo (creado para ser modificado)
*
* Un ejemplo de ejecución es:
* Introduzca un circulo en formato radio-(x,y): 3-(0,0)
* Introduzca o... | ALGO | 0.999365 | 4.781315 |
277d6d26-c93b-4351-93db-4d7b5e3d4a0c | Prayas-Dev/DSA | mergesortedarray.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public :
void merge(vector<int>& nums1, int m, vector<int>&nums2, int n){
int i = m-1;
int j = n-1;
int k = m + n -1;
while(i>=0 && j>=0){
if(nums1[i]>nums2[j]){
nums1[k]=nums1[i];
i--;
}
else{
nums... | ALGO | 0.999967 | 5.099776 |
73ae6415-9dc9-4fc7-93d4-b7fc3dbfda6c | Renm11/Ego-planner-shelf | src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/bind_member_functions.cpp | #include <iostream>
#include <boost/numeric/odeint.hpp>
namespace odeint = boost::numeric::odeint;
typedef boost::array< double , 3 > state_type;
//[ ode_wrapper
template< class Obj , class Mem >
class ode_wrapper
{
Obj m_obj;
Mem m_mem;
public:
ode_wrapper( Obj obj , Mem mem ) : m_obj( obj ) , m_mem(... | ALGO | 0.981143 | 7.561692 |
881a1029-5735-4b27-8d68-d220478dbeb0 | Jeevan-kumar-Raj/LeetCode-Algorithms-Solutions-Topicwise | next-greater-node-in-linked-list.cpp | // Time: O(n)
// Space: O(n)
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
vector<int> nextLargerNodes(ListNode* head) {
vector<int> result;
vector<pair<int, in... | ALGO | 0.999964 | 6.138546 |
51c31671-a056-4f08-a1c2-3fa3a7e3f883 | Serious-senpai/min-timespan-delivery | extern/alglib-cpp/src/fasttransforms.cpp | #ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "stdafx.h"
#include "fasttransforms.h"
// disable some irrelevant warnings
#if (AE_COMPILER==AE_MSVC) && !defined(AE_ALL_WARNINGS)
#pragma warning(disable:4100)
#pragma warning(disable:4127)
#pragma warning(disable:4611)
#pragma warning(disable:4702)
#pra... | ALGO | 0.998219 | 5.951272 |
572b0545-efbf-4922-bac5-3f8b1afb5678 | raincross7/code-similarity | codes/train_code/problem022/problem022_292.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
cin >> a >> b;
double avg = double(a+b)/2;
avg = avg + 0.5;
cout << int(avg);
} | ALGO | 0.999908 | 3.572269 |
b5faf4f7-a149-44a6-9162-9d8a3516f156 | RahulDadhich26/LEETCODE-DSA | 0937-online-stock-span/0937-online-stock-span.cpp | class StockSpanner {
public:
StockSpanner() {}
stack<pair<int,int>>st;
int next(int price) {
int span = 1;
while(!st.empty() && st.top().first <= price){
span += st.top().second;
st.pop();
}
st.push({price,span});
return span;
}
};
/... | ALGO | 0.998438 | 6.197718 |
ab510031-f880-462e-beb6-6b387a10c520 | raincross7/code-similarity | codes/train_code/problem304/problem304_174.cpp | // includes
#include "bits/stdc++.h"
using namespace std;
// macros
#define ll long long
#define MOD 1000000007 // 998244353 //100000000 //
#define pii pair<ll, ll>
#define piii pair<ll, pii>
#define sz(x) ((ll)(x).size())
#define ft first
#define sd second
#define pb push_back
#define rep(i, n) for(ll i = 0; i < n; ... | ALGO | 0.999975 | 5.004799 |
c5054904-ba6a-4eaa-a543-c85dd8de2a93 | ljjhome/CPrimerPractice | chp16/ex16_1.cpp | #include <string>
#include <iostream>
using namespace std;
template <typename T>
T jjabs(T a){
if(a>=0){
return a;
}
else{
return -a;
}
}
int main(){
int t1 = 10;
float t2 = -1.3;
double t3 = -19.34;
cout<<"abs(t1)="<<jjabs(t1)<<endl;
cout<<"abs(t2)="<<jjabs(t2)<<endl;
cout<<"abs(t3)="<<jjabs(t3)<<endl... | ALGO | 0.992664 | 3.905668 |
254bebde-5e5a-4a97-9b07-c200e8aa7acf | ishandutta2007/codeforces | frodakcin/normal/1149/C.cpp | #include <iostream>
#include <cstdio>
using namespace std;
const int MN = 1e5 + 100;
int N, Q;
struct STN
{
int v, w, l, r, a;
int z;
STN operator + (const STN& o) const
{
STN k;
k.v = max(v, o.v);
k.w = min(w, o.w);
k.l = max(v-(o.w<<1), max(l, o.l));
k.r = max(o.v-(w<<1), max(r, o.r));
k.a = max(ma... | ALGO | 0.999896 | 3.658875 |
abffb23c-bbb9-46f6-9d52-dc11ce917410 | microsoft/TSS.MSR | TSS.CPP/Src/Crypto.cpp | #include "stdafx.h"
#include "Crypto.h"
extern "C" {
#include <openssl/aes.h>
#include <openssl/evp.h>
#include <openssl/ossl_typ.h>
#include <openssl/sha.h>
#include <openssl/hmac.h>
#include <openssl/rand.h>
#include <openssl/evp.h>
#include <openssl/rsa.h>
#if !defined(OPENSSL_NO_SM3) && OPENSSL_VERSION_NUMBER > 0... | TOOL | 0.963921 | 7.268291 |
3d8684d9-6269-44cc-b587-9f2cc102d4f8 | doanphuc210/Tonghopbaitapchuong1denchuong13 | pj9_challenger3.cpp | #include <iostream>
#include <iomanip>
// Function prototypes
void inputScores(int* scores, int numScores);
void sortScores(int* scores, int numScores);
double calculateAverage(const int* scores, int numScores);
int main() {
int numScores;
// Get the number of test scores from the user
std::cout << "Ente... | ALGO | 0.997853 | 7.647165 |
27ebc2d0-e420-459a-af6b-eddc6cd36cd1 | atharvanaphade/codeforces | B_Random_Teams.cpp | #include <iostream>
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
ll n, m;
cin >> n >> m;
ll k_max = 0, k_min = 0;
k_max = ((n - m + 1) * (n - m)) / 2;
ll B = n / m, r = n % m;
k_min = (m - r) * (B * (B - 1) / 2) + r * ((B + 1) * B / 2);
cout << k_min << " " << k_max;
}
| ALGO | 0.999846 | 4.030523 |
ff9058bf-4dd1-4964-a843-645b6d7f9e47 | canhhuynh2k2/Applications_of_Algorithm_SAMSUNG_2022 | S102_TapConBangNhau.cpp | #include<bits/stdc++.h>
using namespace std;
int n, a[105], sum = 0, b[105], ok = 0, sum_1 = 0;
void Try(int i){
for(int j = 0; j <= 1; j++){
a[i] = j;
sum_1 += b[i] * a[i];
if(sum_1 = sum / 2){
ok = 1;
return;
}
if(sum_1 <= sum / 2 && i <= n) Try(i+1);
sum_1 -= b[i] * a[i];
}
}
int main(){
int t;
... | ALGO | 0.999689 | 4.13499 |
2c204a31-cb56-40f3-baee-2508cbcf9791 | divyanshusharma3031/leetcode | 89-gray-code/89-gray-code.cpp | class Solution {
public:
void convertToBinary(vector<int> &bin,int i)
{
// cout<<i<<'\n';
while(i)
{
bin.push_back(i%2);
i=i/2;
}
reverse(bin.begin(),bin.end());
}
int convertToint(vector<int> &bin)
{
int ans=0;
... | ALGO | 0.99999 | 5.29311 |
3bd8713a-6287-4b9e-b2da-06573fac049b | harshit-jain52/CP_DSA | codeforces/1851D.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long ll;
bool solve()
{
int n;
cin >> n;
ll a[n];
a[0] = 0;
for (int i = 1; i < n; i++)
{
cin >> a[i];
}
ll tot = n * 1LL * (n + 1) / 2, sum = a[n - 1];
if (sum > tot)
{
return false;
... | ALGO | 0.999804 | 4.193508 |
3f0b4e28-b74c-4994-8aaf-d91e9b3703fa | kassonlab/gmxapi | src/gromacs/linearalgebra/gmx_lapack/dlarft.cpp | #include <cmath>
#include "gromacs/utility/real.h"
#include "../gmx_blas.h"
#include "../gmx_lapack.h"
void
F77_FUNC(dlarft,DLARFT)(const char *direct,
const char *storev,
int *n,
int *k,
double *v,
int *ldv,
double *tau,
double *t,
int *ldt)
{
/* System generated locals */
int t_dim1, t_offs... | ALGO | 0.998915 | 5.613169 |
de74a8fb-ca3a-4a50-b2e1-ccf114648e28 | sejalrai23/DSA-Practise | 1359-count-all-valid-pickup-and-delivery-options/1359-count-all-valid-pickup-and-delivery-options.cpp | class Solution {
public:
int countOrders(int n) {
int mod=1e9+7;
long long ans=1;
for(int i=1;i<=n;i++){
ans= (ans*i)%mod;
ans= (ans*(2*i-1))%mod;
}
return ans;
}
}; | ALGO | 0.999984 | 5.675051 |
5ac60205-89c8-4eb9-af34-498aca8e6b0c | ashekhawat6198/DSA | BINARY_TRESS.CPP | #include <iostream>
using namespace std;
#include <queue>
class Node
{
public:
int data;
Node *left;
Node *right;
Node(int data)
{
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
Node *buildTree(Node *root)
{
cout << "Enter the data: " << endl;
... | ALGO | 0.999845 | 3.828843 |
d51c29df-b4b1-42bc-9462-d1b0fbf0a6a9 | FalseG0d/Algorithm-Data-Structure | GeeksForGeeks/PractiseChallege/countingSquares.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int countSquares(int N) {
// code here
int res=0;
for(int i=1;i*i<N;i++)res++;
return res;
}
};
// { Driver Code Starts.
int main() {
... | ALGO | 0.999897 | 5.397134 |
70b84184-8c76-4a96-821f-e38d9dc52770 | astro2049/LeetCode-2023 | 647/main.cpp | #include <iostream>
using namespace std;
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
class Solution {
public:
int countSubstrings(string s) {
int count = 0;
for (int i = 0; i < s.length(); i++) {
int l = i, r = i;
for (; l >= 0 && r < s.leng... | ALGO | 0.999876 | 5.352179 |
7f72f587-8d0f-4626-9f0c-79cd787dd9f6 | ChyYasir/Competitive_Programming_Codes | Number Theory/Extented_gcd.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
int egcd(int a, int b, int &x, int &y) {
if ( b == 0) {
x = 1;
y = 0;
return a;
}
int x1, y1;
int d = egcd(b, a % b, x1, y1);
x = y1;
y = x1 - y1 * (a / b);
return d;
}
signed main() {
int x,... | ALGO | 0.999761 | 4.709496 |
693447d4-0b72-4432-a43f-e488f7f5eccb | MuskanGarg24/GCI_DSA_BOOTCAMP | milestone3/problem17.cpp | #include<iostream>
using namespace std;
int main(){
int num;
cout<<"enter num: ";
cin>>num;
int rem, rev=0;
while(num!=0){
rem=num%10;
rev=(rev*10)+rem;
num=num/10;
}
cout<<"reverse is "<<rev;
if(rev==num){
cout<<"number is palindrome";
}
e... | ALGO | 0.999639 | 3.746177 |
0b2332c2-639d-4d45-9331-763c6d0d4958 | ParkYeoungJun/Algorithm | Samsung/Professional/week2/marathon.cpp | #include <iostream>
#include <cstdio>
using namespace std;
typedef struct checkpoint
{
int x, y;
} _CHECKPOINT;
int N, Q;
int segTree[400005];
int inTer[300005];
_CHECKPOINT checkPoint[100005];
inline int Max(int a, int b) { return a > b ? a : b; }
int getDist(int a, int b)
{
int x1 = checkPoint[a].x, x2 =... | ALGO | 0.998843 | 4.653984 |
11605bd4-bd8d-4901-aa40-b606be691326 | hitenSharm/LeetCode | insert-interval/Accepted/9-12-2021, 2_14_21 PM/Solution.cpp | // https://leetcode.com/problems/insert-interval
class Solution {
public:
vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newInterval) {
vector<vector<int>>ans;
vector<vector<int>>tmp;
int fl=0;
for(int i=0;i<intervals.size();i++)
{
... | ALGO | 0.999995 | 6.170797 |
473f3beb-bfae-451c-8f9b-4945012ccc9b | SandyyScripts/LeetCode-Questions | 1796-second-largest-digit-in-a-string/1796-second-largest-digit-in-a-string.cpp | class Solution {
public:
int secondHighest(string s) {
// support variables
int res[2] = {-1, -1};
// parsing s
for (char c: s) {
// considering only numerical characters
if (c >= '0' && c <= '9') {
// normalising c
c -= '0';
... | ALGO | 0.999132 | 5.80931 |
6873ef02-b05b-4544-a726-a2c0901a5928 | KarlsruheLongestPaths/KaLP | extern/KaHIP/lib/partition/uncoarsening/refinement/kway_graph_refinement/kway_graph_refinement.cpp | #include <algorithm>
#include <unordered_map>
#include "kway_graph_refinement.h"
#include "kway_graph_refinement_core.h"
#include "kway_stop_rule.h"
#include "quality_metrics.h"
#include "random_functions.h"
kway_graph_refinement::kway_graph_refinement() {
}
kway_graph_refinement::~kway_graph_refinement() {
}
Edge... | ALGO | 0.999926 | 5.613587 |
487bf1aa-a0ff-4115-b6c5-f8555ed58c71 | grx62203/leetcode | 1、acwing/剑指offer/acwing22旋转数组的最小数字-库函数.cpp | /*
把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。
输入一个升序的数组的一个旋转,输出旋转数组的最小元素。
例如数组 {3,4,5,1,2} 为 {1,2,3,4,5} 的一个旋转,该数组的最小值为 1。
数组可能包含重复项。
注意:数组内所含元素非负,若数组大小为 0,请返回 −1。
数据范围
数组长度 [0,90]。
*/
//时间:O(n)
class Solution {
public:
int findMin(vector<int>& nums) {
return nums.empty() ? -1 : *min_element(nums.begin(),nums.e... | ALGO | 0.999981 | 6.144677 |
28e16d2b-7f97-48e0-9a6e-02f1ae3dee74 | pateash/cp | src/main/my_codes/ap_algo_codes/Bst/postorder_to_expressionTree.cpp |
#include<bits/stdc++.h>
using namespace std;
struct eNode{
char data;
eNode *left,*right;
};
eNode* make_node(char par){
eNode *p=new eNode();
p->data=par;
p->left=p->right=NULL;
return p;
}
void postorder(eNode* root){
if(root==NULL)
return ;
else{
postorder(root->left);
p... | ALGO | 0.999985 | 4.480321 |
3aa33350-1e10-4d8b-bdd5-93d4cb671949 | mudar-hussain/DSA_Leetcode_Practice | 1637-widest-vertical-area-between-two-points-containing-no-points/1637-widest-vertical-area-between-two-points-containing-no-points.cpp | class Solution {
public:
int maxWidthOfVerticalArea(vector<vector<int>>& points) {
set<int> s;
for(auto i: points){
s.insert(i[0]);
}
int maxDistance = INT_MIN;
int prev = 0;
for(auto i: s){
if(maxDistance == INT_MIN){
... | ALGO | 0.999956 | 5.772779 |
5c3c61e6-9c3e-4594-81cd-f8966d6e6540 | AyaseCore/Noggit3 | Noggit3libs/Boost/libs/geometry/doc/src/examples/algorithms/difference.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[difference
//` Shows how to subtract one polygon from another polygon
#include <iostream>
#include <list>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#in... | ALGO | 0.962526 | 6.462214 |
34fefa29-49aa-404a-8036-fee5216660dd | esl-epfl/xheep_matrix_spec | llvm-project/mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp | #include "mlir/Dialect/SCF/Transforms/Passes.h"
#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/SCF/Transforms/Transforms.h"
#include "mlir/Dialect/SCF/Utils/Utils.h"
namespace mlir {
#define GEN_PASS_DEF_SCFPARALLELLOO... | ALGO | 0.965086 | 6.385167 |
ddb57d20-a24d-4962-a1a8-495cbc1afa51 | techytoes/competitive-programming | HackerRank/Algorithms/strangeAdvertising.cpp | #include <bits/stdc++.h>
using namespace std;
// Complete the viralAdvertising function below.
int viralAdvertising(int n) {
int like = 5/2;
int sum = 0;
for(int i=0; i<n-1; i++){
int spread = like*3;
like = int(spread/2);
sum += like;
}
return sum+2;
}
int main()
{
o... | ALGO | 0.999978 | 4.90857 |
6d2c26c8-f186-465d-8da8-6e41fa502e0e | alexispapayan/Solving_laplacian_equations | externals/nanogui/ext/eigen/doc/examples/QuickStart_example.cpp | #include <iostream>
#include <Eigen/Dense>
using Eigen::MatrixXd;
int main()
{
MatrixXd m(2,2);
m(0,0) = 3;
m(1,0) = 2.5;
m(0,1) = -1;
m(1,1) = m(1,0) + m(0,1);
std::cout << m << std::endl;
}
| ALGO | 0.995661 | 3.474624 |
64cf4a9a-0ab9-4310-ad34-870834bdc099 | ishandutta2007/codeforces | leapfrog/normal/985/F.cpp | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int>pii;
const int N=200005,P1=1000000007,P2=1000000009,b1=29,b2=37;
pii h[30][N];int n,m,pw1[N],pw2[N];char str[N];
inline pii Get(pii h[],int l,int r)
{
pii ans=h[r];l--;
if(l>=0) ans.fi=(ans.fi-1... | ALGO | 0.999992 | 3.731039 |
a2c0045e-7436-40b4-9142-5ea3b26a333d | hmtrung2305/usaco_guide | usaco/silver/graphs/flood_fill/snowboots.cpp | // Greedy - Time Complexity: O(numTile * numBoot)
#include <bits/stdc++.h>
int main() {
freopen("snowboots.in", "r", stdin);
freopen("snowboots.out", "w", stdout);
std::ios::sync_with_stdio(false);
std::cin.tie(0);
int numTile, numBoot;
std::cin >> numTile >> numBoot;
std::vector<int> feetSnow(numTile);
for (i... | ALGO | 0.999428 | 4.004724 |
a2a4b1ac-f077-460f-b464-14fba4354851 | jaescalante02/IA2 | proyecto2/v2/red_iris.cpp | #include<iostream>
#include<cstdio>
#include"mivector.h"
#include<vector>
#include<cstdlib>
#include<cmath>
#include"mivector.h"
#include<ctime>
using namespace std;
//Descriptor del archivo de casos de entrenamiento
FILE *arch;
//Descriptor del archivo de salida d eerror
FILE *out;
FILE *pruebas;
FILE *salida_prueb... | ALGO | 0.996781 | 3.141829 |
995b7120-e229-4f66-aa4c-f9c6252a79bb | IsrakAhmed/Codeforces_solutions | B/B. Sum of Two Numbers.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ll t;
cin >> t;
while(t--)
{
string s;
ll f = 1, size;
cin >> s;
size = (ll)s.size();
vector < ll > first(size), second(size);
for(ll i = 0 ; i < size ; i++)
{
... | ALGO | 0.999988 | 3.872154 |
cf71d64b-d194-4d37-8839-4eb7d43cb9bc | lucasg1/sard_dataset_without_bias | dataset/Juliet-1/62798-v1.0.0/src/testcases/CWE121_Stack_Based_Buffer_Overflow/s01/bad_CWE121_Stack_Based_Buffer_Overflow__CWE129_rand_73b.cpp | using namespace std;
namespace NAMESPACE0
{
void FUN0(list<int> dataList);
void FUN1()
{
int data;
list<int> dataList;
data = -1;
data = RAND32();
dataList.push_back(data);
dataList.push_back(data);
dataList.push_back(data);
FUN0(dataList);
}
}
using namespace std;
namespace NAMESPACE0
... | ALGO | 0.909184 | 3.035065 |
529e972e-6784-4971-9151-601c3bcc29d4 | subodhnarayan/100DayofCoding | day237.cpp | -- -- -- -- -- -- -- -- -GFG - POTD - 22 / 12 / 2024 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
Search in a Row-Column sorted matrix
Difficulty: EasyAccuracy: 41.62%Submissions: 158K+Points: 2
Given a 2D integer matrix mat[][] of size n x m, where every row and column is sorted in increasing order and a number x, ... | ALGO | 0.999892 | 5.711692 |
0f60faf7-ee5a-4792-af44-eccd4bddde22 | cerredz/LeetCode-Problems | NeetCode 308/101.SymmetricTree.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.999925 | 6.876888 |
be3ad76d-2e83-42e3-bf66-04cb42df24c5 | fieryprofessor/My_CPP_Codes | 17-strings/isomorphic.cpp | /*given two strings s and t, determine if they are isomorphic or not. isomorphic means one to one connection .*/
#include<iostream>
#include<vector>
using namespace std;
bool isomorphicchecker(string &s,string &t){
if(s.size()!=t.size()){
return false;
}
vector<int>v1(128,-1);
vector<int>v2(128,-1);
f... | ALGO | 0.999993 | 5.587416 |
2216dd65-d138-4f2f-b72d-43ce6061502b | DionysiosB/CodeForces | 1200-1299/1272C-YetAnotherBrokenKeyboard.cpp | #include <iostream>
#include <vector>
typedef long long ll;
int main(){
const int N = 26;
std::ios_base::sync_with_stdio(false);
ll n, k; std::cin >> n >> k;
std::string s; std::cin >> s;
std::vector<bool> f(N, 0);
for(ll p = 0; p < k; p++){char c; std::cin >> c; f[c - 'a'] = 1;}
std::vect... | ALGO | 0.999979 | 4.197156 |
1ce27950-39ba-49a8-8adf-c900d320576e | DomenicoDErasmo/LeetCode | src/p8/string_to_integer_(atoi).cpp | #include <iostream>
class Solution {
public:
int myAtoi(std::string s) {
long result = 0;
bool found_sign = false, is_negative = false, number_started = false;
for (size_t i = 0; i < s.length(); i++) {
if (result < INT_MIN) {
result = INT_MIN;
... | ALGO | 0.925644 | 5.468352 |
3170736d-06fe-42b7-9b19-11dd10c636c9 | WonJin4631/AlgorithmStudy | dodo/dodo/boj17825.cpp | #include<iostream>
#include<vector>
using namespace std;
/*
4 10 ֻ
̵ ġ ߰
ڸ ̵ Ұ
ġ ̻ ġ
ġ ̵ ȵ
*/
int move_list[11];
int map[] = { 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,0/*21*/,10,13,16,19,25/* 26*/,20,22,24,25,30,35,40/* 33*/,30,28,27,26,25 /* 38*/};
int mal[5] = { 0 };
int summal[5] = { 0 };... | ALGO | 0.999859 | 3.466455 |
1c98baca-cd8a-46d3-9ef9-08c89237d4db | xuda25/C-study | leetcode/107.二叉树的层序遍历-ii.cpp | /*
* @lc app=leetcode.cn id=107 lang=cpp
*
* [107] 二叉树的层序遍历 II
*/
// @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(nullpt... | ALGO | 0.99998 | 6.528731 |
dd337284-b719-45a7-a789-b1495dc1f316 | aparnag7/Leetcode-Daily-Challenge | Januanry2021/Check If Two String Arrays are Equivalent.cpp | class Solution {
public:
bool arrayStringsAreEqual(vector<string>& word1, vector<string>& word2) {
string w1,w2;
for(int i=0;i<word1.size();i++)
w1+=word1[i];
for(int i=0;i<word2.size();i++)
w2+=word2[i];
return w1==w2;
}
};
| ALGO | 0.999699 | 6.106078 |
88c97bca-4901-4a27-bf63-931153195568 | Randowlh/Project_ACM_2021 | code/competition/EducationalRound85/1.cpp | #include <bits/stdc++.h>
using namespace std;
const int inf = 0x7FFFFFFF;
#define bug cout << "here\n"
typedef long long ll;
#define int long long
const int mod = (0 ? 1000000007 : 998244353);
const double eps = 1e-7;
void work()
{
int n;
cin >> n;
vector<pair<int, int>> v;
pair<int, int> x;
for (in... | ALGO | 0.999993 | 4.848001 |
6a88e5f2-ec6f-495b-9580-16a306a91469 | emzhran/exerciselinkedlist_118 | zachran_118/zachran_118.cpp | #include<iostream>
#include<string>
using namespace std;
class Node {
public:
int rollNumber;
string name;
Node* next;
};
class CircularLinkedList {
private:
Node* LAST;
public:
CircularLinkedList() {
LAST = NULL;
}
void addNode(Node** Mohammad, Node** Zachary);
bool search(int rollno, Node** Mohammad, Node... | ALGO | 0.995683 | 4.550467 |
52bb7ffe-aa9b-429c-be4d-bfa8e20e7187 | ishandutta2007/codeforces | huangxiaohua/normal/1534/D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define M 1000000007
int i,j,k,n,m,t,dep[5050],fa[5050],mx,sb1,sb2,a[5050];
vector<int> v1[5050],v[5050];
void ask(int x){
printf("? %d\n",x);fflush(stdout);
}
void get1(){
int i,j,k,l;
for(i=1;i<=n;i++){
if(dep[i]==2){
v[1].push_back(i);
... | ALGO | 0.999789 | 3.248223 |
46cc4419-e064-4727-845a-3ddde46d27cd | SomeFeaKOS/android_frameworks_av | media/libstagefright/codecs/amrnb/common/src/sqrt_l.cpp | /*
Pathname: ./audio/gsm-amr/c/src/sqrt_l.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template. Changed function interface to pass in a
pointer to overflow flag into the function instead of using a
global flag. ... | ALGO | 0.99996 | 5.869467 |
eb0c7843-12d7-4581-800f-86f1dedfad71 | kalok008/MyCodePortfolio | Problems from competitions/Group E/National Olympiad/Municipal round/2019/totem.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
char arr[3][3];
for(int i=0; i<3; i++){
for(int j=0; j<3; j++){
cin>>arr[i][j];
}
}
int a = 100 * (arr[0][0] - '0') + 10 * (arr[1][1] -'0') + arr[2][2] - '0';
int b = 100 * (arr[0][2] - '0') + 10 ... | ALGO | 0.999738 | 3.618564 |
45f8eb4a-9454-4873-86a7-2866d93cdd65 | tsaiwooo/2023-NCTU-Parallel-Programming | HW2/part1/pi_ori.cpp | #include <iostream>
#include <ctime>
#include <cstdlib>
#include <string>
#include <iomanip>
using namespace std;
// double min = -1;
// double max = 1;
int main(int argc,char **argv)
{
srand(time(NULL));
//get the data from cmd
int thread;
thread = stoi(argv[1]);
long long int tosses;
tosse... | ALGO | 0.993476 | 4.224097 |
88f6425a-1370-47c3-bfe4-92a689f2e743 | IsaacBell/Algorithms | cses/finding_periods.cpp | // #include<bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <unordere... | ALGO | 0.999615 | 3.5657 |
9580455b-06c5-43bb-9a5f-a8483002b5dd | ishandutta2007/codeforces | ronnie007/normal/1486/C2.cpp | #include<bits/stdc++.h>
using namespace std ;
int n ;
int ask ( int l , int r ) {
cout << "? " << l << " " << r << "\n" ;
fflush ( stdout ) ;
int ret ;
cin >> ret ;
return ret ;
}
void input ( ) {
cin >> n ;
}
void solve ( ) {
int l , r , mid ;
int sr = ask ( 1 , n ) ;
if ( sr !=... | ALGO | 0.99993 | 3.43439 |
12545d4d-36a4-4f6d-af19-9bb2981fd29f | evapilotno17/cses-solutions | CSES-SOLUTIONS/Introductory-Problems/Repetitions/admirerr.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int n=s.size();
int mx=1;
int curr=1;
for(int i=1;i<n;i++){
if(s[i]==s[i-1]){
curr++;
}
else if(s[i]!=s[i-1]){
curr=1;
}
mx=max(curr,mx);
}
cout<<m... | ALGO | 0.999914 | 3.652825 |
cdc66023-cdc2-41f1-b9c2-6222ac7f0cd8 | arjun-raj-kuppala/HIP-autopr | tests/performance/compute/hipPerfMandelbrot.cpp | /* HIT_START
* BUILD: %t %s ../../src/test_common.cpp
* TEST: %t
* HIT_END
*/
#include <iostream>
#include <chrono>
#include "test_common.h"
#include <hip/hip_vector_types.h>
#include <hip/math_functions.h>
#include <vector>
#include <string>
#include <map>
typedef struct {
double x;
double y;
double width;... | TEST | 0.982399 | 5.71949 |
14baca46-b6df-4e59-a8c3-2de43605efc7 | sherkitty/tester1 | src/bitcoin-cli.cpp | #include "chainparamsbase.h"
#include "clientversion.h"
#include "rpcclient.h"
#include "rpcprotocol.h"
#include "util.h"
#include "utilstrencodings.h"
#include <boost/filesystem/operations.hpp>
#define _(x) std::string(x) /* Keep the _() around in case gettext or such will be used later to translate non-UI */
using... | WEB | 0.972013 | 6.720397 |
b4d41c86-66ce-4e85-b4ed-d373a3454edb | hack-parthsharma/LeetCode | 2434-using-a-robot-to-print-the-lexicographically-smallest-string/2434-using-a-robot-to-print-the-lexicographically-smallest-string.cpp | class Solution {
public:
string robotWithString(string s) {
string ans;
vector<int> count(26);
stack<char> stack;
for (const char c : s)
++count[c - 'a'];
for (const char c : s) {
stack.push(c);
--count[c - 'a'];
const char minChar = getMinChar(count);
while (!stac... | ALGO | 0.999931 | 6.693184 |
4138ad63-0bb4-4085-8036-75c7e1d1cbdd | Ali-ismail-g/LeetCode_ProblemSolvingSolutions | 283-Move-Zeroes.cpp | class Solution {
public:
void moveZeroes(vector<int>& nums) {
int leftPointer=0;
int rightPointer=0;
for(int rightPointer=0; rightPointer<nums.size(); rightPointer++ ){
if(nums[rightPointer] != 0){
swap(nums[leftPointer],nums[rightPointer]);
leftPo... | ALGO | 0.999973 | 6.347967 |
1ae97169-b2d9-4a43-95b5-e548d9886ab1 | javelin0x/lightbox | lightbox/db/db.cpp | #include "db.h"
#include <iostream>
#include <filesystem>
#include "../util/helpers.h"
#include "io/json.hpp"
#include "../cfg/cfg.h"
#include "../ui/ui.h"
#include "enc/enc.h"
/*
JSON struct
{
creds
{
1
{
"id": 954,
"user": <EMAIL>,
"password": abarajirew891
}
2 ... | TOOL | 0.892177 | 3.011265 |
6a98cca1-9cfd-483f-bfdf-4aacf307eaec | yihsunphys/Competitive_Programming | LeetCode/1732. Find the Highest Altitude.cpp | class Solution {
public:
int largestAltitude(vector<int>& gain) {
int ans = 0, mx = 0;
for(auto i: gain){
ans += i;
mx = max(mx, ans);
}
return mx;
}
}; | ALGO | 0.999792 | 5.923998 |
44feb1b9-160e-4a03-a1ed-4b69519c1615 | DarshanGhorpade/GFG-POTD | 2025/April/27042025_MultiplyTwoStrings.cpp | // Problem Link ---> https://www.geeksforgeeks.org/problems/multiply-two-strings/1
// Difficulty ---> Medium
//{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
/*You are required to complete below function */
string multiplyStrings(string& ... | ALGO | 0.999754 | 6.315072 |
5df3e529-008d-441e-bccc-78fd8fa9b460 | tran-khoa/joint-training-cascaded-st | fairseq/clib/libbleu/libbleu.cpp | #include <array>
#include <cstdio>
#include <cstring>
#include <map>
// NOLINTNEXTLINE
typedef struct {
size_t reflen;
size_t predlen;
size_t match1;
size_t count1;
size_t match2;
size_t count2;
size_t match3;
size_t count3;
size_t match4;
size_t count4;
} bleu_stat;
// left trim (remove pad)
void... | ALGO | 0.995815 | 7.152213 |
86fd10d2-e532-4169-b5dc-c23661f20457 | ByteBug01/Leetcode_DSA | 0100-same-tree/0100-same-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999974 | 6.38211 |
10354bfb-df7b-4f6b-b5cc-61cbe402fb10 | WenHsu1203/Path-Planning | src/Eigen-3.3/doc/examples/Tutorial_ArrayClass_addition.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXXf a(3,3);
ArrayXXf b(3,3);
a << 1,2,3,
4,5,6,
7,8,9;
b << 1,2,3,
1,2,3,
1,2,3;
// Adding two arrays
cout << "a + b = " << endl << a + b << endl << endl;
// Subt... | ALGO | 0.921426 | 3.642258 |
2c5de50f-a4bd-4e9b-a083-3fbf13de29e4 | thegamer1907/Code_Analysis | scrape/data/Tokitsukaze and Discard Items/deepakjnv880_TLE.cpp | // this is my basic template
#include<bits/stdc++.h>
using namespace std;
#include <string.h>
typedef long long int ll;
typedef long double ld;
#define pinf 1e15;
#define ninf (-1)*(1e15);
#define mod 1000000007
#define pb push_back
#define mp make_pair
using namespace std;
#define rep(i,a,b) for(ll i=a;i<=b;++i)
#defi... | ALGO | 0.999923 | 3.147848 |
f51075c9-9010-4403-879c-53201cd69641 | Premkumar981/DSA_Daily_Problems | Seating arrangements in a classroom.cpp | #include <iostream>
using namespace std;
// Define a structure for a node in the linked list
struct Node {
int data;
Node* next;
Node(int val) : data(val), next(nullptr) {}
};
// Function to swap elements pairwise in a linked list
Node* swapPairs(Node* head) {
if (!head || !head->next) {
retur... | ALGO | 0.999997 | 6.366469 |
1f92d350-5e78-4136-b82b-e7489e4a49b6 | AmritanshTiwari2160/CodeHelp-DSA-Busted-Series | Lecture057 Stack Questions/celebrity.cpp | //Initial template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution
{
private:
bool knows(vector<vector<int> >& M, int a, int b, int n) {
if(M[a][b] == 1)
return true;
else
return false;
}
... | ALGO | 0.999877 | 6.005659 |
e5af5def-1aa9-4fe8-823b-fee58e20e8ec | arabori/llvm-color-flip | lib/CodeGen/LiveIntervalAnalysis.cpp | #define DEBUG_TYPE "liveintervals"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "VirtRegMap.h"
#include "llvm/Value.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/CalcSpillWeights.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/... | ALGO | 0.992247 | 4.860963 |
99ac15de-5ee6-490c-a9dc-ffc38ff6c305 | Anirudh257/Leetcode_Solutions | cses_permutations.cpp | #include<iostream>
using namespace std;
int main() {
int n;
cin >> n;
if (n == 1) {
cout << 1 << endl;
return 0;
}
if (n <= 3) {
cout << "NO SOLUTION" << endl;
return 0;
}
if (n == 4) {
cout << "2 4 1 3" << endl;
return 0;
}
int st... | ALGO | 0.999997 | 4.210732 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.