uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
da493869-5aea-44f4-913c-f47ed2964c63 | GaisaiYuno/OI-Record-exe-deleted | Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day2程序包/answers/GD-0329/defense/defense.cpp | #include <bits/stdc++.h>
#include <vector>
#include <queue>
using namespace std;
int n=0;
int m=0;
char type[2];
long long p[100005];
int deep[100005];
vector<int> road[100005];
queue<int> q;
long long dp[100005][2];
int mustbe[100005]; // 0 = any, 1 = mustbe, 2 = mustnot
long long inf = 1e12;
int par[100005];
v... | ALGO | 0.999887 | 3.538132 |
c7b50e14-faf8-40af-9851-58a4c7898280 | Rinnnt/CompetitiveProgramming | AtCoder/bc59/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
#define nl '\n'
#define pii pair<int, int>
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n;
cin >> n;
vector<int> a(n);
for (auto &x : a)
cin >> x;
ll ... | ALGO | 0.999994 | 4.342317 |
9ff1452b-12d7-4ad3-8501-553e6c82949b | ishandutta2007/codeforces | bigbag/normal/1521/E.cpp | /**
* created: 07/05/2021, 19:15:34
**/
#include <bits/stdc++.h>
using namespace std;
const int max_n = 100111, inf = 1000111222;
const int max_r = 700;
int t, m, k, ans[max_r][max_r];
vector<pair<int, int>> v;
vector<int> all;
void clr() {
v.clear();
all.clear();
}
bool good(int n) {
for (int i = 0... | ALGO | 0.999984 | 3.247885 |
316f8c10-a3c9-4a6f-9469-e6a39016176a | bumega/csr_matrix | Matrix.cpp | #include "Matrix.h"
#include "OutOfRange.h"
#include "IncompatibleDimException.h"
#include <memory>
CSRMatrix::CSRMatrix() : amount_of_rows(0), amount_of_values(0), capacity(0), values(nullptr), rows(nullptr), cols(nullptr) {};
CSRMatrix::CSRMatrix(double** matrix, int size) : capacity(size) {
double* tvalues = new ... | TOOL | 0.966333 | 3.572932 |
52b00266-2695-4b18-9e4b-e0f1258aeb2d | 1000kgOnions/CodeAlgorithms-_securityInformation | VigenereCipher_lapkhoa.cpp | #include <iostream>
using namespace std;
//Tạo khóa
string CreateKey(string plaintext, string key)
{
int x = plaintext.size();
for (int i = 0;; i++)
{
if (key.size() == plaintext.size())
break;
key.push_back(key[i]);
}
return key;
}
//Encrypt
string cipherText(string plaintext, string key)
{
string ciph... | ALGO | 0.999957 | 4.377197 |
0cad9137-04d4-4665-9b13-88d2dfeacd69 | Prashant-flick/codeforces-contest | 155 educational/D_Sum_of_XOR_Functions.cpp | #include<bits/stdc++.h>
#include <algorithm>
using namespace std;
const int MOD = 998244353;
#define int long long
int32_t main()
{
int n;
cin >> n;
vector <int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
int ans = 0;
for (int bt = 0; bt < 30; bt++) {
int cb = 1 << ... | ALGO | 0.999975 | 4.461096 |
9705f24f-2ee7-4a11-9c2f-fd01bbbc183c | TechSculptorx/DSA | 11.Strings/checkpermution.cpp | #include <cstdlib>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
using namespace std;
#include <bits/stdc++.h>
bool areAnagram(string &str1, string &str2) {
int n1 = str1.length();
int n2 = str2.length();
if (n1 != n2)
return fal... | ALGO | 0.999207 | 4.299805 |
2ea5c2bd-58b2-41d5-9aa9-12fa32e48ae5 | strivelll/code | dev.c语言/1214.cpp | #include<stdio.h>
int main()
{
int k;
int a,b,c,n,m,s;
scanf("%d",&k);
while(k--)
{
s=0;
m=1;
scanf("%d+%d=%d",&a,&b,&c);
if(a+b==c)
{
printf("0\n");
}
else
{
for(n=10;n<1000000000;n*=10)
{
s++;
if((a*n+b)==c)
{
printf("%d\n",s);
m=0;
break;
}
}
if(m)
... | ALGO | 0.999635 | 3.251293 |
72270423-4995-4cb5-8bcf-eceadecb4b1b | ahmad-kashkoush/PS | Progvar/GCD&&LCM Fun/A. EhAb AnD gCd.cpp | #include<bits/stdc++.h>
#define el '\n'
#define ll long long
#define reset(v, d) memset(v, d , sizeof(v))
#define all(s) s.begin(), s.end()
#define cin(v) for(auto &i:v)cin>>i
#define cout(v) for(auto i:v)cout<<i<<" "
using namespace std;
void judge();
const int mod = 1e9 + 7, OO = 2 * 1e9;
const double pi = 3.141592... | ALGO | 0.999791 | 4.283121 |
dd2068d5-db1e-40ab-b170-b4e075a3ff78 | rahuljroy/Outbreak-contact_tracing | .history/outbreak_seq_20200421111402.cpp | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <bits/stdc++.h>
using namespace std;
struct graph{
int Day;
vector< vector<long int> > graph_for_the_day;
};
long int get_no_lines(char* filename){
long int no_vertic... | DATA | 0.995319 | 3.666029 |
1b2c578d-5a86-426b-860f-c34d92ac15d4 | J-B-Mugundh/LeetCode-Solutions | 0121-best-time-to-buy-and-sell-stock/0121-best-time-to-buy-and-sell-stock.cpp | class Solution {
public:
int maxProfit(vector<int>& prices) {
int mini = prices[0], profit = 0;
for(int i = 1; i < prices.size(); i++){
int curProfit = prices[i] - mini;
profit = max(profit, curProfit);
mini = min(mini, prices[i]);
}
return profit;... | ALGO | 0.999817 | 6.256385 |
4deee093-f90a-4511-82bb-81f574dd1260 | TaoJun724/HttpServer | ResourceManagementAssistant/Upload.cpp | #include "Util.hpp"
enum _boundry_type{
BOUNDRY_NO = 0, //没有boundry
BOUNDRY_FIRST,
BOUNDRY_MIDDLE ,
BOUNDRY_LAST,
BOUNDRY_BAK //不完整的boundry ,如果是不完整的, 就要进行读取判断
};
class Upload{
//对正文据的解析并践行解析
private:
int _file_fd; //遇到文件名就将那个文件描述符打开
int64_t _cont_len;
std::string _file_name;
std::strin... | TOOL | 0.8846 | 4.06997 |
e6268811-6615-4cd9-add5-ca92b3929d28 | mayuka-c/DSA-Algorithms-Practice | Day4/Arrays/pair_sum.cpp | //
// Link: https://bit.ly/3EwlU6e
/*
1 3 2 4 5
k = 5
Output:
1 4
2 3
*/
#include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
void printElements(vector<int> &arr) {
for(auto i: arr) {
cout << i << endl;
}
}
vector<vector<int>> pairSum(vecto... | ALGO | 0.99991 | 5.470097 |
4a095e2a-22f3-40c1-bbf3-c4825a045fc7 | akshayrajp/Competitive-Programming | CodeChef/PSHOT.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int t, n, a = 0, b = 0, i;
bool ans = false;
string ip;
cin >> t;
while (t--)
{
a = 0, b = 0, ans = false;
cin >> n;
cin >> ip;
for (i = 0; i < 2 * n; i++)
{
if (i % 2 == 0... | ALGO | 0.999982 | 3.413239 |
dc818bbc-3d72-4ccc-ae44-7484e86d950d | sarvex/leetcode-dart | solution/1400-1499/1482.Minimum Number of Days to Make m Bouquets/Solution.cpp | class Solution {
public:
int minDays(vector<int>& bloomDay, int m, int k) {
if (m * k > bloomDay.size()) {
return -1;
}
int mi = INT_MIN, mx = INT_MAX;
for (int& bd : bloomDay) {
mi = min(mi, bd);
mx = max(mx, bd);
}
int left = mi, ... | ALGO | 0.999997 | 6.268849 |
8a65b5c5-0d41-4f46-b49e-c3a0269e948e | menyf/Code-Snippet | ACM-ICPC/HDU5792.cpp | #include <set>
#include <map>
#include <stack>
#include <cmath>
#include <queue>
#include <cstdio>
#include <string>
#include <vector>
#include <iomanip>
#include <bitset>
#include <cstring>
#include <iostream>
#include <deque>
#include <algorithm>
#define Memset(a,val) memset(a,val,sizeof(a))
#define PI acos(-1)
#defi... | ALGO | 0.999867 | 3.39747 |
d0d718c4-f2eb-4b75-8564-c6ae468808e9 | s-spillias/EMs-with-LLMs | POPULATIONS/POPULATION_0012/CULLED/INDIVIDUAL_DRXMCFX2/model.cpp | #include <TMB.hpp> // TMB header: provides templated functions and macros for the model
// Model Overview:
// 1. COTS Dynamics: Logistic growth modified by a smooth outbreak-triggered decline.
// 2. Fast-growing Coral (Acropora spp.) Dynamics: Recovery towards full cover minus losses due to COTS predation.
// 3. Slow-... | ALGO | 0.999454 | 7.2531 |
2822667d-2d72-431a-9d6c-7d4aaf9c67d7 | Joshrbalch/TSP-Genetic-Approach | randomMatrix.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <random>
using namespace std;
vector<vector<int>> generateMatrix(int numNodes) {
// Initialize a 2D vector with all elements set to 0
const string filename = "graph.graph";
vector<vector<int>> weightedMatrix(numNodes, vector<int>(numNodes, ... | ALGO | 0.98824 | 6.5119 |
4ec67910-e642-4ea8-b2e2-7cfbf5f5514b | DivyanshMittal-exe/CSES | Additional Problems/New Flight Routes/code.cpp | #pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
mt19937 RNG(chrono::steady_clock::now().time_since_epoch().count());
#define SHUF(v) shuffle(all(v), RNG);
// ----------------------<DEBUG>---------------------------
void __print(int x) {cerr << x;}
void __print(long x) {cerr <... | ALGO | 0.999433 | 3.958213 |
5e0d8dd8-7254-4513-9b16-3631f9310f51 | gabitaniguchi/Competitive-programming | básico/if e else/par ou impar.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int b,c, soma;
scanf("%d %d", &b, &c);
soma = b +c;
if(soma%2 == 0)
{
printf("Bino\n");
}
else
{
printf("Cino\n");
}
return 0;
} | ALGO | 0.999392 | 3.620837 |
f414d301-e79f-45a5-8b50-db92fbbb2697 | Jiryeong29/2023-Algorithm-Study | 01월/Round02 배열/대표값(2846)/지령(2846).cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int iCount = 0, value,iMax=0, iTemp=0, sum=0;
//입력
vector<int> v;
v.assign(10, 0);
for (int i = 0; i < 10; ++i) {
cin >> v[i];
}
for (int i = 0; i < 10; ++i) {
... | ALGO | 0.999715 | 3.505831 |
2067d573-0b05-461e-9931-40ef0fb36c0d | Sumonta056/Learning-DataStructure-and-Algorithms | Number Theory/Divisor/even_odd_divisor.cpp | // ** Sumonta Saha Mridul ** SWE - SUST
/*
###### ## ## ## ## ####### ## ## ######## ###
## ## ## ## ### ### ## ## ### ## ## ## ##
## ## ## #### #### ## ## #### ## ... | ALGO | 0.99994 | 4.793209 |
2937ca80-0831-4413-a851-5b45e7c34bd1 | ishandutta2007/codeforces | marckess/normal/763/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define find(v,x) (lower_bound(ALL(v), x) - v.begin())
typedef long long ll;
typedef long ... | ALGO | 0.999976 | 4.369234 |
41ca28ff-c4c3-4e9e-bc46-ab4b02899878 | Peter-Refaat/Leetcode | Medium/1828. Queries on Number of Points Inside a Circle.cpp | class Solution {
public:
vector<int> countPoints(vector<vector<int>>& points, vector<vector<int>>& queries) {
vector<int>ans;
for(auto& circle : queries)
{
long double x = circle[0];
long double y = circle[1];
long double r = circle[2];
int cnt... | ALGO | 0.999811 | 5.814826 |
adeb95a4-9b32-4339-b6c1-e0556e3efd43 | amanxrawat/dsa_practice | largestNumberFromed.cpp | #include<bits/stdc++.h>
using namespace std;
bool func(string& a, string& b)
{
return a+b > b+a;
}
class Solution{
public:
string printLargest(int n, vector<string> &arr)
{
sort(arr.begin(), arr.end(), func);
string out;
for (auto s : arr)
out+=s;
return out;
}
};
int m... | ALGO | 0.999447 | 5.286455 |
1b512e8a-97f2-4b83-bfff-cb7eecc6516c | shaquib1/code-studio | Search_In_Rotated_Sorted_Array.cpp |
int findpivot(vector<int>& arr, int n){
int s=0;
int e=n-1;
int m=(s+e)/2;
while(s<e){
if(arr[m]>=arr[0]){
s=m+1;
} else {
e = m;
}
m = (s + e) / 2;
}
... | ALGO | 0.999997 | 5.79601 |
10746353-5d71-4814-a296-7a9d692abff7 | guenhae/Orbit | grail/classes/fcm/enum.cpp | /***************************************************************************
File: classes/fcm/enum.cpp
-----
Description:
------------
This file contains the definition of the following function:
int fcm<Label>::enumerate(int number, set<string<Label> >& members)
This function is a public mem... | ALGO | 0.998373 | 5.228919 |
e059b344-6596-40a5-ab34-c8ac96d90207 | Shrondi/computer-vision | fsiv_tutorial_opencv/comp_stats.cpp | /*!
Ejemplo de carga de imagen y su recorrido para calcular estadisticos
simples.
Se supone que se utilizará OpenCV.
Para compilar, puedes ejecutar:
g++ -Wall -o esqueleto esqueleto.cc `pkg-config opencv --cflags --libs`
*/
#include <iostream>
#include <exception>
#include <valarray>
//Includes para Op... | ALGO | 0.968075 | 4.269035 |
9fdee3a6-6eb6-49de-9832-76f960aa84c4 | SQUID12/SQUID | SQUID-HH/Cuckoo.cpp | /*#include "Cuckoo.h"
#include <chrono>
#include "xxhash.h"
#include <unordered_map>
#include <iostream>
using namespace std;
Cuckoo::Cuckoo(int seed1, int seed2, int seed3) {
_seed1 = seed1;
_seed2 = seed2;
_seed3 = seed3;
_mask = 0x3FF;
srand(42);
}
Cuckoo::~Cuckoo() {
}
void Cuckoo::insert(uint32_t key,... | ALGO | 0.979565 | 4.406006 |
12cfc992-2677-449c-b01b-d341c669cbf6 | kyw04004/ProblemSolving | BOJ/1039_교환.cpp | #include<iostream>
#include<map>
#include<queue>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
string str;
int K, ans = -1;
map<pair<string, int>, int> m;
queue<pair<string, int>> q;
void bfs() {
q.push({ str, 0 });
m[{str, 0}] = 1;
while (!q.empty()) {
string now = q.front().first;
... | ALGO | 0.999902 | 4.598077 |
75bc0486-f156-4225-9429-e2c941ec35c1 | shawnhuyiwen/pulse | src/cpp/cdm/utils/FileUtils.cpp | #include "cdm/CommonDefs.h"
#include "cdm/utils/FileUtils.h"
#include <iterator>
#include <chrono>
#include <thread>
// We haven't checked which filesystem to include yet
#ifndef INCLUDE_STD_FILESYSTEM_EXPERIMENTAL
// Check for feature test macro for <filesystem>
# if defined(__cpp_lib_filesystem)
# define... | TOOL | 0.962632 | 6.669029 |
6a144d68-3d9a-4a3f-8893-6479e8cb6335 | Nakib-Arman/CSE318---ArtificialIntelligence | 4.DecisionTree/.history/decision_tree_20250705193734.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
string label;
unordered_map<string,Node*> children;
Node* parent;
public:
Node(string label){
this->label = label;
this->parent = NULL;
}
string getLabel(){
return label;
}
void setParent(Node* parent){... | ALGO | 0.996141 | 5.395937 |
c5cb2a5b-9222-4632-88e5-80d38e7374fc | qazwsxedcrfv12/CPP | Google-KickStart-RoundC-2021/Problem.cpp |
Problem
Astronauts have landed on a new planet, Kickstartos. They have discovered a machine on the planet: a generator that creates gold bars. The generator works as follows. On the first day, an astronaut inputs a positive integer K into the generator. The generator will produce K gold bars that day. The next day, it... | ALGO | 0.996759 | 4.355482 |
6d76f34c-49c5-41ae-ba7a-4324b1cf67ee | solaimanhosen/Compettive-Programming | LightOJ/LTOJ1080usingSegmentTree-Variant2(LP).cpp | using namespace std;
#include <bits/stdc++.h>
#define sf scanf
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define pf printf
#define pb push_back
#define N 100005
#define PI 3.40954185
#define F first
... | ALGO | 0.999767 | 4.028195 |
2d610477-7eea-4e71-b961-d59c7928ba83 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6709_34.cpp | #include <bits/stdc++.h>
using namespace std;
const int MX = 1500 + 5;
const int INF = 0x3f3f3f3f;
const double exps = 1e-10;
const double pi = acos(-1.0);
int T, X, Y, n;
double fx[MX], fy[MX], best[MX], tmp[MX];
double PX[MX], PY[MX];
double Rand(double L, double R) {
return (rand() % (1000)) / 1000.0 * (R - L) + L... | ALGO | 0.999943 | 3.588395 |
c833b54d-b439-493a-9df6-28e9e0d6483d | AlligatorTHPhat/Code_Practice | UpCoder/Basic Programming/If-Else/MAX3SO.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
int max = a;
if (b > a) max = b;
if (c > b) max = c;
int min = a;
if (b < a) min = b;
if (c < b) min = c;
cout << max << " " << min;
return 0;
}
| ALGO | 0.99974 | 3.499027 |
a47c8df3-5131-418a-9069-6aca62311b03 | dag625/AdventOfCode | 2015/day4.cpp | //
// Created by Daniel Garcia on 4/27/21.
//
#include "registration.h"
#include <doctest/doctest.h>
#include <openssl/evp.h>
#include <string>
#include <vector>
#include <cstdint>
#include <string_view>
#include <array>
#include <thread>
#include <atomic>
#include <algorithm>
namespace {
using namespace aoc;
... | ALGO | 0.933114 | 6.214631 |
9c2c7b0d-8af6-4aaf-ba25-5db103ebd09d | ZelboK/OpenToonz | toonz/sources/toonzlib/autoadjust.cpp |
/*
guardare DAFARE
write_lut_image ??? quando ?
*/
#include "autoadjust.h"
#include "cleanupcommon.h"
#define TO_ABS(x) \
{ \
if ((x) < 0) (x) = -(x); ... | ALGO | 0.990645 | 4.349401 |
20961a5b-e0a2-4788-87c1-6a1378a0f78e | KyngstonGaddy/SimpleCalculator | SumAverage.cpp | // Finds the sum and average then prints it
// Created by Kyngston Gaddy
// 1.21.2025
// import statements
#include "SumAverage.h"
#include <iostream>
#include <string>
#include <vector>
// gets userInput for the five numbers
std::vector<std::string> SumAverage::getNums() {
std::vector<std::string> nums = {};
... | TOOL | 0.940047 | 4.181533 |
20e390e5-581f-4a08-81a9-0f2e65d3511b | arhsimluhar/Algopedia | Algorithms/Number Theory/Prime Numbers/Prime Numbers.cpp | // Author: Rahul Mishra
// Email: <EMAIL>
#include<bits/stdc++.h>
using namespace std;
//*****************************************************************************************************
//Prime Number algorithms
//method 1
/*compelexity o(N)
*/
void checkprime(lld N){
lld count = 0;
for( lld i = 1;i <= ... | ALGO | 0.999525 | 4.570535 |
5d0f09ae-7fdb-471c-a122-dd3cdb62cd14 | peterzheng98/gpu-memory | src/base/pytorch/third_party/flash-attention/csrc/composable_kernel/example/28_grouped_gemm_bias_e_permute/grouped_gemm_bias_e_permute_xdl_fp16.cpp | #include <iostream>
#include <numeric>
#include <initializer_list>
#include <cstdlib>
#include "ck/ck.hpp"
#include "ck/tensor_operation/gpu/device/tensor_specialization.hpp"
#include "ck/tensor_operation/gpu/device/gemm_specialization.hpp"
#include "ck/tensor_operation/gpu/device/impl/device_grouped_contraction_multi... | ALGO | 0.921745 | 6.171197 |
86f8ce61-a153-4d48-bfe4-0883e4a4bcdb | Duck800/HighLevelProgrammingLanguageDesign | homework/7b2 肯德基点餐/7-b2.cpp | /*2151133 ﺫ 07*/
#include<iostream>
#include<iomanip>
#include <conio.h>
#include"cmd_console_tools.h"
using namespace std;
const int N = 4;
const int M = 6666;
const struct KFC {
char choice;
const char name[65535];
double price;
};
const struct SPECIAL {
const char choice[65535];
const char combine[65535];
do... | TOOL | 0.960248 | 3.041709 |
83562ecc-1af6-4245-9851-edccc5403d4d | shu8Cream/atcoder-archive | atcoder.jp/abc187/abc187_c/Main.cpp | /**
* author: shu8Cream
* created: 02.01.2021 20:42:51
**/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
int main() {
int n;
ci... | ALGO | 0.999688 | 4.536171 |
8db0407c-9db3-49b4-9829-485fa5ad32fc | ishandutta2007/codeforces | nuip/normal/1279/D.cpp | #include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<cstring>... | ALGO | 0.999985 | 3.456094 |
c9970936-5fc1-421b-8311-7e46740e1785 | ishandutta2007/codeforces | bigbag/normal/768/F.cpp | #include <map>
#include <set>
#include <stack>
#include <cmath>
#include <queue>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
const int max_n = 201111, mod = 1000000007;
int power(int a, int b, int mod) {
... | ALGO | 0.999981 | 4.268107 |
a8717230-3581-4bca-9c3a-c6b8e7de8faa | firstfan119/first_fan-s-code-on-luogu | LuoGu1792.cpp | #include <bits/stdc++.h>
#define ri register int
using namespace std;
int read()
{
int num=0;
int flg=1;
char c=getchar();
while(!isdigit(c))
{
if(c=='-')
{
flg=-1;
}
c=getchar();
}
while(isdigit(c))
{
num=(num<<1)+(num<<3)+(c^48);
c=getchar();
}
return num*flg;
}
struct node
{
int val;
int p... | ALGO | 0.999986 | 3.725164 |
90cbf3ed-66c1-4904-9a15-e8499eeb41a8 | longjianjiang/LeetOJ | cpp/590_n-ary_tree_postorder_traversal.cpp | #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
using namespace std;
/*
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> children;
Node() {}
Node(int _val, ve... | ALGO | 0.999832 | 5.994669 |
400fced7-cdf6-4c69-a65e-4c48c8d59ceb | kriti-raj/CodeChef-Contests-CPP | START21C/Devendra_and_Water_Sports.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t-- > 0)
{
int z, y, a, b, c;
cin >> z >> y >> a >> b >> c;
if ((z - y >= a + b + c))
{
cout << "YES" << endl;
}
else
{
cout << "NO" << endl... | ALGO | 0.997874 | 3.420784 |
5c7c3336-34c9-44d4-8603-a4b986bf6779 | Mallhw/CompetitiveProgramming | USACO/Silver/BuildingTeams.cpp | #include <iostream>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include <algorithm>
#include <cmath>
#include <streambuf>
#include <sstream>
#include <unordered_set>
using namespace std;
typedef long long ll;
#define endll '\n'
vector<int> adj[];
bool visited[];
void dfs(int s, ) ... | ALGO | 0.999388 | 4.229419 |
3e867996-76f6-4415-99e4-262610b5f268 | TheIncredibleVee/CP-compilation | Practice/Atoj < 1300 (Extras)/B_Lucky_String.cpp | #pragma GCC optimize("O3") //https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html (0fast alternative, but more aggressive)
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp> //Policy based Data Structrues containter
#include<ext/pb_ds/tree_policy.hpp> //Ordered set
#define gcj "Case #" //For ... | ALGO | 0.997518 | 3.37298 |
ad4ab9c3-fc04-4be4-8336-398dde923ba1 | Ayushnwoc/LeetCode-Solved | Rat in a Maze Problem - I - GFG/rat-in-a-maze-problem-i.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution{
public:
void fp(vector<vector<int>>&vis , int n , vector<vector<int>>&m,int x ,
int y,int px , int py,string a){
// cout<<x<<y<<... | ALGO | 0.999855 | 6.45495 |
65b6e192-c068-43d5-b465-394ba161c7ae | allnil/competitive-programming | leetcode/852/852-a.cpp | class Solution {
public:
int peakIndexInMountainArray(vector<int>& arr) {
int start = 0, end = arr.size() - 1;
while (start < end) {
int m = start + (end - start) / 2;
if (arr[m] < arr[m + 1]) {
start = m + 1;
} else {
end = m;
... | ALGO | 0.999925 | 5.89389 |
d7ca3118-ecb4-466a-b390-f3fecfbf91a4 | VDrift/trackeditor | src/objects.cpp | #include "objects.h"
#include <algorithm>
OBJECTS::OBJECTS()
{
error_log.open((settings.GetSettingsDir() + "/logs/objects.log").c_str());
object_list = NULL;
model_list = NULL;
loadjpk = false;
}
OBJECTS::~OBJECTS()
{
error_log.close();
//deallocate objects and models
DeleteAll();
}
void OBJECTS::DeleteA... | TOOL | 0.86196 | 4.089536 |
31a3616f-fc42-474a-9755-b82349ac3eef | pratyush2331/DSA_Love-Babbar | XX. AAA_Platform/LeetCode/2_LeetCode Contest/Weekly Contest/Weekly Contest 358/Q2_2816_doubleANumberRepresentedAsALinkedList.cpp | // 2816. Double a Number Represented as a Linked List
// LeetCode : https://leetcode.com/problems/double-a-number-represented-as-a-linked-list/
#include<iostream>
using namespace std;
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next... | ALGO | 0.999875 | 6.000375 |
15c0bd91-3a64-4767-bb81-46a36e6e577d | KMJ192/CodeStorage | cpp/code/leetCode/linked_list/MergeTwoSortedLists.cpp | #include <iostream>
#include <map>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution {
map<int, int> s;
void recursion(ListNode* node)... | ALGO | 0.999955 | 5.635367 |
e20a955e-380a-4fc0-9781-cd6d664b72c7 | ssk4988/Coding | CodeForces/codetonround6/d.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<ld, ld>;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<ld>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;
using vv... | ALGO | 0.999843 | 3.330245 |
0c1d56d8-bba8-4b50-af92-737293502ffa | simacektomas/hackerrank | problem_solving/algorithms/implementation/Number_Line_Jumps/solution_o_1.cpp | string kangaroo(int x1, int v1, int x2, int v2) {
// O(1) SOLUTION (y*v1 + x1 == y*v2 + x2)
return (v2 < v1 && (x2-x1)%(v1-v2) == 0) ? "YES": "NO";
}
| ALGO | 0.999907 | 3.776931 |
f62ce31a-0703-4b28-85c0-db78827e464b | SamIam9640/codetree-TILs | 240319/여러가지 진수변환/various-numeral-system-transformations.cpp | #include <bits/stdc++.h>
#define MAX_DIGIT 20
using namespace std;
int n,b;
int digits[MAX_DIGIT];
int cnt;
int main(){
cin>>n>>b;
while(true){
if(n<b){
digits[cnt++]=n;
break;
}
digits[cnt++]=n%b;
n/=b;
}
for(int i=cnt-1;i>=0;i--){
cout<<digits[i];
}
... | ALGO | 0.99981 | 3.489585 |
5aae2c32-3c6d-4542-a14c-e8f28415d0f9 | Sousxs/notes | insert_sort.cpp | #include <bits/stdc++.h>
using namespace std;
void insert_sort(int a[], int n) {
for (int j = 1; j < n; j++) {
int x = a[j];
int i = j - 1;
while (i >= 0 && a[i] > x) {
a[i + 1] = a[i];
i--;
}
a[i + 1] = x;
}
}
int main() {
int n;
cin >> ... | ALGO | 0.999975 | 5.107848 |
4843a241-38f1-491b-9f4f-8856a0dccca0 | ahn1073/todo_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.998733 | 6.76775 |
876838fd-ff27-461d-87e7-093a6c9c9efe | phuong-dinhmai/Cpp | chd3/I.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n,a[100][100],m,p;
int main() {
while (cin >> n) {
for (ll i=0; i<n; i++)
for (ll j=0; j<n; j++) cin >> a[i][j];
m=-1e18;
for (ll i=0; i<n; i++)
for (ll j=0; j<n; j++) {
if (i<n-3) { p=a[i][j]*a[i+1][j... | ALGO | 0.999926 | 3.463582 |
6594ae33-26da-4d12-9f36-7f1e8a7750b7 | pablolp99/ssoo-2c21-tp | src/HashMapConcurrente.cpp | #ifndef CHM_CPP
#define CHM_CPP
#include <thread>
// alternativamente #include <pthread.h>
#include <iostream>
#include <fstream>
#include "HashMapConcurrente.hpp"
HashMapConcurrente::HashMapConcurrente() {
for (unsigned int i = 0; i < HashMapConcurrente::cantLetras; i++) {
tabla[i] = new ListaAtomica<ha... | ALGO | 0.982745 | 4.947028 |
67cb0c55-c988-40f6-97f7-8808b57b81df | yu3mars/proconVSCodeGcc | atcoder/abc/abc097/b.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
int main()
{
int x,ans=1;
cin>>x;
for(int i = 2;... | ALGO | 0.999977 | 4.279301 |
8b0ef6c6-9a22-4fed-a313-63dc3f0f6727 | manojnsut/Leetcode | 74-search-a-2d-matrix/74-search-a-2d-matrix.cpp | class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int x) {
if (matrix.size() == 0 || matrix[0].size() == 0)
return false;
int R=matrix.size(),C=matrix[0].size();
if(x<matrix[0][0] || x>matrix[R-1][C-1])
return false;
int row=0,col=C-1;
while(row<R && col>=0)... | ALGO | 0.999969 | 6.016083 |
72a92f38-1b66-42ee-bf4e-05f843a00a31 | handsomejackhsnu/Codes | SR/20190411/1/02.cpp | #include <iostream>
using namespace std;
int main() {
char x;
string dna;
while(cin >> x >> dna) {
int n=0;
for(int i = 0; i < dna.length(); i++) {
if(dna[i] == x) {
n++;
}
}
cout << n << endl;
}
}
| ALGO | 0.999598 | 3.927813 |
672f2f0d-1db1-40ab-9527-9ecb76348be9 | darchr/parsec-benchmark | pkgs/libs/tbblib/src/examples/parallel_do/parallel_preorder/Graph.cpp | #include <cstdio>
#include <cstdlib>
#include "Graph.h"
using namespace std;
void Graph::create_random_dag( size_t number_of_nodes ) {
my_vertex_set.resize(number_of_nodes);
for( size_t k=0; k<number_of_nodes; ++k ) {
Cell& c = my_vertex_set[k];
int op = int((rand()>>8)%5u);
if( op>int... | ALGO | 0.997494 | 4.22172 |
cb4a5cf0-f3d2-4530-81d1-da7ef8838108 | YuzheZhou2000/leetcode_code | face2offer/Leetcode顺序/offer-15.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int hammingWeight(uint32_t n)
{
// 输入必须是长度为 32 的 二进制串
/*
已经给出说明输入必须是长度为 32 的 二进制串 。
因此使用位运算直接计算每一个位数上是不是1即可
需要注意的是在这里输入的就是二进制串
*/
int res = 0;
for (int i = 0; i < 32; i++)
... | ALGO | 0.992794 | 5.286275 |
ed16b402-0202-4a58-a221-05d3741efabf | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-gpt35/Codenet/p01322/719027002/response_6.cpp | #include <iostream>
using namespace std;
int main() {
int n, m, o[100];
string b[100];
string l;
int ans;
while (cin >> n >> m && n && m) {
ans = 0;
for (int i = 0; i < n; i++)
cin >> b[i] >> o[i];
for (int i = 0; i < m; i++) {
cin >> l;
for (int j = 0; j < n; j++) {
bool... | ALGO | 0.998177 | 3.480775 |
9aab87a0-c46f-4d9d-9c79-9e0db9de7fc0 | Ajitverma650/leetcodedsa | 222-count-complete-tree-nodes/count-complete-tree-nodes.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.999955 | 6.65362 |
c83d82dd-4df8-45d2-a6d9-9eac1a532034 | Ukeme-Edet/CodeForces | 1366b_shuffle.cpp | /**
* @file 1366b_shuffle.cpp
* @author Ukeme Edet (<EMAIL>)
* @brief The solution to the problem
* Shuffle(https://codeforces.com/problemset/problem/1366/B)
* @version 0.1
* @date 2025-01-06
*
* @copyright Copyright (c) 2025
*
*/
#include <bits/stdc++.h>
#define ll long long
using namespace std;
/**
* @... | ALGO | 0.999892 | 5.001643 |
b5679335-9287-46bd-b914-99115b7db590 | giovannidecrescenzo/LSN_De_Crescenzo | Exercise_10/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <math.h>
#include <vector>
#include <numeric>
#include "../Random/random.h"
#include "../Functions/functions.h"
#include "../Exercise_09/population.h"
#include "mpi.h"
using namespace std;
int main (int argc, char *argv[]){
//MPI
int size, rank;
... | ALGO | 0.999566 | 3.514363 |
ccbb0dc2-64db-4e42-b3bc-d107c876e6a7 | AST-TheCoder/Solved-Problems | Codeforces/Educational Codeforces Round 146 (Rated for Div. 2)/B.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long int
#define pb push_back
#define all(x) x.begin(),x.end()
#define Max 10000000000000000
template <typename T>
using ordered_set = tree<T, null_ty... | ALGO | 0.99992 | 4.36881 |
872cc3b9-206d-47ce-9fb1-c71786362f08 | ghufran2508/DATA-STRUCTURES-AND-ALGORITHM | BITF19M017-LAB- 02(Polynomial)/BITF19M017_LAB-02/Polynomial.cpp | #include<iostream>
#include"Polynomial.h"
#include<math.h>
using namespace std;
//**********************************
// TERM implementation...
//*********************************
term::term()
{
this->coef = 0;
this->exp = 0;
}
void term::set(int c, int e)
{
this->coef = c;
this->exp = (e >= 0) ? ... | ALGO | 0.973226 | 3.52327 |
e8862efc-0ea5-432e-9a4f-c5be6b1609ef | becastal/maratona | utl/Graph Theory/Depth First Search (DFS)/02. Subordinates.cpp | #include <bits/stdc++.h>
#define f first
#define s second
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define dbg(x) cout << #x << " = " << x << endl
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
using namespace std;
int main()
{
_;
int n; cin >>... | ALGO | 0.999855 | 4.527369 |
23872232-19ac-4be4-9b4e-2457430e07c6 | goastian/midori-desktop | js/src/wasm/WasmMemory.cpp | #include "wasm/WasmMemory.h"
#include "mozilla/MathAlgorithms.h"
#include "js/Conversions.h"
#include "js/ErrorReport.h"
#include "vm/ArrayBufferObject.h"
#include "wasm/WasmCodegenTypes.h"
#include "wasm/WasmProcess.h"
using mozilla::IsPowerOfTwo;
using namespace js;
using namespace js::wasm;
const char* wasm::To... | TOOL | 0.8947 | 7.661835 |
cb24eb2d-236a-4723-84db-7632cbe27a85 | c3-competitiveprogramming/cp-template-isadoravrx | acmicpc/Game_of_Matchings /Game_of_Matchings.cpp | #include <iostream>
#include <string>
#include <map>
#include <vector>
typedef long long ll;
using namespace std;
int main(){
string s;
cin >> s;
ll n;
cin >> n;
vector<ll>v(n);
for(ll i = 0; i < n; i++){
cin >> v[i];
}
ll cont = 0;
for(ll i = 0; i <= s.size()-n; i++){
... | ALGO | 0.999935 | 3.772127 |
c7f795ad-95ff-45fc-b049-c01c5cb61ae0 | GektorAdonis/quiz_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.998733 | 6.76775 |
2eb5af89-8a11-4d61-bca9-2c9681c824da | AnupamAwasthi2004/GeeksForGeeks_Questions | 11.cpp | class Solution{
public:
vector<int> duplicates(long long arr[], int n) {
// code here
vector<int> res;
for(int i=0;i<n;i++){
int r=arr[i]%n;
arr[r]=arr[r]+n;
}
for(int i=0;i<n;i++){
if((arr[i]/n)>1)
res.push_back(i);
}
if(res.size()==0) res.push_back(-1);
return r... | ALGO | 0.999642 | 4.845832 |
861118e4-f449-44c7-b979-e55ff174223c | jiang-qi-qian/sequoiasql-mysql | thirdparty/boost_1_59_0/libs/geometry/index/test/algorithms/segment_intersection.cpp | // Boost.Geometry Index
// Unit Test
#include <geometry_index_test_common.hpp>
#include <boost/geometry/index/detail/algorithms/segment_intersection.hpp>
//#include <boost/geometry/io/wkt/read.hpp>
template <typename Box, typename Point, typename RelativeDistance>
void test_segment_intersection(Box const& box, Poin... | TEST | 0.945104 | 7.526044 |
e25d83e6-7673-4f5b-920d-ebadf8832420 | ishandutta2007/codeforces | savinov/normal/603/A.cpp | #include <bits/stdc++.h>
#define clr(x) memset((x), 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define in(x) int (x); input((x));
#define x first
#define y second
typedef int itn;
#define next next12345
#define prev prev12345
#define left lefdsf232
#define right rig4... | ALGO | 0.999939 | 3.636245 |
3c5cd048-b00c-4b7c-a748-fa1d61527cd0 | raincross7/code-similarity | codes/train_code/problem147/problem147_455.cpp | #include <bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;
ll gcd(ll a,... | ALGO | 0.999656 | 4.207613 |
272be41c-5de1-480e-886d-fba26ea5ae43 | npnkhoi/Competitive-programming | BootCamps/2018QuangNam/Mr.Dong/Stock.cpp | #include <bits/stdc++.h>
using namespace std;
const int ooo=-1e9;
int f[35][110][110][110],q[35],p[35][110];
int res,t,n,s,days;
int main()
{
freopen("STOCK.inp","r",stdin);
//freopen("STOCK.out","w",stdout);
scanf("%d%d%d",&n,&s,&days);
//cout<<n<<s<<days<<endl;
for (int i=1;i<=n;i++) scanf("%d",&q... | ALGO | 0.999787 | 3.415332 |
f721077f-77ad-4611-9cbd-212b5d0b4858 | jperoneucsc/peerpressure | PeerPressure/Library/PackageCache/com.unity.ide.visualstudio@2.0.22/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.949301 | 6.933585 |
bcfb46bc-774c-44ad-adef-376d0d62146a | Vakhnovetsky/Algorithms | s4/Task_J_4-sum.cpp | #include <algorithm>
#include <iostream>
#include <tuple>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <vector>
struct hashFunction
{
size_t operator()(const std::tuple<int, int, int, int>& x) const
{
return std::get<0>(x) ^ std::get<1>(x) ^ std::get<2>(x) ^ std::get<3>(x);
}
};
int ... | ALGO | 0.999904 | 3.841741 |
9aedaefc-730a-4800-afc4-00e086f05994 | raincross7/code-similarity | codes/train_code/problem347/problem347_489.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int req[10]={0,2,5,5,4,5,6,3,7,6};
int n,m;cin>>n>>m;
int a[m];
for (int i=0;i<m;i++)
cin>>a[i];
sort(a,a+m,greater<int>());
int dp[n+1];
fill(dp,dp+n+1,-1);
dp[0]=0;
for (int i=0;i<m;i++)
... | ALGO | 0.999994 | 4.122914 |
aa4253ea-6c35-436f-bf42-2b7b4b806135 | lilinxiong/cppPrimerPlus-six- | Chapter 7/ruler.cpp | // ruler.cpp -- using recursion to subdivide a ruler
#include <iostream>
const int Len = 66;
const int Divs = 6;
void subdivide(char ar[], int low, int high, int level);
int main()
{
char ruler[Len];
int i;
for (i = 1; i < Len - 2; i++)
ruler[i] = ' ';
ruler[Len - 1] = '\0';
int max = Len - ... | ALGO | 0.993395 | 3.128033 |
8b58b546-ede8-4fd9-8708-cae2575595e1 | michelebucelli/nmpde-labs-aa-24-25 | lab-04/src/Poisson2D.cpp | #include "Poisson2D.hpp"
void
Poisson2D::setup()
{
std::cout << "===============================================" << std::endl;
// Create the mesh.
{
std::cout << "Initializing the mesh from " << mesh_file_name << std::endl;
// Read the mesh from file:
GridIn<dim> grid_in;
grid_in.attach_triang... | ALGO | 0.996792 | 6.530481 |
5f2ed2eb-e5fa-4531-a914-354d344d65a4 | menaehab/Codeforces-Solutions | 0 - 1000 problems/String Functions.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, q;
cin >> n >> q;
string s;
cin >> s;
while (q--) {
string x;
cin >> x;
if (x == "pop_back") {
s.pop_back();
}
else if (x == "front") {
cout << s.front() ... | ALGO | 0.999427 | 4.539235 |
36d61abc-225f-468e-a874-0d1cef5e000f | elennn13/DZ-20-Massiv-and-Function | DZ №20 Massiv and Function.cpp | #include <iostream>
#include <algorithm>
#include <cstdlib>
#include <ctime>
// заполнение массива случайными числами
template <typename T>
void fill_arr(T arr[], int size, T left, T right) {
srand(time(NULL));
for (int i = 0; i < size; i++)
arr[i] = rand() % (right - left) + left;// Генерация случайного числа от l... | ALGO | 0.999309 | 4.579485 |
7d38b5cf-ba4d-4ade-84b7-9e6780fc8f76 | rudrakaiser/CodeForces-Solutions | SOLVE/1113A - Sasha and His Trip.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n, v;
cin >> n >> v;
int current_litter = 0;
int required_litter = n-1;
int cost = 0;
for (int i=1; i<=n; i++) {
int litter_t... | ALGO | 0.999955 | 3.331452 |
606a828d-e7c1-462d-a256-9cda03ebd1fe | StanfordAHA/Halide-to-Hardware_archive | apps/hardware_benchmarks/apps/conv_layer_3D/conv_layer_3D_generator.cpp | /*
* An application for applying a Gaussian blur.
* It uses a 3x3 stencil with constant weights.
*/
#include "Halide.h"
namespace {
using namespace Halide;
using namespace Halide::ConciseCasts;
// Size of blur for gradients.
const int fx = 3;
const int fy = 3;
const int ic = 4;
const int ox = 16;
const int oy = ... | ALGO | 0.991965 | 7.471609 |
b644dd55-4331-436f-940c-105759ec2852 | SohagMollik/LeetCode | 0502-ipo/0502-ipo.cpp | class Solution {
public:
int findMaximizedCapital(int k, int w, vector<int>& profits, vector<int>& capital) {
int n = profits.size();
vector<pair<int,int>>project(n);
for(int i=0; i<n; ++i){
project[i] = {capital[i], profits[i]};
}
sort(... | ALGO | 0.999996 | 5.406226 |
7c1e056d-c84d-4f41-8d20-79f83a0ebd1d | JaspreetSingh2110/DataStructures | Algorithms/Trees/05_SymetricTree.cpp | /*
* Description:
* Program to check if tree is symmetric i.e. the one half is mirror of other half.
*
* Created on: 3/22/2025
* @author: Jaspreet Singh, <EMAIL>.
*/
#include <iostream>
#include <queue>
class BSTNode {
public:
int data;
BSTNode *left;
BSTNode *right;
BSTNode(int d)
{
data = d;
left =... | ALGO | 0.999954 | 6.602679 |
20aace47-9e11-4f56-9850-05db2f9a786c | InnogeeksOrganization/coderspree2 | IOT/Captain2234_Bhavishya_2125it1064_2/FunctionAndArrays/FindElementInAnArray.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int a[n],index=-1;
for(int i=0;i<n;i++){
cin>>a[i];
}
int d;
cin>>d;
for(int i=0;i<n;i++){
if(d==a[i]){
index=i;
break;
}
}
if(index==-1)
cout<<index<<endl;
else
cout<<index<<endl;
} | ALGO | 0.999178 | 3.750604 |
29fb05b7-4adc-43c6-9bd8-66e519fed152 | manishtomar-cpi/DSA-CP | dynamic-programming/applications/minimumStepsTo1.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int _Minimum_Steps_To_1_(int n)
{
if (n <= 0)
{
return -1;
}
int steps = 0;
while (n != 1)
{
if (n % 3 == 0)
{
n /= 3;
}
else if (n % 2 == 0)
... | ALGO | 0.999983 | 5.630169 |
e655cf23-3fc7-4c68-92ce-88f0cb2efb88 | aryan-0069/CPP_basics | c++/Stack_/balanced_bracket_sequence.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
stack<char> st;
string s;
cin>>s;
int n = s.size();
int i=0;
bool flag = true;
while(n--){
if(st.empty() && (s[i]=='}' || s[i]==')' || s[i]==']')){
flag = false;
break;
}
else if(!st.emp... | ALGO | 0.999878 | 4.45584 |
237ce521-51d4-4230-a34b-93fd9c50ab33 | souravdev33/Codeforces | beautiful_matrix.cpp | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
int m[5][5];
for(int i=0;i<5;i++) {
for (int j=0;j<5;j++) {
cin>>m[i][j];
}
}
int row,col;
for(int i=0;i<5;i++) {
for(int j=0; j<5;j++) {
if(m[i][j]==1) {
row=i;
... | ALGO | 0.999911 | 3.865002 |
b7e63057-e6d3-4325-9a3c-bd776cf0df30 | cicuvc/LLVM-LA32R | llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp | #include "llvm/Transforms/Scalar/InductiveRangeCheckElimination.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/PriorityWorklist.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/Blo... | TOOL | 0.856777 | 7.888545 |
11f7a091-f36a-4095-ab81-bd999f9e444d | krishna9809/DSA-with-cpp | Day081/quickSort/1st.cpp | #include<iostream>
using namespace std;
int Part_Index(int *arr,int low,int high){
int pivot = arr[low];
int i = low;
int j = high;
while(i<j){
while(arr[i] <= pivot && i<=high-1){
i++;
}
while(arr[j] > pivot && j>=low+1){
j--;
}
if(i<j){
swap(arr[i],arr[j]);
}
}
swap(arr[low],arr[j]);
... | ALGO | 0.999954 | 4.943503 |
41746f8c-f9f2-4719-8767-a122e9fea164 | h2waiyan/chatty | 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.9988 | 6.76073 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.