uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7cc3bb68-ca40-4fda-8318-cce731467bc9 | mnish-kumar/C-DSA | Arrays, Time Complexity & Space Complexity/intro.cpp | #include<iostream>
#include<limits.h>
using namespace std;
// void Print(int arr[] , int size){
// for (int index = 0; index < size; index++)
// {
// cout<<arr[index]<<" ";
// }
// }
// bool CheckTraget(int arr[] , int size , int target){
// // right to left ke liye
// for (int i = size-1; ... | ALGO | 0.999029 | 4.086228 |
aa933d60-8e82-4f6e-a0d9-53ce37dabbf5 | Sakshy18/basics | Arrays/selection_sort.cpp | //find min element and swap it with 1st element
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n]; // 12,45,23,51,19,8
int find;
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
... | ALGO | 0.99994 | 3.66674 |
100779b2-bafa-48c2-96d6-b735c1845a98 | MahirSez/problem-solving | codeforces/1401/F.cpp | #include <bits/stdc++.h>
#define ll long long int
#define uu first
#define vv second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
con... | ALGO | 0.999908 | 4.169935 |
416aa8d9-1b5a-481b-8efa-cbe12dd15fd2 | jpostel/FreeBSD-mirror | crypto/openssl/crypto/ripemd/asm/rips.cpp | //
// gettsc.inl
//
// gives access to the Pentium's (secret) cycle counter
//
// This software was written by Leonard Janke (<EMAIL>)
// in 1996-7 and is entered, by him, into the public domain.
#if defined(__WATCOMC__)
void GetTSC(unsigned long&);
#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [ed... | TOOL | 0.870363 | 4.048019 |
37b1d85c-528c-4845-bfcd-8578bf70154d | anushree104120/DSA-questions | Least Prime Factor - GFG/least-prime-factor.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
vector<int> leastPrimeFactor(int n) {
// code here
vector<int> ans(n+1,0);
ans[1]=1;
for(int i=2;i<=n;i... | ALGO | 0.999749 | 5.697709 |
5543646f-f819-4d5b-8c6c-81b80cddc385 | xinghun61/chromium-llvm-project-libcxxabi | src/fallback_malloc.cpp | // Define _LIBCPP_BUILDING_LIBRARY to ensure _LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
// is only defined when libc aligned allocation is not available.
#define _LIBCPP_BUILDING_LIBRARY
#include "fallback_malloc.h"
#include <__threading_support>
#ifndef _LIBCXXABI_HAS_NO_THREADS
#if defined(__unix__) && !defined(__AND... | TOOL | 0.876586 | 7.580986 |
6bff483b-6b4f-4e61-8406-19fb8c4e9865 | ishandutta2007/codeforces | hitman623/normal/867/A.cpp | #include <bits/stdc++.h>
#define pb push_back
#define long long long
#define pll pair < long , long >
#define vll vector < pll >
#define ml map < long , long >
#define mll map < pll , long >
#define x first
#define y second
#define vl vector < long >
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NU... | ALGO | 0.999759 | 3.118932 |
71963d89-5fdd-4d97-bcda-1ccdc8f1b476 | LEVELONCODER/levelontest | levelontests/TaskSeven.cpp | #include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main() {
int x, y;
cout<<"Введите N: "; cin>>x;
cout<<endl;
cout<<"Введите степень K: "<<endl; cin>>y;
int result = pow(x, y);
cout<<"Сумма: "<<result<<endl;
return 0;
} | ALGO | 0.998951 | 4.261692 |
57f531f8-ff09-4454-af14-62350317a81e | Madaoby/111 | map/search_api.cpp | #include "map/search_api.hpp"
#include "map/bookmarks_search_params.hpp"
#include "map/everywhere_search_params.hpp"
#include "search/geometry_utils.hpp"
#include "search/utils.hpp"
#include "storage/downloader_search_params.hpp"
#include "platform/preferred_languages.hpp"
#include "geometry/mercator.hpp"
#includ... | WEB | 0.954962 | 3.178041 |
4350d898-a05b-4b35-974a-8c417483ad3e | ShashiSingh8434/Cpp-and-DSA-Practice-Codes | _027_Input_Output_of_2D_Matrix.cpp | #include <iostream>
using namespace std;
int main(){
// See the initialisation carefully 😉
int row=3, col=3, arr[row][col];
cout<<"Enter the elements of the matrix:-"<<endl;
// Taking the input
for (int i = 0; i < row; i++){
for (int j = 0; j < col; j++){
cin>>arr[i][j];
... | ALGO | 0.97584 | 3.646667 |
07225692-56ed-4ec3-9276-125ff6e618e3 | jatin69/coding-practice | leetcode/algorithms/two-pointer/n-sum-problem/Q15-3Sum.cpp | /*
* Author : Jatin Rohilla
* Date : June-July-2019
*
* Compiler : g++ 5.1.0
* flags : -std=c++14
*/
#include<bits/stdc++.h>
using namespace std;
// source code here
class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
if(nums.size() < 3){
return {};
}
... | ALGO | 0.99976 | 5.488895 |
f94b7afc-7f48-4fd9-86fe-f00d39474241 | TRAN-THUY-NGOC/UPCODER | UPCODER/Other/[CTDL17]QT03.cpp | #include <iostream>
using namespace std;
struct Node {
char data;
Node* next;
Node(char c): data(c), next(nullptr) {}
};
struct LinkedList {
Node* head;
LinkedList(): head(nullptr) {}
void add(char c) {
Node* node = new Node(c);
Node* tmp = this->head;
if (tmp == null... | ALGO | 0.999114 | 4.535494 |
86fb76e7-8001-4732-a012-acc7f0eefeac | kareemessam09/Problems_Solved | OLD/queue.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mx 100000
#define all(x) (x).begin(), (x).end()
#define KemOn09() ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define isEven(n) (n % 2 ==0)
int main() {
KemOn09();
int n;
cin>>n;
long long c;
queue<int> q;
int a;
while (n--)
{
... | ALGO | 0.999587 | 4.153971 |
dcc95a93-74ea-48f5-8c51-130ce91208ea | iitpparshant/dsa_practice | Heaps/Final Array State After K Multiplication Operations II.cpp | // https://leetcode.com/problems/final-array-state-after-k-multiplication-operations-ii/description/
// 3266. Final Array State After K Multiplication Operations II
class Solution {
public:
long long po(long long x,long long y,long long p) {
long long res = 1;
x = x % p;
while (y > 0) {
if (y & 1)... | ALGO | 0.999997 | 5.673894 |
6118c418-eb1e-4a3f-9f90-78df92d798c0 | WJ-self/algorithm | .history/acwing/basic/数学知识/约数/870_约数个数_20230903183110.cpp | #include<bits/stdc++.h>
using namespace std;
unordered_map<int,int> mp;
const int md = 7+1e9;
typedef long long LL;
int n,x;
void divide(int x){
if(x < 2) return ;
for (int i=2; i<=x/i; i++) {
while(x % i == 0){
}
}
}
int main() {
cin >> n;
for(int i=0; i<n; i++) {
cin >>... | ALGO | 0.999963 | 4.263171 |
3a92f4d1-9b4c-46db-bedf-c7a552c3f803 | ishandutta2007/codeforces | roundgod/normal/985/A.cpp | #include<bits/stdc++.h>
#define MAXN 100005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,k,a[MAXN];
int main()
{
scanf("%d",&n);
int res=0;
for(int i=0;i<n/2;i++)
scanf("%d",&a[i]);
sort(a,a+n/2);
int ans=... | ALGO | 0.999857 | 3.693827 |
41252fde-a71d-4f81-8379-91e187be6f16 | ljmf00/lldb-d | lld/MachO/ExportTrie.cpp | #include "ExportTrie.h"
#include "Symbols.h"
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Memory.h"
#include "llvm/ADT/Optional.h"
#include "llvm/BinaryFormat/MachO.h"
#include "llvm/Support/LEB128.h"
using namespace llvm;
using namespace lld;
using namespace lld::macho;
namespace {
struct Edge {
Edg... | TOOL | 0.903243 | 7.440341 |
860dade5-4cf2-4bd8-9a83-a2e3a17b677d | thebesttv/vul-llvm | libcxx/test/std/algorithms/numeric.ops/transform.reduce/pstl.transform_reduce.binary.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: libcpp-has-no-incomplete-pstl
// <algorithm>
// template<class ExecutionPolicy,
// class ForwardIterator1, class ForwardIterator2, class T>
// T transform_reduce(ExecutionPolicy&& exec,
// ForwardIterator1 first1, ForwardIterator1 la... | TEST | 0.964715 | 6.789981 |
f790e774-31b7-49a0-a8a6-3b5017e8a8ce | Nuyoahwjl/HUST-CS | 算法设计与分析/算法设计与分析实践/code/25_P3373❌/ans.cpp | #include <iostream>
#include <vector>
using namespace std;
class SegmentTree {
public:
SegmentTree(int n, int mod) : n(n), mod(mod) {
tree.resize(4 * n, 0);
lazy_add.resize(4 * n, 0);
lazy_mul.resize(4 * n, 1);
}
// 构建线段树
void build(const vector<int>& arr, int v, int tl, int tr... | ALGO | 0.999902 | 5.581189 |
69c32e81-3d9c-4585-977f-a1903993e18e | danielbociat/AlgoLabETH | Week07/H1N1/main.cpp | #include <iostream>
#include <queue>
#include <limits>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_face_base_with_info_2.h>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/squared_distance_2.h>
#include <CGAL/Gmpq.h>
#include <CGAL/utils.h>
typedef CGAL::Exac... | ALGO | 0.999608 | 5.513323 |
5848c378-7fd6-420e-bac6-77c3218c9e64 | albee/rattle-iros-2022 | rattle_rrt/bullet3/examples/Planar2D/Planar2D.cpp | #include "BulletCollision/CollisionShapes/btBox2dShape.h"
#include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h"
#include "BulletCollision/Collision... | ALGO | 0.879884 | 5.832932 |
8b447997-1628-460c-adfd-777557d74993 | tanuki-no/Egg-CommandLine | source/processor.cpp | #include <sstream>
#include <egg/commandline/processor.hpp>
#include <egg/commandline/utility.hpp>
namespace egg
{
namespace commandline
{
processor::processor(
const egg::commandline::description& theDescription,
const egg::commandline::options& theOptions,
const bool optionsFirst)
: _descriptio... | TOOL | 0.884281 | 6.270641 |
fd6101a2-6a57-4a8d-921e-6f1536799d7d | JackMerma/competitivo | csunsa/segundo.cpp | // @author : jinnbit
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define ll long long
#define ld long double
#define endl "\n"
#define PI 3.1415926535897932384626
const ll inf = (ll) 1e12;
//cin.ignore();
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
l... | ALGO | 0.999949 | 3.992318 |
50de9af8-d122-455f-8b8f-3327a0da0250 | amankumar6/CPP | practice/7/7.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
int x=1;
cout<<"Enter the number: ";
cin>>n;
for (int i = 1; i <=n; i++)
{
x=x*i;
}
cout<<"Factorial of "<<n<<" is "<<x<<endl;
return 0;
}
| ALGO | 0.999913 | 3.759926 |
2605a5b9-410c-4d27-b02a-d4d05942fb1f | uier/online_judge_code | toj/Pro8.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int n;
while ( cin >> n )
{
cin.get();
string s;
getline(cin,s);
int len=s.size(), row=0;
for ( int i=0; i<n; i++ )
for ( int j=i; j<len; j+=n )
cout << s[j];
cout << endl;
}
return 0;
} | ALGO | 0.99897 | 3.299204 |
15e962ba-68cf-4e80-af5a-12efc1ad85db | avamirm/Network-Routing-Protocols | src/network.cpp | #include "network.hpp"
#include "errors.hpp"
#include <chrono>
#include <sstream>
#include <iostream>
#include <iomanip>
Network::Network()
{
// nodes = set<int>();
// weights = map<pair<int, int>, int>();
}
int getDigitCount(int x)
{
if (x == 0)
return 1;
int res = 0;
while (x)
{
... | ALGO | 0.993078 | 3.627104 |
8c63dbd4-3492-4896-a265-ab91fd39bc0a | RealityVirtually2019/ComposAR | CNNServer/Fusion/3rdparty/libigl/include/igl/random_dir.cpp | IGL_INLINE Eigen::Vector3d igl::random_dir()
{
using namespace Eigen;
double z = (double)rand() / (double)RAND_MAX*2.0 - 1.0;
double t = (double)rand() / (double)RAND_MAX*2.0*PI;
// http://www.altdevblogaday.com/2012/05/03/generating-uniformly-distributed-points-on-sphere/
double r = sqrt(1.0-z*z);
double... | ALGO | 0.996637 | 5.783068 |
11259b8a-46c7-4b2a-8afc-b0836c84f5ce | qhb1001/For-that-dream | 紫书/第九章 dp/qhb/2_failed.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int dp[41][41][41][41][5];
int h, candy[41][4];
int len[41][41][41][41], ans[41][41][41][41];
void in() {
for (int i = 1; i <= h; ++i)
for (int j = 1; j <= 4; ++j)
cin >> candy[i][j];
}
bool isHaveCandy(int a, int b, int c, int d, int... | ALGO | 0.999773 | 3.427147 |
73d66b5b-38ec-4c3c-a6dc-0bc51ceceef0 | apcel/apcel | iitc-bot/multiplePortals.cpp | #include "multiplePortals.h"
bool multiplePortals::acceptGEOJSON(std::string geoJSONString) {
// rapidjson::Document geoJSON;
// geoJSON.Parse(geoJSONString.c_str());
std::cerr << "Not implemented!" << std::endl;
exit(1);
return true;
}
bool multiplePortals::acceptIITCPolygon(std::string copyPoly... | ALGO | 0.974326 | 4.331147 |
26b9b06f-d3aa-4a10-b007-b09da7af3c75 | krishkhinchi/140daysDSAofseries | Day8/Question2.cpp | // Calculator using switch
#include <iostream>
using namespace std;
int main(){
int num1,num2;
char Operator;
cout << "Enter first number: ";
cin >> num1;
cout << "Enter operator: ";
cin >> Operator;
cout << "Enter second number: ";
cin >> num2;
switch(Operator){
case '+':... | TOOL | 0.872167 | 4.392715 |
b428144d-0bbe-418f-9b08-7f2508a28f5e | ARIF-00/DS-Algo | heap stack queue/heapways.cpp | #include <bits/stdc++.h>
using namespace std;
int solve(int A) {
const long long mod = 1e9 + 7;
vector<long long> facts(A + 1, 1);
for(int i = 2; i < A + 1; i++)
facts[i] = (i * facts[i - 1])%mod;
function<long long(long long , long long)> binpow = [&](long long b, long long p) -> long l... | ALGO | 0.999992 | 4.991836 |
b3edf2d2-07d2-4510-b166-4736f66dcbf7 | shay-ff/cpp-files | grand/Counting_Numbers.cpp | /**
* created: 2025-04-11 03:35:29
**/
#include<bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#include "../debug.cpp"
#else
#define debug(...)
#define debugArr(...)
#endif
#define int long long
#define show(x) cout << x << endl
#define sz(x) (int)(x.size())
int dp[20][2][2];
int find(string &lim, int idx,... | ALGO | 0.99949 | 4.715577 |
570a2e0e-e387-4b3f-b4fb-89de439094fb | ikj/ikeMum | src/ike/rembrandt.cpp | #include "JoeWithModels.h"
#include "JOE/ADJOINT_FILES/JoeWithModelsAD.h"
#include "adolc.h"
//#include "IkeTurbModel_KOM.h"
//#include "turbModels/TurbModel_KOM.h"
//#include "ADJOINT_FILES/TurbModel_KOM_AD.h"
#include "IkeWithPsALC.h"
#include <sstream>
#include <complex>
#include <stdexcept>
#include <iomanip>
... | ALGO | 0.995112 | 3.377478 |
e1846901-4e05-4bca-ba62-63ad294f6ef7 | MahirSez/problem-solving | codeforces/1186/D.cpp | #include <bits/stdc++.h>
#define ll long long int
#define PI acos(-1)
#define read freopen("in.txt","r",stdin)
#define uu first
#define vv second
#define write freopen("out.txt","w",stdout)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define INF ... | ALGO | 0.999992 | 3.744313 |
66175971-1498-4a96-b896-f44f8b51e035 | huaxiufeng/leetcode | src/algorithm/cpp/anagrams/main.cpp | /*
Given an array of strings, group anagrams together.
For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"],
Return:
[
["ate", "eat","tea"],
["nat","tan"],
["bat"]
]
Note:
For the return value, each inner list's elements must follow the lexicographic order.
All inputs will be in lower-case.
Update (2015-08-... | ALGO | 0.999985 | 6.395525 |
683acc6f-546a-4c04-8b30-3e95df766404 | vinayak1407/GDB-Compiler | recursion/Aggressive Rows Code/main.cpp | #include <iostream>
using namespace std;
bool canPlaceBirds(int B,int N,vector<int> nests, int sep)
{
int birds = 1;
int location = nests[0];
for(int i = 1; i<=N-1;i++)
{
int current_location = nests[i];
if(current_location - location >= sep)
{
birds ++;
... | ALGO | 0.999992 | 5.175751 |
e2aa790b-a953-4691-9267-c01caf5bbd0e | mynew4/pvelich | src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp | /* ScriptData
SDName: mob_anubisath_sentinel
SD%Complete: 95
SDComment: Shadow storm is not properly implemented in core it should only target ppl outside of melee range.
SDCategory: Temple of Ahn'Qiraj
EndScriptData */
#include "ScriptPCH.h"
#include "WorldPacket.h"
#include "Item.h"
#include "Player.h"
#include "Sp... | TOOL | 0.892188 | 5.709613 |
b5330f5d-9669-4633-b65e-3744528c1d50 | RyoSci/AtCoder | 競技プログラミングの鉄則 演習問題集/A25.cpp | // #define _GLIBCXX_DEBUG
#include <algorithm>
#include <atcoder/all>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using namespace atcoder;
using lli = long long;
// usin... | ALGO | 0.998922 | 4.813724 |
74caf395-d2d1-490f-8edb-16a07817a7e2 | raincross7/code-similarity | codes/train_code/problem061/problem061_75.cpp | #include <iostream>
#include <string>
using namespace std;
int main(int argc, char* argv[]) {
string s;
cin >> s;
long long K;
cin >> K;
s += s + s;
long long base = 0;
bool changed[s.size()];
changed[0] = false;
for (int i = 1; i < s.size() / 3; ++i) {
if (s[i] == s[i - 1] && !changed[i - 1]... | ALGO | 0.999498 | 4.013296 |
5e621060-3ec4-498c-93fb-e96d9346279d | SabinaRachev/3DAnimationCourse-ass1 | igl/ray_mesh_intersect.cpp | extern "C"
{
#include "raytri.c"
}
template <
typename Derivedsource,
typename Deriveddir,
typename DerivedV,
typename DerivedF>
IGL_INLINE bool igl::ray_mesh_intersect(
const Eigen::MatrixBase<Derivedsource> & s,
const Eigen::MatrixBase<Deriveddir> & dir,
const Eigen::MatrixBase<DerivedV> & V,
const E... | ALGO | 0.954444 | 6.905438 |
b17c528a-89ac-448d-8c06-f8f85f0f730b | snumrl/ys2010 | PyCommon/external_libraries/VirtualPhysics2010/vpLib/vpWorld.cpp | #include <VP/vpWorld.h>
#include <VP/vpBody.h>
#include <VP/vpJoint.h>
#include <VP/vpSystem.h>
#include <VP/vpSingleSystem.h>
#include <VP/vpSpring.h>
#include <VP/vpMaterial.h>
#include <VP/vpPrimitiveCollisionDetector.h>
#include <VP/vpIntegrator.h>
#include <stdio.h>
#include <stdarg.h>
#ifndef max
#define max(a... | TOOL | 0.946007 | 5.229122 |
1e8d43ad-009b-4a69-afff-a1b66a25180f | wrobel546/Rownolegle-CUDA | source/summary.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <iomanip>
#include <filesystem>
#include <algorithm>
struct Result {
int n;
double time;
double best;
};
std::vector<Result> load_results(const std::string& filename) {
std::vector<Result> results;
... | TOOL | 0.986862 | 5.786397 |
65e650d6-952f-43c0-be60-bcc79821c81e | Ash590034/Codechef | Packaging_Cupcakes.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int a;
cin>>a;
int maxi=INT_MIN;
int ans=-1;
for(int i=1;i<=a;i++){
if(a%i>=maxi){
maxi=a%i;
ans=i;
}
}
cout<<a... | ALGO | 0.999903 | 3.880372 |
dd0b56f5-344e-4f77-b727-4fdae4ebd140 | XiangdongGu/icensmis | src/loglikA.cpp | #include <Rcpp.h>
using namespace Rcpp;
// parameterization type A
// parm[j] is change in cumulative incidence in time period j
// parm[j] = log(S[j]) - log(S[j+1]), where S[0] = 1
// This paramerization is inspired by representing survival function as exp(-cumulative hazard)
// [[Rcpp::export]]
double loglikA0(Nume... | ALGO | 0.991628 | 7.174228 |
0274e0bb-4e71-427b-b963-8e9562ce764a | davisnguyen111195/Algorithm | 4_LyThuyetSo/LyThuyetSo28.cpp | // [Hàm, Lý Thuyết Số]. Bài 28. Số Lộc Phát
// Một số được gọi là “lộc phát” nếu chỉ có các chữ số 0,6,8. Nhập vào một số nguyên hãy kiểm tra xem đó có phải số lộc phát hay không. Nếu đúng in ra 1, sai in ra 0.
// bool locphat(long long n){
// }
// int main(){
// long long n; cin >> n;
// if(locphat(n)){... | ALGO | 0.998087 | 4.446681 |
7611a8e1-7189-461e-87c4-2ac9b64c00c3 | s53809/Competition-algorithm | 1620 DFS와 BFS/baekjoon_1620.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
int N, M, V;
std::vector<std::vector<int>> adjList;
bool visited[1001] = { false };
void DFS(int n) {
if (visited[n] == true) return;
std::cout << n << ' ';
visited[n] = true;
for (int node : adjList[n]) {
DFS(node);
}
}
void BFS(int ... | ALGO | 0.99999 | 5.039844 |
d0e2d420-f8fb-4cb1-ac6a-9645e8929808 | Omair95/A_prototype_MPEG-G_encoder | boost_1_66_0/libs/numeric/ublas/doc/samples/vector_slice_project.cpp | #include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/vector_proxy.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
vector<double> v (3);
for (int i = 0; i < 3; ++ i)
project (v, slice (0, 1, 3)) (i) = i;
std::cout << project (v, ... | ALGO | 0.986239 | 3.157517 |
7e7ccf33-09be-401f-9669-c71b3a5f2324 | bccfilkom-cp/codeforces-editorial | 0800/code/1932A-Desta.cpp | #include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
int solve(char path[], int n) {
int ans = 0;
for(int i = 0; i < n; i++){
if(path[i]=='@') ans++;
else if (path[i]=='*'){
if(path[i+1]=='*') break;
}
}
return... | ALGO | 0.999322 | 3.55326 |
7115e5dd-d107-4f9b-a808-6c3becab0087 | carl-221b/mds3d | ray_tracing/mds3d_td1/ext/nanogui/ext/eigen/doc/examples/Tutorial_BlockOperations_print_block.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(4,4);
m << 1, 2, 3, 4,
5, 6, 7, 8,
9,10,11,12,
13,14,15,16;
cout << "Block in the middle" << endl;
cout << m.block<2,2>(1,1) << endl << endl;
for (int i = 1; i <= 3; ++i)
{
cout << "B... | ALGO | 0.98205 | 3.6853 |
166a8011-3a65-481a-932b-b0e8cd637c78 | Abdelrahman122133/scanthis | servers/physics_2d/godot_collision_solver_2d.cpp | /**************************************************************************/
/* godot_collision_solver_2d.cpp */
/**************************************************************************/
/* This file is part of: */
/* ... | ALGO | 0.999808 | 7.567694 |
b67edbe1-ed76-4967-acd5-838a2ede364a | bennettg3362/csc134 | m6lab2_bennett.cpp | #include <iostream>
#include <vector>
using namespace std;
const int RED = 1;
const int BLACK = 0;
int main()
{
vector <int> chamber = {};
chamber.push_back(RED);
chamber.push_back(RED);
chamber.push_back(BLACK);
for (int round : chamber)
{
if (round == RED)
{
c... | ALGO | 0.999371 | 4.718079 |
de792fb9-a66c-4e43-83bb-85c4aa72e935 | baidu-research/hydra-xeye | xcore/crowd_app/leon_rt/matching/linear_assignment.cpp | /******************************************************************************
* __ __ _____ __ __ _____
* \ \ / / | ____| \ \ / / | ____|
* \ \/ / | |__ \ \/ / | |__
* } { | __| \ / | __|
* / /\ \ | |___ / / | |___
* /_/ \_\ |_____| /_/ |_____|... | ALGO | 0.999105 | 6.260185 |
4d2c50a9-b585-45bd-813b-fb14f05682dd | sanchit2843/Datastructure-and-algorithms | dsa_undergrad/Practice/project.cpp | #include <iostream>
using namespace std;
struct Trie
{
struct Trie *children[26];
bool eow;
};
struct Trie *getNode(void)
{
struct Trie *pNode = new Trie;
pNode->eow = false;
for (int i = 0; i < 26; i++)
pNode->children[i] = NULL;
return pNode;
}
void insert(struct Trie *root, string key)
{
struct Trie *... | ALGO | 0.999757 | 3.994271 |
2c95e95d-99b7-429c-bfb9-2a4fa702e9e8 | yang-su2000/CP-Practice | archived/pnyr/k.cpp | #include <bits/stdc++.h>
using namespace std;
// ./run sample.cpp
#define ll long long
int main() {
vector<int> a(6), b(6);
for (int &x: a) cin >> x;
for (int &x: b) cin >> x;
int c1 = 0, c2 = 0;
for (int x: a) {
for (int y: b) {
if (x > y) c1++;
else if (x < y) c2... | ALGO | 0.999131 | 3.507575 |
1ded71a7-2ffa-47d1-9260-c035c8cbaf89 | Lee-ji-soo/algorithm | 훈련 설계/17.마을사람들 찾기.cpp | #include<iostream>
#include<string>
using namespace std;
bool isExist(char c[7], char b){
for(int i = 0;i <6;i++){
if(c[i] == b){
return true;
break;
}
}
return false;
}
int main() {
char c[7] = {"BTKIGZ"};
char t[4] = {""};
for (int i = 0; i<4;i++)... | ALGO | 0.999605 | 3.608789 |
08504a46-d766-432e-87b2-dc0958e32630 | MohiniSarwade/Tree | Construct Tree from Inorder & Preorder.cpp | Node * BT(int pre[], int s, int e, unordered_map<int,int>&mp,int &index)
{
if(s>e)
return NULL;
int x=mp[pre[index]];
struct Node *n=new Node(pre[index]);
index++;
if(s==e)
return n;
n->left=BT(pre,s,x-1,mp,index);
n->right=BT(pre,x+1,e,mp,index);
return n;
}
No... | ALGO | 0.999992 | 5.554684 |
d8ea2529-79b8-4f61-88b6-cd6d32b03661 | Prakash251299/Leetcode | Problems/2971FindPolygonWithTheLargestPerimeter.cpp | class Solution {
public:
long long largestPerimeter(vector<int>& nums) {
vector<long long>v(nums.size()+1,0);
long long max = -1;
sort(nums.begin(),nums.end());
v[0] = nums[0];
v[1] = nums[1]+v[0];
for(int i=2;i<nums.size();i++){
// if(i!=0 && i!=1){
... | ALGO | 0.99917 | 4.909155 |
d05db34a-a81d-4c04-82e0-ec1dac2591be | pranshu27/Leet-solutions | 0074-search-a-2d-matrix/0074-search-a-2d-matrix.cpp | class Solution {
public:
bool searchMatrix(vector<vector<int> > &matrix, int target) {
int n = matrix.size();
int m = matrix[0].size();
int l = 0, r = m * n - 1;
while (l != r){
int mid = (l + r) >> 1;
if (matrix[mid / m][mid % m] < target)
l =... | ALGO | 0.999961 | 6.029974 |
e795abe2-0903-48d1-9f0c-08c5504f09f2 | MohitR1999/cpp-store | Sorting/MergeSort.cpp | #include <iostream>
using namespace std;
// A function to merge the two half into a sorted data.
void Merge(int *a, int low, int high, int mid)
{
// We have low to mid and mid+1 to high already sorted.
int i, j, k, temp[high-low+1];
i = low;
k = 0;
j = mid + 1;
// Merge the two parts into temp[].
while (i ... | ALGO | 0.999978 | 4.86015 |
77321e79-d116-4053-83ad-4f31fc23508a | chiragshrimal/ChiragCodes | c++/array/pascal_tringle.cpp | #include<bits/stdc++.h>
using namespace std;
// brute force apporach
// time complexity O(m*n)
// space complekity is O(n*m)
//Q1
// given row and coloum find element
// 1 st apporach is using recurssion
int f(int row,int coloum){
if(row==1|| coloum==1){
return 1;
}
if(row==coloum){
retu... | ALGO | 0.999812 | 4.306991 |
f7a1171a-480d-48fa-a774-6807e42b9156 | miteshkumar77/LC | balanced-binary-tree/Wrong Answer/12-22-2020, 3:04:41 PM/Solution.cpp | // https://leetcode.com/problems/balanced-binary-tree
/**
* 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) {}
* TreeN... | ALGO | 0.999947 | 6.934763 |
cf57fd0c-f091-479b-b1df-7a941cd4c599 | TianchunH97/LeetCode | Hard/1494_Parallel_Courses_II.cpp | // LeetCode 1494: Parallel Courses II
#include <vector>
using namespace std;
class Solution {
public:
int minNumberOfSemesters(int n, vector<vector<int>>& dependencies, int k) {
vector<int> prereq(n, 0);
for (auto d : dependencies) {
prereq[d[1]-1] |= 1 << (d[0]-1);
}
... | ALGO | 0.999957 | 6.296056 |
42aacf50-bfcc-4699-a71c-494a2d4993e5 | gulls-microlensing/gulls | src/backuppllxLightcurveGenerator.cpp | #include "lightcurveGenerator.h"
#include "backupGenerator.h"
#include "astroFns.h"
#include<time.h>
#include<fstream>
#define DEBUGVAR 0
extern "C"
{
void magfunc_(double *m1, double *a, double *xsCenter, double *ysCenter, double *rs, double *Gamma, double *amp, double *eps, int *errflag);
}
void lightcurveGene... | TOOL | 0.944528 | 4.251622 |
6b895e48-787d-48cc-b789-322e425b0b3e | versenyi98/programming-contests | Kattis/Ab Initio/main.cpp | #include <bits/stdc++.h>
using namespace std;
int AM[4000][4000] = {0};
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
int V, E, Q;
cin >> V >> E >> Q;
bool trans = false;
bool neg = false;
int transV = V;
for (int i = 0; i < 4000; i++) {
for (int j = 0; j < 4000; j... | ALGO | 0.999858 | 4.508166 |
a9f4eefb-e911-45c2-9193-0af1d3f9f4ed | hiteshmewada/LeetHub | Unique Subsets - GFG/unique-subsets.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find all possible unique subsets.
void fun(vector<int> arr, int n, int idx, vector<vector<int>>&res,
vector<int>&subset){
res.push_back(subset);
for(int i... | ALGO | 0.999147 | 6.15384 |
9826c209-7c12-4344-b6a2-f1cff25c7c3f | cppppp/STRANet | VTM_libtorch/VVCSoftware_VTM-VTM-10.2-libtorch/source/Lib/libmd5/libmd5.cpp | #include <stdint.h>
#include <string.h>
#include "libmd5.h"
//! \ingroup libMD5
//! \{
static void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
#ifndef __BIG_ENDIAN__
# define byteReverse(buf, len) /* Nothing */
#else
void byteReverse(uint32_t *buf, unsigned len);
/*
* Note: this code is harmless on lit... | ALGO | 0.989819 | 6.530494 |
08cde388-5fda-475c-9fb4-c5253affb320 | gahara086/AtCorderPromblems-BootCampForBeginners | Hard100/73_2.cpp | #include <bits/stdc++.h>
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset> // bitset
#include <cassert>
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include... | ALGO | 0.999788 | 4.009537 |
00617742-eab3-414d-8412-48cbbb9d9e1d | mathias-dietrich/etiamo_2014 | AudioUnitEffectExample/Source/AUSource/Filter.cpp | #include "AUEffectBase.h"
#include <AudioToolbox/AudioUnitUtilities.h>
#include "FilterVersion.h"
#include "Filter.h"
#include <math.h>
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#pragma mark ____FilterKernel
class FilterKernel : public AUKernelBase // the actual fil... | TOOL | 0.951936 | 5.373672 |
24d4faf7-2275-4677-8595-59642acce288 | kavon/ghc-llvm | lib/Analysis/DominanceFrontier.cpp | #include "llvm/Analysis/DominanceFrontier.h"
#include "llvm/Analysis/DominanceFrontierImpl.h"
#include "llvm/IR/PassManager.h"
using namespace llvm;
namespace llvm {
template class DominanceFrontierBase<BasicBlock>;
template class ForwardDominanceFrontierBase<BasicBlock>;
}
char DominanceFrontierWrapperPass::ID = 0;... | TOOL | 0.980498 | 7.728985 |
83ee11fd-7635-4dae-896d-fba4e7ef14be | deldelda/Box2d-Mods | Box2D/Dynamics/Joints/b2GearJoint.cpp | #include <Box2D/Dynamics/Joints/b2GearJoint.h>
#include <Box2D/Dynamics/Joints/b2RevoluteJoint.h>
#include <Box2D/Dynamics/Joints/b2PrismaticJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Gear Joint:
// C0 = (coordinate1 + ratio * coordinate2)_initial
// C = C0 - (cordinate1 + ra... | ALGO | 0.939992 | 6.55923 |
faef2b81-43c3-49b6-a9d6-0c71c0b588c7 | vineethm1627/CPP | Fork CPP/02 Arrays and Strings/even_subset_sum.cpp | #include<bits/stdc++.h>
using namespace std;
int countSumSubsets(int[], int);
int countSumSubsets(int arr[], int N){
int count = 0;
for(int i = 1; i < pow(2, N); i++) {
int sum = 0;
int temp = i, j = 0;
while(temp) {
if(temp & 1)
sum += arr[j];
j... | ALGO | 0.999525 | 4.687247 |
3e526741-f7ec-486e-9855-d200f9cbc512 | WSU-CptS-581-2025/codelibrary-clone | cpp/numbertheory/factorization.cpp | #include <bits/stdc++.h>
using namespace std;
// returns prime_divisor -> power
// O(sqrt(n)) complexity
map<long long, int> factorize(long long n) {
map<long long, int> factors;
for (int d = 2; (long long)d * d <= n; d++) {
while (n % d == 0) {
++factors[d];
n /= d;
}
... | ALGO | 0.999274 | 4.184285 |
7cc96356-e5c1-467e-b740-cc842c8c6270 | omagdy7/competitive-programming | codeforces/ParanormixPredictions/main.cpp | #include<bits/stdc++.h>
using namespace std;
int main () {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, m;
cin >> n >> m;
vector<int> primes;
for(int i = 2; i <= 50;i++) {
bool ok = 1;
for(int j = 2; j * j <= i; j++) {
if(i % j == 0) {
ok = 0;
break;
}
}
... | ALGO | 0.999943 | 4.009972 |
3408e28d-3e22-4f2a-a34f-287d7ec5dc14 | AlexiaBojian1/Algorithms-and-Data-structure | 0034-find-first-and-last-position-of-element-in-sorted-array/0034-find-first-and-last-position-of-element-in-sorted-array.cpp | class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
return {findleft(nums,target), findright(nums, target)};
}
private:
int findleft(const vector<int> & nums, int target) {
int low = 0;
int high = nums.size() - 1;
int leftinx = -1;
while(... | ALGO | 0.999929 | 6.657532 |
091310e9-7df5-41f3-88a8-7980425ef2c5 | alexandraback/datacollection | solutions_2751486_0/C++/Tagrimar/main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <stack>
using namespace std;
bool is_vowel(char c)
{
return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
int main()
{
ifstrea... | ALGO | 0.999693 | 4.449097 |
f69bf23e-ced5-477b-86ea-fe0720e6d66a | Aadish-jain/DSA | Basics/STL(Standard Template Library)/Unordered_map.cpp | #include <bits/stdc++.h>
using namespace std;
void Printump(unordered_map<int, int> ump)
{
for (auto it = ump.begin(); it != ump.end(); it++)
{
cout << it->first << " " << it->second << endl;
}
cout << endl;
}
int main()
{
unordered_map<int, int> ump;
ump.insert({1, 2});
ump.insert({1, 3});
ump.i... | ALGO | 0.902971 | 4.586038 |
c0792d44-32e1-489d-a476-0c1bcde8c577 | Gopal-nd/DSA-striver | recursion/merge.cpp | #include<iostream>
#include<vector>
using namespace std;
void merge(vector<int> &arr, int low,int mid,int high){
vector<int> temp;
int left = low;
int right = mid+1;
while (left<=mid&&right<=high)
{
if(arr[left]<arr[right]){
temp.push_back(arr[left]);
left++;
... | ALGO | 0.999985 | 4.860517 |
c293ddca-d76c-401f-b790-2d44e80ec3fb | brown0394/algorithm_practice | leetcode/median.cpp | #include <iostream>
#include <vector>
class Solution {
public:
static double findMedianSortedArrays(std::vector<int>& nums1, std::vector<int>& nums2) {
int size1 = nums1.size();
int size2 = nums2.size();
int size = size1 + size2;
int mid = size >> 1;
bool isOdd = size % 2;
... | ALGO | 0.999948 | 5.688477 |
714f5090-ef0a-4329-b8cd-e626a908ebc7 | alon21034/MSoC_Lab1 | MSoC_Lab1_p2/MSoC_Lab1_p2/fifo_fir.cpp | //BEGIN fifo_fir.cpp
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//See fifo_fir.h for more information
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include "fifo_fir.h"
#include <fstream>
#include <iomanip>
#include <cmath>
extern unsigned errors;... | TOOL | 0.938283 | 5.659652 |
1213da4d-418c-41a2-a87f-e293a808f697 | evasabeeh/DSA | RECURSION/binarySearch.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
bool search(int *arr, int key, int start, int end)
{
if(start>end)
return false;
int mid = start + (end - start)/2;
if(arr[mid] == key){
cout<<mid<<" ";
return true;
}
... | ALGO | 0.999961 | 5.39563 |
eebee1a1-62df-46fa-b728-6cdaef257c96 | Jayesh260/Cpp | OODP/Week 5/7.cpp | #include<iostream>
#include<string.h>
using namespace std;
class func{
public:
void pal(char c[]);
};
void func::pal(char c[]){
int l=strlen(c);
char b[10];
int i,j;
for(i=0,j=l-1;i<l;i++,j--){
b[i]=c[j];
}
b[i]=' ';
if(strcmp(c,b)==0){
... | ALGO | 0.999444 | 3.761591 |
8a8b29cb-f8bd-4fe8-a5cf-fffa4093fbd4 | AtharvaPanegai/CppLearning | BITManipulation/BITManipulationQuestions/FindUniqueNumberInArrayTwo/program.cpp | // Write a program to find 2 unique numbers in an array where all the numbers except two are present twice
// {2,4,6,7,4,5,6,2,}
#include <bits/stdc++.h>
using namespace std;
int setbit(int n,int pos){
return ((n &(1<<pos))!=0);
}
void uniqueTwo(int arr[],int n){
int xorSum=0;
for (int i = 0; i < n; i++)... | ALGO | 0.999972 | 4.6752 |
c9543027-ec6e-45e8-ba37-926bb1fae3a5 | thegamer1907/Code_Analysis | DP/1495.cpp | #include<bits/stdc++.h>
using namespace std;
int aa[105];
int main()
{
int n,cont=0,cont2=0,temp=0;
cin >> n;
for(int i=0; i<n; i++)cin >> aa[i];
for(int i=0; i<n; i++)
{
if(aa[i]==1)
{
cont++;
if(cont2!=0)cont2--;
}
else
... | ALGO | 0.999969 | 3.331284 |
9fc67f35-2e83-4efc-a5fd-b501f848b654 | siddhanttomar2003/CP | A_Alice_and_Cups.cpp | //author:-Siddhant Tomar
//linked in :-https://www.linkedin.com/in/siddhant-tomar-9b3aab261/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
using namespace std;
using namespace __gnu_pbds;
typedef tree<
int,
null_type,
less<int>,
... | ALGO | 0.999871 | 3.943934 |
24343543-f866-46ae-99f2-86606a27fdc4 | LP2Grupo02/LP2_FASE2 | G8_EJE03.cpp | #include <iostream>
using namespace std;
class Empleado { // Clase abstracta Empleado
protected:
double salario;
public:
Empleado(double sl) : salario(sl) {}
Empleado() {
this->salario = 1025.0;
}
virtual double calcularSalario() const = 0; ... | ALGO | 0.949759 | 5.756334 |
b1e47704-e7b7-40cb-8978-99be64d35932 | vyom104/DSA-Practice | 128-longest-consecutive-sequence/128-longest-consecutive-sequence.cpp | class Solution {
public:
int longestConsecutive(vector<int>& nums) {
int maxLen = 0;
unordered_map<int, bool> elements;
for(int i=0; i<nums.size(); i++)
elements[nums[i]] = true;
for(int i=0; i<nums.size(); i++) {
int currEle = nums[i], len =... | ALGO | 0.999949 | 5.566793 |
6f0d5975-88aa-4fd1-9700-0eef9cda1795 | boaz30333/CPP | phonetic-search/PhoneticFinder.cpp | /**
* AUTHORS: Boaz sharabi, Ori ben-hamo
*/
#include "PhoneticFinder.hpp"
#include <iostream>
#include <stdexcept>
namespace phonetic
{
using namespace std;
string find(string text, string word)
{
if (word == "")
{
throw std::out_of_range{"empty word cant be find"};
}
else
{ // split te... | ALGO | 0.989344 | 5.314642 |
3a59971f-7fc3-4816-afb5-ad66086f923e | rush4812/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.998733 | 6.76775 |
504e0a33-f430-4838-b81b-4655b08aac2b | Jaisurya2702/Assignment-04-090 | Odd nos/Sum of Even/main.cpp | #include <stdio.h>
int sumoe(int lower, int upper);
int main(void)
{
int x, y;
printf("Enter lower limit : ");
scanf("%d", &x);
printf("Enter upper limit : ");
scanf("%d", &y);
printf("\nSum of Even/Odd numbers from %d to %d is : \n\n", x, y);
printf("%d", sumoe(x, y));
printf("\n");
}... | ALGO | 0.999003 | 3.871214 |
7fa9f693-9715-4b99-9939-017b2223cabc | NWPU-MUSIC-Lab/music-drone-225 | src/uav_simulator/quadsim/src/dynamics/Quadrotor.cpp |
#include <quadsim/Quadrotor.h>
#include <boost/numeric/odeint.hpp>
#include <boost/bind.hpp>
#include <iostream>
#include <cmath>
#include <rclcpp/rclcpp.hpp>
#include <chrono>
using namespace std::chrono_literals;
#define PI acos(-1)
#define deg2rad(x) x / 180.0 * PI
namespace odeint = boost::numeric::odeint;
//... | ALGO | 0.991515 | 4.91455 |
80d313a5-e17e-435c-b058-44d2aa88d747 | namhai0510/C-- | C--/sumn.cpp | #include <bits/stdc++.h>
using namespace std;
#define nothing ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define endl "\n"
#define ll long long
#define ull unsigned long long
#define fi first
#define se second
#define pb push_back
const ll oo = 1e13;
const ll modd = 1e9 + 7;
const int maxn = 1e6 + 5... | ALGO | 0.999998 | 4.124749 |
ce6cb10f-2adf-421a-ac51-57c172bfb775 | sandeshkhadase/Leetcode-Solutions | Leetcode Solutions/solution/2500-2599/2524.Maximum Frequency Score of a Subarray/Solution.cpp | class Solution {
public:
int maxFrequencyScore(vector<int>& nums, int k) {
using ll = long long;
const int mod = 1e9 + 7;
auto qpow = [&](ll a, ll n) {
ll ans = 1;
for (; n; n >>= 1) {
if (n & 1) {
ans = ans * a % mod;
... | ALGO | 0.999994 | 6.135112 |
70c16cd0-f006-4e6f-8515-a2ad306f5d3a | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_7031_11.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int arr[4], a, b;
for (int i = 0; i < 4; i++) {
cin >> arr[i];
}
cin >> a >> b;
int y = *min_element(arr, arr + 4) - 1;
int x = min(y, b);
if (y < a) {
cout << 0 << endl;
} else {
cout << (x - a + 1) << endl;
}
return 0;
}
| ALGO | 0.999922 | 3.578138 |
2d6c62f8-b5cc-45d5-b406-c0d76690cd85 | cjrgamedev/emscripten | irrlicht-ogl-es/irrlicht/examples/07.Collision/main.cpp | /** Example 007 Collision
We will describe 2 methods: Automatic collision detection for moving through
3d worlds with stair climbing and sliding, and manual scene node and triangle
picking using a ray. In this case, we will use a ray coming out from the
camera, but you can use any ray.
To start, we take the program ... | TOOL | 0.981155 | 3.39024 |
c10a00f4-0bb7-4781-8f42-146d7a83259f | adityanjr/code-DS-ALGO | CodeForces/Complete/700-799/770D-DrawBrackets.cpp | #include<cstdio>
char ans[333][555];
void prt(int h, int d, int f, int c) {
int r = h;
for(int p=0;p<d;p++)
ans[r-p][c] = ans[r+p][c] = '|';
ans[r-d][c] = ans[r+d][c] = '+';
ans[r-d][c+f] = ans[r+d][c+f] = '-';
}
int main() {
int n; char s[111]; scanf("%d\n%s", &n, s);
int mh(0), c(0... | ALGO | 0.999954 | 3.110338 |
111db39b-c83a-4a84-bdde-6d5c3ccf9395 | Gabriel4256/algorithm-study | C++/FOSSIL.cpp | // 꽤나 난이도 있는 삼분법 문제. 거의 책을 참고하다시피 해서 풀었다.
// 삼분법의 개념은 그리 어려운 게 아니지만, 이 문제는 어떤 식으로 풀어나가야 될지
// 방향을 정하는 게 어려웠다.
#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
vector<pair<double, double>> polys[2];
vector<pair<double, double>> up_and_low[2][2];
double get_val(double x,... | ALGO | 0.99993 | 3.827679 |
0d216428-98db-4537-ad2f-647d403eddd9 | Angellopp/CodeForces-Problems | Codeforces_Codeforces_Round_942_Div_2/E_Fenwick_Tree.cpp | #include <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define nn '\n'
#define fastio ios_base::sync_with_stdio(false); cin.tie (NULL)
#define readv(v, n) for (int i = 0; i < n; i++) cin >> v[i]
#define printv(v) for (int i = 0; i < v.size(); i++) cout << v[i] << " "; cout << nn
#define fori(ini... | ALGO | 0.999944 | 4.1534 |
a9b69c08-3a0f-4337-b84f-7126858f23f6 | AlrightAndroid-Brokenlab/packages_inputmethods_LatinIME | native/jni/src/suggest/core/dicnode/dic_nodes_cache.cpp | #include <list>
#include "defines.h"
#include "suggest/core/dicnode/dic_node_priority_queue.h"
#include "suggest/core/dicnode/dic_node_utils.h"
#include "suggest/core/dicnode/dic_nodes_cache.h"
namespace latinime {
// The biggest value among MAX_CACHE_DIC_NODE_SIZE, MAX_CACHE_DIC_NODE_SIZE_FOR_SINGLE_POINT, ...
cons... | TOOL | 0.895411 | 6.894089 |
544a841b-24e2-4beb-93a7-98c744dfc423 | liyihai-official/Final-Project | _Older.Versions/MPI.Heat/C++.Heat/ver3.0/hybrid_heat.cpp |
// #include "multi_array/array_distribute.cpp"
// namespace final_project {
// namespace heat_equation {
// template <class T>
// class heat1d_hybrid
// {
// private:
// double coff {1};
// double diag, weight;
// double dt, hx;
// double min_x {0}, max_x {1};
// public:
// array1d_distribut... | ALGO | 0.992677 | 3.951092 |
ad664630-c6e4-429c-91ab-ba0304062929 | bigflyzhou/stafastframe | NFComm/NFCore/Example.cpp | #include "stdafx.h"
#include <stdint.h>
#include <iostream>
#include <string>
#include <boost/functional/hash.hpp>
#include <boost/format.hpp>
#include <boost/crc.hpp>
#include "NFCConsistentHash.hpp"
//б
void InitMainNodes(std::vector<MachineData>& vNodes)
{
MachineData xData;
xData.strIP = "<IP_ADDRESS>";
... | TEST | 0.949793 | 4.49421 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.