uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
02207ad7-69b9-470b-b324-f36a06c1bc71 | dsamot/ProjetProgMod | pricer-skel/src/PerformanceOption.cpp | /*
* File: PerformanceOption.cpp
* Author: samotd
*
* Created on September 16, 2016, 11:06 AM
*/
#include "PerformanceOption.hpp"
#include <iostream>
PerformanceOption::PerformanceOption() {
}
PerformanceOption::PerformanceOption(const PerformanceOption& orig) {
}
PerformanceOption::PerformanceOption(doubl... | TOOL | 0.944422 | 5.068329 |
0452c4ac-54bc-4219-907d-022952413d2f | smadi0x86/Hallucina | obfuscator-llvm/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/equal.range/equal_range_comp.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T, CopyConstructible Compare>
// constexpr pair<Iter, Iter> // constexpr after c++17
// equal_range(Iter first, Iter last, const T& value, Compare comp);
#include <algorithm>
#include <functional>
#include <vector>
#include <cassert>
#include <cstddef>
#in... | TEST | 0.987084 | 6.671169 |
7326b46b-2903-443c-90e9-24067f5df15c | yiikun/MurphiLLM | MurphiFast/include/murphi.original/mu_verifier.cpp | /****************************************
There are 3 groups of implementations:
None of them belong to any class
1) verifying invariants
2) transition sets generation
3) verification and simulaiton supporting routines
4) BFS algorithm supporting -- generate next stateset
5) BFS algorithm main routine
6... | ALGO | 0.995115 | 5.263175 |
8396551b-6930-4db8-9995-b7a59ba21f74 | anika-kamath/BCSE204-DAA-Lab | lab8_activityselection.cpp | //ACTIVITY SELECTION
#include <bits/stdc++.h>
using namespace std;
#define N 6 // defines the number of activities
// Structure represents an activity having start time and finish time.
struct Activity
{
int start, finish;
};
// This function is used for sorting activities according to finish time
... | ALGO | 0.998648 | 4.360702 |
61320595-bddb-43fb-b27d-4a8d8991b9e7 | Sonal997199/Leetcode | 2095-delete-the-middle-node-of-a-linked-list/2095-delete-the-middle-node-of-a-linked-list.cpp | /**
* Definition for singly-linked list.
* 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 {
public:
ListNode* deleteMiddl... | ALGO | 0.999879 | 5.868268 |
66b9e36a-bf0a-48a2-bcb2-d8246ff7c24f | jer22/OI | codeforces/732/D/d.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int n, m, tot;
int arr[MAXN], d[MAXN];
bool vis[MAXN];
bool check(int x) {
if (x == n + 1) return false;
int cnt = 0;
int tt = tot;
memset(vis, 0, sizeof(vis));
for (int i = x; i >= 1; i--) {
if (!arr[i]) continue;
if (!vis[arr[i]]) {
... | ALGO | 0.999987 | 3.906807 |
cc6cad9c-6eb4-45bc-b087-06b1893f5908 | codewithaman07/codeforces | A_Alyona_and_Numbers.cpp | #include <bits/stdc++.h>
using namespace std;
#define Aman() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl '\n'
#define int long long
#define pb push_back
#define f(x,n) for(int i = x ; i<n ; i++)
#define all(x) x.begin(),x.end()
const int M = 1e9+7;
const int N = 1e6 + 1;
void solve()... | ALGO | 0.999972 | 4.334126 |
84a9a118-6d3e-4e51-8dd8-d3986343e58c | hughdavenport/primecoin | src/script.cpp | using namespace std;
using namespace boost;
#include "script.h"
#include "keystore.h"
#include "bignum.h"
#include "key.h"
#include "main.h"
#include "sync.h"
#include "util.h"
bool CheckSig(vector<unsigned char> vchSig, vector<unsigned char> vchPubKey, CScript scriptCode, const CTransaction& txTo, unsigned int nIn, ... | ALGO | 0.880925 | 6.918912 |
082633b4-1819-4870-8fbf-8c2b86a506cc | russaltang88/leetcode-solutions | cpp/0435-non-overlapping-intervals.cpp | /*
Given array of intervals, return min # of intervals to remove for all non-overlapping
Ex. intervals = [[1,2],[1,3],[2,3],[3,4]] -> 1, remove [1,3] for all non-overlapping
Remove interval w/ longer end point, since will always overlap more or = vs shorter one
Time: O(n log n)
Space: O(1)
*/
cla... | ALGO | 0.999952 | 6.396495 |
16dc2c2c-122a-4e26-ac8a-bc6725abb0de | JeongP/algorithm | SWExpertAcademy/D3/9317.cpp | // 석찬이의 받아쓰기
#include <iostream>
#include <string>
using namespace std;
int main () {
int TC;
cin >> TC;
string s1;
string s2;
int cnt=0;
int cur_cnt = 0;
int N;
while(TC--) {
cur_cnt++;
cin >> N;
cin >> s1 >> s2;
for(int i=0;i<N;i++) {
... | ALGO | 0.999605 | 3.628655 |
7710df5c-7399-4a36-9597-6f35dd2e1696 | rajivnayanc/Competitive_Coding | hackerearth/unique-subarrays.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FIO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define inp(arr, n) \
for (ll i = 0; i < n; i++) \
cin >> arr[i];
#define fr(n) for ... | ALGO | 0.999537 | 5.094817 |
bc111a6c-c652-4d82-a641-586ced7c0c60 | ttvd/spatial-collision-datastructures | SortAndSweep.cpp | #include "SortAndSweep.h"
#include <algorithm>
#include <cstdlib>
namespace SpatialTest
{
//--
struct CompareAxisX
{
bool operator()(const ISpatialObject* pLeft, const ISpatialObject* pRight)
{
return(pLeft->VGetPosition().x - pLeft->VGetRadius() < pRight->VGetPosition().x - pR... | ALGO | 0.987689 | 6.428869 |
d18a13b4-884d-49b0-a611-a40c3eb85fc7 | pralinkhaira/Leet-Code-Solutions | 2488-divide-intervals-into-minimum-number-of-groups/divide-intervals-into-minimum-number-of-groups.cpp | class Solution {
public:
int minGroups(vector<vector<int>>& intervals) {
vector<int> start_times, end_times;
// Extract start and end times
for (const auto& interval : intervals) {
start_times.push_back(interval[0]);
end_times.push_back(interval[1]);
}
... | ALGO | 0.999997 | 6.673257 |
7965e874-b9ff-415b-a85b-a93ec955713e | shelltdf/osgall | prebuild/eigen-3.4-rc1/doc/examples/tut_arithmetic_redux_basic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::Matrix2d mat;
mat << 1, 2,
3, 4;
cout << "Here is mat.sum(): " << mat.sum() << endl;
cout << "Here is mat.prod(): " << mat.prod() << endl;
cout << "Here is mat.mean(): " << mat.mean() ... | ALGO | 0.999174 | 3.872858 |
607768b9-d7db-4e7f-919e-daecca368c03 | shakilaust/Spoj-Solve | MAIN8_C.cpp | //BISMILLAHIRRAHMANIRRAHIM
/*
manus tar shopner soman boro
all my suceesses are dedicated to my parents
Author :: Shakil Ahmed
.............AUST_CSE27.........
prob ::
Type ::
verdict::
*/
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pi acos(-1.0)
#define ff first
#define ss se... | ALGO | 0.999949 | 3.167334 |
5892db43-e5b5-4e04-9912-e381763b23bb | ayush06092002/GfG-Solutions | Easy/Reach the Nth point/reach-the-nth-point.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int solve(int i, vector<int> &dp)
{
if(i == 0)
return 1;
if(i == 1)
return 1;
if(dp[i] != -1)
return dp[i];
... | ALGO | 0.99991 | 6.014318 |
872a72e8-292f-4b78-b1f3-504a214f9b88 | DaphneHB/SG | spring_0.82.5.1/rts/lib/streflop/libm/flt-32/e_sqrtf.cpp | /* See the import.pl script for potential modifications */
/* e_sqrtf.c -- Simple version of e_sqrt.c.
* Conversion to Simple by Ian Lance Taylor, Cygnus Support, <EMAIL>.
*/
#if defined(LIBM_SCCS) && !defined(lint)
static char rcsid[] = "$NetBSD: e_sqrtf.c,v 1.4f 1995/05/10 20:46:19 jtc Exp $";
#endif
#include "SM... | ALGO | 0.999876 | 4.821784 |
64970d00-05cf-462b-8a3e-617c784cf775 | Sudipta-Trisha/AtCoder-Problems-Solutions | C - Multiplication 3.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll a;
double b;
cin>>a>>b;
ll ans = (b*100) + 0.5;
ll result = (a*ans) / 100;
cout<<(result)<<endl;
return 0;
}
| ALGO | 0.999844 | 3.007835 |
93f17fd0-2bbf-4569-beab-3fb17fe99b3c | FunTotal/UTokyo_Entrance_Exam | CI/2020_summer/now2.cpp | #include <bits/stdc++.h>
using namespace std;
/*
INPUT data2.bin:
29 2a 2b 2c 2d 2e 2f 00 06 05 00 00 00 00 08 04 30
OUTPUT data2.txt:
29 2a 2b 2c 2d 2e 2f 2a 2b 2c 2d 2e 00 2e 2f 2a 2b 30
total: 18 bytes
*/
void solve() {
ifstream fin("D:/3022244257/data2.bin", ios::in | ios::binary);
ofstream fout("D:/3022... | ALGO | 0.999256 | 3.271233 |
ddb26e61-c505-402f-a991-055b770b07c3 | ttnhathuy313/cp-career | VOI/NhatHuy/GIFTS.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e6 + 5;
int n, k, a[N];
multiset <int> S;
signed main() {
ios_base::sync_with_stdio(0); cin.tie(0);
freopen("GIFTS.INP", "r", stdin);
freopen("GIFTS.OUT", "w", stdout);
cin >> n >> k;
for (int i = 1; i <= n; ++i) {
cin >> a[i]... | ALGO | 0.999841 | 3.727445 |
d06e30bd-1d23-4883-9d90-67e24b0008ae | abanerjee10/ParSGA | ext/parlaylib/examples/mergesort.cpp | #include <iostream>
#include <string>
#include <random>
#include <parlay/io.h>
#include <parlay/primitives.h>
#include <parlay/random.h>
#include <parlay/sequence.h>
#include "mergesort.h"
// **************************************************************
// Driver
// *************************************************... | ALGO | 0.999545 | 5.469632 |
53ecb6de-41db-4540-9300-36a28a4b8e47 | lucic71/llvm-ub-free | libc/src/string/memrchr.cpp | #include "src/string/memrchr.h"
#include "src/__support/common.h"
#include <stddef.h>
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(void *, memrchr, (const void *src, int c, size_t n)) {
const unsigned char *str = reinterpret_cast<const unsigned char *>(src);
const unsigned char ch = static_cast<unsigned char>(c);
... | TOOL | 0.86696 | 6.582025 |
6804cf2a-3400-43b2-8927-dc510c7e5d62 | enochjung/acmicpc_net | 15/15824.cpp | #include <cstdio>
#include <algorithm>
#define N 300000
#define R 1000000007
using namespace std;
int n, a[N];
int main()
{
scanf("%d", &n);
for (int i=0; i<n; ++i)
scanf("%d", a+i);
sort(a, a+n);
long long res = 0;
long long mul = 2;
long long sum = 0;
for (int i=1; i<n; ++i)
{
sum = (sum*2 + (a[i]-a[... | ALGO | 0.999815 | 3.954612 |
b72bac7f-8231-4ef5-9978-633eddaf9f2b | wilsjame/adventofcode | 2020/21/Day21-2-Allergen-Assessment.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <set>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <utility>
using namespace std;
#define print(x) cerr << #x << " is " << x << endl;
int main() {
freopen("input.txt", "r", stdin);
int N = 0;
string S, x;
vec... | ALGO | 0.996979 | 3.914417 |
2320257a-0e24-4248-a5e1-75b689dbee52 | KaanCL/QGC-4.4.0 | libs/eigen/unsupported/doc/examples/PolynomialUtils1.cpp | #include <unsupported/Eigen/Polynomials>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
Vector4d roots = Vector4d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,5,1> polynomial;
roots_to_monicPolynomial( roots, polynomial );
cout << "Polynomial:... | ALGO | 0.99746 | 4.015535 |
fe8abf1e-8a21-47f1-bd9b-d0d57d189e23 | peterkaczorowski/kicad-8.0.7-imx | 3d-viewer/3d_rendering/raytracing/shapes2D/round_segment_2d.cpp | /**
* @file round_segment_2d.cpp
*/
#include "round_segment_2d.h"
#include <wx/debug.h>
ROUND_SEGMENT_2D::ROUND_SEGMENT_2D( const SFVEC2F& aStart, const SFVEC2F& aEnd, float aWidth,
const BOARD_ITEM& aBoardItem ) :
OBJECT_2D( OBJECT_2D_TYPE::ROUNDSEG, aBoardItem ),
... | ALGO | 0.972375 | 7.383502 |
64e786e4-c99e-40fa-b18f-ee9c2d5c8624 | POC-2025/leetcode | solution/0600-0699/0668.Kth Smallest Number in Multiplication Table/Solution.cpp | class Solution {
public:
int findKthNumber(int m, int n, int k) {
int left = 1, right = m * n;
while (left < right) {
int mid = (left + right) >> 1;
int cnt = 0;
for (int i = 1; i <= m; ++i) cnt += min(mid / i, n);
if (cnt >= k)
right =... | ALGO | 0.999986 | 5.579457 |
13f082bb-1649-418b-b766-2383183fbc28 | slh6666/datang_ws | src/turtlebot3/turtlebot3_gazebo/src/turtlebot3_drive.cpp | /* Authors: Taehun Lim (Darby) */
#include "turtlebot3_gazebo/turtlebot3_drive.h"
Turtlebot3Drive::Turtlebot3Drive()
: nh_priv_("~")
{
//Init gazebo ros turtlebot3 node
ROS_INFO("TurtleBot3 Simulation Node Init");
auto ret = init();
ROS_ASSERT(ret);
}
Turtlebot3Drive::~Turtlebot3Drive()
{
updatecommandVe... | TOOL | 0.899203 | 4.314844 |
88da5298-b2f3-4f21-a3d4-4ba4823843f9 | wuwusky/opencv_test | 测试高斯背景模型.cpp | #include "opencv2/bgsegm.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include <opencv2/core/utility.hpp>
#include <string>
#include <iostream>
//------------------------------------------------------------------------------------
//-----------------------------------------------------------------... | ALGO | 0.884791 | 5.089944 |
d427d8e5-991b-4206-bfdf-1d6bbbb02507 | kobayashidaisuke0217/TR1_Aster | Astar.cpp | #include "Astar.h"
#include"Novice.h"
bool isValid(int x, int y, int width, int height) {
//進行先がマップ内かどうか
return (x >= 0 && x < width && y >= 0 && y < height);
}
int calcH(int x, int y, int targetX, int targetY) {
// マンハッタン距離を使ったヒューリスティック関数
return std::abs(x - targetX) + std::abs(y - targetY);
}
std::v... | ALGO | 0.999703 | 3.832154 |
a5597353-402e-4b1f-99fe-aebd952ebff8 | charles-pku-2013/CodeRes_Cpp | TICPP-2nd-ed-Vol-two/code/C07/ListVsSet.cpp | using namespace std;
class Obj {
int a[20]; // To take up extra space
int val;
public:
Obj() : val(rand() % 500) {}
friend bool
operator<(const Obj& a, const Obj& b) {
return a.val < b.val;
}
friend bool
operator==(const Obj& a, const Obj& b) {
return a.val == b.val;
}
friend ostream&
ope... | ALGO | 0.995503 | 4.652702 |
1b2e6293-4247-42ec-a946-82ef6b736011 | Ankush-Pathak/FaaSOnIoT | core/data_xchange/Thirdparty/boost_1_80_0/libs/graph/test/king_ordering.cpp | #include <boost/config.hpp>
#include <vector>
#include <iostream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/king_ordering.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/bandwidth.hpp>
/*
Sample Output
original bandwidth: 8
Reverse Cuthill-McKee ordering starting at: 6
... | ALGO | 0.99999 | 5.692588 |
234c4b4b-6306-4108-b2b1-f685517b323c | openharmony/third_party_boost | libs/msm/doc/HTML/examples/BoostCon09Full.cpp | #include <vector>
#include <iostream>
#include <boost/mpl/vector/vector50.hpp>
#include <boost/msm/back/state_machine.hpp>
#include <boost/msm/front/state_machine_def.hpp>
#include <boost/msm/back/tools.hpp>
namespace msm = boost::msm;
namespace mpl = boost::mpl;
namespace // Concrete FSM implementation
{
// eve... | TOOL | 0.926818 | 7.016479 |
d3e024af-70d6-4b74-84d3-7895cc07db5d | artem-barsov/CP | codeforces/652/C.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n, k;
std::cin >> n >> k;
std::vector<long long> a(n), w;
for (int i = 0; i < n; i++) std::cin >> a[i];
int ones = 0;
for (int i = 0; i < k; i++) {
int inp;
std::cin >> inp;
if (inp == 1) ones++;
e... | ALGO | 0.99976 | 3.589598 |
f78f7bf2-21d6-4e75-a299-3278ef31cad8 | kantam5/Algorithm | Algorithm/Baekjoon/최소 스패닝 트리/1647 도시 분할 계획.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef struct
{
int v1;
int v2;
int dist;
}edge;
int parent[100001];
bool compare(const edge e1, const edge e2)
{
return e1.dist < e2.dist;
}
int getParent(int v)
{
if (v == parent[v])
{
return v;
}... | ALGO | 0.99998 | 5.06985 |
0c3690c4-191b-4f83-9dbc-76150b480230 | Souvadra/dakc | pakman_star/src/iterative_compaction.cpp | #include <stdio.h>
#include <mpi.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <inttypes.h>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <parallel/algorithm>
#include <numeric>
#include <omp.h>
#include <fstream>
#include "distri... | ALGO | 0.997319 | 3.077504 |
69176ae8-577a-481f-a60c-102268d269aa | paola-reyes/assignments | music_library/tempCodeRunnerFile.cpp | void searchAlbum(string remains, const map<string, set<string>> &albums)
// {
// // set<string> keywords;
// // string keyword = "\0";
// // while (!remains.empty()) {
// // splitFirstWord(remains, keyword, remains);
// // keywords.insert(keyword);
// // trimWhiteSpace(remains);
/... | TOOL | 0.887733 | 3.834768 |
b9527c5f-7fc3-439c-8caf-40d4062d31cb | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_2133_0.cpp | #include <bits/stdc++.h>
int A, B, q, L, t, m;
long long f(int i) { return A + (i - 1LL) * B; }
long long sum(int n) { return 1LL * A * n + (n - 1LL) * n / 2 * B; }
int main() {
scanf("%d%d%d", &A, &B, &q);
while (q--) {
scanf("%d%d%d", &L, &t, &m);
int l = L - 1, r = (int)1e6 + 5;
while (r - l > 1) {
... | ALGO | 0.999958 | 3.773916 |
c9266abd-84f1-45e0-a734-d330c2a74aa5 | ImperialCoin/ImperialCoin-TEST | src/rpcmining.cpp | #include "chainparams.h"
#include "db.h"
#include "init.h"
#include "bitcoinrpc.h"
using namespace json_spirit;
using namespace std;
// Key used by getwork/getblocktemplate miners.
// Allocated in InitRPCMining, free'd in ShutdownRPCMining
static CReserveKey* pMiningKey = NULL;
void InitRPCMining()
{
// getwork/... | WEB | 0.935091 | 6.168355 |
2451e8a3-303e-49d9-96e4-30c712857c14 | Kelvinmao/Leetcode | Hash-table/Leetcode204.cpp | class Solution {
public:
int countPrimes(int n) {
int count=0;
bool isprime[n];
for(int i=0;i<n;i++)
isprime[i]=true;
for(int i=2;i<sqrt(n);i++){
if(isprime[i]){
for(int j=2;j*i<n;j++)
isprime[j*i]=false;
}
... | ALGO | 0.999931 | 5.616925 |
491b0ce2-dd57-48db-8f2e-144ccb0114ce | yusifaliyevpro/Competitive-Programming | LeetCode/Medium/2615. Sum of Distances.cpp | // 2615. Sum of Distances
// https://leetcode.com/problems/sum-of-distances/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<long long> distance(vector<int>& nums) {
}
}; | ALGO | 0.998041 | 4.961529 |
7599dd13-5355-4bcb-bc7d-58f8cfd44b72 | Muhammad-abdullah7/Muhammad-abdullah7 | lab7/task8.cpp | #include <iostream>
using namespace std;
int calculate_money(int age, int machine_price, int toy_price) {
int total_money = 0, toy_count = 0, money_gift = 10;
for (int i = 1; i <= age; i++) {
if (i % 2 == 0) {
total_money += money_gift - 1;
money_gift += 10;
} else {
... | ALGO | 0.999226 | 4.098327 |
e5cdea6c-f03f-41e2-a3f8-bee86b616a84 | syarale/LeetCode101 | chapter 7/72 编辑距离.cpp |
// 72. Edit Distance
class Solution {
public:
int minDistance(string word1, string word2) {
int len1 = word1.size();
int len2 = word2.size();
vector<vector<int> > dp(len1 + 1, vector<int>(len2 + 1, 0));
for (int i = 0; i <= len1; i++) {
dp[i][0] = i;
}
... | ALGO | 0.999959 | 5.743563 |
676106dd-4800-4eb2-a4da-88a04b87daa1 | Asevenx174/CP-source-code- | 02_OJ_solution/Random solve/1 random contest/ruet iupc/tfc3/c.cpp | #include<bits/stdc++.h>
#define pf printf
#define ff first
#define ss second
#define sef second.first
#define ses second.second
#define ms(a,b) memset(a, b, sizeof(a))
#define lp(i,a,b) for (int i = a; i <= b; i++)
#define pii pair <int,int>
using namespace std ;
typedef long long ll ;
typede... | ALGO | 0.999985 | 3.550525 |
2474ec2c-0d3f-40da-b690-4ea3d5d4f496 | HyperionSan/Last_One_Standing | Cactus/repos/fuka/src/Domain/Spheric_time/domain_spheric_time_nucleus_nbr_conditions_boundary.cpp | #include "headcpp.hpp"
#include "spheric_time.hpp"
#include "array.hpp"
#include "scalar.hpp"
#include "tensor.hpp"
namespace Kadath {
int Domain_spheric_time_nucleus::nbr_conditions_val_domain_boundary_array (const Val_domain&, int bound, const Array<int>& order) const {
int res = 0 ;
switch (bound) {
case OUTER... | ALGO | 0.995818 | 4.770796 |
e41530a9-1a81-45b3-a2a9-d180c1426ceb | Bacy2545/Estrutura-de-Datos | TrabajoFinal.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
// strcmp para comparar char
// sprintf similar a String
struct pasajero {
char nombre[50];
struct pasajero *sig;
};
struct nodo {
double PrecioViaje;
int destino, altura, num = 0;
char MatriculaEmbarcacion, NombreEmbarcacion[10], id[15];... | TOOL | 0.927946 | 3.847358 |
43eeb8e0-5661-4412-b0f9-8d158fc9e5f9 | Fernando-Mauro/zig-zag-code | BFS/derrameDePetroleo.cpp | /*
https://omegaup.com/arena/problem/COMI-Derrame-de-Petroleo/
Solucion:
Utilizar BFS para simular el movimiento del petroleo sobre el oceano. Correr la BFS mientras el nivel
del BFS sea menor a los días que tenemos que hacer la simulación.
*/
#include <bits/stdc++.h>
using namespace std;
typedef vector <v... | ALGO | 0.999638 | 3.927982 |
003b250c-21c9-4388-981e-2a139b4295bc | Joey-Liu/online-judge-old-version | Liurujia_uva/2v7/uva 211/uva 211/main.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <memory.h>
#include <vector>
#include <set>
#include <sstream>
#include <map>
using namespace std;
const int maxn = 10;
int grid[maxn][maxn];
set<int> pips[7];
int cs[maxn], res[maxn][maxn], cnt = 0;
typedef pai... | ALGO | 0.9971 | 3.877442 |
c550e861-c573-47c2-86fb-f8f6c9af8f2b | akiiishiii/oi_exercises | pub/1057.cpp | // 1057.cpp
#include <iostream>
int main(int argc, const char * argv[]) {
int n;
std::cin >> n;
for (char c = 'A'; c <= 'A' + n - 1; c++) {
for (int i = 0; i < n - (c - 'A') - 1; i++)
std::cout.put(' ');
for (char c1 = 'A'; c1 < c; c1++)
std::cout.put(c1);
st... | ALGO | 0.999818 | 4.313919 |
0eb2af28-9696-4185-9efc-3948f2b955cf | ishandutta2007/codeforces | hollwoq_pelw/normal/1547/C.cpp | /*
// is short or still long ???
hollwo_pelw's template(short)
// Note : -Dhollwo_pelw_local
*/
#pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
using namespace std;
void FAST_IO(string filein = "", string fileout = "", string fileerr ... | ALGO | 0.99991 | 3.544429 |
b5144ecd-5650-4271-95d0-bfe3e798daa4 | hatim523/Protein-Classification | Needleman Wunsch M1.cpp | #include<iostream>
#include<string>
#include<string.h>
#include<fstream>
using namespace std;
/*************************************************************************************************/
/* Note: Please use Microsoft Visual Studio (VS) to run the code to avoid file read errors. */
/**************************... | ALGO | 0.999122 | 3.333563 |
8871390a-eb14-40eb-b8ae-df95229366c7 | ShilunDai/LeetCode | sorting/4sum.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
sort(nums.begin(), nums.end());
vector<vector<int>> result;
for (int i=0; i<nums.size(); ++i){
if (i>0 and nums[i]==nums[i-1]){
continue;
}
if (nums[i]>t... | ALGO | 0.999983 | 6.054043 |
52a919ed-d556-4d84-9ec4-b9b8a38f802f | 2694048168/LeetCodeAlgorithm | C++/invertTree.cpp | /**
* @File : invertTree.cpp
* @Brief : 翻转二叉树
* @Link : https://leetcode-cn.com/problems/invert-binary-tree/
* @Author : Wei Li
* @Date : 2021-08-01
*/
#include <iostream>
// Definition for a binary tree node.
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : va... | ALGO | 0.999942 | 6.546983 |
c63d60d8-9f86-4186-8771-00c3a59212c0 | ghananjani/DSA | C++_Leetcode/564. Find the Closest Palindrome.cpp | class Solution {
public:
string nearestPalindromic(string n) {
const auto& [prevPalindrome, nextPalindrome] = getPalindromes(n);
return abs(prevPalindrome - stol(n)) <= abs(nextPalindrome - stol(n))
? to_string(prevPalindrome)
: to_string(nextPalindrome);
}
private:
// Ret... | ALGO | 0.999931 | 7.169928 |
33e221f4-5122-451e-adc1-8382e2a0da87 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_12157_0.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int x,y,z;
cin>>x>>y>>z;
cout<<((x > y*z)?"No":"Yes")<<endl;
} | ALGO | 0.999925 | 3.883358 |
8f8b3be8-5133-4e2c-8f3b-d9058e7481d1 | GuilhermeHorta22/ATP1 | 1ºBimestre/Lista de Ex. de fixação 1/Ex001.cpp | #include <stdio.h>
int main()
{
float n1, n2, n3, media;
printf("Digite sua primeira nota\n");
scanf("%f",&n1);
printf("Digite sua segunda nota\n");
scanf("%f",&n2);
printf("Digite sua terceira nota\n");
scanf("%f",&n3);
media = (n1+n2+n3)/3;
if (media>=7)
{
printf("Aprovado! Media=%.1f",media);
}
else
... | ALGO | 0.979714 | 3.649614 |
6761d980-8772-42cf-8ea5-ebd8c55a16a8 | adamzhen/Team-Vestigo | GUI/VisualizationToolDev/Eigen/bench/spbench/test_sparseLU.cpp | // Small bench routine for Eigen available in Eigen
// (C) Desire NUENTSA WAKAM, INRIA
#include <iostream>
#include <fstream>
#include <iomanip>
#include <unsupported/Eigen/SparseExtra>
#include <Eigen/SparseLU>
#include <bench/BenchTimer.h>
#ifdef EIGEN_METIS_SUPPORT
#include <Eigen/MetisSupport>
#endif
using namesp... | ALGO | 0.992244 | 4.239584 |
d16fa82e-818c-4a7d-b8b1-efd0b5dfffea | shinkeonkim/BOJ | notes/fenwick_tree.cpp | #include <bits/stdc++.h>
#define for1(s,n) for(int i = s; i < n; i++)
#define for1j(s,n) for(int j = s; j < n; j++)
#define foreach(k) for(auto i : k)
#define foreachj(k) for(auto j : k)
#define pb(a) push_back(a)
#define sz(a) a.size()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typede... | ALGO | 0.999931 | 4.504776 |
4c5a16d6-a8f7-430e-9d08-4fd4af7e48dd | RuiHuangNUS/MARS-FTCC | Dynamical_Trajectory/src/utils/include/igl/normal_derivative.cpp | template <
typename DerivedV,
typename DerivedEle,
typename Scalar>
IGL_INLINE void igl::normal_derivative(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedEle> & Ele,
Eigen::SparseMatrix<Scalar>& DD)
{
using namespace Eigen;
using namespace std;
// Element simplex-size
const s... | ALGO | 0.999472 | 5.646736 |
277453d6-bc3c-484e-8a81-dbcf4cb5b829 | icetotem/Rush3D | 3rdparty/bullet3/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp | ///btDbvtBroadphase implementation by Nathanael Presson
#include "btDbvtBroadphase.h"
#include "LinearMath/btThreads.h"
btScalar gDbvtMargin = btScalar(0.05);
//
// Profiling
//
#if DBVT_BP_PROFILE || DBVT_BP_ENABLE_BENCHMARK
#include <stdio.h>
#endif
#if DBVT_BP_PROFILE
struct ProfileScope
{
__forceinline ProfileS... | ALGO | 0.989136 | 7.308707 |
638bc30d-712e-4e29-a0c1-650190d7280d | tonykhkim/codetree-TILs | 240519/구구단 만들기 2/print-multiplication-table-2.cpp | #include <iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
for (int i=2;i<=8;i+=2)
{
for (int j=b;j>=a;j--)
{
cout << j << " * " << i << " = " << j*i;
if (j>a)
{
cout << " / ";
}
}
cout ... | ALGO | 0.998416 | 3.696571 |
e52c378d-62c8-4852-b878-a343ab207153 | YurasovVadim/Pr1 | 3Caesar/main.cpp | #include <iostream>
#include <string>
#include <cstring>
#include <locale>
#include <cctype>
#include <codecvt>
#include <regex>
using namespace std;
int main()
{
int i=0;
string s;
cout <<"Введите строку: ";
getline(cin, s);
s = regex_replace(s, regex("№"), " ");
for (int i = 0; s[i] != '\0'; i++) { //Пробег... | ALGO | 0.996188 | 3.718903 |
b4730656-71b9-4751-8094-e09106470817 | vitaliy-pg/FLUJO | Ejercicio 4/main2.cpp | //
// Created by Francisco on 16/11/2023.
//
#include <iostream>
#include <iomanip>
int main() {
double num;
std::cout << "Ingresa un número: ";
std::cin >> num;
std::cout << "El número ingresado es: " << std::fixed << std::setprecision(2) << num << std::endl;
return 0;
}
| TOOL | 0.93682 | 4.799525 |
a5108ca1-f619-4e00-8515-6608bf065641 | lhermoso/TSL-PraComecar | Youtube/Risco.cpp | #include "pch.h"
#include "zorro.h"
void tamanhoDoLote(int Compra)
{
double capital = Capital * sqrt(1 + (ProfitClosed / Capital));
double capitalPorAtivo = capital / sqrt(NumAssetsUsed);
double margin = (Compra ? OptimalFLong : OptimalFShort) * capitalPorAtivo;
if (margin >= 0)
{
Margin = margin;
}
else ... | ALGO | 0.967714 | 4.648873 |
6000fa83-06f1-4bda-9ae5-2be391e7fa89 | PaulMLP/mpi2324 | generico.cpp | #include <iostream>
#include <mpi.h>
#include <fstream>
#include <string>
#include <vector>
std::vector<int> read_file() {
std::fstream fs("C:\\Users\\DELL\\Documents\\9no Semestre\\Paralela\\datos\\datos.txt", std::ios::in);
std::string line;
std::vector<int> ret;
while (std::getline(fs, line)) {
... | ALGO | 0.999504 | 4.328666 |
0ac9263e-5774-4935-95f4-47db737d4de9 | elixered/leetcode | 341-flatten-nested-list-iterator/341-flatten-nested-list-iterator.cpp | class NestedIterator {
public:
NestedIterator(vector<NestedInteger> &nestedList) {
begins.push(nestedList.begin());
ends.push(nestedList.end());
}
int next() {
hasNext();
return (begins.top()++)->getInteger();
}
bool hasNext() {
while (begins.size()) {
... | ALGO | 0.999736 | 5.942088 |
34dc3b10-cdaa-41ef-a807-260c93f2b743 | mehedi4958/17DaysOfFlutter | Day-01/dash_jump_flutter_flame_game/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.998612 | 6.785645 |
88cb887c-1334-4ef2-9487-6dd48ec4a397 | vijaylaxmiIttannavar/cpp-training | classwork/day24/day24/prg1.cpp | #include<iostream>
using namespace std;
typedef struct shape
{
int len;
int wid;
}SHAPE;
int main()
{
SHAPE s1;
s1.len = 10;
s1.wid = 30;
SHAPE s2;
s2.len = 20;
s2.wid = 40;
SHAPE s3;
s3.len = s1.len + s2.len;
s3.wid = s1.wid + s2.wid;
cout << s3.len << "\t" << s3.wid << endl;
SHAPE s4=s3; ... | ALGO | 0.95091 | 3.058367 |
018c8f56-822f-433f-b7ed-ce54bd905e5f | TownL/C-Codes-30- | main copy 8.cpp | /*
Jan Rodriguez
Instrucciones para el estudiante:
1. Generar números al azar dentro de un intervalo.
2. Implementación de funciones por valor en sus parámetros de entrada
3. Implementar funciones que retornen un valor.
Descripción de los problemas:
1. (Gaddis) Programming Challenges, 20. Random Number Guessing... | ALGO | 0.994214 | 3.267562 |
09989d24-22af-4f46-bdd2-50154f00bf38 | Sookmyung-Algos/2021algos | algos_assignment/2nd_grade/황수연_syhwang1231/summer_week1/17352.cpp | // 17352 여러분의 다리가 되어 드리겠습니다!(Gold 5)
#include <iostream>
#include <vector>
#include <queue>
#define MAX 300001
using namespace std;
int n;
vector<int> path[MAX];
bool ableToReach[MAX]; // 1번 섬(기준)에서 도달할 수 있는 마을
int main(void) {
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cin >> n; // 섬의 개수 입력
f... | ALGO | 0.999907 | 4.158423 |
26cac41c-a1e4-43df-9297-4f223fd01482 | Masum-Billah1/CodeForces-Accepted-Problem | Equator-962A.cpp | #include<iostream>
using namespace std;
int main()
{
int n,s =0,i,t=0,m;
cin >>n;
int a[n];
for(i=0;i<n;i++)
{
cin >> a[i];
s=s+a[i];
}
if(s%2 == 0)
m=s/2;
else
m=(s+1)/2;
for(i=0;i<n;i++)
{
t = t+a[i];
if(t>=m)
{
cout <<i+1<<endl;
break;
}
}
}
| ALGO | 0.9999 | 3.5373 |
6a09556b-46d7-4748-a12b-b590c185df3d | akashghadge/competitive-programming | CP-31/1300/02 D. Find the Different Ones!.cpp | /*
Notes
** ASCII of 'a'- 97,'z'- 123,'A'- 65,'Z'- 90,'0'- 48,'9'- 57
*/
/*Basic Include */
#include <bits/stdc++.h>
using namespace std;
/* Policy Based Data Structures*/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type, ... | ALGO | 0.999698 | 4.461497 |
3193ebef-1b02-495b-af87-0f24e702fcd8 | BartoszJO/Algorithms_and_Data_Structures | laby/lista1_cpp/zadanie3/DoublyCircularLinkedList.cpp | #include "DoublyCircularLinkedList.hpp"
#include <cstdlib> // Dla funkcji rand()
#include <ctime> // Dla funkcji time()
void DoublyCircularLinkedList::insert(int value) {
Node* newNode = new Node(value);
if (!head) {
head = newNode;
newNode->next = newNode;
newNode->prev = newNode;
... | ALGO | 0.998743 | 3.256548 |
328e905a-3466-4e9f-a729-f8f60c284a6d | AlfengYuan/leetcode-cplusplus-offline | leetcode/l00016.cpp | class Solution {
public:
int threeSumClosest(vector<int>& nums, int target) {
sort(nums.begin(), nums.end());
int res = nums[0] + nums[1] + nums[2];
for(int i = 0; i<nums.size()-2; i++){
if(i > 0 && nums[i] == nums[i-1]) continue;
int left = i+1, right = nums.size() -... | ALGO | 0.999999 | 6.121036 |
8c4f1022-87eb-46e4-8e5b-2de2f19600fd | sazzad110/Data-structures-Algorithms- | Greedy/FractionalKnapsack.cpp | #include<bits/stdc++.h>
#define read(x) freopen(x, "r", stdin);
#define write(x) freopen(x, "w", stdout);
using namespace std;
#define ll long long
#define sazzad
struct Item {
int v,w;
};
bool comp(Item i1,Item i2)
{
return (float)i1.v/(float)i1.w > (float)i2.v/(float)i2.w;
}
int FractionalKn... | ALGO | 0.999845 | 3.998695 |
9f3ddd3c-f042-4311-bc80-7b8c7f7745b8 | raincross7/code-similarity | codes/train_code/problem387/problem387_114.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iterator>
#include <iostream>
#include <algorithm>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <stdio.h>
#include <functional>
#include <chrono>
using namespace std;
#define rep(i,s,n) for(ll i=s;i<(n);++i)
using ll = long l... | ALGO | 0.99997 | 4.249467 |
90c6974b-e129-4c87-b794-13426f7828c5 | JollyBolt/leetcode | 105-construct-binary-tree-from-preorder-and-inorder-traversal/construct-binary-tree-from-preorder-and-inorder-traversal.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.999984 | 6.474384 |
364d3b73-cdbb-48f8-a5ac-5c49d699dd10 | MoriamAkterSwarna/phitron-practice | Algorithm/Contest/Mock-contest/Here_Comes_The_Genie.cpp | // #include<bits/stdc++.h>
// using namespace std;
// int main(){
// int n;
// cin >> n;
// vector<int> v(n);
// for(int i = 0; i < n; i++){
// cin >> v[i];
// }
// int totalBall = 0, color = 0;
// sort(v.begin(), v.end());
// for(int i = 0; i < n; i++){
// ... | ALGO | 0.999982 | 4.971717 |
6a2921ac-e0dc-4dc2-978f-e5dd50066529 | arihant-dev/CompetitiveProgramming | 2114-maximum-number-of-words-found-in-sentences/2114-maximum-number-of-words-found-in-sentences.cpp | class Solution {
public:
int mostWordsFound(vector<string>& sentences) {
int maxNumberOfWords = 0;
for(auto str: sentences){
int numberOfSpaces = 0;
for(auto ch: str){
if(ch == ' '){
numberOfSpaces++;
}
}
... | ALGO | 0.999941 | 5.913271 |
52ee97f9-ec8f-456e-847f-303134427ad1 | lacdr-tox/morpheus-pseudopodia | morpheus/core/random_functions.cpp | #include "random_functions.h"
// make a unique source of randomness available to everyone
vector<mt19937> random_engines;
typedef std::normal_distribution<double> RNG_GaussDist;
typedef std::gamma_distribution<double> RNG_GammaDist;
bool getRandomBool() {
return random_engines[ omp_get_thread_num() ]()<random_engin... | TOOL | 0.930811 | 4.29719 |
9edf8592-50e7-4bb8-a846-2d9557c5000b | PinkArmor/OOP-PTIT-v-B-i-Th-c-H-nh | thong ke phan tu.cpp | #include<bits/stdc++.h>
using namespace std;
struct data{
int n,s;
};
int main(){
int x;
vector <data> a;
while(cin>>x){
int ok=1;
for(int j=0;j<a.size();j++){
if(a[j].n==x){
ok=0;
a[j].s++;
break;
}
}
if(ok==1){
struct data b;
b.n=x;
b.s=1;
a.push_back(b);
}
}
for(int i=0;... | ALGO | 0.996451 | 3.155145 |
8448f400-6553-4d98-b78c-38e6be12ca2d | Kiids/OJ_Practice | 回旋镖的数量.cpp | /*
ƽ n Բͬĵ㣬ڡ ɵʾԪ (i, j, k) i j ֮ľ i k ֮ľȣҪԪ˳
ҵлڵԼ n Ϊ 500еڱ [-10000, 10000] С
ʾ:
:
[[0,0],[1,0],[2,0]]
:
2
:
Ϊ [[1,0],[0,0],[2,0]] [[1,0],[2,0],[0,0]]
class Solution {
public:
int numberOfBoomerangs(vector<vector<int>>& points) {
int ret = 0;
for (int i = 0; i < points.size(); i++)
{
... | ALGO | 0.99991 | 5.480429 |
1be13da3-c19e-4017-bae2-af5977b49887 | MeMrBerlin/Placement_help | All Data Structures/Arrays/22. Find maximum product subarray.cpp | class Solution{
public:
// Function to find maximum product subarray
long long maxProduct(int *arr, int n) {
if(n==1)
return arr[0];
long long minn=1,maxx=1,ans=1;
for(int i=0;i<n;i++){
if(arr[i]==0){
minn=maxx=1;
}
else if(arr[i]>0){
maxx=ma... | ALGO | 0.999954 | 5.34346 |
a0334fc6-88be-47a2-84ac-c0fbace8dda3 | zyicome/STM32F103C8T6_2804MotorFOC | Math_Library/Basic_Math_Library/Src/basicMath.cpp | #include "basicMath.hpp"
float invSqrt(float x)
{
float halfx = 0.5f * x;
float y = x;
long i = *(long*)&y;
i = 0x5f3759df - (i>>1);
y = *(float*)&i;
y = y * (1.5f - (halfx * y * y));
return y;
}
float constrain(float value, float min, float max)
{
if (value < min)
{
return... | TOOL | 0.953703 | 4.628047 |
0a748239-e8fc-4e52-bba0-8e991e8df304 | favorcat/BOJ | Silver/Silver I/7576.cpp | #include <bits/stdc++.h>
using namespace std;
int n,m,day = -1;
int tomato[1001][1001];
bool visited[1001][1001];
queue < pair<int, int> > q;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
void BFS(){
while (!q.empty()){
int x = q.front().second;
int y = q.front().first;
q.pop();
... | ALGO | 0.999914 | 4.847121 |
fb697353-f5bf-4683-b79f-40eab8861c63 | PedroAngeli/Competitive-Programming | Solutions/Codeforces/CF-B/363.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
int query(int l,int r, int* pref){
if(l == 0)
return pref[r];
return pref[r] - pref[l-1];
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,k;
cin >> n >> k;
int vet[n];
for(int i=0;i<n;i++)
cin >> vet[i... | ALGO | 0.999987 | 4.387712 |
caf526fa-7697-47fd-adef-610a8dbd6872 | mitasingh10332/Queue | Implementing Queue using LL.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(int val){
data=val;
next=NULL;
}
};
class queue{
node*front;
node*back;
public:
queue(){
front=NULL;
back=NULL;
}
void push(in... | ALGO | 0.999315 | 4.133034 |
ed3497a9-957e-4f2e-8ec9-42a39cd69e83 | ishandutta2007/codeforces | flashmt/normal/138/D.cpp | #include <iostream>
#include <algorithm>
#include <set>
#include <string>
#include <cstring>
#include <cstdio>
#define N 21
using namespace std;
string a[N];
int m,n,grundy[2][N*2][N*2][N*2][N*2],delta;
int calc(int isOdd,int minSum,int maxSum,int minDif,int maxDif)
{
if (minSum>maxSum || minDif>maxDif) return 0;
i... | ALGO | 0.999954 | 3.487314 |
d5e9d225-12e9-4754-92d5-e10be2286ab7 | sumit-raghukant-soni/Leetcode_Solutions | 1548-check-if-all-1s-are-at-least-length-k-places-away/check-if-all-1s-are-at-least-length-k-places-away.cpp | class Solution {
public:
bool kLengthApart(vector<int>& nums, int k) {
int prev = 0, sz = nums.size();
while(prev < sz && nums[prev] != 1) prev++;
int curr = prev+1;
while(curr < sz){
while(curr < sz && nums[curr] != 1) curr++;
if(curr < sz && nums[curr] == ... | ALGO | 0.999741 | 5.743924 |
79a1c6f0-32bc-49b8-98d0-cda8ef9ffa30 | AndriyKozakevich/lab6-1-_oopF | lab6/main.cpp | #include <iostream>
#include "include_average.h"
using namespace std;
int main() {
setlocale(LC_ALL, "Ukrainian");
// 🔹 Використання функції для середнього арифметичного
int intArray[] = { 5, 10, 15, 20, 25 };
size_t intSize = sizeof(intArray) / sizeof(intArray[0]);
double avg = calculateAverag... | ALGO | 0.968563 | 5.67546 |
2cf1f42f-8991-4ffb-aabb-998dbeda0143 | dannyqiu/advent-of-code | 2020/day06/p1.cpp | #include <iostream>
#include <string>
#include <string_view>
#include <sstream>
#include <vector>
#include <unordered_set>
#include <regex>
int count_answered_yes(const std::vector<std::string_view>& group) {
std::unordered_set<char> answered_yes;
for (const auto& person : group) {
for (char q : person... | ALGO | 0.998812 | 6.124088 |
17d27d8a-0adc-4c71-9cee-a169a01e7804 | arpan-dey-xo/GeeksForGeeks-POTD | 15-06-25.cpp | class Solution {
public:
bool checkCurrentDivisor(int divisor,vector<int>&arr,int k){
int values = 0;
int n = arr.size();
for(int i = 0;i<n;i++){
values += arr[i]/divisor;
if(arr[i]%divisor)
values++;
}
ret... | ALGO | 0.999968 | 5.07764 |
cc1852c3-5efd-483d-9381-07f1aa5838cf | k2font/atcoder | arc018_B.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using P = pair<ll, ll>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, -1, 0, 1};
string char_to_string(char val) {
return string(1, val);
}
int ... | ALGO | 0.999903 | 4.349465 |
7e550cef-00bb-4c70-bbf0-ad48bc7cc604 | Nico7777777/Stats | BigNumbers.cpp | //
// Created by nick on 12/15/23.
//
#include <bitset>
#include "BigNumbers.h"
// Allocation
BigNumbers::BigNumbers(char *q, int n) {
if( q == nullptr) {
s = (char *)malloc(1 * sizeof(char));
len = 1;
sign = false;
} else {
if (q[0] != '-')
sign = false;
els... | ALGO | 0.971395 | 4.419834 |
e1446f0d-805b-44dc-a53c-09b5127bf168 | nitinrathodsvnit/LeetCode | 0097-interleaving-string/0097-interleaving-string.cpp | //Approach-2 (Recursion + Memoization (i, j))
class Solution {
public:
int m, n, N;
int t[101][101];
bool check(string s1, string s2, string s3, int i, int j) {
if(i >= m && j >= n && i+j >= N)
return true;
if(i+j >= N)
return false;
... | ALGO | 0.999953 | 6.253942 |
0e324f03-37ef-439e-b161-1a3c0e70a998 | Amdrija/OO1 | Poglavlje2/Zadatak3/Source.cpp | #include <iostream>
using namespace std;
struct element {
int inf;
element* next;
};
void read_list(element* &head) {
cout << "Input number of elements in the list." << endl;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
element* new_element = new element;
cout << "List elements: " << endl;
cin >> new_e... | ALGO | 0.990264 | 4.349687 |
d4416aee-94d8-49dd-b2ec-e37f68c78aed | iwiwi/programming-contests | other/utpc2014/I.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <climits>
using namespace std;
#define a... | ALGO | 0.999937 | 4.069554 |
ec129938-6713-48c6-9fb0-ba210408ed87 | tripathiaman0709/-leetcode | DCP-12-24/3152-Special-Array-II.cpp | class Solution {
public:
vector<bool> isArraySpecial(vector<int>& v, vector<vector<int>>& q) {
int n=v.size();
vector<int>cum(n,0);
for(int i=1;i<n;i++){
if(v[i]%2 == v[i-1]%2){
cum[i]=cum[i-1]+1;
}else{
cum[i]=cum[i-1];
}
... | ALGO | 0.999687 | 4.990794 |
bb35e5b1-177a-4471-bc88-d7c1c48020fd | mireskandari/Competitive-Programming | codeforces/26/B.cpp | #include <bits/stdc++.h>
using namespace std;
#ifndef LOCAL
#define cerr if(0) cerr
#endif
#define all(v) (v).begin(), (v).end()
#define X first
#define Y second
using ll = long long;
using ld = long double;
template <class T = int> using V = vector<T>;
template <class T = int> using VV = V<V<T>>;
template <class ... | ALGO | 0.999126 | 4.405252 |
a65223d5-8583-4200-8e66-68030b5350a2 | ch37n1/ArchCS | Lab1/Lab1_task4.cpp | #include <iostream>
#include <bitset>
#include <iomanip>
// clear && g++ -o task4 Lab1_task4.cpp && ./task4
#define BITE 8
#define LENGTH sizeof(uint16_t) * BITE
template<typename T>
void print_hex_dec_bin(T number, std::string name) {
std::cout << "-------------- "<< name <<" --------------" << std::endl
... | ALGO | 0.992704 | 5.338974 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.