uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
bffe01d6-f160-477d-87b6-647fdf4b608a | alexandraback/datacollection | solutions_5709773144064000_0/C++/pabloh/B.cpp | #include <iostream>
#include <fstream>
#include <cassert>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <queue>
//download TTMath from http://www.ttmath.org/
//#include <ttmath/ttmath.h>
#undef max
#undef min
using namespace std;
//using namespace ttma... | ALGO | 0.999582 | 3.99649 |
1bc73427-7b8a-4760-9beb-d32360dfa200 | big-quantum/all_code | code/P1094 [NOIP2007 普及组] 纪念品分组.cpp | #include<bits/stdc++.h>
using namespace std;
int w,n,p[30005],ans;
int main(){
cin>>w>>n;
for(int i=1;i<=n;i++){
cin>>p[i];
}
sort(p+1,p+n+1);
int i=0,j=n;
while(i<=j){
if(p[i]+p[j]<=w) {
i++;
j--;
ans++;
} else {
j--;
ans++;
}
}
cout<<ans<<endl;
return 0;
}
| ALGO | 0.999989 | 4.010642 |
f405880d-3aea-4b55-8212-190068fcec78 | tejashri29/openrPublicFork | openr/spark/Spark.cpp | #include "Spark.h"
#include <ifaddrs.h>
#include <net/if.h>
#include <netinet/in.h>
#include <sodium.h>
#include <fcntl.h>
#include <algorithm>
#include <functional>
#include <vector>
#include <fbzmq/service/if/gen-cpp2/Monitor_types.h>
#include <fbzmq/service/logging/LogSample.h>
#include <fbzmq/zmq/Zmq.h>
#include... | TOOL | 0.894557 | 3.753819 |
72e6b435-db7a-4790-9629-dd8c05b3842f | ishandutta2007/codeforces | zscoder/normal/133/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;
const int MOD = 1e9 + 7;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
int main()
{
ios_base::sync_with_stdio(false); ci... | ALGO | 0.997831 | 3.777963 |
0bcfa4e8-1084-4b9b-af10-32244fee57cc | bioconductor-source/DiffBind | src/intervalTree.cpp | #include <cstddef>
#include "intervalNode.h"
#include "intervalTree.h"
// #define ISRED(x) ((x)->isRed==1)
// #define SETRED(x) ((x)->isRed = 1)
// #define SETBLACK(x) ((x)->isRed = 0)
/******************************************************************************/
/* interval set
*
*/
bode::IntervalTree::IntervalT... | ALGO | 0.99017 | 5.001418 |
241ef7eb-6502-46bc-bda7-09da83ad3aef | Nisargparekh7/Coding | 235-lowest-common-ancestor-of-a-binary-search-tree/235-lowest-common-ancestor-of-a-binary-search-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
if(root==NU... | ALGO | 0.999993 | 6.095987 |
128e5296-817f-4450-946e-823a8ff1a052 | iains/LLVM-8-Branch | llvm/tools/dsymutil/MachOUtils.cpp | #include "MachOUtils.h"
#include "BinaryHolder.h"
#include "DebugMap.h"
#include "LinkUtils.h"
#include "NonRelocatableStringpool.h"
#include "llvm/MC/MCAsmLayout.h"
#include "llvm/MC/MCMachObjectWriter.h"
#include "llvm/MC/MCObjectStreamer.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCStreamer.h"
#include... | TOOL | 0.908976 | 6.65395 |
37e2edf6-bfe3-45c7-9660-5038eaaae385 | ishandutta2007/codeforces | xuanquang1999/normal/629/B.cpp | //84104971101048411497 - Can you guess what does this mean?
using namespace std;
#include <bits/stdc++.h>
#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 ft... | ALGO | 0.999743 | 3.162577 |
c7c3f92b-b062-4a7c-b45f-c349a693a500 | Gesrua/OI-code | complete/CF-1140B.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define rep(i, l, r) for (int i = (l); i <= (r); ++i)
#define per(i, l... | ALGO | 0.999925 | 3.479114 |
fc47dccd-c761-494f-a02e-7e975c4f66ee | kirijuana/OOP_LAB_1 | OOP_LAB_1/boost_1_75_0/libs/geometry/doc/index/src/examples/rtree/polygons_shared_ptr.cpp | //[rtree_polygons_shared_ptr
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <cmath>
#include <vector>
#include <iostream>
#include <boost/fore... | ALGO | 0.999488 | 7.361921 |
6b39681c-993e-456a-854e-2085c10bccdf | ChuanqiXu9/clangd-for-modules | libcxx/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp | // <algorithm>
// template<InputIterator Iter, Predicate<auto, Iter::value_type> Pred>
// requires CopyConstructible<Pred>
// constexpr Iter::difference_type // constexpr after C++17
// count_if(Iter first, Iter last, Pred pred);
#include <algorithm>
#include <functional>
#include <cassert>
#include "test_ma... | TEST | 0.957057 | 6.901881 |
d567d500-f607-44a1-9adc-0188e132980c | mygirl8893/cryptoz | src/CryptoNoteCore/CryptoNoteFormatUtils.cpp | #include "CryptoNoteFormatUtils.h"
#include <set>
#include <Logging/LoggerRef.h>
#include <Common/int-util.h>
#include <Common/Varint.h>
#include "Serialization/BinaryOutputStreamSerializer.h"
#include "Serialization/BinaryInputStreamSerializer.h"
#include "Account.h"
#include "CryptoNoteBasicImpl.h"
#include "Crypt... | TOOL | 0.943348 | 6.760699 |
669538a3-c161-42b1-91dd-4c74226461b9 | ugurinal/C | Lab3/lab3_8.cpp | #include <iostream >
using namespace std;
class truck; // a forward declaration
class car{
int passengers, speed;
public:
car(int p, int s) { passengers = p; speed = s; }
friend int sp_greater(car c, truck t);
};
class truck{
int weight, speed;
public:
truck(int w, int s) { weight = w; speed... | ALGO | 0.99632 | 3.874346 |
7cb67367-cd7a-46f6-b4a0-f4d9ea36e9df | ishandutta2007/codeforces | datastructures/normal/1528/D.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int read(){
int x=0;
char ch=getchar();
while(ch<'0'||ch>'9')ch=getchar();
while(ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();
return x;
}
int n,m,c[605][605];
int dis[605],w[605],book[605];
void dijkstra(int s){
memset... | ALGO | 0.999993 | 3.999419 |
18fd798c-5c47-42d4-af82-c96b4d526cb8 | kushuu/competitive_programming_all | leetCode/valid-anagram/Accepted/2-11-2021, 2_33_03 PM/Solution.cpp | // https://leetcode.com/problems/valid-anagram
class Solution {
public:
bool isAnagram(string s, string t) {
vector<char> v1(26, 0);
for(auto i : s) v1[i-'a']++;
for(auto i : t) {
// if(v1[i-'a'] < 1) return false;
v1[i-'a']--;
}
for(int i = 0; i < 26... | ALGO | 0.999987 | 6.615222 |
db1b4aed-60aa-4c46-9e5b-6a78a89cc7da | viana-code/exercises_for_competitions | Neps_Academy/476.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
float p, result = 0, g;
vector<float>v;
cin >> n;
for(int i = 0; i < n; i++) {
cin >> p >> g;
result = p * (1000 / g);
v.push_back(result);
}
float menor = *min_element(v.begin(), v.end());
co... | ALGO | 0.998845 | 3.989586 |
1e706692-d2bc-4ff3-a7a4-2ded4a7e289c | Velmy/EDCB | CtrlCmdCLI/CtrlCmdCLI/CtrlCmdCLI.cpp | // C DLL t@CłB
#include "stdafx.h"
#include "CtrlCmdCLI.h"
#include "../../Common/ErrDef.h"
#include <vcclr.h>
#include <string>
using namespace CtrlCmdCLI;
CtrlCmdUtil::CtrlCmdUtil(void)
{
this->sendCmd = new CSendCtrlCmd;
}
CtrlCmdUtil::~CtrlCmdUtil(void)
{
if( this->sendCmd != NULL ){
delete this->sendCmd... | CONFIG | 0.85685 | 3.70649 |
3f08c8ab-d137-44d4-b0c5-29944f920f93 | Patroklos99/3105_TP5-Plan-Fleet-Vehicles | tp5.cpp | #include <cmath>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <sstream>
#include <cstring>
#include "reseau.h"
void tp5( Reseau&, std::istream&);
double vitesse = 0;
int niveau_algo=1;
int main(int argc, const char** argv){
const char* nomfichier_gbornes=nullptr;
const char* nomfichier_r... | ALGO | 0.982645 | 4.041519 |
5b053b9f-ccf2-4550-a090-8855576eed6e | jaindivij21/Comprehensive-DSA-Questions | STL And DS & Algo/Algorithm/Programs/Binary Search/Painters Partition Problem/main.cpp | // Painters Partition Problem
// https://www.geeksforgeeks.org/painters-partition-problem/
// https://hack.codingblocks.com/app/practice/1/1057/problem
#include<iostream>
#include<climits>
#include<algorithm>
using namespace std;
// checks if all the paintings can be painted in mid amount of time
bool canBePainted(i... | ALGO | 0.999905 | 5.862441 |
4c2d6788-8f76-4704-9780-d49ae7a71ddf | Bibolat2005/PP1 | Lab 3/N.cpp | #include <iostream> //библиотека
#include <cmath>
using namespace std;
int main(){
int n;
cin >> n;
int a[n];
for(int i=0;i<n;i++){
cin >> a[i];
}
for(int i=0;i<n;i++){
cout << a[i]*a[i] << " ";
}
} | ALGO | 0.998711 | 3.608376 |
086fa7ed-5bb4-4bff-81b1-c627d8a2c298 | hermin9804/algorithm | boj/step/04_while/03_1110_더하기사이클/add_cycle.cpp | #include <stdio.h>
int main(void)
{
int n, t, a, b, c;
scanf("%d", &n);
c = 1;
t = 0;
if (n < 10)
n *= 10;
a = n / 10;
b = n % 10;
t = b * 10 + ((a + b) % 10);
while (n != t)
{
c++;
if (n < 10)
n *= 10;
a = t / 10;
b = t % 10;
t = b * 10 + ((a + b) % 10);
}
printf("%d\n", c);
return (0);
}
| ALGO | 0.999549 | 3.912745 |
3bcaf9b2-ac9d-4fbd-8348-fda4f1ea85b8 | hitesh11tahiliani/DSA-Leetcode | 19-remove-nth-node-from-end-of-list/19-remove-nth-node-from-end-of-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* removeNthFr... | ALGO | 0.999962 | 6.127101 |
7ba39cc2-2cb1-404a-bbdc-c688fa638bfa | PunitTak2005/CPP-GFG | 310.cpp | //{ Driver Code Starts
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int findTarget(vector<int>& arr, int target) {
int s=0,e=arr.size()-1;
while(s<=e){
int mid=s+(e-s)/2;
if(arr[mid]=... | ALGO | 0.999653 | 6.378932 |
395b0078-9bbe-46d1-91e4-599fe2d9d655 | JosephJostar0/pat | 甲级cpp/1094 The Largest Generation.cpp | #include <iostream>
#include <queue>
#include <vector>
#define MAXN 100
std::vector<int> v[MAXN];
int isSon[MAXN], rankNum[MAXN], rank = 1, top;
void levelOrder(int root) {
std::queue<int> q;
q.push(root);
int temp, last = root, pre, i;
while (!q.empty()) {
temp = q.front();
q.pop();
... | ALGO | 0.999962 | 4.188614 |
6bfa9f6b-fbfe-4a36-87a0-645c0f424824 | pgh08/DSA | DP/MaxSumOfNonAdjacent.cpp | // Given an array find maximum sum of non ajacent nodes. Similar to house robery pf leetcode.
// Recursive Approach : Time Comaplextiy : O(n^2), space Complexity : O(n).
// Top Down Memoization Approach : Time Comaplextiy : O(n), space Complexity : O(n).
// Bottom Up Approach : Time Comaplextiy : O(n), space Complexity... | ALGO | 0.999985 | 6.150699 |
694e1284-465b-4253-bbaa-16ef21fc1133 | ishandutta2007/codeforces | ae04071/normal/1073/B.cpp | #include <bits/stdc++.h>
using namespace std;
int n,a[200000],b[200000],vis[200001];
int main() {
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",a+i);
int i=0;
for(int j=0;j<n;j++) {
scanf("%d",b+j);
if(vis[b[j]]){
printf("0 ");
} else {
int cnt=0;
for(;i<n && a[i]!=b[j];i++) {
vis[a[i]]=1;... | ALGO | 0.999988 | 3.338567 |
ee805ec4-fd10-4726-b0af-5dac77e1bd66 | Jahnvi-Rc/Geometric-Inage-Modification-Homographic-Transform-Morphological-Processing | 1a.cpp | #include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main(int argc, char *argv[])
{
FILE *file;
int height=512,width=512;
int BytesPerPixel;
if (argc < 3){
cout << "Error" << endl;
cout << "Retry" << endl;
return 0;
}
if (... | ALGO | 0.914468 | 3.442863 |
f7eb2f80-1224-4650-8942-387e52d3a956 | ilanos4/DSA | Mathematics/Count_digit.cpp | #include<iostream>
using namespace std;
int countDigit(long long n){
if(n == 0){
return 1;
}
int count = 0;
while(n!=0){
n = n/10;
++count;
}
return count;
}
int main(void){
long long n = 324265356236;
cout<< "Number of Digit:"<< countDigit(n);
return 0;
} | ALGO | 0.999736 | 4.300214 |
bc6f4a75-15e4-4265-b492-18ba2956fa00 | Anubhvv/CSES-Solutions | Graph Algorithms/Flight Routes Check.cpp | #include <bits/stdc++.h>
#define loop(i, a, n) for(int i = a; i < n; ++i)
using namespace std;
vector<int >graph[200001],rgraph[200001];
bool used[200001];
vector<int>order;
vector<int>scc[200001];
int component_count=0;
void dfs1(int u)
{
used[u]=true;
loop(i,0,graph[u].size())
if(!used[graph[u][i]]... | ALGO | 0.99997 | 3.956182 |
da6b771b-f913-48bd-b1df-855360428bff | shishir-roy/competitive-programming-master | Marathon/Mathematics/Q - Probability UVA - 11346.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define maxn 100007
#define eps 1e-6
int main()
{
// cout << log(2.71828) << endl;
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int tc;
cin >> tc;
while(tc--)
{
double a,b,s;
cin >> a >> b >> s... | ALGO | 0.986907 | 3.742898 |
4f09d16a-4c7a-43f1-a420-c4aa39daa18d | samoliverdev/OneDudeEngine | Engine/ThirdParty/JoltPhysics-5.3.0/Jolt/Physics/Constraints/PathConstraintPathHermite.cpp | #include <Jolt/Jolt.h>
#include <Jolt/Physics/Constraints/PathConstraintPathHermite.h>
#include <Jolt/Core/Profiler.h>
#include <Jolt/ObjectStream/TypeDeclarations.h>
#include <Jolt/Core/StreamIn.h>
#include <Jolt/Core/StreamOut.h>
JPH_NAMESPACE_BEGIN
JPH_IMPLEMENT_SERIALIZABLE_NON_VIRTUAL(PathConstraintPathHermite:... | ALGO | 0.994363 | 7.610324 |
d83ab685-1a3a-4c0c-8954-6cd98dc04c22 | emamhasan1804/YCPC-by-Phitron-1st-round-beginner-level- | Toggle_Switch.cpp | #include<bits/stdc++.h>
#define int long long
#define float double
#define endl '\n'
using namespace std;
/*
When I wrote this code ,
only Allah and I knew what I did.
Now... only Allah knows
*/
int32_t main ()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;cin>>t;while(t--)
{
int n... | ALGO | 0.999964 | 4.345724 |
0b284cfa-e7f1-4c63-8956-91c4101bc96a | Devang-soni/Leetcode | Easy/1380. Lucky Numbers in a Matrix/Lucky-Numbers-in-a-Matrix.cpp | /*
Given an m x n matrix of distinct numbers, return all lucky numbers in the matrix in any order.
A lucky number is an element of the matrix such that it is the minimum element in its row and maximum in its column.
Example 1:
Input: matrix = [[3,7,8],[9,11,13],[15,16,17]]
Output: [15]
Explanation: 15 is the only lu... | ALGO | 0.999986 | 7.075238 |
5ce2a858-d6ed-4650-b5ce-d0dce5d3a8ba | pipisaurio/practica10 | practica_9/experiencia 5.cpp | #include <iostream>
#include <vector>
using namespace std;
class Figura {
public:
virtual double calcularArea() = 0; // Mtodo virtual puro
};
class Circulo : public Figura {
private:
double radio;
public:
Circulo(double r) : radio(r) {}
double calcularArea() override {
return 3.14159 * radio * radio;
}
};
c... | TOOL | 0.920834 | 5.950334 |
ba295b7f-3a09-4247-b58d-1b8808576b1e | ishandutta2007/codeforces | ljc00118/normal/979/C.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 300000 + 10;
struct Edge {
int u, v, next;
}G[N << 1];
long long ans = 0;
int fa[N], d[N], head[N], size[N];
int n, x, y;
int tot = 0;
inline void addedge(int u, int v) {
G[++tot] = (Edge) {u, v, head[u]}, head[u] = tot;
G[++tot] = (Edge) {v, u, head[v]}... | ALGO | 0.999873 | 4.018473 |
af96cab4-2365-4b73-b6b7-c63dbdeb545b | shohan2032/Competitive-Programming-Practice-Codes | Suffix_Equal_Prefix.cpp | #include <bits/stdc++.h>
using namespace std;
//Debug Function-->works for vector,map,set(dbg(stl_name)),,arrar(dbg(array_name,range))
template < typename F, typename S >ostream& operator << ( ostream& os, const pair< F, S > & p ) {return os << "(" << p.first << ", " << p.second << ")";}
template < typename T >ostrea... | ALGO | 0.998613 | 4.616281 |
b2cc3dc2-fae1-4db0-b930-b2d5825979df | ayushid549/TCS_Striver_Sheet | TCS/Arrays/union_of_two_array.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int arr1[] = {1,1,2,3,5};
int arr2[] = {1,2,2,3,4};
int i=0,j=0;
set<int> s;
while(i<5 && j<5)
{
s.insert(arr1[i]);
s.insert(arr2[j]);
i++,j++;
}
for(auto i : s)
{
cout<<i<<" ";
}
r... | ALGO | 0.999346 | 3.44267 |
192f001e-529e-476c-a92b-2f454e27d5ec | GandalfMaster/Trash | 102201528HomeWork1/eigen-3.4.0/unsupported/doc/examples/MatrixSquareRoot.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(2,2);
A << cos(pi/3), -sin(pi/3),
sin(pi/3), cos(pi/3);
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix square root of A is:... | ALGO | 0.999308 | 3.930508 |
6ac80565-0b51-4569-b04c-aa9b4dca79dd | blog2i2j/firmware-mod-kit | src/others/squashfs-4.2/lzma-4.65/CPP/7zip/UI/Common/SortUtils.cpp | // SortUtils.cpp
#include "StdAfx.h"
#include "SortUtils.h"
#include "Common/Wildcard.h"
static int CompareStrings(const int *p1, const int *p2, void *param)
{
const UStringVector &strings = *(const UStringVector *)param;
return CompareFileNames(strings[*p1], strings[*p2]);
}
void SortFileNames(const UStringVec... | TOOL | 0.925383 | 6.468472 |
a2b92739-caa4-4dde-a9ef-9a8c39cfc19c | ishandutta2007/codeforces | scott_wu/normal/1542/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void gogo()
{
int N; cin >> N;
int x = 0;
for (int i = 0; i < 2 * N; i++)
{
int p; cin >> p;
x += (p % 2);
}
if (x == N) cout << "Yes\n";
else cout << "No\n";
}
int main()
{
ios_base::sync_with_stdio(... | ALGO | 0.999688 | 4.694053 |
c134bfaa-3acb-4c8d-b553-bf2ba501d9b4 | iAbhayRajput/DSA | C++/270-280/273.cpp | lass Solution {
public:
vector<int> longestSubarray(vector<int>& arr, int x) {
// code here
deque<int>,imdq,maxdq;
int s=0,e=0;
int anStart=0,ansEnd=0;
vector<int>ans;
int n= arr.size();
while(e<n){
while(!mindq.empty()&& arr[mindq.back()]>arr[e]... | ALGO | 0.999996 | 4.732161 |
72a768cb-2fcc-4016-b5a6-de810099b69f | sp4ghet/comp | dp/g.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (int i = 0; i < n; ++i)
#pragma region Debug
template <typename T>
void view(const std::vector<T> &v)
{
for (const auto &e : v)
{
std::cout << e << " ";
}
std::cout << std::endl;
... | ALGO | 0.999874 | 4.412916 |
c95010be-6f31-4f74-b7c0-b92f5a046527 | etnk125/POSN-first-camp | temp/fibonugchi.cpp | #include<stdio.h>
int i,m0,m1,m_sum,n;
int seq(int a,int b,int c)
{
int i,k[100]={0};
k[0]=a;
k[1]=b;
for ( i=2;i<c;i++)
{
k[i]=k[i-1]+k[i-2];
}
return k[i-1];
}
main()
{
int time;
scanf("%d",&time);
for(int j=0;j<time;j++)
{
scanf("%d%d%d",&m0,&m1,&n);
printf("%d\n",seq(m0,m1,n));
}
}
| ALGO | 0.999861 | 3.392908 |
1943be89-2e1d-42c8-a7e0-481104ab9dfe | grantgabriel/Competitive-Programming | Learning Progress/TLX Toki/Pemrograman Dasar/Submission/11/C.cpp | #include <iostream>
#include <array>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstdint>
#include <climits>
#include <string>
#include <functional>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <stack>
#includ... | ALGO | 0.999467 | 4.150068 |
38791031-abf0-4c03-ace4-ea37505b939f | YaroslavChernetsov/pr_4 | 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 |
eaab012d-f6a7-4a84-8c1d-577dddb925d7 | wozlsla/c-study | cpp/src/src_04.cpp | /* 연습문제 02: 가위바위보 */
#include <iostream>
using namespace std;
int main()
{
srand(time(0));
const int SCISSORS = 1;
const int ROCK = 2;
const int PAPER = 3;
int wins = 0;
int total = 0;
while (true)
{
if (total == 0)
{
cout << "현재 승률: X" << endl;
}... | ALGO | 0.946945 | 4.541166 |
78f4c804-c530-4320-b9e8-0a2dca2abd25 | Val0429/codility-cpp | Lesson17_DynamicProgramming/NumberSolitaire.cpp | // var dynamic_coin_changing = (C, k) => {
// var n = C.length;
// /// multi-dimensional array
// var rows = n+1;
// var cols = k+1;
// var dp = new Array();
// for (var i=0; i<rows; i++) {
// dp[i] = new Array();
// for (var j=0; j<cols; j++) {
// dp[i][j] = i == 0 ... | ALGO | 0.999592 | 5.015896 |
5d4700b8-9d96-442e-9794-e6950766a416 | dahyunko/2023-algorithm | 프로그래머스/lv2/42883. 큰 수 만들기/큰 수 만들기.cpp | #include <string>
#include <vector>
using namespace std;
string solution(string number, int k) {
string answer = "";
int ans_size = number.length()-k;
int s_idx = 0;
for(int i=0;i<ans_size;i++){
char max_int = number[s_idx];
int max_idx = s_idx;
for(int j=s_i... | ALGO | 0.999968 | 5.544553 |
18720fa2-9ac1-47b9-a478-c5d5112dbfcd | alittlekitten/AlgorithmStack | Baekjoon/Cpp/Implementation/B4_33191_Yalda.cpp | #include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// 33191 Yalda
// 구현
int b, w, p, n;
cin >> b >> w >> p >> n;
if (b >= w) cout << "Watermelon";
else if (b >= p) cout << "Pomegranates";
else if (b >= n) cout << "Nuts";
else cout << "Noth... | ALGO | 0.999561 | 4.082142 |
45594bfc-1d35-4f17-91a8-794a3a9db6e3 | valina354/SourceRevitalize | src/filesystem/linux_support.cpp | #include "linux_support.h"
#include "tier0/threadtools.h" // For ThreadInMainThread()
#include "tier1/strtools.h"
char selectBuf[PATH_MAX];
int FileSelect(const struct dirent *ent)
{
const char *mask=selectBuf;
const char *name=ent->d_name;
//printf("Test:%s %s\n",mask,name);
if(!strcmp(name,".") || !strcmp(nam... | TOOL | 0.880423 | 4.436193 |
6662cba5-e767-4102-99d7-3db705f0fc15 | thegamer1907/Code_Analysis | contest/1542535597.cpp | #include <bits/stdc++.h>
#define mp make_pair
#define mt make_tuple
#define ll long long
using namespace std;
int main() {
bool l1 = 0, l2 = 0;
int n;
string pass;
cin >> pass >> n;
for (int i = 0; i < n; i++) {
string str;
cin >> str;
if (str == pass){
puts("YES");
retu... | ALGO | 0.999981 | 3.559624 |
f8763974-74a3-4dd9-8e26-71ad1f77b03e | dmironenko/math-analyzer | src/shunting_yard/algo.cpp | #include "shunting_yard/algo.h"
std::deque<Tokens::Token> Algo::shunting_yard(const std::vector<Tokens::Token> &tokens) {
std::deque<Tokens::Token> result;
std::stack<Tokens::Token> stack;
for (const auto &item: tokens) {
if (item.type == Tokens::Token::Type::NUMBER || item.type == Tokens::Token::... | ALGO | 0.999807 | 6.524794 |
15e37cd6-47b1-427c-871d-b500d36f67bb | pradhumnchourey/Leetcode-Solutions | 0235-lowest-common-ancestor-of-a-binary-search-tree/0235-lowest-common-ancestor-of-a-binary-search-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
if(p==root ... | ALGO | 0.999996 | 6.29569 |
98f26721-961b-45ee-8ea3-73bab4dbfa13 | Boklazhenko/itstephomework | ps/week5/task3/zorina/hw3.cpp | /*Создайте двухмерный массив. Заполните его случайными числами и покажите на экран.
Пользователь выбирает количество сдвигов и положение (влево, вправо, вверх, вниз).
Выполнить сдвиг массива и показать на экран полученный результат. Сдвиг циклический.*/
#include <iostream>
#include<stdlib.h>
#include<time.h>
using nam... | ALGO | 0.997442 | 3.322372 |
ccdd65fe-53b5-4ecd-94d1-d84a244bf573 | ChaduvulaHemanth/C_plus_plus | tut19.cpp | // #include<iostream>
// using namespace std;
// int sum(int a, int b){
// return a+b;
// }
// int sum(int a, int b, int c){
// return a+b+c;
// }
// int main(){
// int a, b, c;
// // cout<< "enter first number"<<a<<endl;
// // cout<< "enter second number"<<b<<endl;
// // cout<< "enter third ... | TOOL | 0.870714 | 3.406811 |
9b2738cf-a15a-4d77-9736-9a1ab25bbd82 | jonrichards/Crespo_android_frameworks_base | media/libstagefright/codecs/mp3dec/src/pvmp3_getbits.cpp | /*
------------------------------------------------------------------------------
PacketVideo Corp.
MP3 Decoder Library
Filename: pvmp3_getbits.cpp
Date: 09/21/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
------------------------... | ALGO | 0.988074 | 6.119893 |
3742525c-1c5a-4fc8-9b7c-2542c0276315 | skantshashi/DataStructure | Queue.cpp | #include <stdio.h>
#include <stdlib.h>
struct Queue
{
int size;
int front;
int rear;
int *Q;
};
void create(struct Queue *q,int size)
{
q->size=size;
q->front=q->rear=-1;
q->Q=(int *)malloc(q->size*sizeof(int));
}
void enqueue(struct Queue *q,int x)
{
if(q->rear==q->size-1)
printf("Queue is Full");
else
{
q... | ALGO | 0.998654 | 4.249681 |
1bddc9af-e378-44b7-95f5-8cba1731bbc1 | Ehsanul-Karim-Pappu/backup_code_repo | uHunt/UVA-Solutions-master/10687 Monitoring the Amazon.cpp | #include <iostream>
#include <algorithm>
using namespace std;
const int MaxNum = 1005;
struct Point
{
int x, y;
bool operator<(const Point & other) const
{
if (x != other.x)
return x < other.x;
return y < other.y;
}
};
Point points[MaxNum];
int twoNeighbors... | ALGO | 0.999939 | 5.39923 |
69e51613-a8f1-4dff-a7fa-dc75c1e749c2 | coder9a/CPlusPlus-Codes | Arrays In C++/FrequencyOfArrayElements.cpp | #include <bits/stdc++.h>
#include<iostream>
using namespace std;
// Time Complexity = O(n)
// Space Complexity = O(n)
int main()
{
int arr[] = {10, 20, 20, 10, 10, 20, 5, 20};
int n = sizeof(arr)/sizeof(arr[0]);
unordered_map<int, int> hmap;
for(int i=0;i<n;i++)
{
hmap[arr[i]... | ALGO | 0.999493 | 3.918217 |
27ebe4af-bcef-40ad-b32c-13bd24926675 | Qivon7/oi-code | 水管局长.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cmath>
#include <ctime>
#include <vector>
#include <queue>
#include <map>
#include <set>
#define hash hhhash
using namespace std;
const int inf = 2147483640;
typedef long long ll;
ll geti(){
char ch=getchar();... | ALGO | 0.999975 | 4.017016 |
47f0f43e-3e82-44d2-ad74-d21785e8978f | phuocchubeo123/Codeforces | Template/Tree/treap.cpp | #include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vii;
typedef vector<vector<int> > vvi;
typedef vector<string> vs;
typedef complex<double> cd;
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r... | ALGO | 0.995658 | 3.844892 |
c660c72d-f2f5-4243-8938-c655dc09a393 | valehasini/valehasini | LBP18.cpp | #include<stdio.h>
#include<math.h>
int main ()
{
int a,b,c,s;
int A;
scanf("%d%d%d",&a,&b,&c);
s=(a+b+c)/2;
A=sqrt(s*(s-a)*(s-b)*(s-c));
printf("%d",A);
return 0;
}
| ALGO | 0.99994 | 3.60841 |
961ebd4e-88b9-4f5e-8a8a-6e320dff94fc | raincross7/code-similarity | codes/train_code/problem132/problem132_388.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b... | ALGO | 0.999963 | 3.56186 |
af44a1b5-91c7-43b9-974c-e0de7c695d20 | MaharjanGagan2057/area-calculator | arecalcuator.cpp | #include <iostream>
using namespace std;
int main()
{
//first rectangle
double length1,breath1;
string a="Sq.ft";
cout <<"Enter Length 1:" <<endl;
cin >>length1;
cout<<"Enter Breath 1"<<endl;
cin >> breath1;
double area = length1*breath1;
cout << "The area of the rectangle 1 is ... | TOOL | 0.956656 | 3.160616 |
10ea3f1f-6b96-40c8-ad73-0d453823c298 | Rahulgoy/leetcode | 230-kth-smallest-element-in-a-bst/230-kth-smallest-element-in-a-bst.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.999996 | 5.84888 |
80d66b43-00b5-4a7e-b805-edcab687b8d6 | AlexanderPaniutin/Miscellaneous | TwoSum20k/main2.cpp | #include <iostream>
#include <fstream>
#include <unordered_set>
using namespace std;
void store_file(string);
bool two_sum(int);
long get_count(void);
unordered_set<long> hash_table;
const int LEFT = -10000;
const int RIGHT = 10000;
int main(int argc, char** argv) {
store_file("/Users/alex.paniutin/Documents/Stu... | ALGO | 0.987459 | 4.802724 |
da65808d-d237-4489-bae0-496820a4c7eb | Anirban19-99/Code_world | bubble_sort/bubble_sort.cpp | void swap(int *a,int *b)
{
int temp;
temp=*a;
*a=*b;
*b=temp;
}
void bubbleSort(int arr[], int n)
{
int i,j;
for(int i=0;i<n-1;i++)
{
for(j=0;j<n-1-i;j++)
{
if(arr[j]>arr[j+1])
swap(&arr[j],&arr[j+1]);
}
}
}
| ALGO | 0.9999 | 4.301982 |
c45caf17-a3d0-4988-9fb5-48dfcc81909a | sumatrapdfreader/sumatrapdf | ext/libdjvu/miniexp.cpp | #ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if NEED_GNUG_PRAGMAS
# pragma implementation "miniexp.h"
#endif
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#include <stdarg.h>
#define MINIEXP_IMPLEMENTATION
#include "miniexp... | TOOL | 0.957283 | 4.589211 |
a669ccfa-78a4-40c4-95ff-35d489c7945e | ArunKarthik05/Zoho-interview-prep | Zoho-problems/Replace-greatest.cpp | #include<bits/stdc++.h>
using namespace std;
void Replace(vector<int> &array){
int maxel= INT_MIN, inx=-1;
for(int i=0;i<array.size()-1;i++){
maxel = INT_MIN;
for( int j=i+1;j<array.size();j++){
if( array[j]>maxel ){
maxel = max(maxel, array[j]);
inx =... | ALGO | 0.999959 | 4.35451 |
7aba92ce-6603-4695-b54f-063019d7dfd7 | KW-CTM/KW-CodingTestMate | Kyeongjeong/2week/04-18.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int size, temp, i, j, total;
vector<int> num, sum;
cin >> size;
for(i = 0; i < size; i++) {
cin >> temp;
num.push_back(temp);
}
for... | ALGO | 0.999977 | 3.832388 |
e5afff82-9ca0-4075-9d77-fd74a01e345f | ishandutta2007/codeforces | est_stella/normal/1326/D1.cpp | #include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false);cin.tie(NULL)
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define eb emplace_back
#define pre(a) cout<<fixed; cout.precision(a)
#define mp make_pair
typedef long lon... | ALGO | 0.999967 | 3.639844 |
e61cbd9a-c855-492d-8ae6-65d5a1e8d427 | ishandutta2007/codeforces | tabr/normal/1381/A2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int tt;
cin >> tt;
while (tt--) {
int n;
cin >> n;
string a, b;
cin >> a... | ALGO | 0.999987 | 4.337722 |
77ed4449-7e03-47c9-9a53-18b3b08672b2 | maahirai/atcoder_solver | abc109/c.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
using vll=vector<ll>;
using vi=vector<int>;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
//pow(llpow,modpow... | ALGO | 0.999934 | 3.759716 |
6a7a36e0-35e0-43b5-ae67-cc6aff20b50d | ishandutta2007/codeforces | leaf1415/normal/1312/D.cpp | #include <iostream>
#include <algorithm>
#include <set>
#define llint long long
#define mod 998244353
#define rep(i, s, t) for(llint (i) = (s); (i) <= (t); (i)++)
using namespace std;
llint n, m;
const int FACT_MAX = 400005;
llint fact[FACT_MAX], fact_inv[FACT_MAX];
llint modpow(llint a, llint n)
{
if(n == 0) retu... | ALGO | 0.999992 | 5.238251 |
dd98fee6-bc67-4165-a9f8-c4e71ae54ac6 | ishandutta2007/codeforces | falldream/normal/746/D.cpp | #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int read()
{
int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
return x*f;
}
int n,k,a,b;
int main()
{
n=read();k=read();a=read();b=read(); bo... | ALGO | 0.999834 | 3.095517 |
a0b38e6b-060b-4f50-9024-0c9a0769061e | xuedingedexingkong/fvm_solver | gmsh/gmsh-4.13.1-source/gmsh-4.13.1-source/src/solver/eigenSolver.cpp | #include "eigenSolver.h"
#include "OS.h"
#if defined(HAVE_SLEPC)
#include <slepceps.h>
#if SLEPC_VERSION_RELEASE != 0 && \
(SLEPC_VERSION_MAJOR < 3 || \
(SLEPC_VERSION_MAJOR == 3 && SLEPC_VERSION_MINOR < 2))
#define EPS... | ALGO | 0.996165 | 5.652997 |
8b5f730a-e979-400b-a2d7-c7e52df14282 | anwar-arif/acm-code | lightoj/1112 - Curious Robin Hood.cpp | #include <bits/stdc++.h>
using namespace std;
#define pf printf
#define sc scanf
#define ll long long
#define SIZ(a) (int)a.size()
#define fil(a,x) memset(a,x,sizeof(a))
#define pb push_back
#define sc1i(a) sc("%d",&a)
#define sc2i(a,b) sc("%d%d",&a,&b)
... | ALGO | 0.999408 | 3.77203 |
3bed58b4-ba81-4663-97ca-b19a169ef162 | KevinMathewT/Competitive-Programming | ChefAndRods1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double ld;
template<class T> ostream& operator<<(ostream &os, vector<T> V) {
os << "[ ";
for(auto v : V) os << v << " ";
os << "]";
return os;
}
template<class T> ostream& operator<<(ostream &os, set<T> S){
os << "{ ";
for... | ALGO | 0.999792 | 3.005239 |
5ecde3f5-e713-4050-8cb1-9a8e4a932caf | euchangxian/LeetCode | C++/0901-OnlineStockSpan/Solution.cpp | #include <iterator>
#include <ranges>
#include <utility>
#include <vector>
constexpr int MAX_N = 1e5;
constexpr auto lessThanOrEqualTo(int price) {
return [price](int p) -> bool { return p <= price; };
}
// Return the span of the Stock's price for the current day.
// The span of a stock on day i is the maximum num... | ALGO | 0.999626 | 6.730445 |
40a2ebe0-3f66-4e40-bfc9-865874aa06e4 | qpDUNES/qpDUNES-dev | externals/qpOASES-3.0beta/src/LAPACKReplacement.cpp | /**
* \file src/LAPACKReplacement.cpp
* \author Hans Joachim Ferreau, Andreas Potschka, Christian Kirches
* \version 3.0
* \date 2007-2014
*
* LAPACK replacement routines.
*/
#include <qpOASES/Utils.hpp>
extern "C" void dpotrf_( const char *uplo, const unsigned long *_n, double *a,
const unsigned long ... | ALGO | 0.999499 | 4.99682 |
a7f1fec8-c393-4c6a-9390-6241ec0fd0b0 | sugaliudaykiran/dsa_labs | Learn_now/Sliding_window.cpp | #include<bits/stdc++.h>
using namespace std;
int sliding_window(int ar[], int n, int k){ // TC -> O(k*n) almost O(n*2) Nested Loop
int Maxs = INT_MIN;
// for (int i=0; i<n-k+1; i++){
// int cur_max = 0;
// for (int j=i; j<k+i; j++){
// cur_max += ar[j];
// }
// i... | ALGO | 0.999946 | 4.990115 |
9b8f05c9-ded3-4b92-b77a-f5e5e9e5a3da | ishandutta2007/codeforces | greencis/normal/479/C.cpp | #include <bits/stdc++.h>
#define pii pair<int,int>
using namespace std;
typedef long long ll;
typedef long double ld;
int n;
pii a[5005];
int main()
{
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> a[i].first >> a[i].second;
}
sort(a,a+n);
int ans = -2e9;
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999927 | 4.222205 |
7784a8c0-a8ea-4f75-9849-2e74b42c122d | OYousryB/Codeforces | 519C - A and B and Team Training/A and B and Team Training.cpp | #include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
int tcases, I, J, K, N, n, m, cnt = 0, len;
cin >> n >> m;
while(1)
{
if(n >= m)
{
if(n >= 2 && m >= 1)
{
n -= 2;
m -= 1;
cnt++;
}
else
break;
}
else
{
if(n >= 1 && m >= 2)
{
n... | ALGO | 0.99997 | 3.124508 |
ff9c13d0-038c-4940-a56d-c193563fe58f | Hambart471/My_Programs | 033_function_predicate/main.cpp | // Predicate
// Works well with standard algorithms
#include <vector>
#include <algorithm>
#include <iostream>
// Shows how functors can be used as predicates
class Person
{
public:
explicit Person(std::string name, double score)
: name(std::move(name)),
score(score){}
bool operator()(const Person& p) const
... | ALGO | 0.999462 | 6.537016 |
51403eb0-3046-42e0-9d40-8d9389c980ba | lesyeuxdelamour/DSAStudyingPTIT | Binary Tree/DSA11026.cpp | #include <bits/stdc++.h>
#define _sinusoid_() int main()
#define endl "\n"
#define faster(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
struct Node
{
int n;
Node *left, *right;
Node(int n)
{
this->n = n;
this->left = this->right =... | ALGO | 0.999891 | 5.556276 |
c885134f-1ad3-4ca4-907e-af3783cb10d8 | sxu39/TP-RPMD | lammps-stable_2Aug2023_update2/src/ML-RANN/rann_fingerprint_radial.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing authors: Christopher Barrett (MSU) <EMAIL>
Doyl Dickel (MSU) <EMAIL>
----------------------------------------------------------------------*/
/*
“The research described and t... | ALGO | 0.997571 | 6.24816 |
db0d9682-bf3f-4daf-8da4-6206bd86e36d | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9856_2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
long long n, d = 0, m = 0, x = 0, k = 0, mn = 1e9 + 7, v = 0, w = 0, h = 0,
i = 0, j = 0, l = 0, r = 0, c = 0, ans = 0;
cin >> n >> k;
vector<pair<int, pair<int, int>>> a(n);
vector<pair<long long,... | ALGO | 0.999996 | 3.435993 |
069a08aa-a273-465b-a33a-230b5d9b70a9 | mdhlimonmia/Codeforces_Problem_Solution | E_Triple_Operations.cpp | /// *** --- ||| In the name of ALLAH ||| --- *** ///
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, doubl... | ALGO | 0.999835 | 3.74179 |
b7e7bfb4-b5bb-42d8-91b8-3736a85e9208 | Gaebobman/Algorithm-2022 | Univ/Problem Solving/Problem Solving/Problem Solving/re_Week13_B_12171735_JunpyoLee.cpp | // CORRECT
#include <iostream>
#include <algorithm>
#include <vector>
#include <limits.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int T;
cin >> T;
while (T--) {
int N, M, Q, u, v, w;
cin >> N >> M >> Q;
vector<vector<int>> G(N, vector<int>(N, INT_MA... | ALGO | 0.999983 | 5.110325 |
b0911db2-c215-4a73-a53f-07f7da9bea21 | malvikpandey/CB_DSA | Patterns/pwz.cpp | #include<iostream>
using namespace std;
int main(){
int num=1, n;
cin>>n;
for(int i=1; i<=n;i++){
for(int j=1; j<=i; j++){
if( j!=1 && j!=i && num>=3 ){
cout<<'0'<<'\t';
}else{
cout<<num<<'\t';
}
}
num++;
... | ALGO | 0.999988 | 3.562268 |
60404175-f2bf-45b2-ad97-04e1b34219af | Zutong/leetcode | zt/code7/reverse.cpp | class Solution {
public:
int reverse(int x) {
double ans=0;
while (1) {
ans = ans * 10 + x % 10;
x = x / 10;
if (x == 0) { break; }
}
return (ans > INT_MAX||ans<INT_MIN? 0:ans);
}
};
| ALGO | 0.999933 | 5.581089 |
530e0aa3-6486-4f45-8ac7-b216241d7d29 | arjkashyap/computer-programming-basics | Array/arrayRotation-jugglingAlgo.cpp | // C++ program to rotate an array by
// d elements
#include <bits/stdc++.h>
using namespace std;
/*Fuction to get gcd of a and b*/
int gcd(int a, int b)
{
if (b == 0)
return a;
else
return gcd(b, a % b);
}
/*Function to left rotate arr[] of siz n by d*/
void leftRotate(int arr... | ALGO | 0.999933 | 6.543456 |
3837c599-a7a1-46f9-85ac-ffa1230ca4a9 | skywhat/leetcode | Cpp/853.cpp | // N cars are going to the same destination along a one lane road. The
// destination is target miles away.
//
// Each car i has a constant speed speed[i] (in miles per hour), and initial
// position position[i] miles towards the target along the road.
//
// A car can never pass another car ahead of it, but it can cat... | ALGO | 0.999512 | 6.104434 |
62c88b2c-957c-4b64-b79e-b76498a92488 | GyaneshwerJha/SDE-SINK | 1706-min-cost-to-connect-all-points/min-cost-to-connect-all-points.cpp | class Solution {
public:
public:
int minCostConnectPoints(vector<vector<int>>& input) {
int n = input.size();
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
vector<int> visited(n, 0);
pq.push({0, 0});
int minCost = 0;
while ... | ALGO | 0.999949 | 6.120004 |
1034a6d5-05ac-4d37-a76d-80f2e793375c | DreamingCats/Solutions_of_Algorithm_Notes | 第05章 数学问题/5.8 组合数/组合数取模II.cpp | #include<iostream>
#include<cstring>
#include<vector>
using namespace std;
typedef unsigned long long ll;
const ll maxn=1000001;
bool isPrime[maxn];
vector<ll> primes;
ll i;
void getPrimes(){ //õ
memset(isPrime,true,sizeof(isPrime));
for(ll i=2;i<=maxn;i++){
if(isPrime[i]){
primes.push_back(i);
for(ll j=i<... | ALGO | 0.999994 | 4.190496 |
196c81ab-3768-43f0-8f4a-9cde2ea922df | ghufrankhan7860/DP_Revision | 6 DP on Stocks/dp37.cpp | // Best Time to Buy and Sell Stock III
// Problem statement
// You are Harshad Mehta’s friend. He told you the price of a particular stock for the next ‘n’ days.
// You are given an array ‘prices’ which such that ‘prices[i]’ denotes the price of the stock on the ith day.
// You don't want to do more than 2 transaction... | ALGO | 0.999967 | 5.792549 |
6e8a9eb5-69b3-4d0f-bb7d-baa9fb462e1e | rathoresrikant/interviewbit | Trees/sorted_array_to_balanced_BST.cpp | /*
Sorted Array To Balanced BST
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
Balanced tree : a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by more than 1.
Example :
Given A : [1, 2, 3]
A h... | ALGO | 0.999977 | 6.529614 |
b146c1cc-5ac2-419c-bb47-f970dba7130d | ButakovBI/Algorythms-DataStructures | gordenko/Simple graph theory/C. Codim. Colored rain.cpp | #include <iostream>
#include <vector>
int main() {
int n = 0;
std::cin >> n;
std::vector<std::vector<int>> matrix(n, std::vector<int>(n));
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
std::cin >> matrix[i][j];
}
}
std::vector<int> colors(n);
for ... | ALGO | 0.999754 | 5.914763 |
d578fdcc-05ae-4b61-9231-4d97b9e35bb7 | ChuanqiXu9/clang-modules-converter | llvm/lib/Support/SpecialCaseList.cpp | #include "llvm/Support/SpecialCaseList.h"
#include "llvm/Support/LineIterator.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/VirtualFileSystem.h"
#include <stdio.h>
#include <string>
#include <system_error>
#include <utility>
namespace llvm {
Error SpecialCaseList::Matcher::insert(StringRef Pattern,... | TOOL | 0.855494 | 7.777138 |
5e4abf03-0ffd-41ab-ac9b-30ad3a610006 | nefrttPrabhu/leetstore | 236-lowest-common-ancestor-of-a-binary-tree/lowest-common-ancestor-of-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
if (root == ... | ALGO | 0.999988 | 6.435311 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.