uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
8deebcbf-e0e2-419d-9f31-38c49539eef5 | CodebyCR/AVL_Tree | main.cpp | #include <iostream>
#include "AVL_Tree.hpp"
int main() {
AVL_Tree<std::string> tree;
tree.add("10");
tree.add("20");
tree.add("0");
tree.add("4001");
tree.add("4002");
tree.add("25");
tree.add("30");
tree.print();
return 0;
}
| ALGO | 0.970817 | 4.884732 |
2eb7b4ae-a626-4786-aee4-8ac0a12b048e | Nurdam17/PP1labs | lab8/8K.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
vector<int> v;
int n;
cin>>n;
int a;
for(int i=0;i<n;i++)
{
cin>>a;
v.push_back(a);
}
int k;
cin>>k;
sort(v.begin(), v.end());
v.erase(v.begin(), v.end()-k);
int sum=0;
for(int i=0;... | ALGO | 0.999868 | 3.45047 |
4d42789c-8d42-40d8-b9bb-29fb5467357b | swag4cat/Practs | Pract 2/final/project/utils.cpp | #include <tuple>
#include <vector>
#include <cmath>
//#include <iostream>
#include "utils.h"
using namespace std;
// Проверка, является ли число простым
bool isPrime(int num) {
if (num <= 1) return false; // 0, 1 и отрицательные числа не являются простыми
// Проверяем делители от 2 до квадратного корня из n... | ALGO | 0.999838 | 4.781041 |
2c462f92-43d2-4556-9b9d-adeeb90af2d6 | rlaminseok0824/algorithm-problem | 16953.cpp | #include<iostream>
#include<queue>
using namespace std;
/* bfs
* ־ bfs 10e9 ̱ ڷ Ͽ long long Ͽ Ǯ ϰ ذȴ.!
*/
long long A, B;
queue<pair<long long,long long>> q;
int main() {
cin >> A >> B;
if (A == B) {
cout << 1;
return 0;
}
q.push(pair<long long,long long > (A, 1));
while (!q.empty()) {
long long curr... | ALGO | 0.999873 | 4.010089 |
9f5173a3-52e1-4dd2-a19d-31ad93135d9d | A-Lokanush/IPMP_2k24 | week6/day1/Trees_4.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.999782 | 6.553144 |
8944fe27-964a-4616-89c0-83d0bef8c8f2 | MohdHozaifa/Data-Structure-And-Algorithm-With-CPP | Learn C++ Language/BITWISE OPERATORS/count_1_bit.cpp | #include<iostream>
using namespace std;
// unit32_t convert decimal number to binary automatically
int hammingWeight( uint32_t n)
{
int ans = 0;
while(n!=0)
{
if(n&1)
{
ans++;
}
n = n>>1;
}
return ans;
}
int main()
{
int answ = hammingWeight( 15 );
... | ALGO | 0.999183 | 5.531783 |
cfdf1950-ff8c-4a6b-8c5f-5bce91278723 | LILTMoney/LILT-Money | src/wallet/rpcdump.cpp | #include "bip38.h"
#include "init.h"
#include "main.h"
#include "rpc/server.h"
#include "script/script.h"
#include "script/standard.h"
#include "sync.h"
#include "util.h"
#include "utilstrencodings.h"
#include "utiltime.h"
#include "wallet/wallet.h"
#include <fstream>
#include <secp256k1.h>
#include <stdint.h>
#inclu... | TOOL | 0.948506 | 6.979155 |
1f4b254b-e48a-4029-852c-1013fa6c5d59 | sunil14701/CN-DSA | 3a_assignment_recursion_1/3_check_palindrome.cpp | #include <bits/stdc++.h>
using namespace std;
// farzi
bool palindrome(string str, int start, int end)
{
if (start == end)
return true;
if (str[start] != str[end])
return false;
bool smallOuptut = palindrome(str, start + 1, end - 1);
return smallOuptut;
}
// test
// int test_palind... | ALGO | 0.999985 | 4.880485 |
30733de1-6f3c-4758-8566-62b5514a7215 | SOSP-OS/android_frameworks_av | media/module/codecs/amrnb/common/src/l_abs.cpp | /*
Pathname: ./gsm-amr/c/src/l_abs.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the L_abs function. Sync'ed up
with the current template and fixed tabs.
Description: Removed conditional code that updates WMOPS c... | TOOL | 0.867689 | 5.873723 |
9593584e-17a0-4a71-931e-cc44c1240705 | williamz123/tugas-praktikum-c | modul 5/tugas-modul5-b.cpp | #include <stdio.h>
int main () {
char j;
int dp,k,h,hsd;
float d;
printf("Kode : "); scanf(" %i",&k);
printf("Jenis : "); scanf(" %c",&j);
printf("Harga : "); scanf(" %i",&h);
switch(j) {
case 'A':
d = 0.1;
break;
case 'B':
d = 0.15;
break;... | TOOL | 0.987395 | 3.268721 |
a853bea7-fd5b-4efc-84a1-5d4622fc4a46 | marcelbra/TSP_vectorized | Exercises/5_OMP/5_MC/MonteCarlo.cpp | /// Monte Carlo pi estimation
///
/// @authors: I.Kulakov; M.Zyzak; V.Akishina
/// @e-mail <EMAIL>; <EMAIL>; <EMAIL>
///
/// use "g++ MonteCarlo.cpp -O3 -fopenmp; ./a.out" to run
// Parallelize the SIMDized version between cores isng OpenMP. Compare the results and time.
using namespace std;
#include <st... | ALGO | 0.999703 | 4.098757 |
06630f76-e19f-49fe-88b4-18f6b6042a66 | raincross7/code-similarity | codes/train_code/problem264/problem264_163.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (... | ALGO | 0.999925 | 3.560045 |
fe593e7d-7e6f-4fc5-962e-ed5eea718e87 | shrudh14007/Dsa | Hashing/tempCodeRunnerFile.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n];
for(int i=0;i <= n;i++)
{
cin>>arr[i];
}
int hash[13]={0};
for(int i=0;i<=n;i++)
{
hash[arr[i]] +=1;
}
int q;
cin>>q;
while(q--)
{
int number;
c... | ALGO | 0.999852 | 4.231142 |
5dfce9aa-152e-450d-afe6-723fc20c1227 | Bearylover/ACCP | AtCoder/abc146_c/38325425_AC_6ms_3604kB.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int digit(ll c) {
ll count = 1;
while (c >= 10) {
count++;
c = c/10;
}
return count;
}
ll m, n, mid, l, r, k, ans, temp, g, b, c;
ll a[200001];
int main() {
cin >> b >> c >> m;
r = 1000000000;
l = 1;
te... | ALGO | 0.999871 | 3.988785 |
be1ba25c-4696-4e91-91d7-4ab7691fcbdd | mvancompernolle/ai_project | data/CHMTSLAM_AA.cpp | #include "hmtslam-precomp.h" // Precomp header
#include <mrpt/utils/CTicTac.h>
#include <mrpt/random.h>
#include <mrpt/utils/CFileStream.h>
#include <mrpt/utils/printf_vector.h>
#include <mrpt/poses/CPose3DPDFParticles.h>
#include <mrpt/system/os.h>
using namespace mrpt::slam;
using namespace mrpt::hmtslam;
using nam... | ALGO | 0.943948 | 5.82656 |
4c605058-46b9-426f-8813-6afb6a281929 | SanskrutiKabadi/Cpp | IPLTicketRush.cpp | #include <iostream>
using namespace std;
int main() {
int T;
cin>>T;
while(T--){
int N,M;
cin>>N>>M;
if(N>M){
cout<<(N-M)<<endl;
}
else{
cout<<0<<endl;
}
}
return 0;
}
| ALGO | 0.999967 | 4.172691 |
03028cd0-a17c-418b-a223-fc0a305e1be9 | GitMaster254/c---and-c-codes | factorial.cpp | #include<iostream>
using namespace std;
int factorial(int x){
int f=1;
for(;x>0;x--){
f=f*x;
}
return f;
}
int main(){
int t;
cout<<"Enter no. to find its factorial:"<<endl;
cin>>t;
cout<<"factorial of"<<t<<"="<<factorial(t);
return 0;
}
| ALGO | 0.999822 | 3.683795 |
70774abc-caee-4a6b-9ef3-df056dd47c70 | ut-astria/AllSky | AllSky/AAKepler.cpp | //////////////////// Includes /////////////////////////////////////////////////
#include "stdafx.h"
#include "AAKepler.h"
#include "AACoordinateTransformation.h"
#include <cmath>
using namespace std;
//////////////////// Implementation ///////////////////////////////////////////
double CAAKepler::Calculate(double M,... | ALGO | 0.999979 | 5.724753 |
8ec45f9f-1a36-40d1-827b-99860cd4b4b7 | Mobink980/Network-on-Chip | src/systemc/tests/systemc/misc/user_guide/chpt3.1/counter.cpp | /*****************************************************************************
counter.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/****************************************************************************... | TOOL | 0.917723 | 4.666629 |
c4b0af47-e9a9-4515-9d58-ffcf274a5c07 | chenqwwq/_algorithm | src/top.chenqwwq/pat/advanced/_1052/Main.cpp | //
// Created by 陈炳鑫 on 2022/4/26.
//
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <vector>
using namespace std;
int main() {
int N;
string h;
cin >> N >> h;
unordered_map<string, pair<int, string>> graph;
string add, next;
int val;
for (int i = 0; i < N; ++i... | ALGO | 0.999893 | 3.807445 |
941a7795-6417-4a3c-b07b-c5cec5028cb5 | CS1103/unidad-4-standard-library-exercises-alonso1311 | Algoritmos/ID_Codes.cpp | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
void ID_Codes() {
string lines;
vector<string> result;
for(;;) {
cin >> lines;
if(lines == "#")
break;
else {
if(next_permutation(lines.begin(), lines.end()))
... | ALGO | 0.999884 | 4.046912 |
5c2e7641-9e17-473f-826e-2666f71a377f | MadhukeshSingh/LeetCodeProblems | 1603-design-parking-system/1603-design-parking-system.cpp | class ParkingSystem {
public:
std::vector<int> slots;
ParkingSystem(int big, int medium, int small) {
slots.resize(3); // Resize the vector to have 3 elements
slots[0] = big;
slots[1] = medium;
slots[2] = small;
}
bool addCar(int carType) {
if (carType >= 1 && c... | ALGO | 0.87782 | 6.236104 |
5284624a-10ea-41c0-b336-f8128a24034c | tilera/test-suite | MultiSource/Benchmarks/Bullet/btContactProcessing.cpp | #include "BulletCollision/Gimpact/btContactProcessing.h"
#define MAX_COINCIDENT 8
struct CONTACT_KEY_TOKEN
{
unsigned int m_key;
int m_value;
CONTACT_KEY_TOKEN()
{
}
CONTACT_KEY_TOKEN(unsigned int key,int token)
{
m_key = key;
m_value = token;
}
CONTACT_KEY_TOKEN(const CONTACT_... | ALGO | 0.997674 | 5.403058 |
5418f047-6e65-452d-a1a9-5be9a31efb53 | hyturing/Competitive-Programming | Codeforces/1354C1.cpp | /* Author: hyturing - Hemant Kumar Yadav */
#include "bits/stdc++.h"
using namespace std;
#define ll long long
const ll MOD = 1e9+7;
void solve(){
// code here
int n;
cin >> n;
double pi = acos(-1);
pi /= (2*n);
double ans = 1/tan(pi);
cout << fixed << setprecision(9) << ans << "\n";
return;
}
int... | ALGO | 0.990849 | 3.92308 |
a4f84772-fd69-4af5-8f91-879fe60f8720 | jash459/DSA-BUSTED | Maximum Average Pass Ratio.cpp | class Solution {
public:
double maxAverageRatio(vector<vector<int>>& classes, int extraStudents) {
auto gain = [](double pass, double total) {
return (pass + 1) / (total + 1) - pass / total;
};
priority_queue<pair<double, pair<int, int>>> maxHeap;
double sum = 0.0;
... | ALGO | 0.999543 | 6.305553 |
9315b867-b29b-4343-b042-1db8d747b1f9 | ishandutta2007/codeforces | alan233/normal/1635/D.cpp | // Author: wlzhouzhuan
#include<bits/stdc++.h>
using namespace std;
#define rep(i,l,r) for(int i=(l);i<=(r);i++)
#define per(i,l,r) for(int i=(l);i>=(r);i--)
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define mset(s,t) memset(s,t,sizeof(s))
#define mcpy(s,t) memcpy(s,t,sizeof(t))
#de... | ALGO | 0.999978 | 3.553178 |
51619e59-a081-4b2f-a7b1-8817dde32017 | onkarbartakke/DSA-Marathon | Link-Lists/Intersection_point_of_two_LL.cpp | #include<iostream>
using namespace std;
int get_count(Node *h)
{
if(h==NULL)
return 0;
return 1+get_count(h->next);
}
int intersectPoint(Node* head1, Node* head2)
{
// Your Code Here
int c1,c2;
c1=get_count(head1);
c2=get_count(head2);
Node *h1,*h2;
if(c1>c2)
... | ALGO | 0.999985 | 4.025796 |
81889394-8e12-4aaf-8654-7c0973ab7df8 | janani271/CP-solutions-2 | dimastair.cpp | #include<bits/stdc++.h>
using namespace std;
long long n , m , i , a[1000000] , w[1000000] , h[1000000] , bottom[1000000];
long long ans , l ;
int main()
{
cin>>n;
for(i=1;i<=n;i++)
{
cin>>a[i];
}
cin>>m;
for(i=1;i<=m;i++)
{
cin>>w[i]>>h[i];
}
l = 0 ;
//this is based on the given condition that initial... | ALGO | 0.999972 | 3.587771 |
2be5c8f7-838a-4bf2-a1f7-a203acae9f26 | aladinoster/mynotes | mn_cpp/0-hackerank/arrays/2-left-rotation.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'rotLeft' function below.
*
* The function is expected to return an INTEGER_ARRAY.
* The function accepts following parameters:
* 1. INTEGER_ARRAY a
... | ALGO | 0.999939 | 4.307602 |
73ccd825-ec83-4950-8b3f-ea5f001604cb | DhruvinXDev/CPP-Concept-and-function-s | Array/Maximum_Value/Using_function.cpp | #include<iostream>
using namespace std;
int main ( )
{
int array[5] ={ 1 ,23,13,44,-54};
int large = array[0];//keep one value inside the array otherwise write INT_MAX
for (int i = 0 ; i < 5 ; i++ )
{
large = max(array[i],large); //using function
}
cout <<"The largest number is : "<<l... | ALGO | 0.999877 | 4.23418 |
a55f1839-31c2-409b-96fc-d90b91c6f9b8 | GulTion/cns | RSA_RSA_ELEGMALL/RSA.cpp | #include "RSA.h"
long long RSA::gcd(long long a, long long b) {
return (b == 0) ? a : gcd(b, a % b);
}
long long RSA::modInverse(long long a, long long m) {
long long m0 = m, t, q;
long long x0 = 0, x1 = 1;
if (m == 1) return 0;
while (a > 1) {
q = a / m;
t = m;
m = a... | ALGO | 0.997826 | 4.673028 |
afd09677-159b-4165-9c4a-438f04a285ef | ishandutta2007/codeforces | reyna/normal/320/A.cpp | #include <iostream>
#include <string>
using namespace std;
int main(){
string a;
cin >> a;
for(int i = 0; i < a.length(); i++){
if(i == 0 && a[i] == '1'){
}else if(i == 0 && a[i] != '1'){
cout << "NO";
return 0;
}
if(i < a.length()-2){
... | ALGO | 0.999908 | 3.745938 |
037db74e-d193-4c47-907a-d77df9a64607 | sajalprajapati/Take-you-forward | Binary Search/Binary_search_on_answer/book allocation problem.cpp | #include<bits/stdc++.h>
using namespace std;
bool load_on_the_student(vector<int> &books, int middle, int studentCount)
{
int currentPages = 0;
int requiredStudents = 1;
for (int i = 0; i < books.size(); i++)
{
if (currentPages + books[i] <= middle)
{
currentPages += books[... | ALGO | 0.99997 | 5.431311 |
3ad2010e-1d7a-4647-9e9c-ca149ea32348 | 250700/Assignement_code | Cdata.cpp | #include "cdata.h"
#include <cmath>
#define M_PI
// constructors
Cdata::Cdata() : n(0), pts(), param(), tang() {}
Cdata::Cdata(int num, const Vector<Point3D>& data) : n(num), pts(data), param(n), tang(n)
{
Foley();
computeTangents();
}
// uniform parameterisation
void Cdata::uniform()
{
// compute the parameter v... | ALGO | 0.910622 | 4.907362 |
5f7e61c1-2833-4241-ba2e-0a3ec9c76ac7 | s7ylo/cpplinkedlist | cpplinkedlist/LinkedList.cpp | #include "LinkedList.h"
template<typename T>
LinkedList<T>::LinkedList(void)
{
this->_head = nullptr;
this->_size = 0;
}
template<typename T>
bool LinkedList<T>::insert(T& data)
{
NodeItem<T>* node = new NodeItem<T>;
if (node != nullptr)
{
node->_data = data;
node->_next = nullptr;
}
else
{
return fals... | TOOL | 0.937033 | 3.268662 |
2dc05df6-c914-403b-b340-959c1ee26154 | ayoussief/arkham | src/node/coin.cpp | #include <node/coin.h>
#include <node/context.h>
#include <txmempool.h>
#include <validation.h>
namespace node {
void FindCoins(const NodeContext& node, std::map<COutPoint, Coin>& coins)
{
assert(node.mempool);
assert(node.chainman);
LOCK2(cs_main, node.mempool->cs);
CCoinsViewCache& chain_view = node... | TOOL | 0.904506 | 6.557853 |
2a7da510-0492-47e4-88c1-27bb0fa17e93 | ishandutta2007/codeforces | mustang98/normal/1065/C.cpp | #include <bits/stdc++.h>
#define F first
#define S second
#define prev azaza
#define MP make_pair
#define PB push_back
using namespace std;
typedef long long ll;
typedef long double ld;
const int max_n = 200111, inf = 1000111222;
int cnt[max_n];
int h[max_n];
int n;
int cnt_f[max_n];
int main()
{
//freopen("i... | ALGO | 0.999981 | 3.897917 |
51048de2-6d4a-4ad4-a0a9-7a8b3647ce67 | ishabhray/Competitive-Programming | codeforces/1437D.cpp | #include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define ii pair<int,int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pll pair<ll,ll>
#define vv vector
#define al... | ALGO | 0.999808 | 4.301432 |
b6880e5b-e350-40aa-9dd1-c77e80f8ca42 | LinXueyuanStdio/LearnTelegram | Demo/jni/secureid_ocr.cpp | #include <jni.h>
#include <android/bitmap.h>
#include <android/asset_manager.h>
#include <android/asset_manager_jni.h>
#include <android/log.h>
#include <vector>
#include <utility>
#include <string>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <libyuv.h>
#inc... | ALGO | 0.977561 | 4.946466 |
d5e7c5f2-3a2b-4c63-83a2-f70b166f7078 | louishust/map | extra/yassl/taocrypt/src/twofish.cpp | /* C++ based on Wei Dai's twofish.cpp from CryptoPP */
/* x86 asm original */
#if defined(TAOCRYPT_KERNEL_MODE)
#define DO_TAOCRYPT_KERNEL_MODE
#endif // only some modules now support this
#include "runtime.hpp"
#include "twofish.hpp"
namespace TaoCrypt {
#if defined(DO_TWOFISH_... | ALGO | 0.999475 | 6.819625 |
69f4cf18-6356-4ff1-920f-b65c9c55d658 | ahmedbodi/verge-v0.17 | src/crypto/hmac_sha512.cpp | #include <crypto/hmac_sha512.h>
#include <string.h>
CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen)
{
unsigned char rkey[128];
if (keylen <= 128) {
memcpy(rkey, key, keylen);
memset(rkey + keylen, 0, 128 - keylen);
} else {
CSHA512().Write(key, keylen).Finalize(... | ALGO | 0.93776 | 5.726457 |
02467f2f-e9e6-4d28-a5ca-167eb8169f40 | JimmyCarter5417/leetcode | cpp/0875. Koko Eating Bananas.cpp | // Koko loves to eat bananas. There are N piles of bananas, the i-th pile has piles[i] bananas. The guards have gone and will come back in H hours.
// Koko can decide her bananas-per-hour eating speed of K. Each hour, she chooses some pile of bananas, and eats K bananas from that pile. If the pile has less than K ... | ALGO | 0.999975 | 5.997363 |
bff51f33-bfd9-4119-9179-ac6125e59d93 | DevDK-byte/DSA_problems | Array_problems/max_consecutive_1.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main()
{
int arr[] = {1,1,0,1,1,1,0,1,1,1,1,1};
int n = sizeof(arr)/sizeof(arr[0]);
int maximum = 0; int counter =0;
for(int i=0; i<n; i++)
{
if(arr[i]==1)
{
counter++;
maximum = max(maximum,counte... | ALGO | 0.999942 | 3.891176 |
c33b1416-b571-4958-8357-b18c56d1c808 | A01798012/Problems | div3881/B.cpp | #include <bits/stdc++.h>
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,ThxDem=b;i<ThxDem;++i)
#define pb push_back
#define ALL(s) s.begin(),s.end()
#define SZ(s) int(s.size())
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
void solve(){
ll n; cin >> n;
ll x, times = 0, p... | ALGO | 0.999609 | 3.714174 |
65b56e5e-b02a-41cc-837a-8eb02d2b579b | sarvex/leetcode-perl | solution/0500-0599/0514.Freedom Trail/Solution.cpp | class Solution {
public:
int findRotateSteps(string ring, string key) {
int m = key.size(), n = ring.size();
vector<int> pos[26];
for (int j = 0; j < n; ++j) {
pos[ring[j] - 'a'].push_back(j);
}
int f[m][n];
memset(f, 0x3f, sizeof(f));
for (int j :... | ALGO | 0.999999 | 5.563651 |
3738e1a9-c64f-4aed-b229-e0e3e394e3a4 | NandreyN/StudyPractice5 | DiagramPie/Pie.cpp | #undef UNICODE
#include <windows.h>
#include <math.h>
#include <cmath>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <iterator>
#include <algorithm>
#include <ctime>
#include <numeric>
using namespace std;
struct Participant
{
Participant() { value = -1; };
... | TOOL | 0.934739 | 4.043551 |
f78c1d0a-2eae-4417-8e93-f1d994637f96 | ishandutta2007/codeforces | juve45/normal/412/C.cpp | #include <bits/stdc++.h>
using namespace std;
string s[100005];
int n;
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
cin>>s[i];
int lg=s[1].size();
char ok;
for(int i=0;i<lg;i++)
{
int skip=0;
ok='?';
char ans;
for(int j=1;j<=n;j++)
{
if... | ALGO | 0.999971 | 3.406696 |
2919db28-3d05-447a-8285-bbe984d6a99d | NadaMamdouh225/Problem_Solving | LeetCode/Sum_of_All_Subset_XOR_Totals.cpp | class Solution {
public:
int solve(int i,int currentXor,vector<int>& nums)
{
//base case
if(i == nums.size()) return currentXor;
// include nums[i] in the subset ---------- don't include nums[i]
return solve(i+1,currentXor^nums[i],nums) + solve(i+1,currentXor,nums);
}
in... | ALGO | 0.999997 | 5.871798 |
a293ee22-0ac7-4110-a49b-5e72a32c752d | nish235/C-CppAssignments | Sept25/10SquareAndSum.cpp | #include<iostream>
using namespace std;
int main()
{
int i,n,sum=0;
cout<<"\n Enter The Number : ";
cin>>n;
cout<<"\n The square natural up to "<<n<<" terms are : "<<endl;
for(i=1;i<=n;i++)
{
cout<<"\n "<<i*i;
sum+=i*i;
}
cout<<"\n\n The Sum of Square Natural Number up t... | ALGO | 0.994334 | 3.410945 |
41f2e022-7f96-4ad3-87a7-930f54cd8357 | zhuxiangyualter/DataStructureInC | Graph/_6_8.cpp | #include<iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int** a = new int*[n];
for(int i = 0; i < n; i++) {
a[i] = new int[m];
}
//输入邻接矩阵
for(int i = 0; i < n; i++) {
for(int j = 0; j < m; j++) {
cin >> a[i][j];
}
}
//选择一个起始点,... | ALGO | 0.999992 | 3.487097 |
27fab9c1-0dcb-4cc7-aa3e-f321ac33c17c | cyrilmaitre/white_hole | lib/boost/boost_1_54_0/libs/msm/example/mpl_graph/depth_first_search.cpp | #include <boost/msm/mpl_graph/depth_first_search.hpp>
#include <boost/msm/mpl_graph/adjacency_list_graph.hpp>
#include <boost/msm/mpl_graph/incidence_list_graph.hpp>
#include <iostream>
namespace mpl_graph = boost::msm::mpl_graph;
namespace mpl = boost::mpl;
// vertices
struct A{}; struct B{}; struct C{}; struct D{}... | ALGO | 0.994455 | 6.194695 |
3b5989db-b097-4241-ace3-7c507f693f5f | surajgodse/Data-Structures-and-Algorithms | Patterns/Pattern1.cpp | // Online C++ compiler to run C++ program online
#include <iostream>
using namespace std;
int main() {
int n = 4;
for(int i = 0; i <n; i++){
char ch = 'A';
for(int j = 0; j<n; j++){
cout << ch;
ch = ch + 1;
}
cout<< endl;
}
} | ALGO | 0.999636 | 3.333542 |
d75e697d-2147-4d38-91ac-c33f24921592 | seo-d-h/Algorithm_CPP | 프로그래머스/lv2/12909. 올바른 괄호/올바른 괄호.cpp | #include <string>
#include <iostream>
#include <stack>
using namespace std;
bool solution(string s)
{
bool answer = true;
stack<char> stk;
for(int i=0;i<s.length();i++){
if(s[i] == '('){
stk.push('(');
}
else if(s[i] == ')'){
if(!stk.empty()){
... | ALGO | 0.998841 | 5.643555 |
0e17910d-3339-457c-9575-7ad5c83cb3ee | WilliamRush/proceshacker | tools/peview/tlsh/tlsh_impl.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include "tlsh.h"
#include "tlsh_impl.h"
#include "tlsh_util.h"
#include <string>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <algorithm>
//#include <string.h>
#define RANGE_LVALUE 256
#define RANGE_QRATIO 16
static void find_quartile(unsigned int *q1, unsigned i... | ALGO | 0.998634 | 3.884865 |
3fe76103-c649-4f5b-b96f-4d6c87a12ab4 | G-Gowtham/Programming | cpp/Length_of_longest_palindrome_in_linked_list.cpp | // { Driver Code Starts
// C program to find n'th Node in linked list
#include <stdio.h>
#include <stdlib.h>
#include<iostream>
using namespace std;
/* Link list Node */
struct Node
{
int data;
struct Node* next;
Node(int x){
data = x;
next = NULL;
}
};
void append(struct Nod... | ALGO | 0.999772 | 5.320652 |
9b3b987e-80f2-44b3-bbb5-94731d3d83e5 | hinh2003/tailieu | mang1chieu.cpp | #include<iostream>
#define MAX 100
using namespace std ;
void nhapmang(int arr[], int n){
for(int i = 0 ;i <=n; i ++){
cout<<"Phan tu arr["<<i<<"] = " <<endl;
cin>>arr[i] ;
}
}
void xuatmang(int arr[], int n){
for(int i = 0 ;i <=n; i ++){
cout<<arr[i] <<endl ;
}
}
i... | ALGO | 0.956236 | 3.563003 |
1573cecf-5356-4afa-bf06-a6ac2ec5e35a | dicksiano/Coding-Interview | CCI/c2/3_DeleteMiddleNode.cpp | #include <iostream>
using namespace std;
class node {
public:
node(int x) {
this->elem = x;
this->next = NULL;
}
int elem;
node *next;
};
/*
Time: O(n)
Space: O(1) - In place!
*/
void deleteMiddleNode( node *head ) {
if(head == NULL) return;
if(head->next == NULL) return; // CANNOT DELETE LAST ELEM... | ALGO | 0.999553 | 5.698926 |
255fcd44-93dc-40b0-b6df-a8146ad7720b | harshthakur3/Codeforces-Solution | C_Sort.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int n, q;
cin >> n >> q;
}
} | ALGO | 0.995939 | 3.290723 |
aaaa54c7-9dd7-4ae3-997e-8da637e4150b | KhalidUsman2024/Programming-Fundamentals-In-C-Plus-Plus | 4 Patterns/30 vertically flipped triangle of ABC.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout<<"Enter n :";
cin>>n;
for(int i=1; i<=n; i++)
{
for(int j=1; j<=n-i; j++)
{
cout<<" ";
}
for(int j=1; j<=i; j++)
{
cout<<(char)(j+64)<<" ";
}
cout<<endl;
}
}
| ALGO | 0.999003 | 3.217583 |
424b6511-eff2-4138-a2b0-36ce4c3b429f | yfdyh000/sqlitebrowser_cross | libs/qscintilla/lexlib/WordList.cpp | // Scintilla source code edit control
/** @file WordList.cxx
** Hold a list of words.
**/
#include <cstdlib>
#include <cassert>
#include <cstring>
#include <algorithm>
#include <iterator>
#include "WordList.h"
using namespace Scintilla;
/**
* Creates an array that points into each word in the string and puts \0... | TOOL | 0.98009 | 6.090459 |
528d451b-f783-4a7d-87a1-48b745d4ae8f | HCHO0323/POJ-Exercises | 2575.cpp | #include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
int n = 0 ;
double number[5000];
double ans[5000];
bool anc[5000];
int cnt = 0;
memset(ans,0,sizeof(ans));
memset(anc,false,sizeof(anc));
memset(number,0,sizeof(number));
cin >> n;
if(n == 1) { cout << "Jolly " << endl; re... | ALGO | 0.99993 | 3.673643 |
5202b6e2-8ca2-4b76-aa58-a0f76df65126 | GusakovIgor/Coursera-cpp | White belt/Week 2/11_Anagrams.cpp | #include <iostream>
#include <map>
#include <string>
using namespace std;
void BuildLettersCounter (map <char, int>& counter, const string& word);
// bool IsAnagrams (map <char, int>& first_word, map <char, int>& second_word);
int main ()
{
int num_pairs;
cin >> num_pairs;
map <char, int> first_word;
map <char... | ALGO | 0.999869 | 5.094821 |
dfadac2a-6529-4d20-8a96-b0b79482ccaf | Mehedihasan444/Competitive_Programming | codeforce/469/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, p, q;
cin >> n;
cin >> p;
int a[p];
for (int i = 0; i < p; i++)
{
cin >> a[i];
}
cin >> q;
int b[q];
for (int i = 0; i < q; i++)
{
cin >> b[i];
}
int array[200];
for (int i = 0; i ... | ALGO | 0.999537 | 3.071929 |
5ff222ac-375a-454d-a503-8127cd2dca52 | panzg123/leetcode | Recover Binary Search Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution
{
public:
TreeNode *p,*q;
TreeNode *prev;
void recoverTree(TreeNode *root)
{
p=q=prev... | ALGO | 0.999996 | 5.905222 |
c4174597-9aae-4f19-8117-69ab60a1a778 | Nishchal-Sachan/DSA-Cpp | Patterns/CharRectangle2.cpp | #include <iostream>
using namespace std;
int main()
{
// ABCD
// ABCD
// ABCD
// ABCD
int row;
cout << "Enter no. of rows:";
cin >> row;
int i = 1;
while (i <= row)
{
char a = 'A';
int j = 1;
while (j <= row)
{
cout << a << " ";
... | ALGO | 0.999493 | 3.92575 |
28ad9544-9e48-41d3-a843-bfa42f7bf808 | atmpluss/msanayei_phd_developments | 04-coupled-model-walberla/apps/benchmarks/FluidParticleCoupling/ObliqueDryCollision.cpp | #include "mesa_pd/collision_detection/AnalyticContactDetection.h"
#include "mesa_pd/common/ParticleFunctions.h"
#include "mesa_pd/data/ParticleAccessorWithShape.h"
#include "mesa_pd/data/ParticleStorage.h"
#include "mesa_pd/data/ShapeStorage.h"
#include "mesa_pd/kernel/DoubleCast.h"
#include "mesa_pd/kernel/ExplicitE... | ALGO | 0.995337 | 6.534138 |
8421f026-e37c-4b4b-91cf-e481f2b91262 | leehaijun/Solutions-Exercises-MobileRobots | exercise_robot_navigation_without_a_map/RobotSimulator.cpp | /// Exercise: Robot navigation without a map
///
/// The goal of this exercise is to let students think
/// about own ideas to bring a robot from a point A
/// in the world to a point B without using a map.
///
/// The user can select a target point in the 2D world
/// and the robot will try to reach this point without... | ALGO | 0.997143 | 3.513075 |
1d0c8b5d-4e5c-4486-bdde-17050ef32f62 | ishandutta2007/codeforces | froggyzhang/normal/1207/F.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 500050
#define M 777
const int n=500000;
const int B=700;
typedef long long ll;
int cnt[M][M],Q,a[N];
void Solve(){
cin>>Q;
while(Q--){
int opt,x,y;
cin>>opt>>x>>y;
if(opt==1){
for(int i=1;i<=B;++i){
cnt[i][x%i]+=y;
}
a[x]+=y;
}
else{
... | ALGO | 0.999654 | 3.766338 |
44eddea3-2a27-48a9-806a-57e5b376573b | chandra71/CPP-DSA | Lecture-04(Patterns)/Inverted Hollow pyramid.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
for(int row=0;row<n;row++ ){
for(int col=0;col<row;col++){
cout<<" ";
}
int totalcol=n-row;
for(int col=0;col<totalcol;col++){
if(col==0 || col==totalcol-1){
cout<<"* ";
}
else{
cout<<" ";... | ALGO | 0.999891 | 3.68291 |
8965c4e0-c5b3-476d-bcb9-1103649b059b | yanmulin/leetcode | 66.plus-one.cpp | class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
int sz = digits.size();
if (sz == 0) return digits;
digits[sz-1] += 1;
int i, carry = digits[sz-1] / 10;
digits[sz-1] = digits[sz-1] % 10;
for (i=sz-2;i>=0&&carry>0;i--) {
digits[i] += car... | ALGO | 0.999954 | 6.786246 |
7d0ebe9d-8f71-4780-9078-d6ad89221bba | Harshal-OP/Codeforces-Solutions | CF_1833B.cpp | #include <bits/stdc++.h>
using namespace std;
bool checkIndex(long long int usedIndex[],long long int n,long long int j){
for(int i=0;i<n;i++){
if(usedIndex[i]==j){
return false;
}
}
return true;
}
int main(){
int t;
cin>>t;
while(t){
long long int n,k;
... | ALGO | 0.999973 | 3.369016 |
a5fecd47-c0dd-4529-89c8-9f550f574bc9 | da380/Interpolation | examples/LagrangeExample.cpp |
#include <Interpolation/All>
#include <algorithm>
#include <cmath>
#include <fstream>
#include <iostream>
#include <iterator>
#include <vector>
int main() {
using namespace Interpolation;
// Set the nodes
int N = 3;
double x1 = 0.0;
double x2 = 1.0;
double dx = (x2 - x1) / static_cast<double>(N - 1);
s... | ALGO | 0.99842 | 5.574449 |
18456c38-ad93-49e3-9162-d928939dd61c | columbia/crane | xtern/eval/find-hotspot/find-hotspot.cpp | #include "find-hotspot.h"
using namespace tern;
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Debug.h"
#include "llvm/Analysis/Dominato... | TOOL | 0.930611 | 6.673398 |
69218489-e206-4f37-9f26-a7dc343a36f9 | vivek2188/Study | C++ Programming/InterviewBit/Binary Search/Painter's-Partition-Problem.cpp | int Solution::paint(int A, int B, vector<int> &C) {
int modulo = 10000003;
B = B%modulo;
int n = C.size();
long long int low=C[0], high=C[0];
for(int i=1;i<n;i++){
if(C[i]>low)
low = C[i];
high += (long long int)C[i];
}
if(A>=n){
low = low%modulo;
... | ALGO | 0.999955 | 4.248259 |
4154cbd2-b08c-43ec-a14a-19007bba53ef | anurag-111/allSubmissions | binary-tree-maximum-path-sum/Accepted/9-1-2023, 12_20_53 AM/Solution.cpp | // https://leetcode.com/problems/binary-tree-maximum-path-sum
class Solution {
private:
int solve(TreeNode *root, int &maxPathSum) {
if(root == NULL) {
return 0;
}
int left = solve(root -> left, maxPathSum);
int right = solve(root -> right, m... | ALGO | 0.99999 | 6.425533 |
ebe8c247-3bf7-4821-895e-58effc6d1463 | osanseviero/C-training | Foundations/Preparation/24.reverse_list.cpp | class Solution {
public:
// Reverses the linkedList which starts from head, and extends to size nodes.
// Returns the end node.
// Also sets the head->next as endNode->next.
ListNode *reverseLinkedList(ListNode *head, int size) {
if (size <= 1) return head;
ListNode *cur =... | ALGO | 0.999961 | 6.170472 |
44f278c0-d04f-4da1-8daf-c341e90a5421 | rainwl/GeometryKit | include/igl/piecewise_constant_winding_number.cpp | template <
typename DerivedF,
typename DeriveduE,
typename DeriveduEC,
typename DeriveduEE>
IGL_INLINE bool igl::piecewise_constant_winding_number(
const Eigen::MatrixBase<DerivedF>& F,
const Eigen::MatrixBase<DeriveduE>& uE,
const Eigen::MatrixBase<DeriveduEC>& uEC,
const Eigen::MatrixBase<DeriveduEE>&... | TOOL | 0.993977 | 6.49784 |
b25cad58-f1df-472c-847a-1d6d09cd841e | ESHUshri202/DSA_C- | 6. Pattern/smple.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int row,col;
cin>>row>>col;
for(int i = 1;i<=row; i++){
for(int j=1 ; j<=col ; j++)
{
if(i==1 || i==row || j == 1 || j==col)
{
cout<<" "<<j<<"*"<<i;
}
else
{
... | ALGO | 0.999747 | 3.193907 |
8177dea6-ef53-4283-88c7-6e6e16ae7c9d | LeeJinHyoung/C-OpenCV | OpenCVApp/5.c++_struct_class.cpp | //struct
//class
#include<iostream>
#include<stdio.h>
#include<vector>
#include<string>
//typedef unsigned char uchar;// Ÿ
//typedef unsigned int uint;
//
//class Myclass
//{
//
//
//};
//
////ü, struct //struct class 1
//// struct(public)
//// class ڰ (public, pivate, )
//struct _stData
//{
// // ٸ Ͽ
... | TOOL | 0.973363 | 3.693801 |
50c1ba8b-09ae-450d-9da7-8a1f3e943a2f | yugal82/DSA | Dynamic Programming/Leetcode/24-RodCutting.cpp | // Q] Given a rod of length N inches and an array of prices, price[]. price[i] denotes the value of a piece of length i. Determine the maximum value obtainable by cutting up the rod and selling the pieces.
#include<bits/stdc++.h>
using namespace std;
class Solution{
public:
int recursion(int idx, int n, vector<in... | ALGO | 0.999938 | 5.296379 |
435df035-7bca-4d19-8b66-8fc6b608f429 | SheetRaj/data-structures-and-algorithms | Partition Array for Maximum Sum/main.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
// Using Dp
int maxSumAfterPartition(vector<int>& arr, int k) {
int n = arr.size();
vector<int> dp(n + 1);
for (int i = 1; i <= n; i++) {
int maxSum = INT_MIN;
for (int j = 1; j <= min(i, k); j++) {
maxSum = max(maxS... | ALGO | 0.999969 | 5.858188 |
ab199963-da22-4b36-a52e-e2735d10c492 | Shyamji07/Leetcode-Solutions | 2600-k-items-with-the-maximum-sum/2600-k-items-with-the-maximum-sum.cpp | class Solution {
public:
// int kItemsWithMaximumSum(int numOnes, int numZeros, int numNegOnes, int k) {
// int count = 0;
// while(k>0){
// if(numOnes>0){
// count++;
// numOnes--;
// k--;
// }
// else ... | ALGO | 0.999931 | 5.26067 |
35ec6bb4-cd8f-4532-b147-081d6b1464b0 | kapil4457/Contests | Codeforces Contests/Codeforces Round 881/D_Apple_Tree.cpp | #include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mod 1000000007ll //998244353ll
#define mii map<int, int>
#define pii pair<int, int>
#define TEST int t;cin >>t;while(t--)
// #define TEST int t=1;while(t--)
int power(int a,int b){int result =1; while(b>0){if(b%2) result*=a; a*=a;b/=2;} retu... | ALGO | 0.99788 | 4.981566 |
bd2e2fc8-e327-4473-bbe4-f57fd72ec710 | eisoku9618/kuroiwa_demos | c++/atcoder/abc167/task_D.cpp | #include <iostream>
#include <vector>
#include <algorithm>
int main() {
int N;
long long K;
std::cin >> N >> K;
std::vector<int> A_array(N);
for (int i = 0; i < N; ++i) {
std::cin >> A_array[i];
A_array[i] -= 1;
}
if (N > K) {
int index = 0;
for (int i = 0; i < K; ++i) {
index = A... | ALGO | 0.99997 | 4.896793 |
2e81486d-961a-4406-97e3-84fe56744ecc | Sungijnwoo/Coding-Test | 9184/9184.cpp | #include <iostream>
using namespace std;
int dp[21][21][21];
void w(int a, int b, int c)
{
cout << "w(" << a << ", " << b << ", " << c << ") = ";
if (a <= 0 || b <= 0 || c <= 0)
{
cout<< 1 << " ";
}
else if (a > 20 || b > 20 || c > 20)
{
cout << dp[20][20][20] << " ";
}
else
{
cout << dp[a][b][c] << " ... | ALGO | 0.999646 | 3.883238 |
dcfa81c8-e11a-4ca2-9312-7a017d5d20dd | Coco0828/codingPractice | C++/20221212/e700.cpp | #include <iostream>
using namespace std;
int main(){
int m, d;
while(scanf("%d/%d", &m, &d)){
if(m == 1){
if(d > 20) cout << "~y" << endl;
else cout << "~y" << endl;
}
else if(m == 2){
if(d > 19) cout << "y" << endl;
else cout << "~y" << endl;
}
else if(m == 3){
if(d > 20) cout << "dϮy" <<... | ALGO | 0.997421 | 3.653284 |
1dfd52a8-625d-4872-84cd-adfa2b820cea | hi2p-perim/lightmetrica-v2 | plugin/renderer_radiosity/renderer_radiosity.cpp | #include <lightmetrica/lightmetrica.h>
#include "radiosityutils.h"
#include <sstream>
#include <boost/format.hpp>
#if LM_COMPILER_MSVC
#pragma warning(disable:4714)
#pragma warning(disable:4701)
#pragma warning(disable:4456)
#include <Eigen/Sparse>
#else
#include <eigen3/Eigen/Sparse>
#endif
#define LM_RADIOSITY_DEBUG... | ALGO | 0.956001 | 6.832454 |
7af9ee39-091c-41a5-9bad-2148706ecde8 | GQH123/Renatus-ACM-Codes | Google Code Jam 2021/Qualification Round/E.cpp | #include <bits/stdc++.h>
#define rep(i, l, r) for (register int i = l; i <= r; i++)
#define per(i, r, l) for (register int i = r; i >= l; i--)
#define srep(i, l, r) for (register int i = l; i < r; i++)
#define sper(i, r, l) for (register int i = r; i > l; i--)
#define erep(i, x) for (register int i = h[x]; i; i = e[i].... | ALGO | 0.999865 | 3.402468 |
6a43d521-f36a-428b-a7c4-8f721944e480 | mint130/Algorithm | 프로그래머스/1/42840. 모의고사/모의고사.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector<int> solution(vector<int> answers) {
vector<int> answer;
int cnt1=0;
int cnt2=0;
int cnt3=0;
//수포자 1번 1,2,3,4,5
//수포자 2번 2,1,2,3,2,4,2,5,2,1,2,3,..
//수포자 3번 3,3,1,1,2,2,4,4,5,5,
vect... | ALGO | 0.999983 | 5.29575 |
e75a1950-8b9b-4ee5-aa52-2849bb03a482 | aryaman0098/codes | cpp/leetcode/729.my-calendar-i.cpp | /*
* @lc app=leetcode id=729 lang=cpp
*
* [729] My Calendar I
*/
// @lc code=start
#include<bits/stdc++.h>
using namespace std;
class MyCalendar {
private:
vector<vector<int>> events;
public:
MyCalendar() {
events = {};
}
bool book(int startTime, int endTime) {
int i = 0, n = ev... | ALGO | 0.999737 | 6.191313 |
00de38d7-1967-47e4-8ca4-356e3c96643a | luliyucoordinate/Leetcode | src/2279-Maximum-Bags-With-Full-Capacity-of-Rocks/2279.cpp | class Solution {
public:
int maximumBags(vector<int>& capacity, vector<int>& rocks,
int additionalRocks) {
int n = capacity.size();
vector<int> diff(n);
for (int i = 0; i < n; i++) {
diff[i] = capacity[i] - rocks[i];
}
sort(diff.begin(), diff.end());
int res = 0;
f... | ALGO | 0.999432 | 5.981616 |
b396fea0-0ca0-4e13-be39-870bac36d223 | akamabhoi/neetCode | Stack/GenerateParentheses.cpp | class Solution
{
public:
// Global variable to store the generated parentheses combinations.
vector<string> ans;
// Recursive function to generate valid parentheses combinations.
void solver(int open, int close, int n, string s)
{
// Base case: If the count of open and close parentheses rea... | ALGO | 0.999943 | 7.077543 |
8f28b99e-15e8-4399-bb5d-071876108558 | emilykackley/Sorting-Algorithms | BubbleSort/main.cpp | #include <iostream>
using namespace std;
void printArray(int arr[], int size)
{
for (int i=0; i<size; i++)
{
cout<<arr[i]<<" ";
}
cout<<endl;
}
void swap(int *x, int *y)
{
int temp = *x;
*x = *y;
*y = temp;
}
void bubbleSort(int arr[], int n)
{
for(int i=0; i<n-1;i++)
{
... | ALGO | 0.998783 | 4.965908 |
796bd8f8-242f-4695-86d7-63a28ead08ca | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_7189_14.cpp | #include <iostream>
using namespace std;
int main(){
int x,y,z;
cin >> x >> y >> z
if (x < y < z) cout << "Yes" << endl;
else cout << "No" << endl;
} | ALGO | 0.99996 | 3.790471 |
4fd259b4-4799-4fa7-a6d8-260b66921f8c | stino220802/aoc2024 | day1.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include <string_view>
#include <ranges>
#include <vector>
#include "aocUtils.h"
#include <algorithm>
void part1(std::vector<std::vector<int>> in);
void part2(std::vector<std::vector<int>> in);
int main() {
aoc::timer timer;
std::string filename = __FI... | ALGO | 0.998245 | 4.467233 |
48d927a7-e0ec-476a-91b3-327a74f4a51a | monhime/atcoder_charter | C++_old/beginner/084/B.cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#include<string>
#include<math.h>
#include<vector>
#include<queue>
#include<map>
#include<stack>
//#include <bits/stdc++.h>
#define INF (1<<30)
#define INFLL (1ll<<60)
using namespace std;
map <int,int> mp;
typedef pair<int, int... | ALGO | 0.999762 | 3.292984 |
3de45c7c-1eaa-4bcd-92c9-f77c244cbc45 | WyjAloneSmile/SVDistic | models/timesvdpp/model.cpp | #include "./model.h"
#include "./helpers.cpp"
/***********************************************
* Predict stuff
**********************************************/
// pred = mu + b_u + b_p + W_p(W_u + |R(u)|^-1/2 sum y_j)
float TimeSVDpp::predict(ExampleMat& X, int ij)
{
const float i = X(0, ij);
const float j = X(1,... | ALGO | 0.999812 | 4.549255 |
986e3515-f975-4cbb-bab7-6a7430333470 | xie-xyh/cpp_learning_pratice | 第五章/课后习题/5.9.3/5.9.3.cpp | #include <iostream>
int main()
{
using namespace std;
cout << "enter a number: ";
double sum = 0;
double num;
cin >> num;
while(num != 0)
{
sum += num;
cin >> num;
}
cout << sum << endl;
return 0;
} | ALGO | 0.991142 | 3.964211 |
a6a8e1e2-c57f-4bc0-b0d6-d81d2766e3ff | KIRILLxBREAK/Preprocess | test/oneLine/include.cpp | #include <iostream>
#include <string.h>
#include <string.cpp>
#define Q 340
using namespace std;
double func(double n)
{
return (2*n-1)*(2*n-1)/n;
}
int main(int argc, char *argv[])
{
int k, m, count;
count = 0;
cout << "Please enter an real value: " << endl;
cin >> k >> m; //read k and m
... | ALGO | 0.999776 | 3.424076 |
511607dc-5d96-46ef-bfcd-a53d32e1926c | songhn233/Algorithm-Packages | codeforces/cf533 div2/A.cpp | #include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<vector>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#define ll long long
#define F(i,a,b) for(int i=(a);i<=(b);i++)
#define mst(a,b) memset((a),(b),sizeof(a))
#define PII pair<int,int>
#define rep(i,x,y) for(auto i=(x);i<... | ALGO | 0.999983 | 4.227891 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.