uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
efabd5c8-3845-4f04-a5a0-1e7c4172fa0a | duong2803/DSA-code.ptit-Full362 | Quay lui - Nhánh cận/DSA02032 - TỔ HỢP SỐ CÓ TỔNG BẰNG X.cpp |
// created: 2023-05-26 17:45:26
// author: Nguyen Tung Duong
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, k;
int a[25];
vector<vector<int>> res;
void Try(int sum = k, vector<int> tmp = {}){
if(sum == 0){
res.push_back(tmp);
return;
}
for(int i = 0; i < n; ++i){
if(a[i] <= s... | ALGO | 0.999137 | 4.445602 |
5d2a40e9-6aea-40be-93bf-9888234e370c | DaEunKim/ClassCpp | 숫자진법변환/숫자진법변환/main.cpp | #include <iostream>
#include <cstdlib>
#include <fstream>
#include <string>
using namespace std;
int Mul(int a, int b){
int mul = 1;
for(int i = 0; i<b; i++){
mul *= a;
}
return mul;
}
int toInt(char c){
if('0' <= c && c <= '9')
return c - '0';
else if('A'<=c && c<='Z')
... | ALGO | 0.999624 | 4.488247 |
e3d617ac-4f85-4d8e-b6e1-f89eede7590f | santi3223/PreseleccionIOI | Codeforces/Problemas/Otros/Balanced_Team.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vl vector<ll>
#define vs vector<string>
#define vb vector<bool>
#define vc vector<char>
#define ull unsigned long long
#define pll pair<ll, ll>
#define pb push_back
#define fi first
#define se second
#define ff(i, p, x) for (ll i = p; i < x; i++... | ALGO | 0.999955 | 4.209108 |
6e35c234-c649-4eff-beaf-13390e2b9450 | gurwinder-git/cpp | findTheDuplicateNumber.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
class Solution
{
public:
int findDuplicate(vector<int> &nums)
{
if (nums.size() > 1)
{
// one pase outside loop
// to //from
int slow = nums[nums[0]];
int fast = ... | ALGO | 0.999858 | 5.366309 |
90d90bdb-7f5c-4a94-a8b9-4bf044e595c7 | alton-zheng/data-structures-and-algorithms | Q01501-Q01600/01588-Sum-of-All-Odd-Length-Subarrays/cpp01588/m03/Solution.cpp |
// Time Complexity: O(N)
// Space Complexity: O(1)
class Solution {
public:
int sumOddLengthSubarrays(vector<int>& arr) {
int res = 0;
for (int i = 0; i < arr.size(); i++) {
int left = i + 1, right = arr.size() - i,
left_even = (left + 1) / 2,right_even = (right + 1) / 2,
... | ALGO | 0.999938 | 5.852589 |
bc817505-9f2d-4a97-b6c9-a76c9da1d018 | otabuzzman/chartacaeli-app | org/chartacaeli/caa/src/AAParallactic.cpp | //////////////////// Includes /////////////////////////////////////////////////
#include "stdafx.h"
#include "AAParallactic.h"
#include "AACoordinateTransformation.h"
#include <cmath>
//////////////////// Implementation ///////////////////////////////////////////
double CAAParallactic::ParallacticAngle(double HourAn... | TOOL | 0.999124 | 7.087277 |
9e17fb64-19de-4443-8c56-f4f9a556ae45 | StrawHatWess/Competitive-Programming-Solutions | IOI/20 (Re)/Plants/A.cpp | #include "bits/stdc++.h"
using namespace std;
#ifndef LOCAL
#include "plants.h"
#endif
typedef vector<int>vi;
#define FOR(i,x,y) for(int i=x; i<y; i++)
#define sz(x) x.size()
#define pb push_back
#define dbgs(x,y) cerr << x << ' ' << y << endl;
const int MX=5000+10;
int N,K,r[MX],ans[MX][MX],vis[MX];
vi adj[MX]; /... | ALGO | 0.999983 | 4.110695 |
ca26d021-18b3-4409-9b05-10f4c6dc4f80 | hd9210/C- | Excercises/Boston Numbers.cpp | //#include<bits/std++.h>
#include<iostream>
using namespace std;
int func(int a)
{ int sum=0;
while(a){sum=sum+a%10;a=a/10;}
return sum;
}
int boston(long long int n)
{ long long int num=n,sum=0;
int len=0,flag;
while(num){sum=sum+num%10;len++;num=num/10;}
for(int i=1;i<=n;i++)
{
for(int j=2... | ALGO | 0.999976 | 3.954046 |
9bc4b376-bce5-4555-8519-bd11b8ea8fa1 | 4xx31/algorithms-cpp | other-onlinejudges/leetcode/Medium/jump-game-ii.cpp | #include <bits/stdc++.h>
using namespace std;
// https://leetcode.com/problems/jump-game-ii/
class Solution
{
public:
int jump(vector<int>& nums)
{
int n = nums.size();
int jumps = 0;
int currentJumpEnd = 0;
int farthest = 0;
for (int i = 0; i < n - 1; i++)
{
... | ALGO | 0.999955 | 6.074955 |
1307f61d-3a59-4b9d-8bd6-8b1a13034390 | choudhary29/Github-Kanchan | Sem 3/Problem Solving/identify_smith_number.cpp | #include <iostream>
using namespace std;
// int main(){
// int n=378;
// int num=n;
// int mul=1;
// for(int i=2;i<=n;i++){
// while(n%i==0){
// // cout<<i<<" ";
// mul=mul*i;
// n=n/i;
// }
// }
// // cout<<mul;
// if (mul==num) {
// c... | ALGO | 0.999972 | 4.183871 |
28de1ae4-3237-425d-a008-17c02dab182e | abhijeetc2804/Pattern_Search | dict.cpp | // Do NOT add any other includes
#include "dict.h"
vector<string> tokenize(string s){
vector<string> v;
int n = s.size();
string s1 = "";
for(int i = 0; i < n; i++){
char lowercase_char = std::tolower(s[i]);
bool check = false;
if(isalpha(lowercase_char)){
s1.append(1, lowercase_cha... | ALGO | 0.991333 | 4.991993 |
93b9a280-d3c4-42c1-8544-30ee7bc14d9c | enkrypter/bb | src/spork.cpp | #include "spork.h"
#include "base58.h"
#include "consensus/validation.h"
#include "key.h"
#include "main.h"
#include "masternode-budget.h"
#include "net.h"
#include "protocol.h"
#include "sync.h"
#include "sporkdb.h"
#include "util.h"
using namespace std;
using namespace boost;
class CSporkMessage;
class CSporkManage... | TOOL | 0.975339 | 5.991731 |
305d0194-faed-4e3e-994a-211370da0ee1 | ishandutta2007/codeforces | skydec/normal/851/B.cpp | #include<bits/stdc++.h>
#define pii pair<int,int>
#define fi first
#define se second
#define rep(i,j,k) for(int i=(int)j;i<=(int)k;i++)
#define per(i,j,k) for(int i=(int)j;i>=(int)k;i--)
using namespace std;
typedef long long LL;
int ax,bx,cx,ay,by,cy;
int main(){
scanf("%d%d%d%d%d%d",&ax,&ay,&bx,&by,&cx,&cy);
if((ax... | ALGO | 0.999973 | 3.006477 |
fe4b8566-6a24-43e3-aa80-bc1efa7950fa | ishandutta2007/codeforces | kostia244/normal/542/A.cpp | #include<bits/stdc++.h>
#define comp loli
#define all(x) begin(x), end(x)
using namespace std;
using ll = long long;
const int maxn = 1<<20;
int n, m, l[maxn], r[maxn], s[maxn], t[maxn], c[maxn];
vector<int> check[maxn], ev[maxn];
array<ll, 3> ans = {0, 0, 0};
array<int, 2> bad = {-(1<<30), -1};
vector<int> raw;
struct... | ALGO | 0.999996 | 3.922959 |
32e6508a-d9c3-43d6-a4d5-d7422c2b6e8a | chichchic/algorithmPrac | BaekJoon/2021/12December/211228_2533.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<vector<int>> link(1000001);
vector<vector<int>> dp(1000001, vector<int>(2, -1));
int getMinCnt(int n, int status, int parent)
{
if (dp[n][status] != -1)
{
return dp[n][status];
}
int ret = 0;
for (int i = 0; i < link[n].size(); i++)
{
... | ALGO | 0.999739 | 4.818701 |
2315b940-5e2f-4bb8-82b0-897167ac685e | forvicky/llvm | llvm/lib/Support/StringExtras.cpp | #include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
/// StrInStrNoCase - Portable version of strcasestr. Locates the first
/// occurrence of string 's1' in string 's2', ignoring case. Returns
/// the offset of s2 in s1 or npos if s2 cannot ... | TOOL | 0.939147 | 6.803111 |
9eea4a86-e97e-47c9-bacb-6835b877a333 | anushkaGurjar99/Data-Structure-and-Algorithms | LEETCODE/2D Matrix/Q240. Search a 2D Matrix II.cpp | /*
* Author : Anushka Gurjar
* Date : April 2020
* flags : -std=c++14
*/
#include<bits/stdc++.h>
using namespace std;
// Problem Statement: https://leetcode.com/problems/search-a-2d-matrix-ii/
class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target){
if(matrix.... | ALGO | 0.999972 | 6.127632 |
a5a02ddb-1dd9-4487-b2bb-da64033d327d | UCTECHIP/PortComputeLibrary | ComputeLibrary/src/runtime/NEON/functions/NELocallyConnectedLayer.cpp | #include "arm_compute/runtime/NEON/functions/NELocallyConnectedLayer.h"
#include "arm_compute/core/PixelValue.h"
#include "arm_compute/core/Utils.h"
#include "arm_compute/core/Validate.h"
#include "arm_compute/runtime/NEON/NEScheduler.h"
#include <cmath>
#include <tuple>
using namespace arm_compute;
namespace
{
voi... | ALGO | 0.904472 | 7.435751 |
339cf24a-2ee9-43ea-a0fc-71c2c64022b6 | FDrekner/mac0214 | Grafos e DFS - 5 horas/Gincana.cpp | // https://olimpiada.ic.unicamp.br/pratique/pj/2011/f2/gincana/
#include<bits/stdc++.h>
using namespace std;
#define int long long
vector<vector<int>> bss;
vector<bool> visitados;
void dfs(int a) {
visitados[a] = true;
for(int b : bss[a]){
if(!visitados[b]){
dfs(b);
}
}
}
signed main() {
int res=0;
i... | ALGO | 0.999683 | 3.811026 |
a1b4c30c-3fd7-4313-968e-9e23ef3ed7aa | ChachanNaman/LeetCode | LinkedList/203.cpp | //203. Remove Linked List Elements
//https://leetcode.com/problems/remove-linked-list-elements/description/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNod... | ALGO | 0.999547 | 5.845442 |
e9e332ac-f9c4-473f-b872-d843a6493019 | smi13/semester06 | optimization/numerical_base/md_task_solver.cpp | #include "md_task_solver.h"
MdTaskSolver::MdTaskSolver( MdTask &T ) : _T(T), _iterCounter(0), _eps(1e-1)
{
}
int MdTaskSolver::getIterCounter()
{
return _iterCounter;
}
void MdTaskSolver::resetIterCounter()
{
_iterCounter = 0;
}
void MdTaskSolver::setEps( double new_eps )
{
_eps = new_eps;
}
| ALGO | 0.995593 | 3.440856 |
73252c6b-745c-43eb-89e0-481b87f78e6e | Yaswanth-Vempuluru-7916/DSA | Recursion/combination_sum_single_pick_sorted_ans.cpp | #include <iostream>
#include <vector>
#include <algorithm> // for sort()
using namespace std;
class Solution {
public:
void solve(vector<int>& candidates, int index, int n, int target, vector<int>& output, vector<vector<int>>& ans) {
if (target == 0) {
ans.push_back(output);
... | ALGO | 0.999993 | 7.201885 |
eea14b5f-15ab-4ef1-9d8e-0bc36f0b2a87 | leehayeong/Algorithm | BOJ_cpp/queue/2164.cpp | #include <iostream>
#include <queue>
using namespace std;
int N;
queue<int> q;
int main() {
cin.tie(NULL);
cout.tie(NULL);
ios::sync_with_stdio(false);
cin >> N;
// 카드를 만든다.
for (int i = 1; i <= N; i++) {
q.push(i);
}
// 카드의 개수가 1이 될때까지 반복한다.
while (q.size() != 1) {
// 맨 위 카드를 삭제한다.
q.pop();
// ... | ALGO | 0.999981 | 4.058065 |
0887f757-9b5f-40fd-889d-13904c748872 | laihuiyuan/LeetCode | cpp/4Sum.cpp | class Solution {
public:
vector<vector<int> > fourSum(vector<int> &nums, int target) {
int len=nums.size();
sort(nums.begin(), nums.end());
vector<vector<int>> res;
for (int i = 0; i<len-3; ++i) {
if (i && nums[i] == nums[i - 1])
continue;
if(0... | ALGO | 0.999975 | 5.751834 |
a9c03d41-ad93-4389-8767-e77c987f8298 | JJuOn/Algorithm-Study | 2000~2999/2751.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n;
vector<int> v;
cin >> n;
for (int i = 0; i < n; i++) {
int temp;
cin >> temp;
v.push_back(temp);
}
sort(v.begin(), v.end());
for (int i = 0; i < v.size(); i++) {
cout << v[i] << "\n";
}
return 0;
}
| ALGO | 0.99992 | 4.464304 |
96254383-db41-40af-b1e8-5b221b5000f6 | xufor/dsa-hustle | learn_cpp/shift.cpp | #include <iostream>
using namespace std;
int main() {
int x = -1, y = 7;
cout << (x << 1) << " " << (y << 1);
//Note that -ve sign is reatined as the first bit is not disturbed
return 0;
} | ALGO | 0.992341 | 3.921201 |
4f3c2036-3fa3-44d1-b82d-8bd500f68d2d | jonatas57/maratona | cf/contest/1828/c/c.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef pair<int, int> ii;
const int INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3fll;
#define each(x, s) for(auto& x : s)
#define loop(x) for(int i = 0;i < x;i... | ALGO | 0.999963 | 3.917628 |
731c92f6-508a-42d7-aa8a-2c331a467aba | ITSJKS/CP_Submissions | CP Problems/C_Slay_the_Dragon.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = a; i < b; i++)
#define all(x) x.begin(), x.end()
#define endl "\n"
typedef vector<int> vi;
typedef pair<int, int> pii;
#define ll long long
#define int long long
ll modPower(ll a, ll b, ll m)
{
if (b == 0)
return 1;
ll result = modP... | ALGO | 0.999973 | 3.960963 |
999a1921-918b-4b05-9527-fc602fe2da74 | se-ahtisham/100-Days-Of-LeetCode-Challenge | Dynamics-Programing-Challenges/5-Decode_Way.cpp | #include <iostream>
#include <string>
using namespace std;
int numDecodings(string& s) {
int n = s.length();
if (n == 0 || s[0] == '0') return 0;
int prev1 = 1; // Number of ways to decode the substring starting from index i+1
int prev2 = 0; // Number of ways to decode the substring starting f... | ALGO | 0.999943 | 6.28172 |
8cb4672d-f1ed-405b-8cda-d3d2d481ad55 | raincross7/code-similarity | codes/train_code/problem302/problem302_183.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF = 1LL<<60;
const int MOD = 1000000007;
ll GCD(ll x,ll y){
if(y == 0) return x;
else return GCD(y,x%y);
}
ll LCM(ll a,ll b){
return a / GCD(a,b) * b;
}
int main() {
ll l,r; cin >> l >> r;
ll ans = 10000;
if(... | ALGO | 0.999836 | 3.99098 |
7609cea9-3056-4963-a425-909938614236 | gourango-modak/Competitive_Programming | Library/Number theory/primeFact.cpp |
void primeFact(ll n) {
vector<pair<int, long long>> val;
for (long long i = 2; i * i <= n; ++i) {
int cnt = 0;
while (n % i == 0) {
++cnt;
n /= i;
}
if (cnt > 0) {
val.push_back({cnt, i});
}
}
if (n > 1) {
val.push_back({1, n});
}
} | ALGO | 0.999361 | 3.971689 |
14573579-5636-4ce4-bf7e-a56a78de6717 | toufu-24/AtCoder | Practice/2024_07_30/ADT1730/F.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define all(v) v.begin(), v.end()
#define SORT(v) sort(v.begin(), v.end())
#define RSORT(v) sort(v.rbegin(), v.rend())
#define REVERSE(v) reverse(v.begin(), v.end())
#define ll long
#define ld long double
#define int ll
int... | ALGO | 0.999919 | 5.258857 |
e9bbee21-5105-4509-aa23-9ad0cbc5bde8 | sshockwave/Online-Judge-Solutions | EZOJ/Contests/1550/B.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <cctype>
#include <algorithm>
using namespace std;
typedef long long lint;
#define cout cerr
#define ni (next_num<int>())
template<class T>inline T next_num(){
T i=0;char c;
for(;!isdigit(c=getchar())&&c!='-';);
bool neg=c=='-';
ne... | ALGO | 0.999998 | 3.888396 |
6f104764-ac97-44d1-9e3a-fe43369dd85a | aka-zoe/flutter_framework_3.10.3 | dev/integration_tests/windows_startup_test/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.998806 | 6.76073 |
55ec6db7-44f1-412f-8379-6853eb3797bf | SatyamSingh343/100-Days-of-Code | 0088-merge-sorted-array/0088-merge-sorted-array.cpp | class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int i = nums1.size()-1;
int ptr1 = m-1;
int ptr2 = n-1;
while(true){
if(ptr1 < 0 || ptr2 < 0) break;
if(nums1[ptr1] <= nums2[ptr2]){
nums1[i] = nums2[p... | ALGO | 0.999985 | 5.400048 |
8c2fb541-1ebd-4fed-92a5-50f1f2eac175 | alohner/WhereAmI | libraries/tess-two/jni/com_googlecode_tesseract_android/src/cube/beam_search.cpp | #include <algorithm>
#include "beam_search.h"
#include "tesseractclass.h"
namespace tesseract {
BeamSearch::BeamSearch(CubeRecoContext *cntxt, bool word_mode) {
cntxt_ = cntxt;
seg_pt_cnt_ = 0;
col_cnt_ = 1;
col_ = NULL;
word_mode_ = word_mode;
}
// Cleanup the lattice corresponding to the last search
voi... | ALGO | 0.999784 | 6.866126 |
b22d9d19-5595-45e1-98ee-20181525c570 | Craneplayz/CP-Archive | MCO/2023/TwoPointersHard_Subtask6.cpp | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unor... | ALGO | 0.99999 | 4.72452 |
4cc3f9b4-f628-4bfe-b01f-072912760d9f | ishandutta2007/codeforces | marckess/normal/570/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define FOR(i,n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int... | ALGO | 0.999949 | 3.054016 |
e2eb7cc6-cc8f-44dc-b004-677d404456c7 | tokyj515/baekjoon | bj18406.cpp | #pragma warning(disable : 4996)
using namespace std;
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cmath>
#include <map>
#include <set>
#define _CRT_SECURE_NO_WARNINGS
#define INF 9876543... | ALGO | 0.998812 | 4.555563 |
d6808dc2-b3a7-495a-a9e8-9c45933324ad | RamanandPandey/DSA-with-cpp | target2/Loops_in_C++/pattern5.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cout<<"enter the size of rows (n) :"<<endl;
cin>>n;
cout<<"------------------------------"<<endl;
for(int i=1;i<=n;i++){
//for spaces....
for(int j=1;j<=(n-i);j++){
cout<<" ";
}
for(int j=1;j<=(2*... | ALGO | 0.99938 | 3.561585 |
493899e3-4e6b-4ede-92ff-7bb96c7e4c93 | ThomasLengeling/LLLMarker | apps/Utilities/utils_markermap/pcdwriter.cpp | #include "markermap.h"
#include <fstream>
#include <map>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
void getRTfromMatrix44(const cv::Mat& M, cv::Mat& R, cv::Mat& T)
{
assert(M.cols == M.rows && M.cols == 4);
assert(M.type() == CV_32F || M.type() == CV_64F... | ALGO | 0.930765 | 4.164704 |
873446ca-69ef-4df9-9794-3cb213f0a05b | ishandutta2007/codeforces | krk/normal/750/D.cpp | #include <map>
#include <set>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int Maxk = 31;
const int Maxn = 320;
const int Maxd = 8;
const int dy[Maxd] = {0... | ALGO | 0.999788 | 3.31942 |
6b244eed-7c96-4a42-883b-f3a79540c502 | tahmidul-islam-star/Data_Structure_B210101002 | Graph/Dfs.cpp | #include <iostream>
using namespace std;
const int n = 3;
int graph[n][n] = {0};
bool visited[n] = {false};
void add_connection(int from, int to) {
graph[from][to] = 1;
}
void display_graph() {
for (int i = 0; i < n; i++) {
cout << i << ": ";
for (int j = 0; j < n; j++) {
if... | ALGO | 0.999865 | 5.860634 |
aa182c4b-7a4b-4615-92d6-092a3d1fd4ce | Ryexocious/problemsolving | eduround(175)/b.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef map<string,int> mp;
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;
#define all(x) (x).begin(), (x).end()
#define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pob... | ALGO | 0.999875 | 3.319131 |
a01d0044-bcd9-4a43-825a-b00791dcccd7 | BR14NG4MER/25-CPP | Programa8/Codigo.cpp | #include <iostream>
/*
Programa 8
Determinar si un numero entero es par o impar.
*/
//@Author BR14NG4MER
//@Date 31 de marzo del 2023
using namespace std;
int main()
{
int a, resultado;
cout<<"Ingrese numero: ";
cin>>a;
cout<<"\n";
resultado=a%2;
if(resultado==0)
{
cout<<"E... | ALGO | 0.998272 | 3.791585 |
fb23f56e-ec93-477d-b841-1cd4b96639e5 | longieee/mit-6.096 | assignment-2/3.cpp | #include <iostream>
void printNum(int number);
int main()
{
printNum(35);
return 0;
}
void printNum(int number)
{
std::cout << number << std::endl;
} | TOOL | 0.933745 | 4.509187 |
8135cd7b-72ea-4569-a832-4e9e6c11d155 | vandan08/LeetCode_100_Days | Day_6/Top_k_freq_ele.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Input: nums = [1,1,1,2,2,3], k = 3
Output: [1,2]
Explanation:
1 -> 3
2 -> 2
3 -> 1
The Top K frequent Element is [1,2,3]
*/
class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k) {
vector<int>ans;
unordered_map<int,int>... | ALGO | 0.999986 | 5.664813 |
80168ffb-13bb-4cc6-b0ab-cb8e92ed6787 | LauraKirby/data-structures-and-algorithms-cpp | FinalPractice/QuickSort/QuickSort/main.cpp | #include <iostream>
#include "book.h"
#include "compare.h"
#include "qsort1.h"
using namespace std;
int main(int argc, const char * argv[]) {
int arr[] = {2,5,1,8,3,10};
int size = 6;
sort<int, minintCompare>(arr, size);
for (int i = 0; i < 6; i++){
cout << arr[i] << endl;
}
return 0... | ALGO | 0.999886 | 4.851516 |
a4e359e6-3e5d-493e-8c79-e41f60958db0 | FryeLun/algorithm-journey | DP/Linear DP/Class66/Code05_UglyNumberII.cpp | // 丑数 II
// 给你一个整数 n ,请你找出并返回第 n 个 丑数
// 丑数 就是只包含质因数 2、3 或 5 的正整数
// 测试链接 : https://leetcode.cn/problems/ugly-number-ii/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int nthUglyNumber(int n) {
vector<int> dp(n + 1);
dp[1] = 1;
for(int i = 2, ia = 1, ib = 1, ic = 1... | ALGO | 0.999875 | 5.462974 |
5e6b8550-35ce-4d3a-8e60-8b5376aa1a68 | pixelled/Rain-Sim | ext/nanogui/ext/eigen/doc/examples/DenseBase_template_int_middleCols.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl;
return 0;
}
| ALGO | 0.969369 | 3.154174 |
a043316d-a061-454c-ad1a-df362cd54949 | tawhidh/code-library | Sorting/Insertion sort.cpp | #include<bits/stdc++.h>
using namespace std;
void insertionSort(int a[], int n) {
for (int i = 1; i < n; i++) {
int key = a[i];
int j = i - 1;
while (j >= 0 && a[j] > key) {
a[j + 1] = a[j];
j = j - 1;
}
a[j + 1] = key;
}
}
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
... | ALGO | 0.999986 | 4.96381 |
71ec0096-95d1-4a10-8a42-c5bdf0007041 | andrew-canada/competitive-programming | codeforces/problems/1600/dp/1295c-obtainTheString/1295c-sol.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = int(2e5) + 99;
const int INF = int(1e9) + 99;
int tc;
string s, t;
int nxt[N][26];
int main()
{
cin >> tc;
while (tc--)
{
cin >> s >> t;
for (int i = 0; i < s.size() + 5; ++i)
for (int j = 0; j < 26; ++j)
... | ALGO | 0.999681 | 4.162783 |
2d5bfc7b-f9ee-42f8-91d6-eb8e37ebf86d | AbuAhamedRafi/Tic-Tac-Toe | Source.cpp | #include <iostream>
#include <vector>
using namespace std;
void displayBoard(const vector<vector<char>>& board) {
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
cout << " " << board[i][j] << " ";
if (j < 2) cout << "|";
}
cout << endl;
if (i < 2... | ALGO | 0.999145 | 7.018966 |
7f9e0719-1cf6-4d7f-aa22-41f0c7daf974 | berylyvos/lcl | src/901-online-stock-span/main.cpp | #include <stack>
using namespace std;
// https://leetcode.cn/problems/online-stock-span/
class StockSpanner {
public:
StockSpanner() {
st.emplace(INT_MAX, -1);
}
int next(int price) {
while (price >= st.top().first) st.pop();
int res = idx - st.top().second;
st.emplace... | ALGO | 0.999121 | 6.132417 |
6df83789-a5f0-4bef-be7c-1e8922ef485d | Ryexocious/problemsolving | sofiaandlostoperations.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef map<ll,ll> mp;
#define cy cout<<"YES"<<endl;
#define cn cout<<"NO"<<endl;
#define all(x) (x).begin(), (x).end()
#define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pob pop_... | ALGO | 0.99988 | 3.691149 |
29e544a2-c9ea-41fd-99ba-28d9bca35658 | vishal2005025/cp | A_Unit_Array.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int t;
cin>>t;
while(t--){
int n,b=0,c=0,flag=0;
cin>>n;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
if(a[i]==1){
b++;
}
else c+... | ALGO | 0.999647 | 4.190094 |
abcf06cf-3383-4c73-abff-ce41eccaa0f5 | SgtApone117/leetcode_daily | 2552-maximum-sum-of-distinct-subarrays-with-length-k/maximum-sum-of-distinct-subarrays-with-length-k.cpp | class Solution {
public:
long long maximumSubarraySum(vector<int>& nums, int k) {
int n = nums.size();
unordered_map<int,int> mp;
long long sum, max_sum, curr_sum;
sum = 0, max_sum = 0;
for(int i = 0; i < k; ++i)
{
mp[nums[i]]++;
sum += nums[i]... | ALGO | 0.999953 | 5.934349 |
92b996ac-3bb6-4e89-a612-1f27c64b1d38 | Dzokaredevil/Codeforces | Kefa and First Steps.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
class ListNode{
public :
int value;
ListNode *next;
};
void printList(ListNode *head){
while(head){
cout<<head->value<<" -> ";
head = head->next;
}
cout<<endl;
}
ListNode* List1(){
ListNode *head,*temp;
hea... | ALGO | 0.999647 | 4.057164 |
31749f52-abb9-4fdc-b31b-2f6b708a4945 | DaeYoung7/sogang_advanced_software | OpenCV/s150614L03HW.cpp | #include "SIFT.h"
#define DIST_RATIO_THR 0.49
//ǽ ۼ ڵ
int MatchDescriptor(const Mat &descriptor1, const Mat &descriptor2, vector<int> &matchingIdx) {
int numMatches = 0;
int i, j, k, r1 = descriptor1.rows, r2 = descriptor2.rows, c2 = 128;
int i1, j1, flag = 0;
float d1 = FLT_MAX, d2 = FLT_MAX, sum;
double temp =... | ALGO | 0.998431 | 5.204548 |
e1142a6e-a75f-4ee2-9c2a-b90fd17db092 | totcoindev/totcoin | src/addrman.cpp | #include "addrman.h"
#include "hash.h"
#include "serialize.h"
#include "streams.h"
int CAddrInfo::GetTriedBucket(const uint256& nKey) const
{
uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetKey()).GetHash().GetCheapHash();
uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup() << (has... | TOOL | 0.915112 | 6.661746 |
d329148a-d4df-4442-9736-5d3f6e49ccaa | Mayur-Pagote/DSA-Practice | Assignment 4/Question 12.cpp | // Reverse a given integer number
// Input: 76542
// Output: 24567
#include <iostream>
using namespace std;
int main()
{
int num, temp=0;
cout<<"Enter a number: ";
cin>>num;
cout<<endl;
while (num>0){
temp *= 10;
temp += num%10;
num /= 10;
}
cout<<temp;
}
| ALGO | 0.998745 | 4.522994 |
0ad210ec-d71a-43b7-a33a-fd1630d8ebb1 | wise-owl-dev/Introduccion_a_C-- | Ciclos/M. CalculosIterativos/CalculosIterativos.cpp | #include <iostream>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
int N = 0;
// Paso 1: Sumar todos los números impares de 1 a A
for (int i = 1; i <= A; i += 2) {
N += i;
}
// Paso 2: Restar todas las potencias de 2 de 1 a B
int power = 1;
... | ALGO | 0.999968 | 5.119479 |
215eebc0-b5bb-4ccb-bfa6-8547c8d5aa0c | ufz/ogs | ProcessLib/CoupledSolutionsForStaggeredScheme.cpp | #include "CoupledSolutionsForStaggeredScheme.h"
#include <numeric>
#include "MathLib/LinAlg/LinAlg.h"
namespace ProcessLib
{
std::vector<double> getCoupledLocalSolutions(
std::vector<GlobalVector*> const& global_solutions,
std::vector<std::vector<GlobalIndexType>> const& indices)
{
if (global_solutions.e... | ALGO | 0.999546 | 5.621868 |
5f05d588-1b34-4abf-86be-949601d366b5 | Synonymous64/Leetcode-daily-challenges | Year-2023/LeetCode-May-Challenge/MinimumNumberofVerticestoReachAllNodes.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> findSmallestSetOfVertices(int n, vector<vector<int>>& edges) {
vector<bool> visited(n, false);
for(auto edge: edges) visited[edge[1]] = true;
vector<int> res;
for(int i = 0; i < n; ++i)
if(... | ALGO | 0.999793 | 5.124294 |
3f7ecb39-904e-4e68-b1ec-d7fd1feb4d5f | jumbojett/hiphop-php-docker | src/boost_1_50_0/libs/msm/doc/PDF/examples/BoostCon09Full.cpp | #include <vector>
#include <iostream>
#include <boost/mpl/vector/vector50.hpp>
#include <boost/msm/back/state_machine.hpp>
#include <boost/msm/front/state_machine_def.hpp>
#include <boost/msm/back/tools.hpp>
namespace msm = boost::msm;
namespace mpl = boost::mpl;
namespace // Concrete FSM implementation
{
// eve... | TOOL | 0.914937 | 7.016479 |
ae7d84f8-8daa-4d41-b8d2-08955bf288fc | kanhaiyagupta9045/Data-Structures-and-Algorithm | Find Missing And Repeating - GFG/find-missing-and-repeating.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
vector<int> findTwoElement(vector<int> arr, int n) {
// code here
map<int,int> m;
vector<int> ans;
for(auto it :arr)
{
m[it]++;
}
f... | ALGO | 0.999577 | 5.441679 |
9408c505-ff47-4627-84a9-a31aa230998b | ishandutta2007/codeforces | andreasyan/normal/1526/C2.cpp | #include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define fi first
#define se second
typedef long long ll;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rnf(2106);
const int N = 200005;
int n;
int a[N]... | ALGO | 0.999966 | 4.472764 |
f88ec05a-5831-4405-913c-f3be38ae9288 | kumcun/AndBulletFluids | jni/Bullet/BulletCollision/CollisionShapes/btConvex2dShape.cpp | #include "btConvex2dShape.h"
btConvex2dShape::btConvex2dShape( btConvexShape* convexChildShape):
btConvexShape (), m_childConvexShape(convexChildShape)
{
m_shapeType = CONVEX_2D_SHAPE_PROXYTYPE;
}
btConvex2dShape::~btConvex2dShape()
{
}
btVector3 btConvex2dShape::localGetSupportingVertexWithoutMargin(const btVecto... | ALGO | 0.872443 | 7.274159 |
02c97806-2191-4a12-9b31-ed778963e97e | yukeyi/LeetCode | 526 Beautiful Arrangement/Beautiful Arrangement.cpp | class Solution {
public:
int countArrangement(int N) {
vector<int> temp;
vector<vector<int>> devisor(N, temp);
for(int i = 1;i<=N;i++)
{
for(int j = 1;i*j<=N;j++)
{
devisor[i*j-1].push_back(i);
if(j != 1)
dev... | ALGO | 0.999966 | 5.703596 |
954e9115-f986-4715-984a-1b657704e233 | bricoletc/HuffmanCompression | lib/StanfordCPPLib/dawglexicon.cpp | /*
* File: dawglexicon.cpp
* ---------------------
* A lexicon is a word list. This lexicon is backed by two separate data
* structures for storing the words in the list:
*
* 1) a DAWG (directed acyclic word graph)
* 2) a Set<string> of other words.
*
* Typically the DAWG is used for a large list read from a f... | TOOL | 0.944208 | 6.87674 |
803e302f-1257-4e09-b966-364c0cd86ee3 | Kerorohu/PAT_Code | 1046.cpp | #include<iostream>
#include<string>
#include<vector>
using namespace std;
struct Data
{
int jhan, jhua, yhan, yhua;
} mdata;
int main() {
int num;
cin >> num;
vector<Data> v;
int j = 0, y = 0;
for (int i = 0; i < num; i++) {
cin >> mdata.jhan >> mdata.jhua >> mdata.yhan >> mdata.yhua;
v.push_back(mdata);
... | ALGO | 0.999582 | 4.16887 |
24d8b4de-a521-4215-a194-7e63e23edabd | dongheuw/ICPC-related | 2016-summer/0914/d.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int T;
char s[20005];
pair<int,int> a[105];
bool r[105];
int main()
{
freopen("d.in","r",stdin);
freopen("d.out","w",stdout);
scanf("%d",&T);getchar();
for (int t = 1;t <= T;t ++)
{
gets(s+1);
int len = strlen(s+1);
for (int i ... | ALGO | 0.997406 | 3.509179 |
ab735fe8-ccfe-4964-ac8e-88edf8a88699 | Line-brack/KogakuinAdvent2020_12_10 | samplingMT.cpp | //参考
//http://sys.ci.ritsumei.ac.jp/probability/2011/10-6.pdf
//https://nishiru3.hatenablog.com/entry/2014/10/28/085130
//https://qiita.com/piyo7/items/36b19c6ea68baa2a69cd
#include<iostream>
#include<fstream>
#include<cmath>
#include"MT.h"
using namespace std;
const double pi=acos(-1);
//メルセンヌツイスタによる一様乱数生成に変更
double ... | TOOL | 0.984851 | 3.362887 |
94d1d89f-0652-44f0-82c7-f0293e82580a | himanshumaharshi/LeetCode-DSA | 713-subarray-product-less-than-k/subarray-product-less-than-k.cpp | class Solution {
public:
int numSubarrayProductLessThanK(vector<int>& nums, int k) {
int left = 0, right = 0, product = 1, count = 0;
int n = nums.size();
if(k <= 1) return 0;
while (right < n) {
product *= nums[right];
while (product >= k) {
p... | ALGO | 0.999927 | 5.651449 |
aee53e4b-3a8c-4f9f-8192-bd854b0ab10b | foorhad/Basic_Algorithm | week 4 Graph recap and Problem solving/MOD 12 Basic Graph & representations recap/matrix_to_adj_list1.cpp | #include <bits/stdc++.h>
#define ll long long int
#define nl '\n'
#define fast() ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
const long long int INF = 1e18+5;
using namespace std;
// void convert(int n, int m, int matrix[][]){
// }
int main()
{
fast();
int n;cin>>n;
int matrix[n][n];
for (int i =... | ALGO | 0.99849 | 3.726084 |
2e81699e-1ebe-4cb3-a511-590e6c8671d8 | srikumar947/effective-barnacle | LC/Google/Medium/tiny_url_encoder.cpp | /*
TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tinyurl.com/4e9iAk.
Design the encode and decode methods for the TinyURL service. There is no restriction on how your encode/decode algorithm should work. You just... | TOOL | 0.9956 | 6.255779 |
b4fbd06f-21e5-438c-8802-8a1f6cba6567 | NizamChy/Competitive-programming | newcomer-sheet-3/K3.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
long long sum =0, k, j, n;
cin >> n;
cin >>s;
for(j=0; s[j]!='\0'; j++) //'\0' refers to the null character
{
k=s[j]-'0'; //'0'character value to converted string to integer
sum = sum + k;
}
cout <<sum;
}... | ALGO | 0.999366 | 3.869785 |
1e09768a-d827-421f-adfb-1b6051ddbc77 | javagovindsharma/leetscode | solution/0200-0299/0260.Single Number III/Solution.cpp | class Solution {
public:
vector<int> singleNumber(vector<int>& nums) {
long long xs = 0;
for (int& x : nums) {
xs ^= x;
}
int lb = xs & -xs;
int a = 0;
for (int& x : nums) {
if (x & lb) {
a ^= x;
}
}
... | ALGO | 0.999973 | 5.416515 |
a693be9d-04a6-4c33-8ac4-c98db7df82f4 | vrmamukul/Placements-2020-coding- | 2.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
// #define int long long
#define rep(i,a,b) for (int i = a; i < b; ++i)
#define pii pair<int,int>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define all(c) c.begin(), c.end()
#define tr(container, it) for(typeof(container... | ALGO | 0.999913 | 3.68948 |
30682767-ef0c-460b-8a82-f6b1bdb27fe2 | Toby1009/test | project/minesweeper-main/game.cpp | /***********************************************************************
* File: game.cpp
* Author: B11115033
* Create Date: 2023/04/16
* Editor: B11115033
* Update Date: 2023/04/20
* Description: Imp the game
***********************************************************************/
#include "game.h"
#include "ui_... | TOOL | 0.854389 | 3.774647 |
2fd6e48e-a9df-4f7d-9866-643439756187 | sahroush/Competitive-Programming-Submissions | Atcoder/C++ (GCC 9.2.1)/agc001_f/24254782.cpp | #pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2")
#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
const int sq = 1000;
#define endl '\n'
#define pb push_back
#define ms(x , y) memset(x , y , sizeof x)
#define dokme(x) cout << x ... | ALGO | 0.999996 | 3.679174 |
ac0a9ca8-712a-402b-ac9c-da0e71d645fa | AnkitSinghGTHB/DSA | LeetCode/0342. Power of Four.cpp | class Solution {
public:
bool isPowerOfFour(int n) {
//can use the logic of recursion but its asking to do w/o rec & loop
//but let me use a loop cuz why not
if (n <= 0) {
return false;
}
while (n % 4 == 0) {
n /= 4;
}
return n == 1;
... | ALGO | 0.999893 | 6.237182 |
a29d33a0-a697-49ce-a623-d34cbd759646 | jbloit/sound2graphics2sound | scene_projections/src/dot.cpp | //
// dot.cpp
// scene_projections
//
// Created by Julien Bloit on 28/08/14.
//
//
#include "dot.h"
#include "ofMath.h"
void dot::setup(float _x, float _y, float _radius=100){
ofRegisterKeyEvents(this); // TODO : remove this
nucleus_x = _x;
nucleus_y = _y;
radius = _radius;
nucleus.... | TOOL | 0.975259 | 4.886265 |
902b9afb-4f4e-4fd7-b7ff-07a2765508ab | ishandutta2007/codeforces | sugim48/normal/474/B.cpp | #include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cstring>
#include <climits>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typed... | ALGO | 0.999905 | 3.703411 |
1a90e8bf-64dd-40a4-8cc2-0d85fb740496 | saransh37/codeforces_A_solution | 1080A -petya and origami.cpp | #include<iostream>
#include<math.h>
#include<bits/stdc++.h>
using namespace std;
int main(){
long long n,k;
cin>>n>>k;
long long r=2*n;
long long g=5*n;
long long b=8*n;
long long res=0;
res+=ceil(float(r)/float(k));
res+=ceil(float(g)/float(k));
res+=ceil(float(b)... | ALGO | 0.999515 | 3.113377 |
783a9601-502f-43ef-bc77-0705325cad1e | 15757170756/All-Code-I-Have-Done | LeetCode/0923. 3Sum With Multiplicity.cpp | /*
Given an integer array A, and an integer target, return the number of tuples i, j, k such that i < j < k and A[i] + A[j] + A[k] == target.
As the answer can be very large, return it modulo 10^9 + 7.
Example 1:
Input: A = [1,1,2,2,3,3,4,4,5,5], target = 8
Output: 20
Explanation:
Enumerating by the values (A[i], ... | ALGO | 0.999919 | 5.952246 |
8e6cedee-2e1d-43a5-b349-6d3ccacbde1c | hma40/Cpp-Competitive-Programming | Codeforces/1472/G.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
using ll = long long;
using pi = pair<int, int>;
void dfs(int i, bool visited2[], int function[][2], vector<vector<int>> &destinations) {
//cout << "line 9: " << i << endl;
function[i][1]=function[i][0];
visited2[i]=true;
for(in... | ALGO | 0.999928 | 4.190053 |
58893d95-f4c1-4d95-ba1a-e4a7d60b012d | deant-digital/NSSPC | cpp-2022-prelim/p10.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
getline(cin, str);
bool bl;
do {
bl = false;
for (int i = 1; i < str.length(); ++i) {
if (str[i - 1] == str[i]) {
int j = i + 1;
while (j < str.length() && str[j] == str[i... | ALGO | 0.999749 | 5.347639 |
e04967b4-e7f2-45b5-87c5-a59b14f48f93 | sri-soumya/leetcode-questions | 144-binary-tree-preorder-traversal/144-binary-tree-preorder-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999984 | 5.77392 |
76faf384-c706-4721-a917-73a18e2fc15b | yuna706/cote | yuna pro/기능개발.cpp | #include <vector>
#include <algorithm>
#include <queue>
#include <iostream>
using namespace std;
vector<int> solution(vector<int> progresses, vector<int> speeds) {
queue<int> que;
queue<int> que2;
for(auto a : progresses){
que.push(a);
}
for(auto a : speeds){
que2.push(a);
... | ALGO | 0.999805 | 4.446194 |
788282a6-e3a7-43b5-abaa-e780f913ffb0 | 4ElentanoJt-hbM-93T-FEj/c_plus_plus | c_plus_plus/function.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
/*Дано N десятков целых чисел. Определить, сколько из них могут
составлять арифметическую прогрессию. Проверку оформить в виде
функции*/
srand(time(0));
cout
<< "Введите количество десятков целых чисел = ";
int n,... | ALGO | 0.995015 | 3.707845 |
a1ab68b4-c4ae-4dcb-b2e2-645a669d8afb | AmiFahad/Assignment-5 | Number 26.cpp | #include<iostream>
using namespace std;
struct node
{
int data;
node *next;
};
void create(node *&front,int value)
{
node *A=new node;
if(front==0)
{
A->data=value;
A->next=0;
front=A;
}
}
void insert_value(node *&front,int value)
{
node *A=new node;
node *temp;
... | ALGO | 0.999994 | 4.526219 |
1bbeca1c-e442-49b0-b5ed-d4e81f7fcf4e | Goodnameisfordoggy/College-assignment | c BasicHomework/04章 选择结构/L0408判断某一年是否闰年.cpp | #include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
if ((n % 4 == 0 && n % 100 != 0 )|| n % 400 == 0)
{
printf("%d is a leap year.", n);
}
else
printf("%d is not a leap year.", n);
}
| ALGO | 0.999946 | 3.251644 |
04617aca-3582-4303-b4cc-bcfdd3788dee | SiddiqueSahb/DSASeries | DSA Series/DS/Recursion/replaceX.cpp | /*
Replace Character Recursively
Send Feedback
Given an input string S and two characters c1 and c2, you need to replace every occurrence of character c1 with character c2 in the given string.
Do this recursively.
Input Format :
Line 1 : Input String S
Line 2 : Character c1 and c2 (separated by space)
Output Format :
U... | ALGO | 0.999711 | 3.773156 |
435c20f1-2ad2-4011-a30b-d57719549d7e | joker-eph/llvm-unified | llvm/lib/DebugInfo/Symbolize/Symbolize.cpp | #include "llvm/DebugInfo/Symbolize/Symbolize.h"
#include "SymbolizableObjectFile.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Config/config.h"
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/DebugInfo/PDB/PDB.h"
#include "llvm/DebugInfo/PDB/PDBContext.h"
#include "llvm/Object/COFF.h"
#include "llvm... | TOOL | 0.862208 | 7.910442 |
be97bfef-e5a8-4c4f-942a-deafc25c8152 | joseph-aoun/LeetCode-Problems | fibonacci-number/fibonacci-number.cpp | class Solution {
public:
int fib(int n) {
int x =0, y = 1;
if(n == 0) return 0;
for(int i = 0; i <= n - 2; i++){
int temp = y;
y += x;
x = temp;
}
return y;
}
}; | ALGO | 0.999998 | 6.000864 |
5a0bec66-0b39-46ce-9dba-e6f60b4557aa | mit-biomimetics/Cheetah-Software | third-party/qpOASES/src/OQPinterface.cpp | /**
* \file src/OQPinterface.cpp
* \author Hans Joachim Ferreau
* \version 3.2
* \date 2008-2017
*
* Implementation of an interface comprising several utility functions
* for solving test problems from the Online QP Benchmark Collection
* (This collection is no longer maintained, see
* http://www.qpOASES.org/... | TOOL | 0.975407 | 5.652308 |
1242083d-746e-4f2b-82fc-17c91462fc98 | RimeOCRLIB/OCRLib | libocr/OCRAlgorithm/OCRAlgorithmFFT.cpp | #include "OCRAlgorithm.h"
namespace ocr{
// -----------------------------------------------------------------------------
// Программа выполнения прямого и обратного БПФ (быстрого преобразования Фурье, FFT)
// Maxim Ivanov http://e-maxx.ru/algo/fft_multiply //
// -------------------------------... | ALGO | 0.999666 | 3.88261 |
4c28eed0-d5b4-4d7c-97cf-5ee95361b75b | akhil-maker/DSA-Practice | Long Problems/burstBalloon.cpp | #include<iostream>
#include<vector>
using namespace std;
int mx = INT_MIN;
int maxCoins(vector<int>& nums, int k, int sum){
}
int main(){
} | ALGO | 0.998925 | 4.083714 |
3a0db568-9f81-4741-9fc8-bf2dae6f6b40 | pkuzw/LeetCode-Zhao-Wei- | Find K Pairs with Smallest Sums.cpp | >//
///@file Find K Pairs with Smallest Sums
///@author Wei Zhao
///@date 2016.09.17
///@version 1.0
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
class Solution {
private:
struct compare {
bool operator()(pair<int, int>& a, pair<int, int>& b) {
... | ALGO | 0.999952 | 5.035795 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.