uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4c4d353f-dbae-4a04-8bed-b98b65f853ac | kmjp/procon | 2012-2016/2016/manthan/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | ALGO | 0.999681 | 3.460293 |
ad8597e3-bee8-41f9-b26f-8dfb55e4f1e3 | hasnat0006/CP_SOLUTION | Codeforces/Normal Round/Round 900 - 999/Round 924 (Div. 2)/1928B.cpp | //!-----------------------------------------------------!//
//! YUSUF REZA HASNAT !//
//!-----------------------------------------------------!//
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#include "C:\Users\Yusuf Reza Hasnat\OneDrive\Desktop\CP\debug.h"
... | ALGO | 0.999766 | 5.461832 |
abfaff42-2ee2-453f-9904-2338491a603d | alexandraback/datacollection | solutions_5669245564223488_0/C++/Ostap/B.cpp | #define _CRT_SECURE_NO_DEPRECATE
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory.h>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
us... | ALGO | 0.999755 | 3.92744 |
8cd71e09-6a6a-4279-9518-0a233cf8e63d | PmecSimulation/Allejos2D | allejos2d/src/chain_action/tackle_generator.cpp | // -*-c++-*-
/*!
\file tackle_generator.cpp
\brief tackle/foul generator class Source File
*/
/////////////////////////////////////////////////////////////////////
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "tackle_generator.h"
#include "field_analyzer.h"
#include <rcsc/player/player_agent.h>
#i... | ALGO | 0.999317 | 6.379383 |
dc3cb582-b79e-48f7-9411-00ffa6723a0b | Maksasj/megaboost | libs/graph/example/dfs-parenthesis.cpp | /*
IMPORTANT!!!
~~~~~~~~~~~~
This example uses interfaces that have been deprecated and removed from
Boost.Grpah. Someone needs to update it, as it does NOT compile.
*/
#include <boost/graph/graphviz.hpp>
#include <boost/graph/depth_first_search.hpp>
char name[] = "abcdefghij";
struct parenthesis_visitor... | ALGO | 0.999437 | 6.436385 |
f634aec0-3346-4c5c-a9c9-8aaeb757765f | NandiSoham/Leetcode-POTD-Daily-Coding-Challenge | Year 2024/05_May/day27-1608. Special Array With X Elements Greater Than or Equal X.cpp | // Problem Link -> https://leetcode.com/problems/special-array-with-x-elements-greater-than-or-equal-x/description/
// ---------------------------- Approch - 1 ( Brute Force ) ----------------------------------
class Solution {
public:
int specialArray(vector<int>& nums) {
int n = nums.size();
for... | ALGO | 0.999909 | 6.027181 |
2c1f1119-a6fe-4102-9397-09dfbbd1bd94 | arraesgustavo/competitiveProgramming | Maratona/aula5/problema3084.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, horafinal, minutofinal;
float m;
while (cin >> h >> m) {
horafinal = h / 30;
minutofinal = m / 6;
cout << setw(2) << setfill('0') << horafinal << ":" << setw(2) << setfill('0') << minutofinal << endl;
}
... | ALGO | 0.98112 | 4.581707 |
072eb225-4881-4ded-a484-d634e30fb2d5 | pranavajith/CP-Practice | A_And_Then_There_Were_K.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <set>
#include <cmath>
#include <map>
#include <sstream>
#include <deque>
#include <algorithm>
#include <limits>
#include <iomanip>
using namespace std;
#define ll long long
// #define TxtIO freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); freopen... | ALGO | 0.999943 | 5.011026 |
4502a583-a233-46d1-b820-20620ecf6449 | wzao1515/R2S | ra2sql/ra2sql/include/boost_1_55_0/libs/icl/example/party_/party.cpp | #include <iostream>
#include <boost/icl/interval_map.hpp>
#include "../toytime.hpp"
using namespace std;
using namespace boost::icl;
/**
Party.cpp demonstrates the possibilities of an interval map (interval_map or
split_interval_map). An interval_map maps intervals to a given content. In
this case the co... | ALGO | 0.995138 | 6.794724 |
a56370e5-b071-49b3-8ea1-f20d7393d628 | AdeLeo/coding | interview/stringShift1.cpp | #include <iostream>
#include <string>
using namespace std;
#define positiveMod(m, n) ((m) % (n) + (n)) % (n)
/*
左旋字符串str,m为负数时表示右旋abs(m)个字母
*/
void rotate(string &str, int m)
{
if(str.length() == 0)
return;
int n = str.length();
//处理大于str长度及m为负数的情况,positiveMod可以取得m为负数时对n取余得到正数
m = posi... | ALGO | 0.999966 | 4.099395 |
d060240b-1468-4f40-9dd8-96bdb86e3f72 | see-egor/belicoin | src/wallet.cpp | #include "wallet.h"
#include "walletdb.h"
#include "crypter.h"
#include "ui_interface.h"
#include "base58.h"
using namespace std;
//////////////////////////////////////////////////////////////////////////////
//
// mapWallet
//
struct CompareValueOnly
{
bool operator()(const pair<int64, pair<const CWalletTx*, un... | TOOL | 0.947362 | 4.073135 |
2908fe5a-3ee1-4d40-87fe-f333b086b864 | backengineering/theodosius | src/theo.cpp | #include <theo.hpp>
namespace theo {
theo_t::theo_t(std::vector<std::uint8_t>& lib,
lnk_fns_t lnkr_fns,
const std::string&& entry_sym)
: m_dcmp(lib, &m_sym_tbl),
m_recmp(&m_dcmp, {}, {}, {}),
m_entry_sym(entry_sym) {
m_recmp.allocator(std::get<0>(lnkr_fns));
m_recmp.co... | TOOL | 0.974666 | 5.80003 |
c5cf3c16-67df-428b-99fc-6938a3046942 | daniel-ankit/Leetcode | 188-best-time-to-buy-and-sell-stock-iv/188-best-time-to-buy-and-sell-stock-iv.cpp | class Solution {
public:
int dp[1001][2][101];
int dp_fun(int k,vector<int>& prices,int idx,int b)
{
if(k==0 || idx==prices.size()) return 0;
if(dp[idx][b][k] != -1) return dp[idx][b][k];
if(b==1)
return dp[idx][b][k] = max((-prices[idx]+dp_fun(k,prices,idx+1,0)), dp_fun(... | ALGO | 0.999757 | 5.523119 |
70ae3878-207f-487e-9105-9e08f7e5abbb | lzyrapx/Competitive-Programming | 百度之星/2016 Astar Contest - Round 2A/1001-All X.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#define Rep(i, x, y) for (int i = x; i <= y; i ++)
#define Dwn(i, x, y) for (int i = x; i >= y; i --)
#define RepE(i, x) for (int i = pos[x]; i; i = g[i].nex)
#define v g[i].y
using namespace std;
typedef long long LL;
typede... | ALGO | 0.999927 | 3.834134 |
e6cb9a61-77a0-43f4-bfd7-7bead4d41b87 | ericbrandwein/competencias | Codeforces/1374/b/b.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define endl '\n'
#define elif else if
#define ll long long i... | ALGO | 0.999899 | 4.364155 |
7c762007-9f38-4b4a-8433-76688a1db520 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/10/12/8.cpp | // GCJ 2010 Round 1A (B)
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <bitset>
#in... | ALGO | 0.999952 | 4.278432 |
77a6112b-0321-4841-885b-6a2459861093 | Dianpeng-Wang/autoware | ros/src/computing/planning/motion/packages/astar_planner/nodes/obstacle_avoid/search_info_ros.cpp | #include "search_info_ros.h"
namespace astar_planner
{
SearchInfo::SearchInfo()
: map_set_(false)
, start_set_(false)
, goal_set_(false)
, path_set_(false)
, closest_waypoint_index_(-1)
, obstacle_waypoint_index_(-1)
, start_waypoint_index_(-1)
, goal_waypoint_index_(-1)
, state_("")
, upper_bound_... | TOOL | 0.98743 | 5.113218 |
16740d19-97a8-48d5-a99e-0280cf296ed6 | psshamshin/For_I-2.2 | ОАИП/Lab_2/Lab_2/Lab_2.cpp | #include <iostream>
#include <cstdlib>
#include <math.h>
using namespace std;
long double fact(int n) {
if (n == 1) {
return 1;
}
if (n > 1) {
return n * fact(n - 1);
}
}
int main()
{
//Смена кодировки консоли//
system("chcp 1251>null");
/* ========= ВВОД ПЕРЕМЕННЫХ ЕСЛИ НАДО ===========
double x, y, z, ... | ALGO | 0.999523 | 3.471284 |
1aa6de8f-9979-4817-a693-f5f93f397678 | sarvex/leetcode-clojurescript | solution/0800-0899/0870.Advantage Shuffle/Solution.cpp | class Solution {
public:
vector<int> advantageCount(vector<int>& nums1, vector<int>& nums2) {
int n = nums1.size();
vector<pair<int, int>> t;
for (int i = 0; i < n; ++i) t.push_back({nums2[i], i});
sort(t.begin(), t.end());
sort(nums1.begin(), nums1.end());
int i = 0,... | ALGO | 0.999999 | 6.086144 |
afaa7924-44e5-4c64-b90e-4c3d2558376a | JunBinLiang/Road-To-1900 | 蓝桥杯/月赛30/课本分配.cpp | //https://www.lanqiao.cn/problems/20647/learning/?contest_id=258
#include <iostream>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <cmath>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <map>
#include <queue>
#include <deque>
using namespace std;
... | ALGO | 0.999993 | 3.01663 |
3fa5d758-85e7-43ef-a5e8-5c1b5fbee38c | ishandutta2007/codeforces | qazswedx2/normal/1148/B.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n,m,k,ta,tb,a[1000005],b[1000005];
int main()
{
scanf("%I64d%I64d%I64d%I64d%I64d",&n,&m,&ta,&tb,&k);
for(int i=1;i<=n;i++)
scanf("%I64d",&a[i]);
for(int i=1;i<=m;i++)
scanf("%I64d",&b[i]);
if(k>=n||k>=m)
{
pr... | ALGO | 0.999937 | 3.076298 |
e77dafa8-2c43-47ce-bc6c-a5db2a155b71 | GarryMarkus/codes-documentation | c++ and dsa/cp/A_TrippiTroppi.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
string s1, s2, s3;
cin >> s1 >> s2 >> s3;
cout << s1[0] << s2[0] << s3[0] << endl;
}
} | ALGO | 0.999822 | 3.817682 |
36e4e482-88e6-429e-b842-a87c4de847da | ishandutta2007/codeforces | yuukakazami/normal/98/C.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <climits>
#include <numeric>
#include <vector>
#include <cmath>
using namespace std;
double a, b, l, w;
const double EPS = 1e-8;
inline int sign(double a) {
return a < -EPS ? -1 : a > EPS;
}
struct Point {
double x, y;
Point() ... | ALGO | 0.999818 | 3.432992 |
c5053351-7684-4a96-bdbb-d53cfbfb29f4 | szwow/schoolwork | cpp/lab8/ex2.cpp | #include <iostream>
#include <vector>
#include <string>
#include <memory>
class Animal {
protected:
std::string name;
std::string species;
int age;
public:
Animal(const std::string& name, const std::string& species, int age)
: name(name), species(species), age(age) {}
virtual ~Animal() = ... | TOOL | 0.853259 | 7.347175 |
8ba02295-a8e0-462d-8b76-14c431a4fa0e | lttthedev/SPOJ-VNOI-VNOJ-Solution | PTIT136A-src.cpp | #include <iostream>
#include <string>
using namespace std;
typedef pair<string, long> record;
record hs[101];
string s;
long n, res, vt, t = 0;
int xh(string s)
{
for (long i = 1; i <= t; i++)
if (s == hs[i].first)
{
vt = i;
return 1;
}
return 0;
}
main()
{
cin >> n;
res = 0;
for (long i = 1; i... | ALGO | 0.999574 | 3.704051 |
e3fe5ccd-8306-4709-ba97-2bbfa52621c0 | natsunoshion/Web_Project | 源码/abbreviation.cpp | #include <iostream>
#include <vector>
using namespace std;
bool opt[1000][1000];
string abbreviation(string a, string b) {
opt[0][0] = true;
for(int i = 1; i <= a.size(); i++) {
opt[i][0] = !isupper(a[i - 1]) && opt[i - 1][0];
}
for (int j = 0; j < b.size(); j++) {
opt[0][j + 1]... | ALGO | 0.999987 | 5.477297 |
c6044d9c-9988-48a6-ab68-2c0c5f810d76 | ishandutta2007/codeforces | alexandr_ts/normal/519/C.cpp | #include <bits/stdc++.h>
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define frb(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
typedef long long ll;
typedef long double ld;
const int N = 1e5;
... | ALGO | 0.999759 | 3.521533 |
44b28f91-53ba-46e0-9c70-d39699a4d831 | Tipto-Ghosh/Data-Structure-and-Algorithm | Dynamic_Programming/All Patterns/LCS/minNumInsertionToMakePalin.cpp | #include <bits/stdc++.h>
#define endl "\n"
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#pragma GCC optimize ("-ffloat-store")
using namespace std;
#define firstio() ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
// Last Updated: 14-08-2024
typede... | ALGO | 0.999993 | 5.672655 |
e231642b-cc86-4860-b0bf-99eeddfb4ddd | raulrobinson/route-calculator | route-backend/osrm-backend/src/partitioner/recursive_bisection_state.cpp | #include "partitioner/recursive_bisection_state.hpp"
#include "partitioner/tarjan_graph_wrapper.hpp"
#include "util/tarjan_scc.hpp"
#include <algorithm>
#include <climits> // for CHAR_BIT
#include <numeric>
#include <set>
#include <unordered_map>
namespace osrm::partitioner
{
RecursiveBisectionState::RecursiveBisect... | ALGO | 0.995967 | 7.356855 |
2ff7c7ab-91f7-415e-9d87-d4c1ed55f86a | tmdarwen/AudioLib | Source/Signal/Source/PeakProfile.cpp | #include <Signal/PeakProfile.h>
#include <Utilities/Exception.h>
#define _USE_MATH_DEFINES // Seems some compilers need this so M_PI will be defined
#include <math.h>
#include <iostream>
#include <algorithm>
#include <utility>
Signal::PeakProfile::PeakProfile(const Signal::FrequencyDomain& frequencyDomain) : frequen... | ALGO | 0.999116 | 5.916106 |
a7548b71-6d78-4e8a-812e-f849ef6f8697 | trilinos/Sundance | Playa/src/PlayaNonlinearSolverBuilder.cpp | /* @HEADER@ */
/* @HEADER@ */
#include "PlayaExceptions.hpp"
#include "PlayaNonlinearSolverBuilder.hpp"
#include "PlayaLinearSolverBuilder.hpp"
#include "PlayaNOXSolver.hpp"
#include "PlayaNewtonArmijoSolverImpl.hpp"
#include "PlayaLinearCombinationImpl.hpp"
#include "Teuchos_ParameterXMLFileReader.hpp"
#ifndef HAVE... | TOOL | 0.857858 | 7.193073 |
e9cadebc-69d8-409a-bac6-76bc30b24ef9 | cvfish/PangaeaTracking | src/main_engine/tracker/DeformNRSFMTracker.cpp | #include "main_engine/tracker/DeformNRSFMTracker.h"
baType mapBA(std::string const& inString) {
if (inString == "mot") return BA_MOT;
if (inString == "str") return BA_STR;
if (inString == "motstr") return BA_MOTSTR;
}
dataTermErrorType mapErrorType(std::string const& inString){
if(inString == "gray") return P... | ALGO | 0.962023 | 6.22568 |
81e89681-9622-4286-805c-08bffd8f014a | sahith29s/vim-configurations-vs-code | History/7deedc31/68UZ.cpp | // #include <iostream>
// using namespace std;
// bool binarySearch(int *arr, int s, int e, int k)
// {
// // base case
// // element not found
// if (s > e)
// return false;
// int mid = s + (e - s) / 2;
// // element found
// if (arr[mid] == k)
// return true;
// if (... | ALGO | 0.99943 | 4.268324 |
d6e9ec2a-e87a-46d0-8776-f87cdafce955 | wdazhi97/coro | thirdparty/boost_1_82_0/libs/compute/perf/perf_uniform_int_distribution.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/container/vector.hpp>
#include <boost/compute/random/default_random_engine.hpp>
#include <boost/compute/random/uniform_int_distribution.hpp>
#include "perf.hpp"
namespace compute = boost::compute;
... | TOOL | 0.900398 | 3.90948 |
7af0f626-639b-48a9-9cbe-1da5f2bf7552 | DenisPGH/hades | src/modules/flight_mode_manager/tasks/FlightTask/FlightTask.cpp | #include "FlightTask.hpp"
#include <mathlib/mathlib.h>
#include <lib/geo/geo.h>
constexpr uint64_t FlightTask::_timeout;
const trajectory_setpoint_s FlightTask::empty_trajectory_setpoint = {0, {NAN, NAN, NAN}, {NAN, NAN, NAN}, {NAN, NAN, NAN}, {NAN, NAN, NAN}, NAN, NAN};
const vehicle_constraints_s FlightTask::empty_c... | ALGO | 0.879498 | 7.091273 |
1fdf33bb-e435-465f-a10b-062bc3a17094 | shaunno94/MCompTeamProject_2016 | CSC8503 Framework/BulletPhysics/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp | #include "btCollisionDispatcher.h"
#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
#include "Line... | ALGO | 0.972861 | 6.753022 |
7528ac61-32cb-4129-90b7-e04c7ed35199 | socc-io/algostudy | ProblemPool/tree_poop/becxer.cpp | #include <fstream>
#include <iostream>
#define VERSION "FILE"
using namespace std;
class Node{
public:
bool isFull;
int start, end;
Node* left;
Node* right;
Node* parent;
Node(int s, int e) :start(s), end(e), isFull(false){}
};
Node* root;
void makeSegmentTree(Node* parent){
int s = parent->start; int e = pa... | ALGO | 0.998738 | 4.226949 |
8976d91f-b7e0-4ef4-873a-32c022389204 | h1mmm1/posn | e1_pairsum.cpp | /* LANG : C++ */
#include<bits/stdc++.h>
using namespace std;
bool mp[2000005];
int main(){
ios::sync_with_stdio(0); cin.tie(0);
int n,m;
cin >> n >> m;
int x[n];
for(int i=0;i<n;i++){
cin >> x[i];
mp[x[i]]=true;
}
for(int i=0;i<m;i++){
int b,c=0;
cin >> b;
for(int j=0;j<n;j++){
if(b>=x[j] && mp[b-... | ALGO | 0.999952 | 4.005186 |
716d427b-7ab4-4e09-a8ee-ae2479923909 | AdithyaRaoK14/DS-Lab | L3/A1.cpp | //Program to implement N stacks in a single array
#include <iostream>
using namespace std;
const int SIZE=10;
const int N=5;
class NStacks{
private:
int arr[SIZE]={0};
int top[N];
int bot[N+1];
public:
NStacks(){
for(int i=0,j=-1;i<N;i++,j+=SIZE/N){
top[i]=j;
bot[... | ALGO | 0.998293 | 4.836982 |
6c4f50f7-5c7f-486c-90d6-d29d49ff9b41 | bioyoshoo/atcoder | Boot-camp/Hard-lap3/87.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
struct UnionFind {
vector<int> par, siz;
UnionFind(int n) : par(n, -1), siz(n, 1) { };
int root(int x) {
if (par[x] == -1) return x;
... | ALGO | 0.999997 | 5.096809 |
dafbe031-63a2-4d32-bd9f-566a32970848 | Xu-Jack11/ACM-Learning | CodeForces/Round 1037 Div.3/2126A.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
string s;
cin>>s;
cout<<*min_element(s.begin(),s.end())<<'\n';
}
int main()
{
#if !LOCAL
ios::sync_with_stdio(0);
cin.tie(0);
#endif
int tt = 1;
cin >> tt;
while (tt--)
solve();
#if LOCAL
system("pause");
#endif
... | ALGO | 0.998295 | 4.581659 |
da22217d-23ee-4666-a612-525cb71af753 | euchangxian/LeetCode | C++/3254-FindThePowerOfKSizeSubarraysOne/Solution.cpp | #include <cstddef>
#include <cstdlib>
#include <deque>
#include <vector>
class Solution {
public:
std::vector<int> resultsArray(std::vector<int>& nums, int k) {
// nums of length n, integer k.
// Power is defined as:
// its maximum element if all its elements are consecutive and ascending.
// -1 oth... | ALGO | 0.999728 | 6.251195 |
f392026d-732a-4b5e-b9f2-2e956f6b1bb1 | ngochahh2005/PTIT-code | CodePTIT-CPP/CodePTIT/CPP0442 - TÌM KIẾM NHỊ PHÂN.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
std::ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--) {
int n, x, tmp;
int ck = -1;
cin >> n >> x;
for (int i = 0; i < n; i++) {
cin >> tmp;
if (... | ALGO | 0.999533 | 4.277009 |
ec391d59-464f-413a-b21c-311d28fe4e0e | hustic/shell-tool | Code/nurbsSur.cpp | // Sotiris Gkoulmaris - sg3219
// spline-tool
// NURBS surface derived class cpp file. Contains implementations of surface
// generators, operators and samplers.
#include <cmath>
#include <iostream>
#include <fstream>
#include "nurbsSur.h"
using namespace std;
/* Class destructor - since we are using unique_ptr, i... | TOOL | 0.962966 | 5.72661 |
aaf0c38b-fb5b-43b8-8711-8fdc97dd7268 | gemrb/gemrb | gemrb/plugins/BIKPlayer/dct.cpp | /**
* @file libavcodec/dct.c
* (Inverse) Discrete Cosine Transforms
*/
#include "dsputil.h"
av_cold int ff_dct_init(DCTContext* s, int nbits, int inverse)
{
int n = 1 << nbits;
s->nbits = nbits;
s->inverse = inverse;
s->data = (struct FFTComplex*) av_malloc(sizeof(FFTComplex) * 2 * n);
if (!s->data)
retur... | ALGO | 0.892273 | 6.146295 |
225c635c-cc1a-4ce6-938c-0bd121a86c69 | sourabh59-coder/StriverA-Z_Sheet | Step 14: Binary Search Tree/Lec 02: Practice Problem/13. Largest/Approach1.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node {
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val) {
Node* temp = new Node;
temp->data = val... | ALGO | 0.999817 | 6.854178 |
b92f79fe-0d82-43bf-bdba-6aab62e1e159 | dushyant-shukla/ramanujan | source/transform.cpp | #include "transform.h"
#include "constants.h"
#include "quaternion.h"
#include <math.h>
namespace ramanujan
{
Transform::Transform(const Vector3& _position, const Quaternion& _rotation, const Vector3& _scale)
: position(_position)
, rotation(_rotation)
, scale(_scale)
{
}
Transform Combine(const Transfo... | ALGO | 0.862754 | 6.839135 |
0865448e-4d26-486d-8f55-d895252be458 | venum61/-mro-viim31-Ivanov-Veniamin-Nikolaevi3 | src/lab2/laba2.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <random>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
class DataGenerator {
private:
std::string inputFile;
std::string outputFile;
int numClasses;
int numPointsPerClass;
int dimension;
std::vector<s... | DATA | 0.996645 | 4.134021 |
1f50b316-cfac-47fc-b464-f1e30a2b5c76 | vanshshxrma/cpp | pattern 1/numbersprint.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cout<<"enter no. of rows";
cin>>n;
for(int i =1;i<=n;i++){
for(int j=1;j<=i;j++){
cout<<j;
}
cout<<endl;
}
} | ALGO | 0.999079 | 3.766104 |
6d4bdf7d-7a45-4864-83b9-bac1ac04f740 | mdyasinahmed/flutter_app_dev | my_practice/rest_api/api_prac_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.997654 | 6.76775 |
72566de2-fb81-4688-bea0-afb9a242c9e2 | kgj1234/SCOUT | Preprocessing/VideoRegistration/image-registration-master/external-dependencies/ba_interp2.cpp | #include <mex.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <iostream>
inline double round( double d ) {
return floor( d + 0.5 );
}
inline
static
int access(int M, int N, int x, int y) {
if (x<0) x=0; else if (x>=N) x=N-1;
if (y<0) y=0; else if (y>=M) y=M-1;
return M*x + y;
}
inlin... | ALGO | 0.99925 | 5.791307 |
5269708c-159d-49a6-88dd-1bbd057732a2 | ishandutta2007/codeforces | kmjp/normal/933/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | ALGO | 0.99997 | 4.040487 |
e7a50ee4-4b19-4f75-a26d-22c82f9a1b50 | AngelAnconeyra/ComputacionParalela | Lab_2/ejercicio_3_7.cpp | #include <mpi.h>
#include <stdio.h>
#include <time.h>
int main(int argc, char *argv[]) {
int rank, comm_sz;
int pingpong_count = 100000; // Número de ping-pongs repetidos para obtener un tiempo medible
int data = 0;
double start_time, end_time;
clock_t clock_start, clock_end;
// Inicializar MP... | ALGO | 0.996235 | 5.075097 |
209a9a8c-4b4f-4d5f-991a-974e22666c47 | ShreyaCtrl/DSA-in-CPP | 17_set_bits.cpp | #include<iostream>
using namespace std;
int set_bits(int a, int b) {
int count = 0;
// int n = a | b;
while (a>0) {
int bit = a & 1;
if (bit == 1) {
count++;
}
a /= 2;
}
while (b>0) {
int bit = b & 1;
if (bit == 1) {
count++;
... | ALGO | 0.999549 | 4.018179 |
ff539f6d-dca4-45d5-95a1-176a9438480d | rafgpereira/competitive-programming | listas-geometria/lista-reta/collinearityReduce.cpp | #include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
using Point = pair<int, int>;
// Função para calcular a inclinação entre dois pontos
// Usa a forma de fração reduzida para evitar problemas de precisão
vector<int> slope(const Point &P, const Point &Q) {
int dy = Q.y - P.y;
int dx ... | ALGO | 0.99999 | 5.263591 |
9def129c-78bb-4ab2-95c0-c8669b06b9aa | SenseLogic/MYST | BOOST/boost_1_76_0/libs/geometry/doc/src/examples/algorithms/azimuth_strategy.cpp | // Boost.Geometry
// QuickBook Example
//[azimuth_strategy
//` Shows how to calculate azimuth in geographic coordinate system
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
int main()
{
namespace bg = boost::geometry;
typedef bg::model::point<double, 2, bg::... | TOOL | 0.961384 | 6.697726 |
6236ef02-9e5f-4cd6-9217-e1f5ca887be1 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/August/Subsequence_20200812124538.cpp | #include<iostream>
#include<bits/stdc++.h>
#define MOD 1000000007
using namespace std;
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
long long int modularExponentiation(long long int n,long long int base){
long long int result = 1;
while(n){
if(base % 2 == 0){
... | ALGO | 0.999943 | 4.20346 |
7b10ec79-350b-4a0c-9ad5-eb43457321fc | MGZX/Problems | Problems/Euler_7.cpp | /*
2016/8/7 ZXD
10001st prime
Problem 7
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number?
*/
#include <iostream>
using namespace std;
bool is_prime(int n);
int main(void)
{
int index = 0;
int n = 1;
do
{
n++;
if (is... | ALGO | 0.999793 | 4.947928 |
950ff3af-33f4-4744-a620-ee36f42f7506 | esl000/CustomUE4VolumeRaymarching | Engine/Source/ThirdParty/IntelTBB/IntelTBB-4.0/src/perf/fibonacci_impl_tbb.cpp | #include <cstdio>
#include <cstdlib>
#include "tbb/task_scheduler_init.h"
#include "tbb/task.h"
#include "tbb/tick_count.h"
extern long CutOff;
long SerialFib( const long n ) {
if( n<2 )
return n;
else
return SerialFib(n-1)+SerialFib(n-2);
}
struct FibContinuation: public tbb::task {
lon... | ALGO | 0.999699 | 4.705167 |
c853f8e5-adae-40fb-b070-37abae3cb1ae | sarvex/leetcode-j | solution/1100-1199/1165.Single-Row Keyboard/Solution.cpp | class Solution {
public:
int calculateTime(string keyboard, string word) {
unordered_map<char, int> index;
for (int i = 0; i < keyboard.size(); ++i) {
index[keyboard[i]] = i;
}
int res = 0, t = 0;
for (char c : word) {
res += abs(index[c] - t);
... | ALGO | 0.999971 | 5.867857 |
0288aaff-df9b-4b00-b97f-d6e690c59e81 | matheusAFONSECA/C204 | LAB/MODDLE/Linha_de_Montagem_Recuperar_caminho.cpp | #include <iostream>
#include <list>
using namespace std;
int main()
{
//Variaveis de entrada
int n; // numero de maquinas por linha
int a[2][100]; // a[i][j]: tempo de processamento da maquina j da linha i -> a[0,4] = 8
int t[2][100]; //t[i][j]: tempo pra ir da maquina j da linha i para a outra linha -> t[0,4] = 4... | ALGO | 0.999968 | 3.817177 |
975bf8c1-8011-4819-9752-e29ff33ec2cc | ishandutta2007/codeforces | xuanquang1999/normal/1017/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef complex<double> point;
#define mapii map<int, int>
#define debug(a) cout << #a << ": " << a << endl
#define debuga1(a, l, r) fto(i, l, r) cout << a[i] << " "; cout << endl
#define fdto(i, r, l) for(int i = (r); i >= (l); --i)
#define fto(i, l... | ALGO | 0.999971 | 3.341771 |
642e022b-53ac-433b-b918-36ff98fcc679 | vcoppola/c_plus_plus | vc739_hw7_q6.cpp | #include<iostream>
#include <cstdlib>
using namespace std;
int binarySearch(int arr[], int arrSize, int val);
int main() {
int array[10] = { 1, 7, 13, 22, 34, 45, 47, 54, 57, 65 };
cout << binarySearch(array, 10, 57) << endl;
return 0;
}
int binarySearch(int arr[], int arrSize, int val) {
int low = 0;
int h... | ALGO | 0.999545 | 5.63422 |
6652c5a9-6298-487b-8f93-115239171a04 | darkshuige/codecode | c code/Ama no Jaku.cpp | #include<bits/stdc++.h>
#define jiasu ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define int long long
#define INF 0x3f3f3f3f
#define endl "\n"
using namespace std;
const int maxn=2005;
char a[maxn][maxn];
signed main()
{
jiasu;
map<string,int>mp1,mp2;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
... | ALGO | 0.999479 | 3.480294 |
2000d886-7518-4741-9f38-087e2833d2db | Fapley13/Games101PA7 | src/BVH.cpp | #include <algorithm>
#include <cassert>
#include "BVH.hpp"
BVHAccel::BVHAccel(std::vector<Object*> p, int maxPrimsInNode,
SplitMethod splitMethod)
: maxPrimsInNode(std::min(255, maxPrimsInNode)), splitMethod(splitMethod),
primitives(std::move(p))
{
root = recursiveBuild(primitives);
}
... | ALGO | 0.999431 | 6.112085 |
07e46658-5d58-481d-ab56-ebf0ca961430 | prog-ankit/DSA-Programs | infix_to_prefix.cpp | //Implement a program to convert infix notation to postfix notation using stack.
//Operators --> (),^,/,*,+,-, A+ (B*C-(D/E^F)*G)*H
/*
Trial Expressions are:
(A+B^(X*Y+Z))/(C+D)-(D*E)
(a+b/(c-d))*f^e
a-b+c*d/f/g*h-s+k
a+b*(c^d-e)^(f+g*h)-i
(R/(I-T+K))-M*X+(P*Y/Q^S)^D^E-F
(a+b/(c-d*(x+y/(p+q))))*f^e
*/
#include... | ALGO | 0.999855 | 4.458719 |
c2f7ad5b-d00d-4b09-b502-be8815d2dd62 | tx19980520/Implement-the-algorithm-with-c-- | Eratosthenes.cpp | #include <cmath>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int num;
cout << "confirm you num" << endl;
cin >> num;
vector<int> prime;
prime.clear();
int num_of_prime = 0;
int *all = new int[num + 1];
for (int i = 1; i <= num; ++i) {
all[i] = i;
}
for (int i = 2; i <... | ALGO | 0.999895 | 3.580439 |
8a0ab65a-ec93-43fe-9183-4c499f4d214a | miece/inventory | tess-two/jni/com_googlecode_tesseract_android/src/ccmain/fixxht.cpp | #include "mfcpch.h"
#include <string.h>
#include <ctype.h>
#include "params.h"
#include "float2int.h"
#include "tesseractclass.h"
namespace tesseract {
// Fixxht overview.
// Premise: Initial estimate of x-height is adequate most of the time, but
// occasionally it is inco... | ALGO | 0.879411 | 6.739966 |
0426c886-1e05-40df-87e6-ab90a4964ddd | 113bommy/LogicalErrorFixCodeT5 | LogicalErrorFix_metric/ParseError_CodeT5_LineNumber_cpp_source/Problem_56_source_313.cpp | #include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
long long k, q;
set<long long> marked;
map<pair<int, int>, int> dp;
map<long long, int> color;
set<pair<int, int> > bad_edge = {{1, 1}, {2, 2}, {3, 3}, {4, 4},
{5, 5}, {6, 6}, {1, 2}, {2, 1},
{3, 4}, {4, 3}, {5, 6}, {6, 5}};
int add(int a, int b) { re... | ALGO | 0.999853 | 4.480507 |
0202cb4a-337b-415f-b3f6-b40720341835 | tfygg/opencv | modules/legacy/src/enteringblobdetection.cpp | /*
This file implements the virtual interface defined as "CvBlobDetector".
This implementation based on a simple algorithm:
A new blob is detected when several successive frames contains connected components
which have uniform motion not at an unreasonably high speed.
Separation from border and already tracked blobs ar... | ALGO | 0.998658 | 5.848119 |
19ddb49b-4e3a-4192-912c-c68d39734164 | ishandutta2007/codeforces | reyna/normal/930/B.cpp | // In the name of God
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#incl... | ALGO | 0.999247 | 3.544792 |
977dade3-8ea8-4047-ac36-cffa028af217 | kyomin/algorithm | Baekjoon/9507.cpp | #include <iostream>
using namespace std;
typedef unsigned long long ll;
ll dp[68];
void koong() {
// ڸ ش
dp[0] = 1;
dp[1] = 1;
dp[2] = 2;
dp[3] = 4;
// ä
for (int n = 4; n <= 67; n++)
dp[n] = dp[n - 1] + dp[n - 2] + dp[n - 3] + dp[n - 4];
}
int main() {
cin.tie(NULL);
ios::sync_with_stdio(false);
... | ALGO | 0.999905 | 4.527835 |
928b75d2-9af4-4694-8262-82a42f579fc3 | minaamfasihi/competitive-programming | LeetCode/best-time-to-buy-and-sell-stock.cpp | int maxProfit(vector<int>& prices) {
int minSoFar = INT_MAX, maxProfit = 0;
for (auto& i : prices) {
if (minSoFar >= i) minSoFar = i;
int max_i = i - minSoFar;
if (max_i > maxProfit) maxProfit = max_i;
}
return maxProfit;
}
| ALGO | 0.99875 | 6.212417 |
c2641ad9-d6c8-4dc8-8d43-5e9c01c5361d | Aryan-ki-codepanti/sem6-cg-prac | lab_4_p2_midpt_circle.cpp | #include <iostream>
#include <graphics.h>
#include <cmath>
using namespace std;
void plot_circle_points(int x, int y, int center_x, int centre_y, int color)
{
putpixel(center_x + x, centre_y + y, color);
putpixel(center_x + x, centre_y - y, color);
putpixel(center_x - x, centre_y + y, color);
putpixel... | ALGO | 0.978642 | 4.382014 |
59020b21-688a-467e-ac48-01d482a35281 | divyeshp07/contact_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.9988 | 6.76073 |
f7b61c55-6cb7-447c-a0d1-4a0f61bd0212 | PhamTuanHung3011/tonghop | fchat1/demolearn/hello_word/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.997975 | 6.785645 |
a684f2cf-f799-42ae-b1fa-9ec32ea10b05 | Romi-776/DSA_Practice_and_Notes | DSASheets/Striver/Tree/bottomViewOfBTree.cpp | // Similarly it can be done using BFS traversal by storing only col and changing the node in map
// at each col as new node will come for the same level
// Using DFS Traversal
// T.C = O(NlogN), S.C = O(N)
map<int, pair<int, int>> mp;
void pre(Node *root, int col, int level)
{
if (root)
{
// if this ... | ALGO | 0.999991 | 6.042642 |
3cccc2d9-40eb-4d7f-9254-29fb24e9b2a7 | 2013612/CP-algorithm | AtCoder/abc357/abc357B.cpp | #include<iostream>
using namespace std;
int main() {
string s;
cin >> s;
int cnt = 0;
for (int i = 0; i < s.size(); i++) {
cnt += s[i] <= 'Z';
}
string t;
for (int i = 0; i < s.size(); i++) {
if (cnt > s.size() / 2) {
if (s[i] <= 'Z') {
t.push_back(s[i]);
} else {
t.push_back(s[i] ^ 32);
... | ALGO | 0.999914 | 4.101109 |
965ce472-e14a-41b1-92b4-56ef1ea4fed6 | OmkarPrabhu08/Embedded_Machine_Vision | Omkar_Prabhu_Exercise_3/Question_3/Code/Diff.cpp | #include <opencv2/highgui/highgui.hpp>
#include <opencv2/video/background_segm.hpp>
#include "opencv2/opencv.hpp"
#include <iostream>
#include "opencv2/imgproc/imgproc.hpp"
#include <opencv2/core/core.hpp>
#include <string>
#include <stdio.h>
#include <opencv/highgui.h>
#include <opencv2/video/background_segm.hpp>
usin... | TOOL | 0.88979 | 3.978561 |
5671f263-0129-4d9c-ab29-29b9bdf364e2 | Awadesh365/DSA | Learning stuffs/Two Pointers/CF Edu/Step 2/A_Segment_with_Small_Sum.cpp | /* Awadesh Nautiyal */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
// For debugging
/*-------------------------------------------------*/
#ifndef ONLINE_JUDGE
#define debug(x) \
cerr << #x << " "; \
_print(x); \
... | ALGO | 0.999943 | 3.941285 |
cd552dc5-4d01-4f6d-9b1f-117696273d99 | NirobNabil/CP | assignments/algo/assignment 1/2019331084/Task 1/BFS_Without_Queue.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vv vector<int>
#define pp pair<int,int>
#define pb(x) push_back(x)
#define in(x) insert(x)
#define del(x) erase(x)
#define emp(x) emplace_back(x)
#define mt make_tuple
#define X first
#define Y second
#define A begin
#define B end
#define... | ALGO | 0.999539 | 4.410345 |
5403a33e-9e16-4dd1-8949-d02dd3094fd2 | AnishGuruvelli/miniature-fiesta | hashmaps/howManyNoSmallerThanCurrent.cpp | class Solution
{
public:
vector<int> smallerNumbersThanCurrent(vector<int> &nums)
{
// vector<int> ans = nums;
// unordered_map<int, int> mp;
// sort(ans.begin(), ans.end());
// for (int i = 0; i < ans.size(); i++)
// if (mp.find(ans[i]) == mp.end())
// ... | ALGO | 0.999956 | 5.425753 |
767c1926-442d-477d-bb07-702a9f5fa1e2 | JosafatV/Proyecto1-Analisis | code/src/main.cpp | /**
* Copyright (C) 2018
* Área Académica de Ingeniería en Computadoras, TEC, Costa Rica
*
* This file is part of the numerical analysis lecture CE3102 at TEC
*
* @Author: Pablo Alvarado
* @Date : 24.03.2018
*/
#include <cstdlib>
#include <string>
#include <iostream>
#include <algorithm>
#include <boost/prog... | ALGO | 0.989006 | 6.189745 |
5c51e191-64fe-4045-b89d-40fc0d4db0a1 | funcdfs/Algorithm | 2021/03-背包问题/05-数字组合.cpp | // Problem: 数字组合
// Contest: AcWing
// URL: https://www.acwing.com/problem/content/280/
// date: 2022-07-23 16:11:21
// Memory Limit: 64 MB
// Time Limit: 1000 ms
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int N = 10010;
int n, m;
int f[N];
int main() {
cin >> n >> m... | ALGO | 0.999974 | 4.777318 |
bf63079d-d8f1-48d1-8fa9-ad1b37dab602 | Ravikisha/CodeArchive | GeeksForGeeks/PrintMatrixInSnakePattern.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
// Function to return list of integers visited in snake pattern in matrix.
vector<int> snakePattern(vector<vector<int>> matrix)
{
vector<int> result;
for (int i = 0; i < matr... | ALGO | 0.999965 | 6.421916 |
a0fe1730-dafa-41cd-bb4f-194c3e13bb26 | w3void/discrete-math-in-c | graphs_algorithms/dijkstra_shortest_path.cpp | // Programs for finding shortest path
#include <stdio.h>
#include <limits.h>
#define MAX 100
#define INF 99999
int graph[MAX][MAX];
int vertices;
void dijkstra(int src)
{
int dist[MAX], visited[MAX];
for (int i = 0; i < vertices; i++)
{
dist[i] = INF;
visited[i] = 0;
}
dist[src] = 0;
for (int ... | ALGO | 0.999981 | 4.44948 |
ae501f42-bbf5-4c3e-9583-0ae6ea9e25c6 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-gpt4/Codenet/p00891/302423662/response_8.cpp | #include <iostream>
#include <vector>
#include <unordered_set>
#define N 3
typedef unsigned long long ull;
const int MAX_SIZE = 1010;
int im[MAX_SIZE][MAX_SIZE], pa[110][110];
int w, h, p, ans;
std::unordered_set<ull> used;
ull roll[1001][1001] = {};
inline void ppp() {
ull a = 0;
for (int i = 0; i < p; i++)
... | ALGO | 0.997678 | 3.54388 |
6cf8a2f1-a45d-4bc8-b924-ba11fc838343 | Anik-Modak/CompetitiveProgramming | Codeforces/Vitamins.cf.cpp | //Anik_Modak
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, cost;
cin>>n;
string s;
int a, b, c, ab, bc, ca, abc;
a = b = c = ab = bc = ca = abc = 300005;
while(n--)
{
cin>>cost>>s;
if(s == "A") a = min(a,cost);
else if(s == "B") b = min(b,cost);
... | ALGO | 0.999437 | 4.084098 |
404c89e5-0d3b-4f90-9927-4b641256f099 | jash459/DSA-BUSTED | Solved Count Ways To Build Good Strings.cpp | class Solution {
public:
int countGoodStrings(int low, int high, int zero, int one) {
unordered_map<int, int> dp;
dp[0] = 1;
int mod = 1e9 + 7;
for (int i = 1; i <= high; i++) {
int valid_strings_ending_with_zero = dp.count(i - zero) ? dp[i - zero] : 0;
... | ALGO | 0.999825 | 5.922863 |
3afc8493-ddcf-44b3-99aa-c4d6d6f5bc9e | perfectpencil/Triangles-OOP | main.cpp | #include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
using namespace std;
struct Distances {
private:
int x1,x2, x3;
int y1, y2, y3;
};
double Distance(int x1,int y1, int x2, int y2){
int x,y;
double distance;
distance = sqrt(pow((x2-x1),2) + pow((y2-y1),2));
return dist... | ALGO | 0.999474 | 4.291777 |
573923f8-3be4-4012-912e-29c3bf2e60e9 | IdotMaster1/peercoin | src/base58.cpp | #include <base58.h>
#include <hash.h>
#include <uint256.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <assert.h>
#include <string.h>
#include <limits>
/** All alphanumeric characters except for "0", "I", "O", and "l" */
static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghi... | TOOL | 0.911258 | 7.325682 |
7306af12-8bf5-48e7-94fa-26c2282483d7 | TrMTan/DSA-PTIT | ctdlgt codeptit/DSA05023 tong cac xau con.cpp | #include<bits/stdc++.h>
using namespace std;
void check(){
string s; cin >> s;
long long f[101] = {}, kq = 0;
f[0] = s[0] - '0';
kq = f[0];
for(int i = 1; i < s.length(); i++){
int t = s[i] - '0';
f[i] = f[i - 1] * 10 + t * (i + 1);
kq += f[i];
}
cout << kq;
}
int main(){
int t; cin >> t;
while(t--){... | ALGO | 0.999848 | 4.764193 |
a8385c7a-791a-46e3-9a08-2771a2b90e41 | bokutotu/atcoder | ABC/124/c.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
long long onecouter = 0, zerocounter = 0;
std::string number;
std::cin >> number;
int length = number.length();
char idx = '0';
for (long long i = 0; i < length; i++) {
if (number[i] == idx) zerocounter++;
if ... | ALGO | 0.999864 | 4.53977 |
16e862e8-7b33-4fe1-9ecc-94cc98013478 | Bhaveshpetkar3/leetcode | 0103-binary-tree-zigzag-level-order-traversal/0103-binary-tree-zigzag-level-order-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.999995 | 6.104183 |
12b5ba9b-fdf6-4764-93b2-622a0b5ebb67 | MikaelVallenet/R-Type | libs/boost/libs/hana/example/sort.cpp | #include <boost/hana/assert.hpp>
#include <boost/hana/equal.hpp>
#include <boost/hana/front.hpp>
#include <boost/hana/greater.hpp>
#include <boost/hana/integral_constant.hpp>
#include <boost/hana/negate.hpp>
#include <boost/hana/ordering.hpp>
#include <boost/hana/sort.hpp>
#include <boost/hana/tuple.hpp>
#include <str... | TEST | 0.995665 | 6.693691 |
4ff56cf5-e97d-4e5d-9c00-d980715db4f5 | ishandutta2007/codeforces | lucaperju/normal/1426/F.cpp | #include <bits/stdc++.h>
using namespace std;
char v[200005];
const long long mod=1000000007;
long long dp[5][5];
int main ()
{
ios_base::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
long long t,i,j,k=0,n,q,m;
cin>>n;
for(i=1;i<=n;++i)
{
cin>>v[i];
if(v[i]=='?')
++... | ALGO | 0.999986 | 3.853235 |
f7ceaa03-1a8c-47da-ad71-06d6f7af3e62 | Vivashwan/LeetCodes | 0309-best-time-to-buy-and-sell-stock-with-cooldown/0309-best-time-to-buy-and-sell-stock-with-cooldown.cpp | class Solution {
private:
int func(vector<int>&prices, int n)
{
vector<int>next1(2, 0), next(2, 0), curr(2, 0);
for(int ind=n-1; ind>=0; ind--)
{
for(int bought=0; bought<=1; bought++)
{
int profit;
if(bought==0)
{
... | ALGO | 0.999849 | 6.114243 |
ba4ece28-e760-4cd0-8e0b-c328b50c5787 | rhythmus-emulator/rhythmus | src/LR2/exdxa.cpp | // exdxa.cpp, v1.01 2012/02/22
// coded by asmodean
// modified / modulized by @lazykuna
// contact:
// web: http://asmodean.reverse.net
// email: asmodean [at] hush.com
// irc: asmodean on efnet (irc.efnet.net)
// This tool extracts *.dxa archives.
#include "exdxa.h"
#include "common.h"
#include <stdio.h... | TOOL | 0.891596 | 4.332899 |
f36a7bcd-d2c4-40d1-9c89-1c542c5264f1 | SasiDharKM/DataStructures | Well_formed.cpp | /**This is a program to check if an expression is well formed**/
#include <iostream>
using namespace std;
int top =-1;
char stack[50];
void push(char s){
top++;
stack[top]=s;
}
char pop(){
char temp='\0';
if(top ==-1){
cout<<"not well formed";
exit(0);
}
else {
temp =... | ALGO | 0.997942 | 4.506925 |
c905c592-dba7-46aa-814a-65b9110abc54 | imhansf/triOrder | animorder/ReOrder.cpp | #include "ReOrder.h"
#define MAXIteration 10
class patchSort
{
public:
float dist;// distance
int id;//index
};
class clusterAssign
{
public:
int frameId;
int viewId;
};
bool sortPatch(const patchSort &a, const patchSort &b)
{
return a.dist < b.dist;
}
ReOrder::ReOrder(float lamda, int CacheSize, int numClusters,... | ALGO | 0.999271 | 3.863247 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.