uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
92ceb520-6c70-41a0-9f18-b19ec8ee20ab | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_12301_7.cpp | #include <bits/stdc++.h>
using namespace std;
signed main() {
string s;
cin >> s;
long long n = s.size();
long long an = 0;
for (long long i = 0; i < n; i++) {
long long r = INT_MAX;
for (long long j = i; j <= min((long long)9, n - 1); j++) {
for (long long k = 1; k <= 3; k++) {
if (j + ... | ALGO | 0.999793 | 4.260198 |
05b6e0e2-8ae6-4da1-85f4-0ce1d90d3d2b | Xelerezex/learning-space | stepik-courses/stepik-introduction-to-programming-c++/1.7.for-loop-and-arrays/step-05/task_3.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, sum_of_positives = 0; //кол-во элементов в массиве
cin >> n;
vector<int> arr(n);
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
for (int i = 0; i < arr.size(); i++) {
if (arr[i] > 0) {
su... | ALGO | 0.999961 | 4.473238 |
7f6c42b4-ccaa-49f5-a079-6a7bc011a45e | pradeeptosarkar/LeetCode | LeetCode/problems/subsets/solution.cpp | class Solution {
vector<vector<int>> result;
void solution(int idx, vector<int> &nums, vector<int> &temp)
{
if(idx == nums.size())
{
result.push_back(temp);
return;
}
temp.push_back(nums[idx]);
solution(idx+1,nums,temp);
temp.pop_back()... | ALGO | 0.999951 | 6.257579 |
518e8257-6b9e-4ecf-ba9c-807c20bb115d | Hank-Liao-Yu-Chih/C-_primer_document | ch3/p3_17.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main()
{
vector<char> cvector = {'a', 'b', 'c', 'd', 'e', 'f'};
cout << "orginal Char Vector" << endl;
for (auto i : cvector)
cout << i << " ";
cout << endl;
cout << "Modify Char Vector...." << endl;
for (auto &i : cvector)
... | TOOL | 0.967479 | 3.650344 |
a2e17dbd-b4ab-4101-ae83-b5dc4e672724 | lqjack/venus-accademy | rts/Sim/Misc/SmoothHeightMesh.cpp | #include <vector>
#include <cassert>
#include <limits>
#include "SmoothHeightMesh.h"
#include "Map/Ground.h"
#include "Map/ReadMap.h"
#include "System/float3.h"
#include "System/myMath.h"
#include "System/OpenMP_cond.h"
#include "System/TimeProfiler.h"
SmoothHeightMesh* smoothGround = NULL;
static float Interpolate... | ALGO | 0.983574 | 6.519402 |
25205ad2-3a39-4359-afc2-ba49514b4cc0 | nigels-com/nnr | pes.cpp | // parameters: n
//
// n is the size of the alphabet
#include <vector>
#include <string>
#include <iostream>
#include <cstring>
#include <cassert>
#include <cstdint>
#include <CLI11.hpp>
using namespace std;
// Input sequence as alpha string
std::vector<uint8_t>
fromString(const char *str)
{
if (!str)
... | ALGO | 0.99345 | 7.113209 |
96e69f4e-ae87-44d0-b27d-8500e17e6b8d | HKUST-Aerial-Robotics/RIO | rio/src/residual/IMUResidual.cpp | #include "IMUResidual.hpp"
#include <iostream>
#include <utility>
#include "MathUtility.hpp"
// #include <Eigen/src/Geometry/Quaternion.h>
// #include <Eigen/src/Core/Matrix.h>
namespace Residuals {
IMUResidual::IMUResidual(Preintegration imuPreintegration,
const Eigen::Vector3d &gravity)
... | ALGO | 0.989346 | 6.614296 |
641e92a1-0d5b-47ce-b8a8-097487ea6835 | kasa021/atcoder-archives | abc281/abc281_b_37160232_RE.cpp | /*
* Author: kAsA02
* Submission URL: https://atcoder.jp/contests/abc281/submissions/37160232
* Submitted at: 2022-12-10 12:29:28
* Problem URL: https://atcoder.jp/contests/abc281/tasks/abc281_b
* Result: RE
* Execution Time: 104 ms
*/
#include <bits/stdc++.h>
#include <cmath>
#if __has_include(<atcoder/all>)
... | ALGO | 0.99991 | 5.578876 |
ae2a6261-95b5-44f1-aa9d-1135e5ed8b4f | Dup4/competitive-programming | codeforces/contest/1282/c/c.cpp | #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define fi first
#define se second
#define endl "\n"
using namespace std;
using db = double;
using ll = long long;
using ull = unsigned long long... | ALGO | 0.999726 | 4.539219 |
4e245d58-3ca4-45e3-8eec-10a2d13a2b67 | Yangsx-1/leetcode-c | 0-500/0070.cpp | class Solution {
public:
int climbStairs(int n) {
int a = 1 ,b = 1, c = 1;
for(int i = 0; i < n - 1; ++i){
c = a + b;
a = b;
b = c;
}
return c;
}
};
// finished in 2024.1.22, first use dynamic programming
class Solution {
public:
int climb... | ALGO | 0.999974 | 6.568357 |
2db2508f-9c83-432a-a325-325c3c1116ba | HeYuHan/Common_Game_Server | 3rd/RakNet/DependentExtensions/cat/src/math/rtl/mul/Multiply.cpp | #include <cat/math/BigRTL.hpp>
using namespace cat;
#include "CombaMul.cpp"
// Unrolled schoolbook method with special attention to carries
// This 4x4 multiply is (slightly) faster than using Comba method
// An 8x8 Comba multiply is significantly faster than this method
CAT_INLINE void CAT_FASTCALL SchoolbookMultipl... | ALGO | 0.999701 | 5.553619 |
3d208b0e-d2b2-41a5-8031-27c7a6952cfa | LeePenn/CP-congrumen- | Chapter-5/Segment-Tree/POJ3321.cpp | #include <stdio.h>
#include <iostream>
#include <stack>
#include <complex>
#include <vector>
#include <cstring>
#include <map>
#include <algorithm>
// #include <queue>
// #define mytest
using namespace std;
typedef long long LL;
const int N = 100000 + 5;
struct Edge {
int v, nxt;
}edge[N << 1];
int hd[N], tot;
in... | ALGO | 0.999529 | 4.343296 |
cde6ba3a-f57b-40f6-85dc-7736dc6f4b4b | TUDSSL/intermittent-risc-v | llvm/llvm-9.0.1/llvm/lib/Transforms/Scalar/Sink.cpp | #include "llvm/Transforms/Scalar/Sink.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IntrinsicInst.h"
#incl... | ALGO | 0.994914 | 7.964056 |
07bb0441-e53f-437d-ae43-83a13cf09cb2 | spexcher/Codechef_solutions | Peaceful_Party.cpp | /*
* 888
* 888
* 888
* .d8888b 88888b. .d88b. 888 888 .d8888b 88888b. .d88b. 888d888
* 88K 888 "88b d8P Y8b `Y8bd8P' d88P" 888 "88b d8P Y8b 888P"
... | ALGO | 0.999555 | 5.721856 |
697856ec-615c-4db5-a2da-0ab097ff384d | balabit-deps/mysql | storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp | #define DBTUP_C
#define DBTUP_SCAN_CPP
#include "Dbtup.hpp"
#include <signaldata/AccScan.hpp>
#include <signaldata/NextScan.hpp>
#include <signaldata/AccLock.hpp>
#include <md5_hash.hpp>
#undef jam
#undef jamEntry
#define jam() { jamLine(32000 + __LINE__); }
#define jamEntry() { jamEntryLine(32000 + __LINE__); }
#ifd... | ALGO | 0.898964 | 4.852634 |
75fb1b40-812d-4f6c-b938-71570f5f708b | Kiyopon176/text_recognizer_flutter | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998764 | 6.762122 |
537b9aee-73be-4e40-8f9b-445c879f6c05 | AlexGiovanni/hwAC3 | hwAC3/autocompleter.cpp | //Alexis Santiago 10/13/18 20241845
#include "autocompleter.h"
#include <iostream>
#include <vector>
#include <string>
using namespace std;
// Creates a new Autocompleter with an empty dictionary.
//
// Must run in O(1) time.
Autocompleter::Autocompleter() {
root = new Node();
}
// Adds a string x to the dictio... | ALGO | 0.975738 | 4.333707 |
81bf91c5-f310-4a0e-a9d3-403cc35be04a | feixh/VISMA | thirdparty/libigl/include/igl/per_corner_normals.cpp | #include "vertex_triangle_adjacency.h"
#include "per_face_normals.h"
#include "PI.h"
template <typename DerivedV, typename DerivedF, typename DerivedCN>
IGL_INLINE void igl::per_corner_normals(
const Eigen::MatrixBase<DerivedV>& V,
const Eigen::MatrixBase<DerivedF>& F,
const double corner_threshold,
Eigen::Pla... | ALGO | 0.999311 | 6.380252 |
de1126c2-95a0-4d34-a95f-10568a99fc01 | y3shiy/test | inoutlib/read.cpp | #include <iostream>
#include <vector>
void read(std::vector<int>& numbers, std::size_t numbersCount)
{
for (std::size_t i = 0; i < numbersCount; i++)
{
int number;
std::cin >> number;
numbers.emplace_back(number);
}
} | TOOL | 0.967933 | 4.315214 |
f5156d5a-9a83-4165-b267-12d0623e3605 | turneja123/competitive-programming-library | Problem/Other/Ada and Fimbers.cpp | //https://www.spoj.com/problems/ADAFIMBR/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define endl "\n"
#define IOS ios_base::sync_with_stdio(false); cin.tie(nullptr);
using ll = long long;
const int N = 3e6 + 5;
const int F = 33;
int dp[N];
in... | ALGO | 0.999982 | 5.847583 |
6b68d230-c42f-4b22-b56c-a336b716fbdf | damymeister/ZPOCPP | LAB9-Z1/main.cpp | #include <fstream>
#include <string>
#include <iostream>
using namespace std;
void openFile (ifstream &plik, string n) {
plik.open(n);
if (!plik)
{
throw runtime_error("Could not open file!");
}
}
int CommentIndex (string line) {
for (int i = 1; i < line.length(); i++) {
if (line.at(... | TOOL | 0.939443 | 4.206396 |
960a9dc9-8b67-40b5-a23e-c3fb6ffae531 | mmz-zmm/LeetCode | 0094-Binary-Tree-Inorder-Traversal.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:
vector<int> inorderTraversal(TreeNode* root) {
vector<TreeNode*> s;
vector<int>... | ALGO | 0.999989 | 6.355512 |
2e609494-bbbd-4ed0-ba6a-0756a6427142 | DiasDogalakov/ADS_FALL_2020 | LAB 1/J.cpp | #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
using namespace std;
int main()
{
int a, b;
cin >> a >> b;
while(a > 0 && b > 0)
{
if(a > b)
a = a % b;
else
b = b % a;
}
if(a > 0)
cout << a... | ALGO | 0.999896 | 3.398477 |
a1c80e9c-072a-4464-858d-f720a79b7d5a | vallagenakisu/my-github | cph/contest phase 1.cpp | #include<bits/stdc++.h>
#define f(i,n) for(int i=0;i<n;i++)
using namespace std;
long long int xor_till_X(long long int x)
{
long long int sum=0;
while( x>=0 and x % 4!= 3)
{
sum = sum ^ x;
x--;
}
return sum;
}
void sol()
{
long long int a,b;
cin >> a >> b ;
long long int... | ALGO | 0.999989 | 3.899682 |
95fe83c1-5693-4025-ba24-5c7fae379049 | ApprenticeYu/Leetcode | C++_version/子集 II.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
class Solution
{
public:
vector<int> t;
vector<vector<int>> ans;
void dfs(bool choose, int cur, vector<int>& nums)
{
if (cur == nums.size())
{
ans.push_back(t);
return;
}
dfs(false, cur + 1, nums);
if (!choose && cur > 0 ... | ALGO | 0.99996 | 4.98722 |
664fa8f5-1930-4db8-a26f-f974ae0f0ff6 | giautoidi/giautoidi | src/crypto/cn/CnHash.cpp | #include <cstdio>
#include "backend/cpu/Cpu.h"
#include "crypto/cn/CnHash.h"
#include "crypto/common/VirtualMemory.h"
#if defined(XMRIG_ARM)
# include "crypto/cn/CryptoNight_arm.h"
#else
# include "crypto/cn/CryptoNight_x86.h"
#endif
#ifdef XMRIG_ALGO_ARGON2
# include "crypto/argon2/Hash.h"
#endif
#ifdef XMRI... | ALGO | 0.950812 | 6.121618 |
0019a659-3ef6-4efd-bbb1-a8d2505be721 | binodkumar23/IITJ_IDDEDA | RTOS_JOB_SCHEDULING_SIMULATOR/Files/sjfp.cpp | #include <bits/stdc++.h>
using namespace std;
int mODe;
void find_wait_time_sjfp(vector<int> &wait_time, vector<int> &cpu_burst, vector<int> &arrival_time, vector<int> &response_time)
{
int n = wait_time.size();
// int service_time[n];
vector<int> remaining_burst = cpu_burst;
int processes_executed = 0... | ALGO | 0.999926 | 3.559789 |
7231167f-5710-47be-a581-4d842c086947 | QuyDatSadBoy/CPP_PTIT | CPP0140.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define foru(i, a, b) for (ll i = a; i <= b; i++)
#define ford(i, b, a) for (ll i = b; i >= a; i--)
#define ms(a, n) memset(a, n, sizeof(a))
#define all(v) v.begin(), v.end()
vector<ll> v;
bool nt(ll n)
{
foru(i, 2, sqrt(n))
{
if (n % ... | ALGO | 0.99987 | 5.221071 |
0d13ec7a-8dc7-408d-9284-4a22fcc7577f | louhmmsb/IME | 3sem/desafios/aula10/d.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
int tabuleiro[27123];
int l, r, c, start;
queue<int> q;
void bfs(int ini, int end){
if(ini-r*c >= 0){
if(tabuleiro[ini-r*c] > tabuleiro[ini]+1 || tabuleiro[ini-r*c] == 0 && ini-r*c != start){
... | ALGO | 0.999908 | 3.614268 |
ebd9f701-6cc3-44e7-81f5-5e393676fbd8 | fciasth/Algorithms_Fourth_Edition | Part01/union-find-Algorithms/quick-find/union-find.cpp |
#include <iostream>
#include "union-find.h"
using std::cin;
using std::cout;
using std::endl;
int main()
{
cout << "봥" << endl;
int N;
cin >> N;
UF uf = new UF(N);
cout << "Ҫ" << endl;
for (int i = 0; i < N; i++)
{
int p, q;
cin >> p;
cin >> q;
if (uf.connected(p,q)) continue;
uf.union_(p, q);
cout... | ALGO | 0.998658 | 3.942976 |
4142155c-22a2-4ec9-b485-1d0063b99719 | Haihomhinh/Week02 | ex2.cpp | #include<iostream>
using namespace std;
int linearSeachSentinel(int a[], int n, int key);
int main() {
int n, key;
cin >> n >> key;
int a[100];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
cout << linearSeachSentinel(a, n, key) << endl;
system("pause");
return 0;
}
int linearSeachSentinel(int a[], int n, in... | ALGO | 0.999967 | 4.955538 |
3b641a9c-bb84-4261-bbb7-530983233021 | Abhishekkumar021/GeeksForGeeks | 21_05_2022_POTD.cpp | #include <bits/stdc++.h>
using namespace std;
int binary(vector<int> v, int l, int h, vector<int> arr)
{
int mid, a = -1;
while (l <= h)
{
mid = (l + h) / 2;
if (v[mid] < arr[l-1])
{
a = mid;
l = mid + 1;
}
else
{
h = mid - ... | ALGO | 0.999996 | 4.091452 |
7badc1fc-528b-40f1-a503-57bc4111f6e5 | miggymayfield/Bootcamp | 1]. DSA/4]. Striver Series/30 Days of SDE Sheet/C++/2]. Day2/5]. Stock buy and sell.cpp | //Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
//Function to find the days of buying and selling stock for max profit.
vector<vector<int> > stockBuySell(vector<int> A, int n)
{
vector<vector... | ALGO | 0.999345 | 5.363923 |
74764b0a-6de4-4ef9-9f36-56ac34f8da8b | spcl/cppless-clang | libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14
// <numeric>
// Became constexpr in C++20
// template<class InputIterator, class OutputIterator, class T>
// OutputIterator inclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result, T init);
//
#include <numeric>
#inclu... | TEST | 0.962892 | 7.143979 |
408120ab-3b7b-4f01-8b02-e3e3888ce9a1 | RajaKunalPandit1/Leetcode_Questions | 839. Similar String Groups.cpp | Output Status :
Runtime
29 ms
Beats
81.59%
Memory
9.7 MB
Beats
100%
class Solution {
public:
int p[300], r[300], sum;
int numSimilarGroups(vector<string>& strs) {
int n = strs.size();
sum = n;
for (int i = 0; i < n; i++) p[i] = i, r[i] = 1;
for (int i = 0; i < n; i++) {
... | ALGO | 0.999969 | 5.944954 |
31a85a49-0690-406b-9647-8c2b2060442a | enuiii/Algorithms | sem_2/lab5.cpp | #include <iostream>
#include <vector>
#include <stack>
// Перечисление для направлений ребер
enum direction {
direction_NONE = 0,
direction_AB = 1,
direction_BOTH = 2,
};
// Структура вершины
struct Vertex {
int dest;
int weight;
direction Path;
};
// Шаблон класса
template <size_t Rows_Colm>... | ALGO | 0.99992 | 6.438316 |
b2742294-0201-424a-8f05-9dddd5fd76d7 | akshatchhabra/TransLRPL | CodeGen/data/transcoder_evaluation_gfg/cpp/CEILING_IN_A_SORTED_ARRAY_1.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
int f_gold ( int arr [ ], int low, int high, int x ) {
int mid;
if ( x <= arr [ low ] ) return low;
if ( x > arr [ high ] ) return - 1;
mid = ( low + hig... | ALGO | 0.999282 | 5.632227 |
cb8cda2f-7b30-45e1-a23e-06b6053cb29b | thaoc-demo/cpp_array | array-copy.cpp | #include<iostream>
using namespace std;
void copy_array(string original[], string copy[], int size){
for(int i=0; i<size; i++){
copy[i] = original[i];
}
}
int main(){
string original[4] = {
"apple", "orange", "pineapple", "banana"
};
string copy[4];
copy_array(original, copy, 4)... | ALGO | 0.987958 | 4.218019 |
dcd43ded-d076-47c3-9604-d2c83c7b9356 | Rakib1958/DSA | Graph/bfs.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
vector<int> bfs(vector<vector<int>> &adj)
{
int n=adj.size();
int i=0;
vector<int> res;
queue<int> q;
vector<bool> visited(n, false);
q.push(i);
visited[i]=true;
while (!q.empty())
{
int current=q.front... | ALGO | 0.999989 | 5.041237 |
8d7329c8-d855-40e3-92bd-95f0eb369ead | teahyen/souse | 15_26/15_26.cpp | #include <numeric>
#include <vector>
#include <iostream>
using namespace std;
void main( )
{
vector<int> v(10);
for (int i= 0; i < v.size(); i++)
v[i] = i + 1 ;
cout << accumulate(v.begin(), v.end(), 0) << endl;
cout << accumulate(v.begin(), v.end(), 100) << endl;
} | ALGO | 0.996678 | 3.915375 |
673ec6fc-a8aa-4f2b-82db-c45409c081d5 | haastregt/occlusion_tracking | occlusion_package/CGAL-5.5.2/examples/Set_movable_separability_2/is_pullout_direction_single_mold_trans_cast.cpp | #include <fstream>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Set_movable_separability_2/Single_mold_translational_casting/is_pullout_direction.h>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Vector_2 Vector_... | ALGO | 0.932072 | 6.382314 |
0857afda-adc7-4c90-b657-a11fa1a29b13 | Coach-Academy/Winter-1-2023 | Level 3 Class 1/Lecture/Week 06/Problem 02 Code 01.cpp | // Teleporters Path
// https://cses.fi/problemset/task/1693/
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, in_deg[N], out_deg[N];
bool visited[2 * N];
vector<pair<int, int>> g[N];
vector<int> ans;
// This works for both directed and undirected.
// This also works for both Euler circuit... | ALGO | 0.999985 | 4.545888 |
10f3596d-042d-47aa-a668-e1cea5ed67db | vickyklim/Algoritmos-1 | TP grupal/TPI/auxiliares.cpp | #include <algorithm>
#include "auxiliares.h"
#include <iostream>
#include <algorithm>
#include <fstream>
#include <iomanip>
using namespace std;
const double pi = 3.14;
double radioTierra = 6378;
double obtenerLatitud(gps posicion) {
return get<0>(posicion);
}
double obtenerLongitud(gps posicion) {
return g... | ALGO | 0.993729 | 3.686522 |
45515fc3-04b3-4182-852f-9b678e718b8c | astojilj/astoj_oolongengine | Renderer/Geometry/TriStrip.cpp | #include <stdlib.h>
#include <stdio.h>
//#include "Context.h"
#include "TriStrip.h"
#include "Macros.h"
/****************************************************************************
** Defines
****************************************************************************/
#define RND_TRIS_ORDER
/*********************... | ALGO | 0.999472 | 4.831182 |
09a6a3cd-8910-4dbd-b6be-248e0ae9b73a | Nafyaz/my-codes | QOJ/3870.cpp | #include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long LL;
typedef pair<LL, LL> pLL;
#define ff first
#define ss second
#define show(x) cout << #x << ": " << x << "; "
#define MOD 1000000007
#define MAXN 2000006
bool vis[45][725];
bool grid[45][725];
bool bfs()
{
int rad, ang;
... | ALGO | 0.999772 | 3.721901 |
2369608b-7520-4301-8894-a81fae3b6061 | Amit00986/coding | Searching and Sorting/Searching/linearSearch.cpp | // Linear Search
// T.C = 0(n);
#include<bits/stdc++.h>
using namespace std;
int linearSearch(int *arr, int n , int k) {
for(int i=0;i<n;i++ y g) {
if(arr[i] == k) {
return 1;
// break;
}
}
return 0;
}
int main()
{
int n;
cin >> n;
int arr[n];
for(in... | ALGO | 0.999971 | 5.101624 |
e6fc271e-39b8-4d20-b336-96b127c0ca4b | fiterV/Solutions | Team Olympiad.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> v[4];
int main()
{
int n,i,ans,t;
cin>>n;
for (i=0;i<n;i++)
{
cin>>t;
v[t].push_back(i+1);
}
ans=min(min(v[1].size(),v[2].size()),v[3].size());
cout<<ans<<endl;
for (i=0;i<ans;i++)
cout<<v[1][i]<<" "<<v[2][i]<<" "<<v[3][i]<<endl;
retu... | ALGO | 0.999935 | 3.025548 |
73447ca8-9832-4f1d-99a1-185209b84727 | SushiStar/LC | Tree/InorderSuccessorInBST.cpp | /*
* Given a binary search tree and a node in it, find the in-order
* successor of that node in the BST.
*
* The successor of a node p is the node with the smallest key
* greater than p.val.
*
* Date: 04/29/2020
* Author: Wei Du
*/
class Solution {
public:
TreeNode *inorderSuccessor(TreeNode *root, TreeNo... | ALGO | 0.999958 | 6.395609 |
05b24fc4-b1f6-4612-8270-f7789e57b030 | ishandutta2007/codeforces | tinkerking/normal/979/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int N;
char s[3][200010];
int cnt[128];
int len;
int score[3];
char name[3][20] = {"Kuro","Shiro","Katie"};
int main()
{
scanf("%d",&N);
for (int i=0;i<3;i++)scanf("%s",s[i]);
len = strlen(s[0]);
int maxscore = 0;
for (int i=0;i<3;i++)
{
m... | ALGO | 0.9998 | 3.734404 |
c3eb5d58-dd00-4e4e-b302-9721199451e1 | Akshay-136/DSA | stacks/post_fix.cpp | #include<iostream> //stack use lifo property
using namespace std;
#include <stack>
#include<math.h>
int postfixEvaluation(string s){
stack<int> st;
for(int i = 0 ; i<s.length();i++){
if(s[i]>='0' && s[i]<='9'){
st.push(s[i]-'0');
}
else{
int op2 =st.top();
... | ALGO | 0.999815 | 4.480644 |
88be5e6a-df0d-4527-9b38-71e7a7703201 | wincle626/HLS_Legup | legup-4.0/llvm-2.9_mips/lib/CompilerDriver/CompilationGraph.cpp | #include "llvm/CompilerDriver/BuiltinOptions.h"
#include "llvm/CompilerDriver/CompilationGraph.h"
#include "llvm/CompilerDriver/Error.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/DOTGraphTraits.h"
#include "llvm/Support/GraphWriter.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <c... | TOOL | 0.993208 | 7.633556 |
2e80f45e-e371-46a8-9b92-7b384ce6737b | ketankamble/Projects | Chapter 6/source_code/streamulus_fourth.cpp | ///////////////////////////
//
// g++ -I"./Streamulus-master/src" -ID:\PRASEED_PERSONAL\Packet_Publishing\REACTIVE_PROGRAMMING_BOOK\Book\boost_1_66_0\boost_1_66_0 streamulus_first.cpp
//
//
//
#include "streamulus.h"
#include <iostream>
using namespace std;
using namespace streamulus;
//------- Functors for doubl... | ALGO | 0.883157 | 7.562237 |
f8589c11-4326-4ab0-8ec0-f378939f9478 | Vii-shal/DSA | 05_Stack C++/03_imp_pr.cpp/imp_pr_09.cpp | // count number of brackets to be removed for balanced brackets .
#include<iostream>
#include<stack>
using namespace std;
int removeBrackets(string &s){ // time complexity = O(n)
stack<char> st;
int count = 0;
for (int i=0;i<s.size();i++) {
if (s[i]=='('){
... | ALGO | 0.998829 | 5.535805 |
d9f9aa83-188e-43bb-a8ce-627fa9f9c9bd | Abhitrambadia/Program-List-1 | Program -11 (Vowel Or Consonant).cpp | #include<iostream>
using namespace std;
void vowel(char);
int main()
{
char c;
cout<<"Enter Any Character To Check If It Is Vowel Or Consonant :: ";
cin>>c;
vowel(c);
return 0;
}
void vowel(char c)
{
if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u')
cout<<c<<" Is Vowel :)";
else if(c=='A' || c=='E' || c=='I' ... | ALGO | 0.984886 | 3.572452 |
a06c5a4a-78f6-48bd-a2c8-09f759bc0a87 | Willedward/Competitive-Programming | Codebreaker/swapsort.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, q;
cin>>n;
int arr[n+1];
int cnt = 0;
for(int i = 1; i<=n; i++)
{
cin>>arr[i];
if(arr[i] != i) cnt++;
}
cin>>q;
int counter = 0;
for(int i = 0; i < q; i++)
{
int a, b;
cin>>a>>b;
if(arr[a] == b) cnt--;
else if(arr[a] == a) cnt++;... | ALGO | 0.999958 | 3.752453 |
251d5091-eba2-433a-9a48-b74162e8430d | Andrew5c/Cplusplus-in-Linux-guide | code/essential/map_and_set.cpp | #include <map>
#include <string>
#include <iostream>
using namespace std;
int main() {
string words;
map<string, int> names;
names["andrew"] = 1;
cout << "please input a string :";
cin >> words;
// 下面使用三种方式查找words是否存在于names的map中
// 查询
int count2 = 0;
map<string, int>::iterator ... | ALGO | 0.975145 | 3.987041 |
33c16c23-0664-4aa8-9de9-4a4304078af3 | mtoquinn/CarND-Extended-Kalman-Filter-Project | src/tools.cpp | #include "tools.h"
#include <iostream>
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth)
{
VectorXd rmse(4);
rmse << 0,0,0... | ALGO | 0.986615 | 6.071848 |
80c5e273-eb9f-4d69-a604-6948d4152a05 | ishandutta2007/codeforces | purplecrayon/normal/1152/F2.cpp | /*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).be... | ALGO | 0.99992 | 3.335048 |
f1d9b2e5-fd37-4d1b-915c-407cd9e61d03 | jzzzzh/HiBench | dataset/Code/c++Selected/85.cpp | class Solution {
public:
vector<int> asteroidCollision(vector<int>& asteroids) {
vector<int> result;
for (const auto& x : asteroids) {
if (x > 0) {
result.emplace_back(x);
}
while (!empty(result) && 0 < result.back() && result.back() < -x) {
result.pop_back();
}
if (!empty(result) && 0 < result.back()) {
if (result.bac... | ALGO | 0.999951 | 5.821544 |
3baca2e9-ca06-484d-be9d-4997e84481be | Simi-Paxleal-J/CPP-Workshop | Chapter12/Exercise76/Exercise76.cpp | #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
class Track
{
public:
Track(float length, string name, int popularity) : m_trackLength(length),
m_trackName(name), m_popularityRating(popularity) {}
float getLength() const { return m_trackLength; }
string getName() const { ... | ALGO | 0.995667 | 4.965659 |
27515454-06a7-4dcf-bfad-9ec50e370d6b | bluesia0305/Coding_Problems | 프로그래머스/2/12945. 피보나치 수/피보나치 수.cpp | #include <string>
using namespace std;
int solution(int n)
{
if (n == 2)
return 1;
int answer, a = 1, b = 1;
for (int i = 3; i <= n; i++)
{
answer = (a + b) % 1234567;
a = b;
b = answer;
}
return answer;
} | ALGO | 0.999867 | 4.675606 |
45264595-d04e-4f0b-ba50-a10d06ee60d8 | mohit701473/cpp | DSA Questions/Topic - 3 Array/Prefix and Suffix Approch/Que1_maxConsecutiveOnes.cpp | // LeetCode -> https://leetcode.com/problems/max-consecutive-ones-iii/description/
// Approch -> 1: Brute Force Approch
/*
Algo -> step -> 1: Find All the subarrays which contains at moat k zeros
step -> 2: after finding subarrays from step 1 now check the length of the subaarays
*/
// T.C. = O(N^2)
//... | ALGO | 0.999951 | 6.344931 |
231d4004-a174-4514-850a-fbfffa9a6589 | SetsunaChyan/OI_source_code | CF1157B.cpp | #include <bits/stdc++.h>
using namespace std;
int n,f[10],flag=0;
char s[200005];
int main()
{
scanf("%d%s",&n,s);
for(int i=0;i<9;i++)
scanf("%d",&f[i+1]);
for(int i=0;i<n;i++)
{
if(s[i]<f[s[i]-'0']+'0'||flag&&s[i]==f[s[i]-'0']+'0')
{
s[i]=f[s[i]-'0']+'0';
... | ALGO | 0.999881 | 3.398476 |
d6220bc0-4ec7-4aa2-8271-cb2e145643fd | Li-Ming-Fan/AutoFNN | ApplicationFNN.cpp |
//
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
//
#include "FloatMat.h"
#include "FNN_Model.h"
//
//
void loadConfiguration();
//
int FlagLoadFromFile;
int FlagTraining;
int FlagFiles;
//
float LearningPortion;
int SeedLearning;
float Criteria; // 0.95, 0.85, 0
//
int ErrBalanc... | DATA | 0.985169 | 4.178629 |
7df1fac4-d20c-4a7d-a84b-c3f8396fddad | Jaadoooo/DSA | Lec 23 (2D Array)/Binary2.cpp | // You are given an m x n integer matrix matrix with the following two properties:
// Each row is sorted in non-decreasing order.
// The first integer of each row is greater than the last integer of the previous row.
// Given an integer target, return true if target is in matrix or false otherwise.
#include <iostream... | ALGO | 0.999923 | 6.330181 |
c0d61bc1-0784-424b-8dd9-f8c0836db703 | Justinshao33/competitive_programming | done/AtCoder/B_XOR_MOD.cpp | #pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,popcnt,sse4,abm")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define rep(X, a, b) for(int X = a; X < b; ++X)
#define pii pair<int, int>
#define... | ALGO | 0.999888 | 5.080058 |
58cd6569-8ef4-4681-99e9-ba94a938e36c | Rkhoiwal/Competitive-prog-Archive | hackerrank/c++/introduction/virtual_functions.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
class Person
{
public:
virtual void getdata() = 0;
virtual void putdata() = 0;
protected:
string name;
unsigned int age;
};
class Professor: public Person
{
public:
Professor():
... | ALGO | 0.969979 | 3.623294 |
1305777d-3358-40ec-ab41-8302ffc2cea4 | Erasto-M/riverPod-API-data | 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 |
7f8ef218-36e0-4c6e-9223-5398fd49d934 | KryukovSA/pp_2021_spring_engineers | modules/test_tasks/test_mpi/ops_mpi.cpp | std::vector<int> getRandomVector(int sz) {
std::random_device dev;
std::mt19937 gen(dev());
std::vector<int> vec(sz);
for (int i = 0; i < sz; i++) { vec[i] = gen() % 100; }
return vec;
}
int getSequentialOperations(std::vector<int> vec, const std::string& ops) {
const int sz = vec.size();
... | ALGO | 0.989756 | 6.056751 |
77fd2b01-a389-48e6-8082-a49e61b1d879 | aimotive-legacy/eigen-release | doc/examples/DenseBase_template_int_middleCols.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl;
return 0;
}
| ALGO | 0.974697 | 3.184086 |
f046de96-946b-4b6a-aee9-2ac335a25165 | SevenBruce/lAuth | lAuth/utils.cpp | #include "utils.h"
unsigned short randonIdentity() {
srand((unsigned)time(NULL));
return rand()% 65535;
}
int randonIntegerNumber() {
srand((int)time(NULL));
return rand() % (INT_MAX -1) + 1;
}
string __int82String(__int8 org) {
string str = "";
str += *((char*)&org);
//cout << endl;;
return str;
}
__int8 s... | TOOL | 0.890346 | 4.250968 |
a2eb1710-b591-4c1c-8ff4-ff900aa2df99 | manishsundriyal/Algorithms-DS-CP | Array Algorithm/PrefixSumAlgo.cpp | #include<bits/stdc++.h>
using namespace std;
void prefix(int arr[], int n, int prefixsum[]) // Insertion in Prefixsum array.
{
prefixsum[0] = arr[0];
for (int i = 1; i < n; i++)
prefixsum[i] = prefixsum[i-1] + arr[i]; // sum of the previous element with the current element.
}
int main()
{
int n;
... | ALGO | 0.999919 | 4.388882 |
096d4f69-a462-4c32-93c0-ec2b9ba0735d | gnahtcouq/cpp | Luyen Thuat Toan/LUYENCODE/VT11.cpp | #include <iostream>
using namespace std;
int main() {
int a[100000], n;
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 1; i < n - 1; i++)
for (int j = i + 1; j < n - 1; j++)
if (a[i] > a[j])
swap(a[i], a[j]);
for (int i = 0; i < n; i++)
cout << a[i] << " ";
return... | ALGO | 0.999929 | 3.364479 |
7ae2e123-e9af-4f4d-9b92-a6d5c23b45f5 | amaan8302/Leetcode | 0021-merge-two-sorted-lists/0021-merge-two-sorted-lists.cpp | class Solution {
public:
ListNode *findMid(ListNode *head)
{
if (head == NULL || head->next == NULL)
return head;
ListNode *slow = head;
ListNode *fast = head->next;
while (fast != NULL && fast->next != NULL)
{
slow = slow->next;
fast... | ALGO | 0.999971 | 5.67693 |
90707e43-b68c-4214-a37c-beb919fc303b | hansh0101/Algorithm_BaseCamp | c++_ps/baekjoon/10819.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n;
vector<int> v;
int result;
int main() {
cin.tie(NULL);
ios::sync_with_stdio(false);
cin >> n;
for (int i = 0; i < n; i++) {
int num;
cin >> num;
v.push_back(num);
}
sort(v.begin(),... | ALGO | 0.999986 | 4.760398 |
377bcc09-7159-4970-8454-682753cdbd31 | vanphi34/c_plusplus_hanam | btvn_c++/phí ngọc văn/buổi 1/bai3.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,n;
a=0;b=1;
cin>>n;
while(b<=n)
{
if(n%b==0)
a=a+b;
b++;
}
cout<<a;
return 0;
}
| ALGO | 0.999963 | 3.741264 |
727647e6-3131-4b49-bf1e-f0582c0b1afd | iyaacs/algospot | STRJOIN.cpp | #include<cstring>
#include<iostream>
#include<algorithm>
#include<sstream>
#include<string>
#include<vector>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<fstream>
#include<cassert>
#include<numeric>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<deque>
#define INF 1987654321
using na... | ALGO | 0.999967 | 3.734624 |
0579522a-532d-4df2-aea8-e52b249f4cfc | wesinalves/AED | codigos/07 - Arvore/ArvoreSet.cpp | #include <iostream>
#include <set>
using namespace std;
/* Na STL, a implementao do container set uma rvore binria de busca, sendo auto-balanceada de acordo com os critrios
de balanceamento das rvores rubro-negras
importante ressaltar que, em containers do tipo set, possvel e remover elementos, bem como encontrar ... | ALGO | 0.990134 | 4.57866 |
75eb25b2-2763-4a2e-9ffb-5c9327764827 | zpoint/Reading-Exercises-Notes | C++ Primer/16_Templates_And_Generic_Programming/16_36.cpp | #include <iostream>
template <typename T> void f1(T, T)
{
std::cout << "f1(T, T)" << std::endl;
}
template <typename T1, typename T2> void f2(T1, T2)
{
std::cout << "f2(T1, T2)" << std::endl;
}
int main()
{
int i = 0, j = 42, *p1 = &i, *p2 = &j;
const int *cp1 = &i, *cp2 = &j;
f1(p1, p2); // a
f2(p1, p2)... | TOOL | 0.905966 | 5.165878 |
28e5ccc7-3054-4883-8b89-b514fa5004e1 | Nnyohe/library | rolling_hash_on_lazy_segtree_I.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define reps(i, a, n) for (ll i = (a); i < (ll)(n); i++)
#define rep(i, n) for (ll i = (0); i < (ll)(n); i++)
template <typename T, typename E>
struct LazySegmentTree {
private:
int n{}, sz{}, height{};
vector<T> data;
vector<E> lazy;
T (*op... | ALGO | 0.999922 | 4.885775 |
3f7ed2cd-261c-4681-be6c-88227797233a | gauravbaghel09/love-babbar | Recursion/climbStairs.cpp | #include <iostream>
using namespace std;
int climb(int n)
{
if (n == 0 || n == 1)
{
return 1;
}
int ans = climb(n - 1) + climb(n - 2);
return ans;
}
int main()
{
int n;
cout << "enter a number : ";
cin >> n;
int ans = climb(n);
cout << "ans is : " << ans << endl;
ret... | ALGO | 0.999979 | 4.351596 |
f3e90a59-c5bd-4b7b-9015-b380597cfd56 | ishandutta2007/codeforces | scott_wu/normal/1091/A.cpp | #include <iostream>
#include <iomanip>
#include <algorithm>
#include <map>
#include <vector>
#include <string>
#include <set>
#include <cmath>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(NULL);
int x, y, z;
cin >> x >> y >> z;
y--;
z -= 2;
... | ALGO | 0.999827 | 4.01425 |
78db049c-ef70-4928-bbee-fc52acd63b01 | buithog/DSA_PTIT | hoanvixaukytu.cpp | #include <bits/stdc++.h>
using namespace std;
int n, A[20], B[20]={0},a[10001];
string s;
void in(){
for(int i=1;i<=n;i++){
cout<<s[A[i]-1];
}
cout<<" ";
}
void quaylui(int i){
int j;
for(j=1;j<=n;j++){
if(!B[j]){
A[i]=j; B[j]=1;
if(i==n) in();
else quaylui(i+1);
B[j]=0;
}
}
}
main(){
int t;
c... | ALGO | 0.999946 | 3.518174 |
0c38895b-b465-46e3-bd67-ed8bc70dacb3 | krzysiek6d/adventOfCode2021 | advent_04_p2/solution.cpp | #include "solution.hpp"
#include <vector>
#include <algorithm>
#include <iterator>
#include <sstream>
int solution(std::vector<BingoTable> v, const std::vector<int>& numbers)
{
std::vector<bool> winners(v.size(), false);
int lastWinner = -1;
int lastNum = 0;
for(const auto& num: numbers)
{
... | ALGO | 0.999769 | 6.361989 |
18e7a3f6-796b-4e20-841f-d253f8df7c89 | Deepak-png981/Data_Structures_And_Algorithms | 0048-rotate-image/0048-rotate-image.cpp | class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
reverse(matrix.begin() , matrix.end());
for(int i = 0; i<matrix.size() ; i++)
for(int j = i + 1; j<matrix[i].size() ; j++)
swap(matrix[i][j] , matrix[j][i]);
}
}; | ALGO | 0.999964 | 6.134588 |
c12c7ff2-7873-4116-a089-7be66362fe81 | manoj060603/Codes | Learning/segment_tree.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long L;
const char NL = '\n';
#define f(i,a,b) for(int i=a;i<b;i++)
#define fr(i,a,b) for(int i=a;i>=b;i--)
#define test int t; scanf("%d",&t); while(t--)
#define mod 1000000007
#define all(a) a.begin(),a.end()
class Segment_tree
{
private... | ALGO | 0.999921 | 3.479841 |
a03f2ca0-7762-481f-9f3f-d6d17cab9cf2 | CoolCold/sphinx | src/sphinxmetaphone.cpp | //
// $Id: sphinxmetaphone.cpp 2616 2011-01-01 02:33:06Z shodan $
//
#include "sphinx.h"
#include "sphinxint.h"
struct CurrentWord_t
{
BYTE * pWord;
int iLength;
int iLengthPadded;
};
static bool IsVowel ( BYTE c )
{
return c=='A' || c=='E' || c=='I' || c=='O' || c=='U' || c=='Y';
}
static bool SlavoGermanic ... | TOOL | 0.97574 | 4.601235 |
3e05bf48-16d4-44d6-a8a1-7608f858ea9f | AliEmili/codeforcesProblem | Mishka and Game/main.cpp | #include <iostream>
using namespace std;
int main() {
int n, m = 0,c = 0, x, y;
cin >> n;
while(n--){
cin >> x >> y;
if(x > y) {
m++;
}
else if(y > x){
c++;
}
}
if(m > c){
cout << "Mishka" << endl;
}
else if(c > m){
... | ALGO | 0.999877 | 3.741926 |
41292737-f921-4088-b362-9e9e01bca0db | jag1g13/cgtool | src/boltzmann_inverter.cpp | #include "boltzmann_inverter.h"
#include <iostream>
#include <cmath>
using std::cout;
using std::endl;
using std::vector;
BoltzmannInverter::BoltzmannInverter(const double temp, const int bins) :
temp_(temp), bins_(bins){
histogram_.init(bins_);
gaussian_.alloc(bins_);
harmonic_.alloc(... | ALGO | 0.990107 | 6.554076 |
bd404c65-6f75-4d06-987e-020dd31c3310 | Alaxe/noi2-ranking | 2019/solutions/E/RSI-Sofia/odd.cpp | #include<iostream>
using namespace std;
int main (){
long long a,b,i,n=1,brDeliteli=0,brChislaSNechetenBrDeliteli=0;
cin>>a>>b;
for(i=a;i<=b;i++){
while(n<=i){
if(i%n==0){
brDeliteli++;
}
n++;
}
if(brDeliteli%2==1){
brChislaSNechetenBrDeliteli++;
}
n=1;... | ALGO | 0.999813 | 3.754511 |
c099ce10-5bdb-42b5-b542-2bab91e63319 | pcw109550/problem-solving | LeetCode/binary-tree-zigzag-level-order-traversal.cpp | // 103. Binary Tree Zigzag Level Order Traversal
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <utility>
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), ... | ALGO | 0.999991 | 6.117277 |
680bd70c-1e74-414f-bcba-970c221da945 | ExtremeBY/KPO_3rd | LabRab#18 +/SE_Lab18/SE_Lab18/LA.cpp | #include"LA.h"
#include"stdafx.h"
#include"In.h"
#include"Error.h"
#include <stdio.h>
#include <string.h>
#include <iomanip>
namespace LA
{
LT::LexTable __LexTable = LT::Create(LT_MAXSIZE - 1); //Таблица для хранения лексем
IT::IdTable __IdTable = IT::Create(TI_MAXSIZE - 1); //Таблица для хранения идентифи... | TOOL | 0.916397 | 3.009369 |
1303db39-f687-4eba-94bb-04f5455276b4 | Lamiiine/Competitive-Programming-1 | Solutions/UVA/00925.cpp | #include<stdio.h>
#include<queue>
#include<set>
#include<string>
#include<vector>
#include<map>
#define MAX 125
using namespace std;
int n, r;
set<int> p[MAX];
void clean(){
for (int i = 0; i < n; ++i) // for all classes i
for (auto j : p[i]){ // for all prerequisites j of i
queue<int>q;
for (auto k : p[j])
q... | ALGO | 0.999686 | 3.725371 |
ff5f294f-3de2-42dc-a23f-355a44d0df24 | Gilyermo/RailEngine | Kernel/Math/Math.cpp | #include "Math.h"
namespace RGE
{
namespace Math
{
float EPS = 1E-4f;
uint8_t HighestOneBit(uint64_t val){
val |= val >> 1;
val |= val >> 2;
val |= val >> 4;
val |= val >> 8;
val |= val >> 16;
val |= val >> 32;
return static_cast<uint8_t>( val - (val >> 1) );
}
uint8_t HighestOneBit(uint32_t val){
val |= va... | ALGO | 0.964057 | 4.202613 |
7d9d33ff-fdcb-4580-b513-e5c0ae65b41a | jjjasperd/Cpp-Primer-Exercise | Exercise6.5.cpp | #include <iostream>
using namespace std;
void abs(){
int val;
cout << "please input a interger to get its absolute value:" << endl;
cin >> val;
if (val>=0) {
cout << "the result is " << val << endl;
}
else
cout<< "the result is " << -val << endl;
}
int main(int argc, const cha... | TOOL | 0.993347 | 3.438761 |
5b9df3e4-7ca6-45c6-9ea2-70a1343a0696 | UtkarshJain05/DSA | 4. ARRAY/P06 - Left Rotate by K/P6-Brute.cpp | // Left Rotate The Array by K Places. (Brute)
#include <bits/stdc++.h>
using namespace std;
void Krotate(int arr[], int n, int k)
{
k = k % n;
vector<int> temp;
for (int i = 0; i < n; i++)
{
if (i < k)
{
temp.emplace_back(arr[i]);
}
else
{
... | ALGO | 0.999969 | 5.521138 |
2d9bc51b-3dc1-41e7-b803-9485cf54ee1d | PacktPublishing/CPP-Data-Structures-and-Algorithms | Chapter06/Subsequence_Generator/Subsequence_Generator.cpp | // Project: Subsequence_Generator.cbp
// File : Subsequence_Generator.cpp
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
vector<string> GenerateSubsequences(
string str)
{
// Return value is stored
// on vecString
vector<string> vecString;
// Retrieve str length
... | ALGO | 0.99905 | 6.428646 |
ce89f3c0-b8ca-4e0c-83a0-bb8e4d449520 | ivangulyk/EDA | Acepta el reto/245 - Los Dalton.cpp | #include <iostream>
using namespace std;
// Usar esta funcin para la prctica
//{Pre: 0 <= n <= longitud(v)}
/*
bool resuelve(long long int a[],long long int n){
bool ret , creciente = true, decreciente = true;
long long int i = 0;
while(i < n-1 && (creciente || decreciente)){
if(creciente && !(a[i] < a[i+1]))
... | ALGO | 0.998202 | 3.526872 |
08f2b51b-c1f5-406f-8656-eea694f017ea | Lessica/HikariSummer | libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp | // <algorithm>
// template<class T, StrictWeakOrder<auto, T> Compare>
// requires !SameType<T, Compare> && CopyConstructible<Compare>
// pair<const T&, const T&>
// minmax(const T& a, const T& b, Compare comp);
#include <algorithm>
#include <functional>
#include <cassert>
#include "test_macros.h"
template <cl... | TEST | 0.983509 | 5.639257 |
d7597323-f1e4-4337-baa0-fb1c5e8e2bd6 | hieumai1905/Code_Algorithm | programonline/laptrinhonline.club-main/BanhTrung.cpp | #include<stdio.h>
int main(){
int n, f1=0, f2=0, f3=0, sum=0, check=1;
scanf("%d", &n);
int a[n+5];
for(int i=0;i<n;i++){
scanf("%d", &a[i]);
if(a[i]==1) f1++;
else if(a[i]==2) f2++;
else if(a[i]==3) f3++;
else sum++;
}
if(f2%2==0) check=0;
int d2=f2/2;
if(f1>f3){
int x=f1-f3;
if(!check) sum+=f3+d... | ALGO | 0.999831 | 3.172504 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.