uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
e08c2afb-cc05-476c-9cde-3d2c9761f8c0 | CNC-Drone/CNC-Competition | Swarm-search/src/swarm_exploration/utils/lkh_mtsp_solver/src2/lkh3_interface.cpp | #include <lkh_mtsp_solver/lkh3_interface.h>
/*
* This file contains the main function of the program.
*/
int solveMTSPWithLKH3(const char* input_file) {
GainType Cost, OldOptimum;
double Time, LastTime = GetTime();
Node* N;
int i;
/* Read the specification of the problem */
// if (argc >= 2)
// P... | ALGO | 0.999962 | 4.911894 |
6d8f21ce-6f28-47ec-aeae-677bd619ba2d | alexandraback/datacollection | solutions_5686275109552128_0/C++/grokbrokkoli/BDynamicFix.cpp | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
long recursiveSolution(std::vector<long> &input, std::map<std::vector<long>, int> &moves, int depth)
{
if (moves[input] != 0) return moves[input];
for (std::size_t i = 2, isz = input.size(); i != isz; ++i) {
if (input[i] == 0) continue;
fo... | ALGO | 0.999934 | 5.081424 |
02368bc4-c573-4975-ac34-4d2a9cf337ad | leikang123/LLVM-NMX | llvm/utils/PerfectShuffle/PerfectShuffle.cpp | #include <cassert>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <vector>
struct Operator;
// Masks are 4-nibble hex numbers. Values 0-7 in any nibble means that it takes
// an element from that value of the input vectors. A value of 8 means the
// entry is undefined.
// Mask manipulation funct... | ALGO | 0.983424 | 4.59199 |
61136061-5c4b-4942-8534-93bcac932780 | Monuar/Online_Judges | Codeforces/C/three_parts_of_the_array.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++) cin>>a[i];
int l=0,r=n-1,ans=0,sum1=0,sum2=0;
while(l<=r){
if(sum1<sum2){
sum1+=a[l];
l++;
}
else{
sum2+=a[r];
r--;
... | ALGO | 0.999985 | 3.886316 |
b18b83cc-4d60-4604-a75d-6d26d5804b70 | souravdev33/Codeforces | amusing_joke.cpp | #include<iostream>
#include<string.h>
#include<bits/stdc++.h>
using namespace std;
int main()
{
string a,b,c,d;
cin>>a>>b>>c;
d=a+b;
sort(c.begin(),c.end());
sort(d.begin(),d.end());
if(c==d)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return 0;
}
| ALGO | 0.99997 | 3.398979 |
4d86c28c-2918-4b21-91a7-2af57c98060d | DLopezMadrid/CarND-PathPlanning-P11 | src/Eigen-3.3/doc/examples/Tutorial_PartialLU_solve.cpp | #include <Eigen/Core>
#include <Eigen/LU>
#include <iostream>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
Vector3f b;
A << 1,2,3, 4,5,6, 7,8,10;
b << 3, 3, 4;
cout << "Here is the matrix A:" << endl << A << endl;
cout << "Here is the vector b:" << endl << b << endl;
Vec... | ALGO | 0.999752 | 3.150347 |
f0c82a1b-2be9-47f4-9517-a8a292521824 | Jay100125/CSES | 800/goals.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin>>n;
n--;
int sum = 0;
while(n--)
{
int x;
cin>>x;
sum += x;
}
if(sum < 0)
{
cout<... | ALGO | 0.999381 | 3.754084 |
51be37df-5aff-4a62-878b-76c70928f76f | KagariET01/CMDJ | pack/algorithm/Discrete_lite.cpp | #include<bits/stdc++.h>
using namespace std;
#define INT long long int
//Discrete
void Discrete(
vector<INT>::iterator L,//初始位置
vector<INT>::iterator R,//結束位置(此位置不處理)
vector<INT>::iterator out//輸出的初始位置
){
INT st=1;
vector<pair<INT,INT>> v;
INT id=0;
for(vector<INT>::iterator i=L;i!=R;i++,id++){
INT val=*i;
v... | ALGO | 0.999995 | 3.827561 |
039d77ff-389f-44c1-9e16-8e4d89a027f3 | uzbit/allegprogs | etree/test.cpp | #include<conio.h>
#include<iostream.h>
#include<stdio.h>
#include<stdlib.h>
#include"etree.h"
void print(const int &a)
{cout<<a<<endl;}
void main(int argc,char **argv)
{
clrscr();
int num=0;
num=strtol(argv[1],NULL,10);
etree <int> tree;
if(num)
{
for(int i=0;i<num;i++)
tree.insert(ran... | ALGO | 0.993134 | 3.011856 |
7555d3f5-0823-43a6-be5d-f24f56bcde01 | JasonI123/Capstone_Project | Library/PackageCache/com.unity.ide.visualstudio@2.0.18/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.954364 | 6.933585 |
6fef0d8d-9b17-4415-9f14-8366efe875fc | Huy3152004/Code | ManagerPlayer.cpp | #include "ManagerPlayer.h"
void ManagerPlayer::AddTail(Player &P)
{
list.AddTail(P);
}
void ManagerPlayer::Sort()
{
for(Node<Player> *temp = list.getHead(); temp != NULL; temp = temp->next)
{
for(Node<Player> *t = temp->next; t != NULL; t = t->next)
{
if(t->data.getScore() > te... | TOOL | 0.902189 | 3.763597 |
2b291295-e1e6-4b59-b7fc-acea51378c21 | Ezekiel-DA/MW4-firmware | lib/ESP32-audioI2S-2.0.5/src/mp3_decoder/mp3_decoder.cpp | /*
* mp3_decoder.cpp
* libhelix_HMP3DECODER
*
* Created on: 26.10.2018
* Updated on: 27.05.2022
*/
#include "mp3_decoder.h"
/* clip to range [-2^n, 2^n - 1] */
#if 0 //Fast on ARM:
#define CLIP_2N(y, n) { \
int sign = (y) >> 31; \
if (sign != (y) >> (n)) { \
(y) = sign ^ ((1 << (n)) - 1); \
} \
}
#else /... | TOOL | 0.950062 | 4.172368 |
4c883202-3fe9-4b17-b621-c753d5bef3cb | suhani-1203/Leetcode | 0801-is-graph-bipartite/0801-is-graph-bipartite.cpp | class Solution {
public:
bool dfs(int node,int setNo,vector<vector<int>>& graph,vector<int>& vis){
vis[node]=setNo;
for(auto it:graph[node]){
if(vis[it]==-1){
if(dfs(it,!setNo,graph,vis)==false)
return false;
}
else if(vis[it]=... | ALGO | 0.999964 | 6.088524 |
c647517e-d0c1-41cb-8737-38945b2cdcca | wouterfranken/SceneSynthFramework | src/AnalysisPhase/Sampler.cpp | /**
This code comes from this paper:
Hu, Ruizhen, et al. "Interaction Context (ICON): Towards a Geometric Functionality Descriptor." ACM Transactions on Graphics 34.
*/
#include "Sampler.h"
#include "../Utilities/Utilities.h"
Sampler::Sampler(const Mesh &srcMesh, SamplingMethod samplingMethod)
{
/* srand (123456... | ALGO | 0.996657 | 6.017165 |
b63a1530-5a5c-4429-8759-0f4c3920fad0 | YunWGui/LeetCode-300 | Sliding Window/76_Minimum-Window-Substring.cpp | /**
* Title:
* 76. Minimum Window Substring
* 76. 最小覆盖子串
* Address:
* https://leetcode-cn.com/problems/minimum-window-substring/
*/
#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
// 方法一:滑动窗口 - 双指针
/* 时间复杂度:O( s.size() + t.size() ) */
// https://mp.weixin.qq.co... | ALGO | 0.999782 | 7.290363 |
913436a3-70b4-4322-95e3-72397e7fddc9 | kunge98/CPlusPlus_Study | STL_jihe/test3.cpp | #include <vector>
#include <algorithm>
#include "iostream"
using namespace std;
class myPrint
{
public:
void operator()(int val)
{
cout << val << " ";
}
};
void test()
{
vector<int> v1;
vector<int> v2;
for (int i = 0; i < 10; i++)
{
v1.push_back(i); // 0 - 9
v2.push_... | ALGO | 0.995097 | 3.878528 |
bc6f035b-8d96-4208-8876-1e90e33866d2 | wakamebu/AtcoderPractice | abc327/b/main.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
using P = pair<int,int>;
#define rep(i,n) for(int i = 0; i < (n); i++)
int main() {
long long B;
cin >> B;
for (int A = 1; A <= 15; A++) {
long long x = 1;
for (int i = 0; i < A; i++) x *... | ALGO | 0.999951 | 4.834786 |
f6619eda-646e-489e-bbe3-b8ea04f6b46b | Soumyo001/Online_Judge_Solves | algo prac 2.2/bfs.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
vector<int> graph[N];
int n,m,s,status[N];
int dist[N];
void inputGraph(){
for(int i=0;i<m;i++){
int u,v;cin>>u>>v;
graph[u].push_back(v);
graph[v].push_back(u);
}
}
void bfs(){
for(int i=1;i<=n;i++) status[i]=1;
que... | ALGO | 0.999926 | 3.580955 |
39263f63-7756-440b-85c5-7870032654ec | capstone-engine/llvm-capstone | libc/src/math/generic/llround.cpp | #include "src/math/llround.h"
#include "src/__support/FPUtil/NearestIntegerOperations.h"
#include "src/__support/common.h"
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(long long, llround, (double x)) {
return fputil::round_to_signed_integer<double, long long>(x);
}
} // namespace LIBC_NAMESPACE
| TOOL | 0.996168 | 6.661853 |
3973c9aa-aca0-4ba8-b778-630506101f7f | dhkwon03/programming_problem_practice | c_problems/baekjoon/2869/main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main()
{
int a, b, v;
scanf("%d %d %d", &a, &b, &v);
if(((v - b) % (a - b)) == 0) {
printf("%d\n", ((v - b) / (a - b)));
}
else {
printf("%d\n", ((v - b) / (a - b)) + 1);
}
return 0;
}
| ALGO | 0.999676 | 3.377769 |
eba1140b-7c01-4848-96c9-3234c4a7606d | ishandutta2007/codeforces | yamunaku/normal/778/A.cpp | //
// Created by yamunaku on 2019/10/11.
//
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define repl(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x... | ALGO | 0.999994 | 5.118612 |
bd7a81f8-cd2e-40c7-8c48-3aef7ddcee4b | anhhducc/NMLT_IT001.L11 | Chuong02/Bai_063/Bai_063.cpp | #include<iostream>
#include<cmath>
using namespace std;
int TichSoLe(int);
int main()
{
int n;
cout << "Nhap n: ";
cin >> n;
int kq = TichSoLe(n);
cout << "Tich chu so le la: " << kq;
return 1;
}
int TichSoLe(int k)
{
int T = 1;
for (int t = k; t != 0; t = t / 10)
{
int dv = t % 10;
if(dv%2!=0)
T = T * ... | ALGO | 0.999955 | 4.080047 |
226a432c-787f-466f-b124-d1605e9d0599 | ImtiazAhmedAkash/Problem-Solving | atcoder/abc090/C.cpp | /* In the Name of ALLAH, the most gracious, the most merciful */
// Flip,Flip, and Flip......
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define deb(x) cerr << #x << " = " << x << nl
const int inf = 1e9;
const ll INF = 1e18;
const int mod = 998244353;
const int N = 2e5 + 5;... | ALGO | 0.999517 | 4.613903 |
04bdb737-32d9-4f58-b567-43c20ca00983 | BinomialSheep/codingame_tttc | 11_mcts solver_board_fast.cpp | #include <bits/stdc++.h>
using namespace std;
using namespace chrono;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
template <typename T>
inline bool chmax(T& a, T b) {
return ((a < b) ? (a = b, true) : (false));
}
template <typename T>
inline bool chmin(T& a, T b) {
r... | ALGO | 0.999155 | 4.382084 |
8491f80a-9e18-45a1-b95a-a8b4ef55c91f | 8bit-nyk/HSLAM | Thirdparty/opencv-3.4.6/3rdparty/carotene/src/magnitude.cpp | #include "common.hpp"
#include "vtransform.hpp"
#include <cmath>
namespace CAROTENE_NS {
#ifdef CAROTENE_NEON
namespace {
struct Magnitude
{
typedef s16 type;
void operator() (const int16x8_t & v_src0, const int16x8_t & v_src1,
int16x8_t & v_dst) const
{
int16x4_t v_src0_p = vget... | ALGO | 0.997039 | 6.697874 |
b5eae6c4-f5f0-42ac-9902-313a93f70e2d | triggor/uni_assignments | 4.semester/Programming_in_CPP/nr10_solution/bigint.cpp |
// Written by Hans de Nivelle, June 2011.
#include "bigint.h"
bigint::bigint( unsigned int x )
: sign( 1 )
{
word w1 = x & 0XFFFF;
word w2 = ( x & 0XFFFF0000 ) >> 16;
if( w2 )
{
repr. push_back( w1 );
repr. push_back( w2 );
}
else
{
if( w1 )
repr. push_back( w1 );... | ALGO | 0.998982 | 5.206256 |
6814b7a9-4806-4232-9ac1-c3dd7a385d1d | SourabhGurwani/Leetcode-Question | 714-best-time-to-buy-and-sell-stock-with-transaction-fee/best-time-to-buy-and-sell-stock-with-transaction-fee.cpp | class Solution {
public:
int fun(int idx,int buy,vector<int> & prices,vector<vector<int>>& dp,int fee){
if(idx==prices.size()) return 0;
if(dp[idx][buy]!=-1) return dp[idx][buy];
if(buy){
return
dp[idx][buy]=max(-prices[idx]+fun(idx+1,0,prices,dp,fee), //sell
... | ALGO | 0.99995 | 5.517736 |
c4b27775-8512-496f-9218-799a805e4055 | haiguanplayer/ACM-ICPC | 各种比赛/2017 美团 CodeM/CodeM 初赛 Round A/数列互质.cpp | #include<cstdio>
#include<cmath>
#include<algorithm>
#include<vector>
#define L 100
using namespace std;
const int N = 5*1e4+5;
int S,Sn;
int u,v,ul,vr;
int l,r;
int a[N],sum[N/L+5][N],ans[N],t[N];
int ql[N],qr[N],qk[N];
vector<int> V[N*2];
vector< pair<int,int> > Ins[L+5][N],Del[L+5][N];
vector<int> query[N];
int ma... | ALGO | 0.99991 | 3.569016 |
11d4ce1a-86df-4e69-ab83-9fb56360a23c | shamim7999/Target-Samsung-13-Nov-2019 | Endoscope.cpp | #include<iostream>
#include <cmath>
#include<queue>
//#include <pair>
#include <map>
#include <algorithm>
using namespace std;
#define dd double
#define int long long
#define ull unsigned long long
#define ld long double
#define mx 52
#define mod 1000000007
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.... | ALGO | 0.99982 | 3.970292 |
f0ce9cba-5fc7-46ff-b641-64d8f26602e8 | saketh1999/DSA_MASTERY | Tree/Tree_SheetQ.cpp/CountLeafNode.cpp | //GFG: https://practice.geeksforgeeks.org/problems/count-leaves-in-binary-tree/1?utm_source=gfg&utm_medium=article&utm_campaign=bottom_sticky_on_article
////////////////////////////////////////////////
/*
SOLUTION
*/
////////////////////////////////////////////////
int preorderTrav(Node* root, int &cou... | ALGO | 0.9996 | 6.164307 |
317ec50f-8fb7-4e13-8bb0-8104f2934864 | gcfavorites/firmware-mod-kit | src/others/squashfs-3.2-r2-lzma/CPP/7zip/UI/Common/UpdatePair.cpp | // UpdatePair.cpp
#include "StdAfx.h"
#include <time.h>
#include "Common/Defs.h"
#include "Common/Wildcard.h"
#include "Windows/Time.h"
#include "UpdatePair.h"
#include "SortUtils.h"
using namespace NWindows;
using namespace NTime;
static int MyCompareTime(NFileTimeType::EEnum fileTimeType,
const FILETIME &t... | TOOL | 0.932443 | 6.258458 |
9b0e3930-93b5-4f19-96b3-b19c67b6006a | LEECHHE/acmicpc | solved/11758.cpp | #include <cstdio>
using namespace std;
int ccw(int x1, int y1, int x2, int y2, int x3, int y3) {
int temp = x1*y2+x2*y3+x3*y1;
temp = temp - y1*x2-y2*x3-y3*x1;
if (temp > 0) {
return 1;
} else if (temp < 0) {
return -1;
} else {
return 0;
}
}
int main(){
int x[3],y[3]... | ALGO | 0.999982 | 4.486052 |
a9d08a1d-5b81-4765-ad39-1b9aea0cdc30 | jayeshpatel8/Coding-Practise-using-Leetcode-Coding-Platform | problems/delete_columns_to_make_sorted/solution.cpp | class Solution {
public:
int minDeletionSize(vector<string>& strs) {
int r = strs.size(), c = strs[0].size();
int ans = 0;
for (int i=0; i<c; i++){
for (int j=1; j<r; j++){
if (strs[j-1][i] > strs[j][i]){
ans++;
break;
... | ALGO | 0.999947 | 6.073835 |
2daa2d8a-d7ae-40e0-b203-5328e499dec0 | thelastone07/cp | CSES/Graphs/Labyrinth.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef pair<double,double> pdd;
typedef vector<ll> vl;
typedef vector<int> vi;
template<class T> using pq = priority_queue<T>;
template<class T> using pqg = priority_queue... | ALGO | 0.999983 | 4.769551 |
110ad9b1-ad6b-4871-a60e-7cbfd2ee1b99 | zhuhuijia0001/leetcode | 374-Guess-Number-Higher-or-Lower.cpp | // Forward declaration of guess API.
// @param num, your guess
// @return -1 if my number is lower, 1 if my number is higher, otherwise return 0
int guess(int num);
class Solution {
public:
int guessNumber(int n) {
int low, high;
int mid;
low = 1;
high = n... | ALGO | 0.999997 | 5.959663 |
50ed1fbb-c739-4193-853c-236fc46d2c45 | Yukihatara/AIP-2-semestr | 13_14 week/Zadacha_4/main.cpp | #include <iostream>
#include <ctime>
#include <cmath>
using namespace std;
//11. Вывести элементы массива, меньших среднего арифметического
int main()
{
short int sum = 0;
float sra = 0;
srand (time(NULL));
short int arr[20];
for(int i = 0; i < 21; i++){
arr[i] = rand() % 21;
}
for(i... | ALGO | 0.999434 | 3.185762 |
7785fc78-0f2d-487e-b93f-e49e74ab93e0 | Jaiba43/Juan | third-party/openh264/third_party/openh264/src/codec/decoder/core/src/bit_stream.cpp | #include "bit_stream.h"
#include "error_code.h"
namespace WelsDec {
inline uint32_t GetValue4Bytes (uint8_t* pDstNal) {
uint32_t uiValue = 0;
uiValue = (pDstNal[0] << 24) | (pDstNal[1] << 16) | (pDstNal[2] << 8) | (pDstNal[3]);
return uiValue;
}
int32_t InitReadBits (PBitStringAux pBitString, intX_t iEndOffset... | TOOL | 0.944419 | 5.257495 |
ef49cf7c-f58b-4846-8cb6-068207ca7825 | ebjarstal/RayFlecting | rays.cpp | #include "rays.h"
// TODO:
// - Define CalculateP1Prime
void Ray::SetOrigin(const SDL_Point new_origin) {
origin = new_origin;
}
void Ray::SetP1(const SDL_Point new_p1) {
p1 = new_p1;
}
SDL_Point Ray::CalculateCollisionPoint(
const SDL_Point point_start, const double a, const SDL_Rect* obstacles, const int ... | ALGO | 0.936104 | 4.631791 |
e688e197-c2ae-4aad-befc-5f4a06c58bf7 | ishandutta2007/codeforces | alex_wei/normal/1043/A.cpp | #include<bits/stdc++.h>
using namespace std;
int mx,n,s,a;
int main()
{
cin>>n;
for(int i=0;i<n;i++)
cin>>a,s+=a,mx=max(mx,a);
cout<<max(mx,(s*2)/n+1);
return 0;
} | ALGO | 0.999772 | 3.1302 |
b71046e6-87b2-47e5-9faa-62df9887160e | yangjl2022/cp | problems/atcoder/F_Range_Connect_MST.cpp | #include <bits/stdc++.h>
#ifdef YJL
#include "debug.h"
#else
#define debug(...)0
#endif
#define ALL(a) a.begin(),a.end()
using namespace std;
using ll = long long;
template<class T>
istream& operator>>(istream& is, vector<T>& v) {
for(auto& x:v) is>>x;
return is;
}
struct DSU {
int n;
vector<int> vis,... | ALGO | 0.999774 | 3.883363 |
7f09d54a-3568-4a4a-aa59-d68c5a8ebb5d | wanghengg/LeetCode | medium/0018fourSum.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution{
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
vector<vector<int>> result;
if (nums.size() < 4) return result;
sort(nums.begin(), nums.end()); // 先对数组排序,后面可以用双指针
... | ALGO | 0.999984 | 5.02261 |
6fb5f677-114f-4de6-942e-74a4c86b64fc | maopu2001/Codeforces | B_String_LCM.cpp | #include <bits/stdc++.h>
using namespace std;
#define int ll
using ll = long long;
using u32 = unsigned int;
using u64 = unsigned long long;
#define pb push_back
#define p1 first
#define p2 second
#define pr pair<int, int>
#define vc vector<int>
#define si set<int>
#define mpi map<int, int>
#define nl endl
#define F... | ALGO | 0.999967 | 4.867024 |
bbb27a00-3a87-4bff-b5c3-2defa7237e61 | Taha-Adeel/CP | Hard-75/D_Knowledge_Cards.cpp | #include <bits/stdc++.h>
using namespace std;
#define FAST ios::sync_with_stdio(0); cin.tie(0)
template<class T> struct V: vector<T>{using vector<T>::vector;
void sort() { std::sort(this->begin(), this->end()); }
void sort_dsc() { std::sort(this->begin(), this->end(), greater<T>()); }
auto sum()... | ALGO | 0.999917 | 4.392873 |
07debc75-220a-482e-86c6-2b0b4eae45c6 | 0xff07/libfoj | Exercise/Shortest Path/POJ-3259.cpp | #include<cstdio>
using namespace std;
#define MAXNODE 5100
#define MAXEDGE 25100
#define OO 1000000000
int main()
{
int b[MAXEDGE], t[MAXEDGE], w[MAXEDGE];
int F, N, M, W;
scanf("%d", &F);
for(int index = 0; index < F; index++){
scanf("%d%d%d", &N, &M, &W);
int size = 0;
int dist[MAXNODE];
for(int i = 0; i... | ALGO | 0.999737 | 3.440571 |
98ad773f-1329-4942-8b49-ee983411d705 | whxwhx/17-18homework | agc016_e.cpp | #include <iostream>
#include <cstdio>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define rep(i,a,b) for(int i = a; i <= b; i++)
#define dep(i,a,b) for(int i = a; i >= b; i--)
#define Rep(i,a) for(int i = 0; i < a; i++)
#define pb(a) push_... | ALGO | 0.999901 | 3.311374 |
d92d5463-b9b7-44c2-8de7-67e1662a42f5 | khaledsliti/CompetitiveProgramming | AtCoder/abc249/C.cpp | // RedStone
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define endl '\n'
#define D(x) cerr << #x << " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
typedef long long ll;
const int N = 15;
i... | ALGO | 0.999941 | 4.328136 |
f99a83e6-1a22-4ea1-8c40-fb1e63b206f2 | prasimbaal/astu_cpp | vector/vector_sum.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
int row, column, sum(0), *ptr;
cout<<"ENTER ROW & COLUMN FOR YOUR MATRIX: ";
cin>>row;
// vector<vector<int>> matrix(row, vector<int>(column));
vector<int> matrix(row);
ptr=matrix.data();
for(int i=0;i<row;i++){ // for(int j=0;j<column;j++)... | ALGO | 0.983827 | 3.846576 |
69783c40-5a5a-45b9-bc40-16ac9dcbf6cd | lucassvalentim/Heuristic-Metaheuristic-Algorithms | Algoritmo-Genetico/algoritmoGeneticoTSP.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
random_device rd;
mt19937 generator(rd());
int comp (pair<vector<int>, double> &a, pair<vector<int>, double> &b){
return (b.second < a.second);
}
// Lê as coordenadas dos vértices e calcula a matriz de adjacência
vector<vector<... | ALGO | 0.999994 | 5.784841 |
10cf644a-f3dc-4c28-b3c8-674efb0af379 | sumitkaushik1005/coding | graph/toplogicalSort1.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> adj[1001];
bool vis[1001];
stack<int> st;
void topSort(int s){
vis[s]=true;
for(int i=0;i<adj[s].size();i++){
int v=adj[s][i];
if(vis[v]==false){
topSort(v);
}
}
st.push(s);
}
int main(){
int nodes,edges;
cin>>nodes>>edges;
for(int i=0;i<edges;i+... | ALGO | 0.999999 | 4.633059 |
c883d282-fcbb-4ccd-89a3-e1a7ada58bec | yellowHatpro/Codes-Practice | Leetcode/2265_CountNodesEqualToAverageOfSubtree.cpp | #include <bits/stdc++.h>
using namespace std;
// 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)
... | ALGO | 0.999773 | 6.48029 |
1ccf6602-8608-489a-9d66-8549b1e206af | Choijh03/Login_UI_App_Flutter | login_ui/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.998728 | 6.785645 |
1ad7d538-cd47-4c27-ad35-e1a7e0250556 | Sahil7570/c-plus-coding-DSA | bubblesort.cpp | #include<iostream>
using namespace std;
int main(){
int a[5]={8,3,4,9,2};
for(int i=0;i<5-1;i++){
for(int j=0;j<5-i;j++){
if(a[j]>a[j+1]){
swap(a[j],a[j+1]);
}
}
}
for(int i=0;i<5;i++){
cout<<a[i];
}
} | ALGO | 0.999931 | 3.436682 |
dcde398e-60dd-4911-9513-236df7729065 | dixitt5/CP-Solutions | Codeforces/405A_Gravity_Flip.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n; cin>>n; int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
sort(a,a+n);
for(int i=0;i<n;i++){
cout<<a[i]<<" ";
}
return 0;
}
| ALGO | 0.999801 | 3.777482 |
8aaed7e2-3c71-4cc3-b6d0-011ef712f2a8 | AndreeaIsabela/DataSecurity | columnarTransportation.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <regex>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <map>
#include <list>
#include <numeric>
#include <functional>
#include <iterator>
#include <cstdlib>
using namespace std;
const string k... | ALGO | 0.999625 | 4.733989 |
5383ee16-d012-4623-b40e-acf56463df95 | liuxiaotiao/pytorch | aten/src/ATen/native/cpu/airy_ai.cpp | #define TORCH_ASSERT_NO_OPERATORS
#include <ATen/native/UnaryOps.h>
#include <ATen/Dispatch.h>
#include <ATen/native/Math.h>
#include <ATen/native/TensorIterator.h>
#include <ATen/native/cpu/Loops.h>
namespace at::native {
inline namespace CPU_CAPABILITY {
static void airy_ai_kernel(TensorIteratorBase& iterator) {
... | ALGO | 0.969104 | 7.091665 |
cb6060d4-8295-44e1-af66-f4a594bc6808 | sanjeetboora/CppCompetitive | InterviewPreparation/LeetcodeCompanywise/Amazon/Week1/WordBreak.cpp | //https://leetcode.com/problems/word-break/
/* O(N^2) with O(N) extra space */
class Solution {
public:
bool wordBreak(string s, vector<string>& wordDict) {
int sz = s.length();
unordered_set<string> st;
for (string s : wordDict) {
st.insert(s);
}
bool dp[sz ... | ALGO | 0.999597 | 5.98604 |
608f7382-139c-4c5f-aa9c-aa6852be663d | nikhilyadavcode/LeetCode-Practice | leetcode51.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution{
public:
bool issafe(int row,int col,vector<vector<char>>&board){
for(int j=0;j<board.size();j++){
if(board[row][j]=='Q'){
return false;
}
}
for(int i=0;i<board.size();i++){
... | ALGO | 0.999815 | 5.420657 |
0c310688-e373-4883-bd1d-eb975509bb7d | yubaoliu/slambook | slambook2_dev/NoNLinearOptimization/gaussNewton.cpp | #include <iostream>
#include <chrono>
#include <opencv2/opencv.hpp>
#include <Eigen/Core>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main(int argc, char **argv) {
double ar = 1.0, br = 2.0, cr = 1.0; // 真实参数值
double ae = 2.0, be = -1.0, ce = 5.0; // 估计参数值
int N = 100; ... | ALGO | 0.999975 | 4.486063 |
6581ddd3-eca2-4778-9de2-f95055b37401 | Sneha-Agarwal23/Leetcode_Problems | Sequentially_Ordinal_Rank_Tracker.cpp | class SORTracker {
private:
struct Min_comp
{
bool operator()(const pair<int, string>&a, const pair<int, string>&b)
{
if(a.first != b.first)
return (a.first > b.first);
else
return (a.second < b.second);
}
};
struct Max... | ALGO | 0.999675 | 5.588724 |
9d74e28e-1c08-4202-9304-55d37d5f4b29 | worldmint/MinerOM | src/merkleblock.cpp | #include "merkleblock.h"
#include "hash.h"
#include "consensus/consensus.h"
#include "utilstrencodings.h"
using namespace std;
CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter& filter)
{
header = block.GetBlockHeader();
vector<bool> vMatch;
vector<uint256> vHashes;
vMatch.reserve(block.... | ALGO | 0.997511 | 5.965203 |
07077043-662c-4253-b03b-bad75d99e162 | rcslab/hatcp | freebsd/contrib/llvm-project/llvm/lib/Analysis/IntervalPartition.cpp | #include "llvm/Analysis/IntervalPartition.h"
#include "llvm/Analysis/Interval.h"
#include "llvm/Analysis/IntervalIterator.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include <cassert>
#include <utility>
using namespace llvm;
char IntervalPartition::ID = 0;
IntervalPartition::IntervalPartition() : F... | ALGO | 0.988623 | 7.599286 |
c9a6b2e7-a498-4a1e-ae26-44b7ee043c87 | sourabh59-coder/LeetCode | 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlin... | class Solution {
public:
string largestOddNumber(string num) {
int n = num.size(); // Get the size of the input string
if (num[n - 1] % 2 != 0) // Check if the last digit of the input number is odd
return num; // If it is, the input number is already the largest odd number
... | ALGO | 0.999875 | 6.397887 |
89a01cc3-ce4e-4b78-82c9-333507cb30f7 | Fisher87/leetcode | cplus/maximum-balanced-subsequence-sum.cpp | // Time: O(nlogn)
// Space: O(n)
// bst, binary search, mono stack
class Solution {
public:
long long maxBalancedSubsequenceSum(vector<int>& nums) {
static const auto NEG_INF = numeric_limits<int64_t>::min();
const auto& query = [](const auto& bst, const auto& k) {
const auto it = bst... | ALGO | 0.999987 | 6.372511 |
fbf017e2-8502-4703-8477-508ea1036f4a | raviii21/Leetcode-Codes | majority-element/12-17-2022, 2_59_56 PM/majority-element.cpp | // Link: https://leetcode.com/problems/majority-element
/** Submission Info:
*
* AUTHOR: Ravi Savsani
* TITLE: majority-element
* RUNTIME: 27 ms
* MEMORY: 19.6 MB
* DATE: 12-17-2022, 2:59:56 PM
*
*/
// Solution:
class Solution {
public:
int majorityElement(vector<int>& a) {
int count=1;
... | ALGO | 0.999899 | 5.495248 |
d3abcb11-d74a-4e48-96af-112b807d18a3 | Hasan-Saju/Competitive-Programming | LeetCode/973.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution
{
public:
float distancee(int x, int y)
{
float dist = sqrt(x*x + y*y);
cout<<dist<<" in fn \n";
return dist;
}
vector<vector<int>> kClosest(vector<vector<int>>& points, int k)
{
multimap<float, vector<int>... | ALGO | 0.999989 | 4.856024 |
55039667-046b-414c-b5bd-39b4c7094633 | HadyAhmed00/MyChallenge | July 2022/day21/Haiku.cpp | //
// Created by Hady Ahmed on 7/20/2022.
//
/*
██████╗ █████╗ ██╗ ██╗ ██╗ ██╗ ██████╗ ██╗
██╔══██╗██╔══██╗╚██╗ ██╔╝ ████████╗ ╚════██╗███║
██║ ██║███████║ ╚████╔╝ ╚██╔═██╔╝ █████╔╝╚██║
██║ ██║██╔══██║ ╚██╔╝ ████████╗ ██╔═══╝ ██║
██████╔╝██║ ██║ ██║ ╚██╔═██╔╝ ███████╗ █... | ALGO | 0.998871 | 3.967945 |
4335fe44-aba1-40d1-914d-887ca645eafd | TUS123456/DSAjourney | combination.cpp | #include<bits/stdc++.h>
using namespace std;
void solution(vector<int> &arr,int target,int indii,vector<int> &temp,vector<vector<int>> &ans){
//base
if(target==0){
ans.push_back(temp);
return;
}
if(target < 0){
return;
}
//main code
for(int i=0; i<arr.size(); i++){
temp.push_back(arr[i]);
solution(ar... | ALGO | 0.999864 | 4.84584 |
0076c720-3c2f-4985-b64c-2566ecf92092 | Meherab151175/graph_tree_stack_que_linked_list | insert_at_tail_optimize.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node* next;
Node(int val){
this->val=val;
this->next=NULL;
}
};
void insert_at_tail(Node *&head,Node *&tail,int val){
Node* newNode = new Node(val);
if(head == NULL){
head = newNode;
t... | ALGO | 0.99934 | 4.366056 |
8050d814-b78c-4d3b-aee7-3ce1dad8294b | syntaxhacker/competitive-programming | codeforces/Practice/A. Translation.cpp | #include <bits/stdc++.h>
using std::ifstream;
#define fri(i,n) for(lli i = 0 ; i < n;++i)
#define jri(j,k,n) for(int j = k ; j >= n;j--)
// Need to add a check to make sure you are not swapping the same // variable with itself. Otherwise it will zero the value.
#define swapnumsxor a ^= b; b ^= a; a ^= b
#define... | ALGO | 0.999993 | 3.772242 |
a21568de-2059-4ed0-b8ef-61b7ca04fa85 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-coop-gpt35/Codenet/p02391/234069043/original.cpp | #include <algorithm>
#include <bits/stdc++.h>
#include <vector>
using namespace std;
int main() {
double pai = 3.141592653589;
int a, b;
scanf("%d %d", &a, &b);
if (a > b)
printf("a > b\n");
else if (a < b)
printf("a < b\n");
else
printf("a == b\n");
return 0;
}
| ALGO | 0.999545 | 3.193967 |
5bf418f3-a416-499c-baeb-72c830322ac2 | ezhou2008/algorithm-basic | cpp2/601-Flatten-2D-Vector.cpp | /*Flatten 2D Vector
Description
Implement an iterator to flatten a 2d vector.
Example
Given 2d vector =
[
[1,2],
[3],
[4,5,6]
]
By calling next repeatedly until hasNext returns false,
the order of elements returned by next should be: [1,2,3,4,5,6].
Tags
Airbnb Zenefits Google Twitter*/
class Vector2D {
public:
... | ALGO | 0.994492 | 6.599241 |
ab5b54f4-973a-4331-b7ea-51e6c03ee074 | Dedicate-labors/Cplusplus-Review | C++算法/LeetCode/Project/143.cpp | //#include<iostream>
//#include<vector>
//using namespace std;
//
//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) {}
// };
//
////һvector<ListNode *>... | ALGO | 0.999986 | 5.219031 |
8892691a-673d-4c8e-a385-a395d42132a0 | krish160802/DataStructuresAndAlgorithms | Bit Manupilation/setbit.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,i,z;
cin>>n>>i;
z = n & (1<<i);
cout<<z<<endl;
if(z==0){
cout<<"not set";
}
else{
cout<<"set";
}
}
| ALGO | 0.996243 | 3.551187 |
d5a0f5e8-63f0-4775-b778-f5af1832a676 | ishandutta2007/codeforces | akulyat/normal/1672/E.cpp | // #include <bits/stdc++.h>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>... | ALGO | 0.999974 | 3.38197 |
86e0febb-3adf-430c-b4c1-9b373be4626c | pravinargade18/CP-world | LeetCodeProblems/Priority_QueueProblems/1046_Last_Stone_Weight.cpp | class Solution {
public:
int lastStoneWeight(vector<int>& stones) {
priority_queue<int>pq;
for(auto i:stones){
pq.push(i);
}
while(pq.size()>1){
int a=pq.top();
pq.pop();
int b=pq.top();
pq.pop();
... | ALGO | 0.99997 | 5.510506 |
33b9e623-fd38-4156-bb0e-d3c658e5cdaa | tanamaay/DSA_SUPREAM-BATCH | binary search tree/left root print.cpp | #include<iostream>
using namespace std;
struct Node{
int key;
struct Node*left;
struct Node*right;
Node(int k){
key=k;
left=right=NULL;
}
};
int maxlevel=0;
void printleft(Node*root,int level){
if(root==NULL)
return;
if(maxlevel<level){
cout<<(root->key)<<" ";
maxlevel=level;
}
pri... | ALGO | 0.99996 | 4.596682 |
3e8de931-dcb2-4b92-8856-1c8c7df7ae47 | mammothb/boost_1_54_0 | libs/geometry/doc/src/examples/algorithms/correct.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[correct
//` Shows how to correct a polygon with respect to its orientation and closure
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/adapted/boost_tup... | TEST | 0.881416 | 7.434141 |
a926def6-4e6a-4bd9-ba3c-3c938e024ecf | jatinS-dev/Leetcode-Solutions | Reverse Spiral Form of Matrix - GFG/reverse-spiral-form-of-matrix.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> reverseSpiral(int Row, int Col, vector<vector<int>>&A) {
int T,B,L,R,dir;
T=0;
B=Row-1;
L=0;
R=Col... | ALGO | 0.999964 | 5.306006 |
91bc865b-6249-47c2-86da-42274f0ad30e | raincross7/code-similarity | codes/train_code/problem255/problem255_483.cpp | //#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, ... | ALGO | 0.999965 | 3.900164 |
5d6d97a6-75d5-4234-b576-904928cd33a9 | RashmiMaxCoder/Data-Structure | Dynamic_Programming/gfg/countWithGivenSum.cpp | int subsetSum(int a[], int n, int sum)
{
// Initializing the matrix
int dp[n + 1][sum + 1];
// Initializing the first value of matrix
dp[0][0] = 1;
for (int i = 1; i <= sum; i++)
dp[0][i] = 0;
for (int i = 1; i <= n; i++)
dp[i][0] = 1;
for (int i = 1; i <= n; i++)
{
... | ALGO | 0.999979 | 5.24542 |
c4f5955c-b9e3-4ada-b79a-12969d37e3e6 | IshanX111/CodeChef_Problem_Solution | IDandShip.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
char c;
cin>>t;
while(t--){
cin>>c;
if(c=='B'|| c=='b')
printf("BattleShip\n");
else if(c=='C'||c=='c')
printf("Cruiser\n");
else if(c=='D'||c=='d')
printf("Destroyer\n");
else if(c=='F'||c=='f')
printf... | ALGO | 0.98874 | 3.347073 |
9f6dbe63-57f5-4a19-a09a-2b90cea74c38 | AbhineshJha/Supreme_Dsa | 03_Arrays,Time-&-Space-Complexity/06_Arrays_Level-03/2dArrays.cpp | #include<iostream>
using namespace std;
void printArray(int arr[][4],int row,int cols){
// Row wise ->
for (int i = 0; i < row; i++)
{
for (int j = 0; j < cols; j++)
{
cout<<arr[i][j]<<" ";
}
cout<<endl;
}
// Column wise ->
for (int i = 0; i < cols; i... | ALGO | 0.956352 | 4.099729 |
4a8e46cc-c404-4ccd-b352-275ebb81b7ff | 5128kishansingh/leetcode | 0040-combination-sum-ii/0040-combination-sum-ii.cpp | class Solution {
public:
void f(vector<int>&candidates,int ind,vector<int>p,
vector<vector<int>>&ans,int target){
if (target == 0) {
ans.push_back(p);
return;
}
for (int i = ind; i < candidates.size(); i++) {
if (i > ind && candidates[i] == candidates[i - 1]) continue;
if (candid... | ALGO | 0.999985 | 6.08018 |
835700c3-9170-4d2f-ae3a-936ad7456616 | Anushka-098/Problem-of-the-day- | array reverse.cpp | #include <iostream>
using namespace std;
int reversearray(int arr[],int n){
int start=0;
int end=n-1;
while(start<=end){
swap(arr[start],arr[end]);
start++;
end--;
}
}
int printarray(int arr[],int n){
for(int i=0;i<n;i++){
cout<<arr[i]<< " ";
}
cout<<endl;
}
... | ALGO | 0.99792 | 4.910222 |
367453c1-8dba-4c51-8199-c4dd565b6352 | wiznetmaker/W5100S-MQTT-DHT11 | libraries/pico-sdk/lib/tinyusb/hw/mcu/nxp/mcux-sdk/devices/MK24F12/mcuxpresso/startup_mk24f12.cpp | #if defined (DEBUG)
#pragma GCC push_options
#pragma GCC optimize ("Og")
#endif // (DEBUG)
#if defined (__cplusplus)
#ifdef __REDLIB__
#error Redlib does not support C++
#else
//*****************************************************************************
//
// The entry point for the C++ library startup
//
//********... | CONFIG | 0.860865 | 7.473406 |
ec688c46-4636-4d19-8c50-c7d3daa8ae8d | Redleaf23477/ojcodes | acmicpc/2020-LatinAmerica/N.cpp | #include <bits/stdc++.h>
using namespace std;
using LL = long long int;
int get_money() {
char ch; cin >> ch;
int x; cin >> x;
cin >> ch;
int y; cin >> y;
return y;
}
int main() {
ios::sync_with_stdio(false); cin.tie(0);
int n; cin >> n;
int ans = 0;
int money = get_money();
fo... | ALGO | 0.959532 | 3.399029 |
4b655fbf-b77f-43de-abb8-18f4f3eadabc | proghead00/LeetcodeGrind | 406-queue-reconstruction-by-height/406-queue-reconstruction-by-height.cpp | class Solution {
public:
vector<vector<int>> reconstructQueue(vector<vector<int>> &people) {
int n = people.size();
vector<vector<int>> ans;
/*
1. sort descending by height and insert
2. if height is same, sort by increasing of 1st index
3. if element is already present, insert the smaller one befo... | ALGO | 0.999998 | 6.203965 |
ea193b28-825b-4411-8152-ca3358e3c5ad | NIGHTLOS/Just-my-codes-for-practice | Project RG/锐格 实验 第一学期/实验7/8999.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char a[15][20],tmp[20];
int n,i,j,k;
while(scanf("%d",&n)!=-1)
{
for(i=1;i<=n;i++)
scanf("%s",a[i]);
for(i=1;i<=n;i++)
{
for(j=1;j<n;j++)
{
if (strcmp(a[j],a[j+1])>0 )
{
... | ALGO | 0.999845 | 3.304847 |
4dc5d1ca-9e20-4e34-b7db-7b3372129632 | jxx-sx/BOJ_Study | solved/24041.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
vector<pair<long long, int>> v1, v2;
int n, g, k;
int ans;
void search() {
long long l = 0;
long long r = 2000000000;
while (l <= r) {
long long sum = 0;
int mid = (l + r) / 2;
priority_queue<long long> pq... | ALGO | 0.99897 | 3.836577 |
7bd4ec94-be5e-4c6e-be6b-664f7f093f17 | ISOLDE-Project/riscv-llvm | llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp | #include "llvm/Transforms/Utils/MemoryTaggingSupport.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/Analysis/StackSafetyAnalysis.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/IntrinsicInst.h"
#in... | TOOL | 0.97402 | 6.408189 |
abf18ccc-b054-480a-a9e1-e9172ff19b80 | arash16/prayers | UVA/vol-007/755.cpp | /*
>>~~ UVa Online Judge ACM Problem Solution ~~<<
ID: 755
Name: 487--3279
Problem: https://onlinejudge.org/external/7/755.pdf
Language: C++
Author: Arash Shakery
Email: <EMAIL>
*/
#include <stdio.h>
#include <iostream>
#include <string>
#include <map>
using namespace std;
int d[127];
int main() {
... | ALGO | 0.999024 | 4.257801 |
08b64dae-81c4-4e74-a97a-bca87a89096b | Luke-Tseng/DigiPen | CS280/Avl_map/avl-map.cpp | #include <iostream>
#include <stack>
// static data members
template <typename KEY_TYPE, typename VALUE_TYPE>
typename CS280::AVLmap<KEY_TYPE, VALUE_TYPE>::AVLmap_iterator
CS280::AVLmap<KEY_TYPE, VALUE_TYPE>::end_it = CS280::AVLmap<KEY_TYPE, VALUE_TYPE>::AVLmap_iterator(nullptr);
template <typename KEY_TYPE, typenam... | ALGO | 0.980687 | 3.849678 |
f8926389-d4f8-49db-ac50-d5dca7cf188f | saraserafino/AdvancedProgramming | lab exercises/lab06/ex6.cpp | #include <chrono> // for measuring time
#include <cmath> // for power
#include <iostream>
class Vector {
public:
// Constructor.
Vector(const unsigned int &size = 0) : data(new double[size]), size(size) {}
// Move constructor.
Vector(Vector &&other) noexcept {
// noexcept means that it doesn't throw excep... | TOOL | 0.87633 | 6.858612 |
fb4c9b6f-066b-4f0f-b1a7-93f2840da7c5 | neelotpal-d/VectorField_Multiaxis | ThirdPartyDependence/libigl/include/igl/cat.cpp | #include <cstdio>
// Bug in unsupported/Eigen/SparseExtra needs iostream first
#include <iostream>
#include <unsupported/Eigen/SparseExtra>
// Sparse matrices need to be handled carefully. Because C++ does not
// Template:
// Scalar sparse matrix scalar type, e.g. double
template <typename Scalar>
IGL_INLINE void ... | ALGO | 0.96892 | 5.91755 |
57c231e6-3737-4649-9fa9-365d09cdd792 | Kibria2002/XPSC_Weekly_Practice | Week 10 Day 02/Two_Subsequences.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
string s;
cin >> s;
auto c = min_element(s.begin(), s.end());
cout << *c << " ";
s.erase(c);
cout << s << endl;
}... | ALGO | 0.999967 | 4.711422 |
c691639a-ad2b-43f9-b6ae-c57a1517d94e | Lakshita2002/LeetCode-Problems-Summers-2021 | leetcode problems/70. Climbing Stairs.cpp | class Solution {
public:
int dp[1000] = {0};
int climbStairs(int n) {
// base case
if(n==1){
dp[1] = 1;
return dp[1];
}
if(n==2){
dp[2] = 2;
return dp[2];
}
if(dp[n]!=0){
retur... | ALGO | 0.999911 | 6.4158 |
2d202c19-3ac7-4ad6-8e63-8007cdb7dcd8 | algo1shot1kill/Code_study | pshpjr/[LET]Maximum Employees to Be Invited to a Meeting/main.cpp | class Solution {
public:
int maximumInvitations(vector<int>& favorite) {
/*순회하면서 가장 긴 사이클을 찾는다. dfs로
사이클이 생겼을 때 dfs 깊이를 각각 저장
가장 긴 사이클 / 가장 긴 안 사이클 2개 비교
1. 사이클의 크기를 어떻게 알아내지?
사이클이 생기면, 깊이를 저장
더 갈 곳이 없으면 깊이를 저장
*/
vector<vector<int>>... | ALGO | 0.999901 | 5.719266 |
d33ee27e-f592-4f5f-b542-3685f1e7afbb | skasifiqbal-cs/Hybrid_automata | final.cpp | /*
* HybridAutomata.cpp
*
* Created on: 09-Jul-2014
* Author: amit
*/
#include <core/hybridAutomata/hybridAutomata.h>
#include "z3++.h"
#include <fstream>
#include <string>
using namespace std;
hybrid_automata::hybrid_automata() {
dimension = 0;
}
hybrid_automata::hybrid_automata(std::map<int, location:... | ALGO | 0.999492 | 4.275015 |
b70757f6-3964-4b34-9791-a3aff82634ae | Lqs66/boost_1_74_0 | libs/algorithm/string/example/trim_example.cpp | // Boost string_algo library example file ---------------------------------//
// See http://www.boost.org for updates, documentation, and revision history.
#include <string>
#include <iostream>
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/classification.hpp>
using namespace std;
usi... | TOOL | 0.946103 | 6.979737 |
af22f521-301d-4ee0-85ef-31024b69c3a9 | Qiuhuawa/cddproject | SystemController/t6.cpp | #include <iostream>
using namespace std;
int main()
{
int day, afterday;
int sum = 0;
cin >> day >> afterday;
int enday = afterday % 7;
if (day + enday > 7)
{
sum = day + enday - 7;
}
else
sum = day + enday;
cout << sum << endl;
return 0;
} | ALGO | 0.99982 | 3.328907 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.