uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
84abd9d7-e10d-45d8-b645-65b8fd5df95e | MAZHARMIK/Interview_DS_Algo | Sliding Window/Minimum Size Subarray Sum.cpp | /* Scroll below to see JAVA code also */
/*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=D2MbogiFXWU
Company Tags : Google, Accolite, Amazon, Facebook, Goldman Sachs
Leetcode Link : https://leetcode.com/problems/minimum-size-subarray-sum/
Simil... | ALGO | 0.999505 | 5.68415 |
ad7934b0-d019-453b-830c-466237f29606 | kanhaiya143/Leetcode-solutions | 494-target-sum/494-target-sum.cpp | class Solution {
public:
unordered_map<int,unordered_map<int,int>> dp;
int all(vector<int>& nums, int &count, int n, int target, int begin, int sum){
if(begin==n){
if(target==sum){
count++;
return 1;
}
return 0;
}
... | ALGO | 0.999988 | 5.96332 |
f9933d5f-e525-4b4c-8bc8-cd2a5fbbe451 | muhammadrofiq586/finall | thirdparty/embree/kernels/bvh/bvh_intersector_hybrid.cpp | #include "bvh_intersector_hybrid.h"
#include "bvh_traverser1.h"
#include "node_intersector1.h"
#include "node_intersector_packet.h"
#include "../geometry/intersector_iterators.h"
#include "../geometry/triangle_intersector.h"
#include "../geometry/trianglev_intersector.h"
#include "../geometry/trianglev_mb_intersector.... | ALGO | 0.999649 | 7.290206 |
168e7757-45c5-4af3-b210-62a9b1528735 | Sean0628/competitive_programming | atcoder/abc/abc223/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int, int>;
int main() {
int x; cin >> x;
if (x != 0 && x % 100 == 0) cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
}
| ALGO | 0.999582 | 3.603857 |
96b1fb25-451a-4283-9ce9-9ab074c1bc10 | nickkolok/didact-tp | exercises-listings/unite-for-1.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
int main()
{
cout << "Введите строку: ";
char str[256];
gets(str);
int count = 0;
for (const char *p = str; *p; p++)
if (*p == 'a')
count++;
cout << "Количество букв 'a' в строке = " <<count<<endl;
int count1 = ... | ALGO | 0.961651 | 3.16483 |
b7375de3-4156-439f-8869-0ce3290f1e9b | petewat/cp | apio19bridges.cpp | #include<iostream>
#include<stack>
#include<map>
#include<vector>
#include<string>
#include<unordered_map>
#include <queue>
#include<cstring>
#include<algorithm>
#include<limits.h>
#include<set>
#include<cmath>
#include<bitset>
using namespace std;
#define ll long long
#define f first
#define endl "\n"
#define s second... | ALGO | 0.999956 | 4.280274 |
61144b7b-5ec3-48b1-a395-2c26f0fb52f5 | GabrielMonS/AoC2024 | Day1/src/functions.cpp | #include "functions.h"
#include <iostream>
#include <algorithm>
namespace Day1{
void orderList(std::vector<int> &list){
std::sort(list.begin(), list.end());
}
unsigned int getTotalDistance(std::vector<int> firstList, std::vector<int> secondList){
unsigned int totalDistance = 0;
for(... | ALGO | 0.996797 | 4.512287 |
bee65f32-809a-4e7e-96aa-42aff836e2e4 | Sujal3013/CP-practice | Implementation/640A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int sum=0;
int digits=(int)(floor(log10(n)+1));
if(digits==1){
cout<<"1"<<endl;
cout<<n<<endl;
continue;
}
string s=... | ALGO | 0.999641 | 4.605525 |
6a12d46c-4ab5-4b10-a804-9453d7bc6e49 | lyciumlee/learn_leetcode_easy | Largest Odd Number in String.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
string largestOddNumber(string num)
{
for(int i = num.size()-1; i >= 0; i--)
{
if((num[i] - '0') & 1)
{
return num.substr(0, i+1);
}
}
return string("")... | ALGO | 0.999901 | 5.719622 |
0fc6b845-9938-4139-b09f-59284307e4a1 | rosyidId/Belajar_cpp | bab-18/stl_find.cpp | /******************************************************
Nama file: stl_find.cpp
*******************************************************/
#include <iostream>
#include <vector> // std::vector
#include <algorithm> // std::find()
int main() {
std::vector<std::string> v = {"C++","C","Ruby","Java","Python"};
... | ALGO | 0.999479 | 5.502616 |
f7ce2eaa-4ce1-40ad-8a7e-277e16b85cf0 | kashish281/GfG-Daily-Practice | Difficulty: Easy/Roof Top/roof-top.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to find maximum number of consecutive steps
// to gain an increase in altitude with each step.
int maxStep(vector<int>& arr) {
// Your code here
int maxi = arr[... | ALGO | 0.999809 | 6.131087 |
865b6c87-3718-420d-ac9b-7527fece6889 | feng-jianwei/obstacle | code/luogu/sort/p1068.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Player {
int id {};
int score {};
bool operator <(const Player& rhs) const
{
if (score != rhs.score) {
return score > rhs.score;
}
return id < rhs.id;
}
};
int main()
{
in... | ALGO | 0.999983 | 4.452122 |
b17f9ed3-b95f-426f-afb2-a682f3b62505 | umair-666/DSA-everyday | DSA questions/POTD/Leetcode/16th_April - Add One Row to Tree.cpp | // 623. Add One Row to Tree
// https://leetcode.com/problems/add-one-row-to-tree/description/?envType=daily-question&envId=2024-04-16
#pragma GCC optimize("O3", "unroll-loops")
class Solution {
void dfs(TreeNode* root, int val, int depth, int level){
if (!root) return;
if (level < depth-1)... | ALGO | 0.999982 | 6.699698 |
30eaaa60-b8e7-4fe5-963e-86e9ed20ae8c | MennaAllahZakaria/DataStructure | Sorting/Increasing order/Heap_sort.cpp | // اللهم لا سهل الا ما جعلته سهلا و انت تجعل الصعب ان شئت سهل
#include <bits/stdc++.h>
#define nl "\n"
#define sz(x) int(x.size())
using namespace std;
template<typename T = int> istream& operator>>(istream& in, vector<T>& v){
for (T& i : v) in >> i;
return in;
}
templa... | ALGO | 0.999969 | 4.722073 |
d6dba2cb-24ba-44be-b611-373e3fa35dae | flatsim/flatsim | examples/test_carrot.cpp | #include <chrono>
#include <iostream>
#include <thread>
#include <vector>
#include "flatsim/loader.hpp"
#include "flatsim/simulator.hpp"
#include "flatsim/types.hpp"
#include "rerun/recording_stream.hpp"
int main(int argc, char *argv[]) {
std::cout << "=== Carrot Algorithm Path Following Test ===" << std::endl;
... | TEST | 0.931088 | 6.279472 |
3adf4f7b-56d6-4d29-8db7-9fdc9b2a4f3f | lyh4967/MyAlgorithm | MyAlgorithm/MyAlgorithm/CODE_MONSTER_2018/Q2.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
int map[201][201];//0: ĭ, 1:, 2:
int main() {
int N;//
int M;//
int answer = 0;
cin >> N >> M;
vector<vector<int>> house;
for (int i = 0; i < M; i++) {
vector<int> tmp;
int tmpX, tmpY;
cin >> tmpX >> tmpY;
tm... | ALGO | 0.999887 | 3.964027 |
ef17601a-7a14-4831-afc5-2a7063687ae6 | fang-yu-liu/path-planning | src/path_planner.cpp | #include "path_planner.h"
/**
* Initializes Path Planner
*/
Path_Planner::Path_Planner(){}
Path_Planner::Path_Planner(int total_num_lanes, double desired_speed, double ref_speed, double max_acceleration) {
this->total_num_lanes_ = total_num_lanes;
this->desired_speed_ = desired_speed;
this->ref_speed_ =... | ALGO | 0.996206 | 4.231499 |
1fe34543-3554-4c3a-a877-50e505ed98a7 | sunilkumarmaurya786693/solution-leedcode-codechef-codeforces-gfg-interviewbits-hackerEarth-HackerRank | leetcode/two pointer/350_Intersection_of_Two_Arrays_II.cpp | // question link
// https://leetcode.com/problems/intersection-of-two-arrays-ii/
// Given two arrays, write a function to compute their intersection.
// Example 1:
// Input: nums1 = [1,2,2,1], nums2 = [2,2]
// Output: [2,2]
// Example 2:
// Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
// Output: [4,9]
#include <bit... | ALGO | 0.999996 | 4.696172 |
c2565d1d-4a72-468d-be14-9638afa98584 | gihwanJang/Algorithm | cpp/Baekjoon1967/Baekjoon1967.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#define INF 1234567891
using namespace std;
struct edge{
int e, v;
edge(int E, int V): e(E), v(V){}
};
pair<int,int> dijkstra(vector<vector<edge>>&tree, int start){
pair<int,int> res = {start,0};
pair<int,int> curr, next;
... | ALGO | 0.999725 | 4.315042 |
6afafeda-c1e4-40ab-aadf-f432b5ecf80f | TadeOfAndorhal/P3_31985_TC | PWIR_5/kod_9_zad_2.cpp | #include <thread>
#include <cstdio>
#include <windows.h>
#include <time.h>
thread_local unsigned int counter = 0;
//unsigned int counter = 0;
int* generowanie()
{
srand(time(NULL));
int* my_array = new int[100];
for (size_t i = 0; i < 100; i++)
my_array[i] = rand() % 10 + 1;
return my_array;
}... | TOOL | 0.986196 | 3.774777 |
a57388df-4f18-4edb-b8bb-e0ffa27aad7a | WillForEternity/MultiSim | src/neural_network.cpp | // neural_network.cpp
#include "../include/neural_network.h"
#include "../include/common.h"
#include "../include/quadruped.h"
#include "../include/socket.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <sstream>
#include <string>
// --- Hyperparameters ---... | ALGO | 0.999452 | 5.673735 |
d17dfcca-35b4-40bc-92f0-2b2568cddf34 | mnscoin/mnscoin | src/rest.cpp | #include "chain.h"
#include "primitives/block.h"
#include "primitives/transaction.h"
#include "main.h"
#include "httpserver.h"
#include "rpc/server.h"
#include "streams.h"
#include "sync.h"
#include "txmempool.h"
#include "utilstrencodings.h"
#include "version.h"
#include <boost/algorithm/string.hpp>
#include <boost/d... | WEB | 0.937177 | 5.06782 |
18b95e92-5ee4-4d94-aea3-530b2c70f7be | CFOP2357/CtCi | Chapter 8 - Recursion and Dynamic Programming/8_11_ Coins.cpp | #include <iostream>
#include <vector>
using namespace std;
int coins(int n){
vector<int> dp(n+1, 0);
const vector<int> c= {25, 10, 5, 1};
for(int i=0; i<c.size(); i++)
if(n>=c[i])
dp[c[i]]=1;
for(int i =1; i<=n; i++)
for(int coin : c)
if(i>coin)
dp[i] += dp[i-coin];
return dp[n];
}
int main(){
... | ALGO | 0.991368 | 4.235589 |
8c0c0481-22db-4e0a-bf30-40ca6822bbbb | thefstalphabet/100DaysOfCode | Day 04/ContainerWithMostWater.cpp | class Solution {
public:
int maxArea(vector<int>& height) {
int left = 0; //starting point of array
int right = height.size()-1; // ending point of array
int result = 0; // main result
while(left<right){
int area; //area where water store
if(height[left] < hei... | ALGO | 0.999947 | 6.614771 |
aa782031-260e-4447-98a7-e703d2a80cd9 | orwel1984/cpp | Templates/main.cpp | //
// main.cpp
// Sorting
//
// Created by tanweer ali on 28/05/2021.
//
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <cmath>
#include <memory>
// Example 1: TEMPLATE CLASS EXAMPLE
// A simple generic Array with fixed size 2.
template <typename T>
class ArrayOf2
{
public:
... | TOOL | 0.964031 | 5.189362 |
e618b0ff-3354-43ed-a2ee-b85ce952ba8f | ishandutta2007/codeforces | deemo/normal/707/B.cpp | #include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int n, m, k, x[MAXN], mark[MAXN];
vector<pair<int, int>> adj[MAXN];
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> m >> k;
if (k == n || k == 0){
cout << "-1\n";
return 0;
}
while (m--){
int a, b, c; cin >> a >> b ... | ALGO | 0.999977 | 3.993223 |
c11f9193-403d-438c-a09d-94f4336533f8 | Manteg-Singh/CP-Problems | a.cpp | #include <iostream>
#include<vector>
using namespace std;
int maximumWealth(vector<vector<int>>& accounts) {
int ans=0,sum=0;
for(int i=0;i<accounts.size();i++)
{
sum=0;
for(int j=0;j<accounts[i].size();j++)
{
sum+=accounts[i][j];
... | ALGO | 0.999485 | 4.84679 |
1cbec7f8-f3bf-447b-8c65-a21cc1eb8bc2 | devesh95official/CUH_DSA | 21_Time-Space Analysis/O2n_naive_fib.cpp | #include <bits/stdc++.h>
using namespace std;
long long fib(int n) {
if (n <= 1) return n;
return fib(n-1) + fib(n-2); // O(2^n)
}
int main() {
int n = 35; // keep small so it finishes
cout << fib(n) << "\n";
return 0;
}
| ALGO | 0.999989 | 5.261951 |
61402d9a-1a16-4b6d-99b1-3a76e132c5d8 | ishandutta2007/codeforces | xuanquang1999/normal/84/B.cpp | using namespace std;
#include <bits/stdc++.h>
#define fdto(i, r, l) for(int i = r; i >= l; --i)
#define fto(i, l, r) for(int i = l; i <= r; ++i)
#define forit(it, type, var) for(type::iterator it = var.begin(); it != var.end(); it++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define fi first
#define se second... | ALGO | 0.999853 | 3.497703 |
64363241-6f91-420b-8d9e-3e37a4c2fd8a | tjira/hazel | src/gradient.cpp | #include "gradient.h"
Matrix Gradient::get(const System& system, const std::function<double(System)>& efunc, bool print) const {
// define the gradient matrix
Matrix G(system.atoms.size(), 3);
// print the header
if (print) std::printf("\n ELEM dE [Eh/Bohr] TIME\n");
// fill the grad... | ALGO | 0.998126 | 4.906975 |
37bff505-3ee1-4684-bfbb-5d5444393b55 | shekharbhide/DSA-Questions-CPP | 10_RECURSION/Easy/05_cut_rod_into_segments.cpp | #include<bits/stdc++.h>
using namespace std;
int solve(int n,int x,int y,int z){
//base case
if(n==0){
return 0;
}
if(n < 0){
return INT_MIN;
}
int ans1 = solve(n-x,x,y,x) + 1;
int ans2 = solve(n-y,x,y,z) + 1;
int ans3 = solve(n-z,x,y,z) + 1;
int ans = max(ans1,max... | ALGO | 0.99994 | 3.887371 |
c348a71b-90cb-4b12-acc3-002ad39b17d5 | hoangtrietdev/Learning-OpenGl-with-ubuntu | common/objloader.cpp | #include <vector>
#include <stdio.h>
#include <string>
#include <cstring>
#include <glm/glm.hpp>
#include "objloader.hpp"
// Very, VERY simple OBJ loader.
// Here is a short list of features a real function would provide :
// - Binary files. Reading a model should be just a few memcpy's away, not parsing a file at ... | TOOL | 0.937376 | 4.801904 |
4dc66cf8-cc1f-47a6-9536-9c04f5965f4e | ishaantiku29/GFG-Problems | Medium/Number of Good Components/number-of-good-components.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:
int cnt=0;
int cnt1=1;
void dfs(int node,vector<vector<int>> &adj,vector<int> &vis)
{
vis[node]=1;
cnt+=(... | ALGO | 0.999928 | 6.446185 |
ef7fa086-6a28-43c8-a1fe-65821eef1b70 | suyi-92/UESTC | 2349.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
int n, m, L, R, a, b, c, d;
scanf("%d", &T);
while (T--)
{
int mTime = 0;
scanf("%d%d%d%d%d%d%d%d",&n,&m,&L,&R,&a,&b,&c,&d);
mTime += abs(a - c);
if(b>L&&b<R&&d>L&&d<R)
mTime += min(b + d - ... | ALGO | 0.999046 | 3.20601 |
b73e6e0f-601a-4a7a-b74b-492ce268178a | NewUU-I2P/homework-3-bekzod-mukhamedov-2110203 | problems/problem_5.cpp | float problemSolution5(float x, float y, char operation) {
float result;
// write your code here
return result;
}
| ALGO | 0.986831 | 3.497573 |
a3cb31c9-0dba-4003-8b2b-0c06baa715a8 | ovalerio/omp_confab | src/matrix.cpp | #include <openbabel/babelconfig.h>
#include <openbabel/matrix.h>
#include <cstdio>
using namespace std;
namespace OpenBabel
{
void print_matrix(std::vector<std::vector<double> > &m)
{
unsigned int i,j;
for (i = 0; i < m.size(); ++i)
{
for (j = 0; j < m[i].size(); ++j)
printf("%5.2f",... | TOOL | 0.977294 | 4.35815 |
481fa399-28f9-4844-977c-d0161169a41f | alaminmiah4274/algorithm | disjoint_set_union/union_by_size.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int parent[N];
int group_size[N];
void dsu_initialization(int n)
{
for (int i = 0; i < n; i++)
{
parent[i] = -1;
group_size[i] = 1;
}
}
int find_leader(int node)
{
if (parent[node] == -1) return node;
int leader =... | ALGO | 0.999922 | 4.497409 |
bbbb63ec-89cf-423a-bc7d-3d0bcc1b4555 | Hashcode/platform_external_opencore | codecs_v2/audio/aac/dec/src/fwd_short_complex_rot.cpp | /*
Pathname: ./src/fwd_short_complex_rot.c
Funtions: fwd_short_complex_rot
------------------------------------------------------------------------------
REVISION HISTORY
Date: 10/18/2002
Description:
(1) Change the input argument, only a single max is passed.
(2) Eliminate search for ma... | ALGO | 0.999751 | 5.329768 |
a43e85a3-9255-49b9-8522-d3e9d46c8f53 | beardog-ukr/uncrustify-config-examples | examples/align/align_same_func_call_params_span/v_2.cpp | #include <iostream>
int booFunct(int fp, int sp, int tp);
int booFunct2(int fp, int sp, int tp);
int main()
{
int aa, x = 10;
int y = 20;
booFunct(100, y, 5);
booFunct(x, 100, y);
return 0;
}
| TOOL | 0.922312 | 4.355925 |
2aec1953-5d1e-4691-8c5c-70b8b5bc489b | shaobingbing/lintcode | stack_related.cpp | #include<stack>
#include<vector>
#include<iostream>
using namespace std;
void print(stack<int> s);
// 对栈进行排序,可以将其放入到另外一个栈中,但不可以借助数组实现
void stackSorting(stack<int> &stk);
int main()
{
vector<int> v = {4,2,1,3};
stack<int> s;
for(int i = 0; i < v.size(); i++)
{
s.push(v[i]);
}
stackSorting(s);
print(s);
retur... | ALGO | 0.999955 | 4.748563 |
735645f9-2b64-4dc4-9abe-c48a9435520c | gabrielbeauchemin/eigen-faces | imn-tp1/deps/eigen/unsupported/doc/examples/PolynomialSolver1.cpp | #include <unsupported/Eigen/Polynomials>
#include <vector>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
typedef Matrix<double,5,1> Vector5d;
Vector5d roots = Vector5d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,6,1> polynomial;
roots_to_mo... | TEST | 0.999401 | 4.69287 |
ad9af25e-0fa4-48b5-91a6-e25980f2c22c | yijan29/2020cce | week13/2.cpp | #include<iostream>
using namespace std;
int GCD(int a, int b){
int n,ans=1;
if(a<b)n=a;
else n=b;
for(int i=2;i<=n;i++){
if(a%i==0 && b%i==0) ans=i;
}
return ans;
}
int main(){
int a,b;cin>>a>>b;
cout<<GCD(a,b)<<endl;
return 0;
}
| ALGO | 0.999914 | 4.750338 |
12fb0b2d-c820-4fe5-9587-91f12050dcbe | UnpureRationalist/myLeetcodeAnswer | other/189旋转数组.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
class Solution
{
public:
void rotate(vector<int> &nums, int k)
{
int n = nums.size();
k %= n;
if (k == 0)
return;
vector<int> temp(n);
for (int i = 0; i < n; ++i)... | ALGO | 0.999963 | 5.299739 |
5de98747-a581-4d22-a248-b7ed43944a1e | SmittyHalibut/HamClock | calibrate.cpp | #define _CALIBRATE_C_
/****************************************************/
/* */
/* Included files */
/* */
/****************************************************/
#include "calibrate.h... | ALGO | 0.998328 | 4.566585 |
7a961497-119c-48e6-ad78-290875b8332f | kasa021/atcoder-archives | abc146/abc146_c_38147843_AC.cpp | /*
* Author: kAsA02
* Submission URL: https://atcoder.jp/contests/abc146/submissions/38147843
* Submitted at: 2023-01-19 04:49:10
* Problem URL: https://atcoder.jp/contests/abc146/tasks/abc146_c
* Result: AC
* Execution Time: 5 ms
*/
#include <bits/stdc++.h>
#include <cmath>
#if __has_include(<atcoder/all>)
#i... | ALGO | 0.999638 | 3.892116 |
aadb70ee-4427-417b-a24f-5ba575ced35c | starga2er777/PointCloudCompression | 3rdparty/carotene/src/cmp.cpp | #include "common.hpp"
#include "vtransform.hpp"
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
inline void vnst(u8* dst, uint8x16_t v1, uint8x16_t v2) { vst1q_u8(dst, v1); vst1q_u8(dst+16, v2); }
inline void vnst(u8* dst, uint16x8_t v1, uint16x8_t v2) { vst1q_u8(dst, vcombine_u8(vmovn_u16(v1), vmovn_u16(v... | ALGO | 0.989357 | 6.2177 |
3305c60e-f675-45be-b6a5-6bbe34e08d83 | Admer456/halflife-twhl-tutorials | game_shared/shared_util.cpp | // Author: Matthew D. Campbell (<EMAIL>), 2003
#include <port.h>
#include <stdarg.h>
#include "shared_util.h"
#ifndef _WIN32
#define _vsnwprintf vswprintf
#endif
static char s_shared_token[ 1500 ];
static char s_shared_quote = '\"';
//---------------------------------------------------------------------------------... | TOOL | 0.971011 | 5.480612 |
74395f27-ccea-4556-b612-55c4800085d7 | rootrasel/Introduction-to-Algorithms | Course-module/Module 19/Road_Reparation_Kruskal.cpp | #include <bits/stdc++.h>
using namespace std;
class Edge
{
public:
int a, b, w;
Edge(int a, int b, int w)
{
this->a = a;
this->b = b;
this->w = w;
}
};
bool cmp(Edge a, Edge b)
{
return a.w < b.w;
}
const int N = 1e5 + 5;
int parent[N];
int parentSize[N];
void dsu_set(int n)
... | ALGO | 0.999991 | 4.8755 |
89a219cc-3ade-4465-90ec-859dc708537c | knucklebal1/ACM-Day1 | evenOdd.cpp | #include <iostream>
#include <algorithm>
#include <string.h>
using namespace std;
int main(){
int N;
char s[61];
cin>>N;
for(int i=0;i<N;i++){
cin>>s;
if((s[strlen(s)-1]-'0')%2==0){
cout<<"even\n";
}else{
cout<<"odd\n";
}
}
return 0;
}
| ALGO | 0.999756 | 4.022583 |
6558f635-8caa-479e-a74f-d807c08232bc | Alaxe/noi2-ranking | 2017/solutions/B/IJG-Pleven/progres.cpp | #include<iostream>
#include<cmath>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
long long n, ok, br, a[1100];
int main ()
{
cin>>n;
for (int i=1; i<=n; i++)
cin>>a[i];
for (int i=2; i<=n; i++)
if (a[i]-a[i-1]>0) ok++;
if (ok==n-1)
{
ok=0;
... | ALGO | 0.999983 | 3.404261 |
784dea30-2f50-4610-bc8a-7a810cb52217 | LuvKobe/StudyCode-2023 | Code_01_27/多态7.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
using namespace std;
////
//class Person {
//public:
// Person(const char* name)
// :_name(name)
// {}
//
// // 麯
// virtual void BuyTicket()
// {
// cout << _name << "PersonƱ-ȫ 100" << endl;
// }
//
//protected:
// string _name;
//};
//
//... | TOOL | 0.936867 | 4.027424 |
7392ee47-3c0b-45d8-8896-66443a45359a | tylerlong/flutter_firebase_demo | 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.99887 | 6.783439 |
43e2a791-7cb9-4d3d-b88f-c22af2855a59 | wanimaru47/CodeForces | 329.2.b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
int main() {
int n;
ll x1, x2;
cin >> n >> x1 >> x2;
vector<P> v;
for (int i = 0; i < n; i++) {
ll k, b;
cin >> k >> b;
ll y1 = k * x1 + b;
ll y2 = k * x2 + b;
v.... | ALGO | 0.99996 | 3.642333 |
3220a48d-5b4a-4301-9519-263812f440da | Nitish-web-nik/LeetCode-Practice-Problems | 0231-power-of-two/0231-power-of-two.cpp | class Solution {
public:
bool isPowerOfTwo(int n) {
if(n < 1)
return false;
if(n ==1)
return true;
if((n & (n -1)) == 0)
return true;
return false;
}
}; | ALGO | 0.995525 | 6.3268 |
e1ab405a-6be1-4d4d-8a00-34fb19942aaf | cy-org/docs-samples | snippets/cpp/VS_Snippets_CLR/IComparable`1 Example/CPP/source.cpp | //<snippet1>
#using <System.dll>
using namespace System;
using namespace System::Collections::Generic;
public ref class Temperature: public IComparable<Temperature^> {
protected:
// The underlying temperature value.
Double m_value;
public:
// Implement the generic CompareTo method with the Temperature clas... | TOOL | 0.971056 | 6.35934 |
2c2a649e-0bc3-4891-8f35-b5ff1ddfab79 | kimsaehun/CsufCpsc121Si | QuestProjects/CPSC121SIQuest10/CPSC121SIQuest10/main.cpp | /*
Sae Hun Kim
CPSC 121 SI Quest 10
This program calculates the sum from 0 to the user given input.
*/
#include <iostream>
#include <string>
using namespace std;
int main() {
// Declare variables
int input = 0, sum = 0;
char again = '\0';
bool quit = false;
while (!quit) {
cout << "Enter number: ";
cin >> ... | ALGO | 0.978665 | 4.065515 |
207ed25b-622d-418b-b890-927cadfdffb0 | mantask/usaco | contest/2005-2006 01 Qualification/allow.cpp | /*
PROB: allow
LANG: C++
*/
#include <fstream>
#include <cstdlib>
using namespace std;
struct Coin {
long value, count;
} coins[20];
long sum, totalCoins;
long weeks;
void Read()
{
ifstream f("allow.in");
f >> totalCoins >> sum;
for (int ck = 0; ck < totalCoins; ck++)
f >> coins[ck].value >> coins[ck].count;
... | ALGO | 0.999837 | 3.609038 |
424bc3d6-a012-4752-b89c-dc465bb8f566 | imatry/projet-Euler | Euler 03 Largest Prime Factor.cpp | #include <stdio.h>
void find_factors(long long int n) {
long long int i;
while (n % 2 == 0) {
printf("%lld ", 2);
n /= 2;
}
for ( i = 3; i*i<=n; i+= 2) {
while (n % i == 0) {
printf("%lld ", i);
n /= i;
}
}
if (n > 2) {
printf("%l... | ALGO | 0.999536 | 4.607921 |
d39d35a6-1dd6-4b0b-8c37-a778ee3a066e | runru1030/PS | 10000-19999/10872.cpp | #include<iostream>
using namespace std;
int fac(int n){
if(n<=1)return 1;
return n*fac(n-1);
}
int main(){
int n;
cin>>n;
cout<<fac(n);
return 0;
} | ALGO | 0.999962 | 4.66188 |
dd5ec05f-fa1e-4371-9524-fc0630b3ba6a | qumingzizhenmafan/algorithmStudy | leetcode/3042/zyf/zyf.cpp | #include "../../stdc.h"
class Solution {
int isPrefixAndSuffix(string a, string b){
size_t na = a.size();
size_t nb = b.size();
if(na > nb) return 0;
if(a == b.substr(0,na) && a == b.substr(nb - na, na)) return 1;
else return 0;
}
public:
int countPrefixSuffixPairs(v... | ALGO | 0.999783 | 5.921416 |
93e3f163-8b90-47e9-a8f1-b8b48645ce58 | murugan-k-0204/Competitive-Programming | Leet-Code/0386 Lexicographical Numbers/iterative - 0ms .cpp | class Solution {
public:
vector<int> lexicalOrder(int N) {
vector<int> res(N);
for (int i = 0, curr = 1; i < N; ++i) {
res[i] = curr;
if (curr*10 <= N)
curr *= 10;
else {
if (curr >= N)
curr /= 10;
... | ALGO | 0.999867 | 6.072079 |
4891a2e9-0cd1-45ba-9bed-efb0347b5478 | divyanshusharma3031/leetcode | Floor in a Sorted Array - GFG/floor-in-a-sorted-array.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// Function to find floor of x
// n: size of vector
// x: element whose floor is to find
int findFloor(vector<long long> arr, long long n, long long x){
// Your code h... | ALGO | 0.999953 | 5.705916 |
cc9b6b2a-25ec-46dc-acbf-ed257d96c5ad | shadowstacker21/C-Algorithm | shortest_path.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int>adj_list[1005];
bool visit[1005];
int parent[1005];
void BFS(int source)
{
queue<int>q;
q.push(source);
visit[source]=true;
while(!q.empty())
{
int p=q.front();
q.pop();
for(int child : adj_list[p])
{
... | ALGO | 0.999995 | 4.031046 |
5fff0a49-4af6-450a-8e5a-445d36376d80 | weii0831/111700002garbage | 6-1.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
string s, token, line, c1, c2;
int yy, mm, dd, hour, min;
stringstream ss;
getline(cin, s);
getline(cin, line);
ss << line;
getline(ss, token, '/');
y... | ALGO | 0.99838 | 3.700755 |
451f706b-8926-4232-b781-ab0b0ff471b4 | varovleonid/-2.1- | лр(2.1).cpp | #include <iostream>
#include <string>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <Windows.h>
#include <cctype>
#include <limits>
using namespace std;
char CharInputValidation(char ch, string s);
int InputValidation(int num, string s);
int PositiveInputValidation(int num, string s);
int main()
{
... | ALGO | 0.97711 | 4.266326 |
0ee184d4-408a-4250-a3ab-fa84d74afb17 | mpragnay/Operations-Research | BFS using North West Corner Rule/q8a.cpp | #include <bits/stdc++.h>
#define mod 1000000007
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);cout.precision(dbl::max_digits10);
#define pb push_back
#define mod 1000000007 //998244353
#define ll long long
#define lli long long int
#define ld long double
#define vi vector<int>
#define vll v... | ALGO | 0.999877 | 4.296811 |
aa5640a6-ee1d-453d-9c05-1a6907455c97 | sjm150/ps | baekjoon/2914/solution.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
int a, i; cin >> a >> i;
cout << a * (i - 1) + 1 << '\n';
} | ALGO | 0.999908 | 3.101058 |
a4f6ec24-9c74-4b1d-a7a8-94cace6a6b5e | martin-ray/atcoder | typical_problems/28.cpp | #include<iostream>
#include<string>
#include<vector>
#include<map>
#include<string>
#include<algorithm>
#include<set>
#include<list>
#include<bits/stdc++.h>
#include <iomanip>
#include<queue> //do not forget about priority_queue;
//std::cout << std::setprecision(2) << 3.141; // "3.1"
using namespace std;
std::vector<st... | ALGO | 0.994074 | 3.226059 |
cb6980c1-75de-48e5-843a-d59e445c732b | ishandutta2007/codeforces | fataleagle/normal/605/A.cpp | #include <bits/stdc++.h>
using namespace std;
int N;
int bit[100001];
int dp[100001];
void add(int x, int v)
{
bit[x]=max(bit[x], v);
}
int get(int x)
{
return bit[x];
}
int main()
{
scanf("%d", &N);
int ans=0;
for(int i=1; i<=N; i++)
{
int a;
scanf("%d", &a);
dp[i]=... | ALGO | 0.999689 | 3.791807 |
a5f89a2a-9595-4ed9-a755-cc7f397753a5 | dheerajnandigama/DSA | DSA/Template/main.cpp | #include <bits/stdc++.h>
using namespace std;
// to set precision use fixed,setprecision(number_of_points_after_decimal)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto &a : x)
#define all(x) begin(x), end(x)
#define mod 1000000007
#define sz(x) (int)(x).size()
#define ff first
#define s... | ALGO | 0.998237 | 5.302747 |
99eb5b75-399e-4a26-99bb-3ea79a8ec8d6 | rishirajsurti/uva | 10038.cpp | #include <cstdio>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <numeric>
#include <cstring>
using namespace std;
#define MAX 3005
bool seq[MAX];
int main(){
int n;
while(scanf("%d",&n)!=EOF){
int pre, currentNum, total;
scanf("%d",¤tNum);
pre = currentNum;
bool es ... | ALGO | 0.999841 | 3.662501 |
ff03a64d-09f4-4226-b18e-332e5b0f5c01 | Manoranjanhere/LEETCODE-PRACTICE | 3018-make-string-a-subsequence-using-cyclic-increments/3018-make-string-a-subsequence-using-cyclic-increments.cpp | class Solution {
public:
bool canMakeSubsequence(string str1, string str2) {
int n = str1.length();
int m = str2.length();
int left=0;
for(int i=0;i<n;i++)
{
if(str1[i]==str2[left]||(str1[i]+1)==str2[left]||(str1[i]=='z'&&str2[left]=='a'))
{
... | ALGO | 0.999934 | 6.33973 |
3722865e-3bf9-4dce-9ca6-1adf5e0039d1 | msft-mirror-aosp/platform.hardware.qcom.sm7250.gps | utils/loc_misc_utils.cpp | #define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_misc_utils"
#include <stdio.h>
#include <string.h>
#include <dlfcn.h>
#include <log_util.h>
#include <loc_misc_utils.h>
#include <ctype.h>
int loc_util_split_string(char *raw_string, char **split_strings_ptr,
int max_num_substrings, char delimiter)... | TOOL | 0.884244 | 5.857681 |
25c7c071-a0ee-4c3f-a2f7-71f387a75ed2 | terrysky18/Cpp-training | Practices/source/generic-type.cpp | #include <iostream>
using namespace std;
template <class Numeric>
Numeric Max(const Numeric& x, const Numeric& y);
int main()
{
long dA = 123456;
long dB = 45678;
cout<<"The bigger number is: ";
cout<<Max<long>(dA, dB)<<endl;
return 0;
}
template <class Numeric>
Numeric Max(const Numeric& x, const Numeric& y)... | ALGO | 0.999013 | 4.005368 |
6ee8ff7b-4c1a-4168-ae91-d4bf25d76afa | Th0masAndy/KKRT16 | thirdparty/win/miracl/miracl_osmt/source/brute.cpp | /*
* Program to factor numbers using brute force.
*
* Requires: big.cpp
*/
#include <iostream>
#include "big.h"
using namespace std;
#define LIMIT 10000
#ifndef MR_NOFULLWIDTH
Miracl precision=50;
#else
Miracl precision(50,MAXBASE);
#endif
int main()
{
int n,p;
Big x;
miracl *mr=&precision;
... | ALGO | 0.998901 | 4.669192 |
a14ee074-44ad-4c71-8d5a-8a156b06c738 | scorpiorhds/Godotrep | scene/3d/voxelizer.cpp | /**************************************************************************/
/* voxelizer.cpp */
/**************************************************************************/
/* This file is part of: */
/* ... | ALGO | 0.969085 | 3.240472 |
0ec729bc-e00e-4801-a682-183b47f06da8 | raja226/Flutter_ListView | 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 |
a7857c94-6f5d-4bd8-a0e9-f346c379db43 | CaDe27/Coding | CodingRush/CrearProblema/aerodromPython/solution.cpp | #include <iostream>
using namespace std;
typedef int64_t ll;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll n, m;
cin>>n>>m;
int t[n], i;
for(i=0; i<n; ++i)
cin>>t[i];
ll ini, mitad, fin, suma;
ini = 1;
fin = ((ll)t[0])*m;
while(ini!=fin){
sum... | ALGO | 0.999987 | 3.749249 |
6ca09779-5378-48ca-9e29-d4ccc50be602 | Coen-Potgieter/LeetCode | medium/98-validate-binary-search-tree/src/main.cpp |
#include <vector>
#include <iostream>
#include <algorithm>
// 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, TreeN... | ALGO | 0.999611 | 6.694156 |
6ac92957-d3ae-45bd-aec9-8baf83c01a8d | code-fans/books-source | 基础算法/第8章_高精度算法/8.2.1万进制高精度运算/万进制除法/div.cpp | //Ƹ߾ȳ
#include <bits/stdc++.h>
using namespace std;
#define MAXN 5100
#define limit 5000
struct BigNum
{
int data[MAXN/4+1];
int frac[MAXN/4+1];
int &operator[](int n) //[]
{
return data[n];
}
int &operator()(int n) //()
{
return frac[n];
}
BigNum()
{
memse... | ALGO | 0.999784 | 4.206504 |
1f68b1a0-bc8b-4673-9f4c-a925b4907702 | ishandutta2007/codeforces | keko37/normal/1188/B.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long llint;
const int MAXN = 300005;
llint n, p, k, sol;
llint a[MAXN];
map <int, vector <int> > mp;
llint sq (llint x) {
return x * x % p;
}
llint f (llint x) {
llint res = sq(sq(x)) - k * x;
res = (res % p + p) % p;
return res;
}
bool ok... | ALGO | 0.999887 | 3.7276 |
7c422fcc-b002-4c7d-a03b-44942f2e8cd5 | chandragk/ElevatorProblem | Source.cpp | #include <iostream>
#include "Package.h"
#include <vector>
#include <ctime>
#include <cstdlib>
#define __DESC(show, msg) {if (show == true) cout << msg << endl;};
#define __SWITCH_OUTPUT__ true
using namespace std;
/* Merge Sort Function
* @Source: http://simplestcodings.blogspot.ca/2010/08/merge-sort-implementation... | ALGO | 0.998504 | 3.930103 |
ef9683e7-797d-47ca-a409-8b37ff4b66f8 | Discorre/1st | supportFiles.cpp | //
// Created by Dom on 14.10.2024.
//
#include "supportFiles.h"
#include <string>
#include <fstream>
#include "supportFiles.h"
using namespace std;
// Возвращает длину строки
int Strlen(const string &str) {
int len = 0;
while (str[len]!= '\0') {
len++;
}
return len;
}
// Возвращает подстр... | TOOL | 0.936531 | 3.486508 |
d2c63f82-50ef-4f56-ac97-f835f8fd2bc0 | surrenfy/SwordToOffer | 26.cpp | #include "universal.h"
//输入一个字符串,按字典序打印出该字符串中字符的所有排列。例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba。
//字典序法:在当前序列中,从尾端往前寻找两个相邻元素,前一个记为*i,后一个记为*ii,并且满足*i < *ii。
//然后再从尾端寻找另一个元素*j,如果满足*i < *j,即将第i个元素与第j个元素对调,并将第ii个元素之后(包括ii)的所有元素颠倒排序,即求出下一个序列了。
class Solution {
public:
vector<string> Permutation(string str... | ALGO | 0.999107 | 4.798589 |
c53a1c32-b0d0-4a6a-9384-1732c28cbd1b | andrew-epstein/paq_history | paq8/paq8q2.cpp | /* paq8q3 file compressor/archiver. Release by Simon Berger May. 13, 2009
Copyright (C) 2008 Matt Mahoney, Serge Osnach, Alexander Ratushnyak,
Bill Pettis, Przemyslaw Skibinski, Matthew Fite, wowtiger, Andrew Paterson,
Jan Ondrus, Andreas Morphis, Pavel L. Holoborodko, KZ., Simon Berger,
Kaido.
... | TOOL | 0.984915 | 4.396967 |
f5c7df5b-0357-4952-a3ec-6f74a682f882 | tauhrick/Competitive-Programming | Contests/Atcoder/ABC-157/e.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
class Fenwick {
public:
vector<T> Fenw;
int n;
Fenwick(int _n) : n(_n) {
Fenw.resize(n);
}
void modify(int x, T v) {
while (x < n) {
Fenw[x] += v;
x |= (x + 1);
}
}
T get(i... | ALGO | 0.999876 | 4.970005 |
14a9dcf4-d666-4f53-962d-fce8a00d7734 | 18carica/Aulas-POO | Listas/Lista01/exercicio35.cpp | /* Programa 35 */
/*35. Escreva um programa que leia 2 números e em seguida pergunte ao usuário qual operação ele deseja realizar. O resultado da operação deve ser acompanhado de uma frase que diga se o número e:
a. Par ou ímpar;
b. Positivo ou negativo;
c. Inteiro ou decimal.*/
// exercicio35.cpp
//Função principal
#... | ALGO | 0.995235 | 4.694142 |
235159c3-2a43-46fe-a944-9c06da494e08 | yusifaliyevpro/Competitive-Programming | LeetCode/Easy/1160. Find Words That Can Be Formed by Characters.cpp | // 1160. Find Words That Can Be Formed by Characters
// https://leetcode.com/problems/find-words-that-can-be-formed-by-characters/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int countCharacters(vector<string>& words, string chars) {
}
}; | ALGO | 0.999177 | 6.303294 |
e9c7d252-2091-4ca9-a2ac-257f4e9eda86 | bluster980/Leetcode-Solutions | 0846-hand-of-straights/0846-hand-of-straights.cpp | class Solution {
public:
bool isNStraightHand(vector<int> hand, int W) {
map<int, int> c;
for (int i : hand) c[i]++;
for (auto it : c)
if (c[it.first] > 0)
for (int i = W - 1; i >= 0; --i)
if ((c[it.first + i] -= c[it.first]) < 0)
... | ALGO | 0.999978 | 5.868629 |
d4db3273-f85e-44fc-8504-84a5a6a92a2c | molloy-lab/Dollo-CDP | src/boost_1_80_0/libs/math/src/tr1/hermitef.cpp | extern "C" float BOOST_MATH_TR1_DECL boost_hermitef BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, float x) BOOST_MATH_C99_THROW_SPEC
{
return c_policies::hermite BOOST_PREVENT_MACRO_SUBSTITUTION(n, x);
}
| ALGO | 0.981667 | 3.641016 |
02ee140d-a318-4bd2-9f7b-c721547f2208 | t-sakashita/rokko | example/lapack/sterf.cpp | #include <rokko/blas.hpp>
#include <rokko/lapack/sterf.hpp>
#include <rokko/lapack/lange.hpp>
#include <rokko/eigen3.hpp>
#include <rokko/utility/laplacian_matrix.hpp>
#include <iostream>
int main(int argc, char** argv) {
constexpr double eps = 1e-10;
int n = 5;
if (argc > 1) n = std::stoi(argv[1]);
// genera... | ALGO | 0.998705 | 4.141452 |
019fe5c1-6666-41b7-be58-eab9d1eb60c1 | PlasmaControl/FreeMHD | OpenFOAM-v2206/ThirdParty/sources/cgal/CGAL-4.14.3/examples/Kernel_23/exact.cpp | #include <iostream>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <sstream>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point_2;
int main()
{
Point_2 p(0, 0.3), q, r(2, 0.9);
{
q = Point_2(1, 0.6);
std::cout << (CGAL::collinear(p,q,r)... | ALGO | 0.97791 | 4.940006 |
3dad37fd-37b9-46e9-b488-33ff242aa7d5 | KL-Lru/Competitive-Programming | AtCoder/abc085/d.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,h;
cin >> n >> h;
vector<int> b(n);
int a, mx = 0, cnt = 0;
for(int i=0;i<n;i++){
cin >> a >> b[i];
mx = max(a,mx);
}
sort(b.begin(), b.end(), greater<int>());
for(int i=0;i<n;i++){
if(mx < b[i]){ // 投げる
cnt++;
h = m... | ALGO | 0.999929 | 3.722349 |
fb6af72b-325f-48b7-9810-1b9ecc98421d | lua9520/source-engine-2018-hl2_src | game/client/splinepatch.cpp | #include "mathlib/vmatrix.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
//-----------------------------------------------------------------------------
// Catmull rom blend weights
//-----------------------------------------------------------------------------
static VMat... | ALGO | 0.857878 | 4.758902 |
0c3d5aba-6650-4b2e-9b1c-6b04d5c1e149 | EbenBoakye/ShopByStock | 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 |
9fb3dbe6-c892-4f69-9896-226963bc8ab8 | dhirajkumbhar28/LP5 | Ashish-karche-A-54/HPC code/Ass2/ass2_B.cpp | // Ashish Karche
// assignment 2(B)
#include <iostream>
#include <stdlib.h>
#include <omp.h>
using namespace std;
void mergesort(int a[], int i, int j);
void merge(int a[], int i1, int j1, int i2, int j2);
void mergesort(int a[], int i, int j)
{
int mid;
if (i < j)
{
mid = (i + j) / 2;
#pragma o... | ALGO | 0.999962 | 3.445622 |
72155aa3-1438-420f-82ff-d8f9215477f4 | maxco2/leetcode | ba-shu-zu-pai-cheng-zui-xiao-de-shu-lcof.cpp | //
// @lc app=leetcode.cn id=177806801 lang=cpp
//
// [177806801] ba-shu-zu-pai-cheng-zui-xiao-de-shu-lcof [把数组排成最小的数]
//
class Solution {
public:
vector<string> snums;
string minNumber(vector<int>& nums) {
auto sz=nums.size();
for(auto n:nums) snums.emplace_back(to_string(n));
if(sz==1)... | ALGO | 0.999969 | 6.669281 |
11783f98-e266-4933-ac53-57b9b7e17664 | MereyPolatkhan/competitive_programming_and_algorithms | _codeforces/div2_899/b.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <cassert>
#include <queue>
#include <bitset>
#include <numeric>
#include <vector>
#include <ctime>
... | ALGO | 0.999714 | 4.372243 |
2424d5b2-3e91-4719-8de1-4cf686187c08 | yuforest/contests | agc_018/d/main.cpp | // ここは競プロではサボりがちです
#include <bits/stdc++.h>
using namespace std;
// デバッグ用マクロです。詳しくは https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
// 節操ないですが、競プロでは便利です。
using ll = long ... | ALGO | 0.99898 | 3.576259 |
c81a454b-0860-4efa-81d7-3a90ce0bd671 | sensen963/AtCoder | ABC/ABC085/C.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <numeric>
using namespace std;
typedef long... | ALGO | 0.999807 | 3.389619 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.