uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6ceaba2a-9c26-4975-9302-415d3d00f778 | nis/Numerical-Methods--RB-NUM6-U2-1-F12- | Code/Tools/NR_C301/legacy/nr2/CPP_211/examples/xbessj0.cpp | #include <string>
#include <fstream>
#include <iostream>
#include <iomanip>
#include "nr.h"
using namespace std;
// Driver for routine bessj0
int main(void)
{
string txt;
int i,nval;
DP val,x;
ifstream fp("fncval.dat");
if (fp.fail())
NR::nrerror("Data file fncval.da... | TOOL | 0.991131 | 3.518776 |
83951b09-8d08-427e-a71d-30421fccdc9d | Sachin-og/appfiles | ques_5.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
string s, t;
cin >> s >> t;
int q;
cin >> q;
vec... | ALGO | 0.999785 | 5.497511 |
b725c3e2-428d-4f0a-87cb-fda157d3db3b | AminaIqbal6/ProblemC- | code 93.cpp | //1
//23
//456
//78910
#include<iostream>
using namespace std;
int main(){
int n =1;
for(int i=1;i<=4;i++){
for(int j=1;j<=i;j++)
{
cout<<n;
n++;
}
cout<<endl;
}
return 0;
} | ALGO | 0.99966 | 3.382041 |
f24915bd-30c9-4f91-89fa-ccb2f79b5cde | tarik1bosunia/cp_algorithms | graphs/2_single_source_sortest_path_sccp_on_tree.cpp/1.cpp | #include<bits/stdc++.h>
using namespace std;
bool vis[1000001];
int dist[1000001];
vector<int> ar[1000001];
void dfs(int s, int d){
vis[s] = true;
dist[s] = d;
for(int child : ar[s]){
if(!vis[child]) dfs(child, d + 1);
}
}
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", ... | ALGO | 0.999969 | 4.476807 |
d8daec62-e191-4969-835d-da5c4dbce6e0 | Sudhanshubhandari/MyCode | Substerecursuion.cpp | #include<bits/stdc++.h>
using namespace std;
using namespace std;
string solve(string str, string op, set<string>&st) {
if (str.length() == 0) {
st.insert(op);
return op;
}
vector<int>op1 = op;
vector<int>op2 = op;
op2.push_back(str[0]);
str.erase(str.begin() + 0);
solve(str... | ALGO | 0.999777 | 3.938585 |
d4037a8b-e53e-49ad-a29a-929a15ccb2f0 | arundhativaishnav/lp-codes | worstfit.cpp | #include <iostream>
#include <vector>
#include <limits> // For std::numeric_limits
#define MAX 25
using namespace std;
int main() {
vector<int> frag(MAX, 0), b(MAX, 0), f(MAX, 0);
vector<int> bf(MAX, 0), ff(MAX, 0);
int nb, nf;
// Input number of blocks and files
cout << "\nEnter the numbe... | ALGO | 0.999137 | 3.608355 |
10ac870d-6854-48b0-9fd5-a915ace51e75 | vfolunin/archives-solutions | MCCME/119.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int reverse(int n) {
int res = 0;
while (n) {
res = res * 10 + n % 10;
n /= 10;
}
return res;
}
int main() {
freopen("input.txt", "r", stdin);
freopen... | ALGO | 0.999579 | 4.606988 |
760a8f70-56bc-4dcf-ba4e-98713ef4c588 | uyen0902/BT-cac-tuan-sau | BT_T4/B12. Eratosthenes_ Sieve.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
bool a[n+1];
for (int i=2; i<=n; i++) a[i] = true;
for (int i=2; i<=n; i++){
if(a[i] == true){
for (int j=2*i; j<=n; j+=i){
a[j] = false;
}
}
}
for (int i=2; i<=n; i++){
if(a[i] == true){
cout << i << " ";
}
}
re... | ALGO | 0.999934 | 4.150406 |
ba5a1836-d9f3-4941-9dae-9fe8ede9022f | Ri-Nai/CompetitionCode | ACM/2023-2024-1/BITNEW/7/K.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define End(X) return cout<<X<<'\n',void()
bool Nai;
namespace T
{
const int N=1e6+5;
int n,W,C,w[N];
void solve()
{
cin>>n>>W>>C;
for(int i=1;i<=n;++i)cin>>w[i];
sort(w+1,w+n+1);
ll ans=0;
for(int... | ALGO | 0.99999 | 3.542066 |
9ceab16c-4af4-4962-b68a-fe5bbdf016b3 | DeepSpace98/qx_center | pthread/book13.cpp | // 本程序演示线程同步-自旋锁。
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
int var;
pthread_spinlock_t spin; // 声明自旋锁。
void *thmain(void *arg); // 线程主函数。
int main(int argc,char *argv[])
{
pthread_spin_init(&spin,PTHREAD_PROCESS_PRIVATE); // 初始化自旋锁。
pthread_t... | TOOL | 0.981959 | 4.554626 |
5e1551e5-40cb-4006-9139-d602112c6fec | SurbhiYadav03/DSA | DSA2/insertInsorted.cpp | #include<iostream>
using namespace std;
int main()
{
int n,i;
cout<<"Enter size:\n";
cin>>n;
int arr[n];
cout<<"Enter elements:\n";
for(int i=0;i<n;i++){
cin>>arr[i];
}
int key;
cout<<"Enter key:\n";
cin>>key;
cout<<"Elements before:\n";
for(int i=0;i<n;i++){
... | ALGO | 0.999964 | 4.085319 |
3ea61808-ff03-4ffe-b353-f7f98d5da168 | Talibb555/codeforces | A_Devu.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, d;
cin >> n >> d;
int t[n];
int sum = 0;
for (int i = 0; i < n; i++)
{
cin >> t[i];
sum += t[i];
}
sum += (n - 1) * 10;
if (sum > d)
{
cout << -1 << endl;
}
else
{
cout ... | ALGO | 0.999675 | 3.559417 |
736c0de4-1956-48f1-a0a0-57778631c71a | quadratech188/baekjoon | solutions/6661-noinclude.cpp | #include <array>
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <iostream>
#include <vector>
template<typename T, typename T2 = T>
struct Vec2 {
using type = T;
T x, y;
Vec2(T x, T y): x(x), y(y) {}
Vec2(): x(T()), y(T()) {}
Vec2 operator+(const Vec2& other) const {
return Vec2(this->x + oth... | ALGO | 0.999801 | 3.764426 |
0cd24ca9-0604-4fa3-9a1c-ae0624747dc7 | Rahwik-CPP/CPP_BASIC_TO_ADVANCE | day-06/Program_4.cpp | #include <iostream>
using namespace std;
template <typename T>
T add(T num1, T num2) {
return (num1 + num2);
}
int main() {
int result1;
double result2;
// calling with int parameters
result1 = add<int>(2, 3);
cout << "2 + 3 = " << result1 << endl;
// calling with double parameters
re... | TOOL | 0.991394 | 6.507755 |
83fc4121-1f21-4bee-ad53-91569859d325 | codeguru-cmd/nuttela | grid.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int h,w;
cin>>h>>w;
vector<int> r;
vector<int> c;
for(int i=0;i<h;i++){
int a;
cin>>a;
r.push_back(a);
}
for(int i=0;i<w;i++){
int b;
cin>>b;
c.push_back(b);
}
int ans[... | ALGO | 0.999978 | 3.676034 |
f1964aca-574a-4a31-9a46-d304b2e67ea4 | thigiacmaytinh/TGMTcpp | lib/opencv342/contrib/sfm/src/robust.cpp | #include "precomp.hpp"
// Eigen
#include <Eigen/Core>
// OpenCV
#include <opencv2/core/eigen.hpp>
#include <opencv2/sfm/robust.hpp>
#include <opencv2/sfm/numeric.hpp>
// libmv headers
#include "libmv/multiview/robust_fundamental.h"
using namespace std;
namespace cv
{
namespace sfm
{
// TODO: unify algorithms
temp... | ALGO | 0.986435 | 6.590762 |
bd3750cd-ab88-4485-b39d-4d4b2b7a3a0b | Jinu-Lee/Practice | acmicpc/1000/1546.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int N;
scanf("%d", &N);
vector<int> v(N);
for (auto i = v.begin(); i != v.end(); i++)
scanf("%d", i);
int max = v[0], sum = 0;
for (auto i = v.begin(); i != v.end(); i++)
{
if (*i > max)
m... | ALGO | 0.994589 | 3.738639 |
9fa0801f-99a9-4b56-abfb-3195c9d1385a | ishandutta2007/codeforces | natsugiri/normal/1114/E.cpp | #include<random>
#include<chrono>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c... | ALGO | 0.999186 | 3.334655 |
cf14fcec-6012-42d2-b847-07a86bdf4cdf | yoshimura19/samples | C++/kind/chap1-7/sample5-6.cpp | #include <iostream>
using namespace std;
int main()
{
int res;
char ans;
cout << "Which course do you choose ?\n";
cout << "Input an integer. \n";
cin >> res;
// if(res == 1)
// ans = 'A';
// else
// ans = 'B';
/* 上のif文と同じ処理
条件 ? trueのときの式1 : falseのときの式2 */
ans = (res == 1) ? 'A' : '... | ALGO | 0.996576 | 3.029046 |
59f88f11-d9e8-4013-a15d-9dd2727b602b | ishandutta2007/codeforces | 300iq/normal/1588/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
mt19937 rnd(228);
const int N = 3e5 + 20;
ll t[2][4 * N];
void build(int id, int v, int l, int r, vector <ll> &arr) {
if (r - l == 1) {
t[id][v] = arr[l];
} else {
int m = (l + r) / 2;
build(id, v * 2 + 1, l, m, ar... | ALGO | 0.999929 | 4.267039 |
f394389c-fe73-4acb-aabb-b200933d56f7 | Naveen-oops/Competitive-coding | SDE-sheet-striver/day-3/search-a-2d-matrix.cpp | // Plain brute force approach
// Did on the go to correct code according to the code according testcases
// Time taken to slove : 35 minutes
// Time complexity : O(6n) effectively = > O(n)
class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
int m = matrix.size();
... | ALGO | 0.999947 | 5.860115 |
0f026007-1c17-4a6e-9c7d-08f4bd2228b5 | Pratham2411/DSA-in-CPP | 5. Arrays/ARRAY 1/LinearSearch.cpp | // Find the element x in the array. Take array and x as input
#include<iostream>
using namespace std;
int main(){
int n;
cout << " Enter size of Array :";
cin>> n;
int arr[n];
// input
cout<< " Enter Elements :" ;
for(int i=0; i<=n-1;i++){
cin>>arr[i];
}
int x;
cout<< "Enter x : ";
cin>> x... | ALGO | 0.999753 | 4.211218 |
20483cd3-9d76-4720-a45c-b39d92d050b9 | josehpg98/Exercicios-URI-Online-Judge | ExerciciosURI/C++/1049.cpp | #include<iostream>
using namespace std;
main()
{
string p1,p2,p3;
cin>>p1;
cin>>p2;
cin>>p3;
if(p1 == "vertebrado")
{
if(p2 == "ave")
{
if(p3 == "carnivoro")
{
cout<<"aguia"<<endl;
}
else if(p3 == "onivoro")
... | ALGO | 0.957106 | 3.883329 |
390327d9-e4f6-417d-abce-62bb0555080c | deepakbind/codeforces | .history/team_20230326225352.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,a,b,c,s=0;
cin>>n;
cin>>a;
cin>>b;
cin>>c;
cin>>s;
if((a==1 && b==1)||(b==1 && c==1)||(c==1 && a==1))
s++;
cout<<s<<endl;
return 0;
} | ALGO | 0.999002 | 3.126179 |
4f584cb1-5878-488c-8116-0e8741422354 | NadulaG/FabTrack | 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.998859 | 6.785645 |
0b8360bf-f30a-426a-8c33-ed4c365f1793 | Dftlg/LargeScaleForest-old | libraries/listIO/listIO.cpp | #include "listIO.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
using namespace std;
// removes all whitespace characters from string s
void ListIO::stripBlanks(char * s)... | TOOL | 0.924804 | 3.94064 |
92309edf-06b0-4d26-8d4b-126feed76399 | jiatanghao/mooc_c_advance | 第一次作业/寻找下标.cpp | #include <cstdio>
const int N = 100;
int main() {
int a[N] = {0};
int n;
scanf("%d", &n);
for (auto i = 0; i < n; i++) {
scanf("%d", a + i);
}
for (auto i = 0; i < n; i++) {
if (a[i] == i) {
printf("%d\n", i);
return 0;
}
}
printf("N");
return 0;
} | ALGO | 0.998551 | 3.430096 |
dc568282-1180-487a-a445-7a186bce9daf | Christinezy/MLOpsSuite | codeporting/TransCoder/data/evaluation/geeks_for_geeks_successful_test_scripts/cpp/LONGEST_COMMON_SUBSTRING_SPACE_OPTIMIZED_DP_SOLUTION.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
int f_gold ( string X, string Y ) {
int m = X . length ( );
int n = Y . length ( );
int result = 0;
int len [ 2 ] [ n ];
int currRow = 0;
for ( int i... | ALGO | 0.999682 | 5.687297 |
46808b30-c41f-4eeb-a018-ddc6c1a56046 | NearlyTRex/Boost | libs/msm/doc/PDF/examples/iPodSearchEuml.cpp | // same as iPodSearch.cpp but using eUML
// requires boost >= v1.40 because using mpl::string
#include <vector>
#include <iostream>
#include <boost/msm/back/state_machine.hpp>
#include <boost/msm/front/euml/euml.hpp>
#include <boost/msm/front/euml/stl.hpp>
using namespace std;
using namespace boost::msm::front::euml... | ALGO | 0.99014 | 5.675474 |
5e93159f-2158-4a58-8758-2a9b17b7245d | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6504_3.cpp | #include <bits/stdc++.h>
using namespace std;
long long n, m, ans, k, a[500000];
int f(int x) {
int t = 2;
for (int i = 1; i <= n; i++) t *= 2;
return t - 2;
}
int f1(int x) {
int t = 1;
for (int i = 1; i <= x; i++) t *= 2;
return t;
}
int main() {
cin >> n;
for (int i = 1; i <= f(n); i++) {
cin >> ... | ALGO | 0.999093 | 3.827599 |
96f0d0ec-26cf-4a70-a35f-5a04eca6ad64 | mwyngaarden/Cadie | src/uci.cpp | #include <filesystem>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <mutex>
#include <sstream>
#include <string>
#include <thread>
#include <vector>
#include <cinttypes>
#include <cmath>
#include <cstdarg>
#include "search.h"
#include "string.h"
#include "timer.h"
#include "tt.h"
#include "uci.h"
#... | TOOL | 0.925057 | 5.678508 |
16c5303a-c0f7-4a77-994f-47889701bf5a | naveenbish/DSA | Week_3_Array/2D-Array/TransPoseMatrix.cpp | #include<iostream>
using namespace std;
void printArr(int arr[][4],int row,int col){
// Printing Array
for (int i = 0; i < row; i++) {
for(int j=0; j < row; j++){
cout << arr[i][j] << " ";
}cout << endl;
}
}
void transposeMatrix(int arr[][4], int row, int col){
for(int i=0;... | ALGO | 0.999832 | 5.108958 |
3f4bc1a5-5fc5-4346-bef8-f9457bb2ac2b | Vartika2207/CodeChef | C++/Starters 115/Make All Zero.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#define int long long int
using namespace std;
int32_t main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<int... | ALGO | 0.999915 | 4.832453 |
6b215087-209b-46f2-b636-efdbbf9f0200 | shion24hub/compp | tessoku/f/qa/a17.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = n-1; i >= 0; i--)
//print 2d vector<int>
void p2dveci(vector<vector<int>> vv) {
for (int i = 0; i < vv.size(); i++) {
for (int j = 0; j < vv[i].size(); j++) {
cout << vv... | ALGO | 0.999992 | 3.335941 |
1d480abf-1dac-4837-ba9c-256a8e7b6190 | masterAtGithub143AtN/CrackYourPlacement | 206.cpp | #include<bits/stdc++.h>
using namespace std;
// * Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution {
public:
... | ALGO | 0.999971 | 5.393977 |
148f767a-6665-428b-b8ec-0a9868eeb2c8 | gigel773/asm-labs | asm_lab_2.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <count.h>
constexpr char test_file_path[] = R"(../data/bib)";
constexpr uint32_t file_size = 111261;
constexpr auto symbol = 'o';
int main()
{
// Open test file
std::ifstream file(test_file_path, std::ifstream::... | ALGO | 0.879537 | 6.648043 |
32755fcd-08c2-4769-815c-a02c5e2be5e2 | Noplace/iOSFisherMan | FisherMan/libs/Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.cpp | #include <Box2D/Dynamics/Contacts/b2EdgeAndPolygonContact.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <new>
using namespace std;
b2Contact* b2EdgeAndPolygonContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)
{
void* mem... | ALGO | 0.984467 | 6.861051 |
ae9b4003-0eb2-4fde-b5bb-fe98b3b69d94 | jamesg0716/Comp2710 | project4/project4_Glass_jpg0044.cpp | /*
* Name: James Glass
* AU Email: <EMAIL>
* Filename: project4_Glass_jpg0044.cpp
* Compiler: g++ project4_Glass_jpg0044.cpp -o project4.out
* Run: ./project4.out
* Sources:
* 1. Used Visual Studio Code as text editor.
* 2. Used Project4_hint.pdf for the basic formatting and hints for the project.
* 3. Used https://w... | TEST | 0.975519 | 5.342838 |
91fd3eb3-af23-4e8d-a965-6dfc416da069 | Darkknight1299/C-plus-plus | Set/Multiset.cpp | #include<bits/stdc++.h>
#include<set>
using namespace std;
typedef multiset<int>::iterator It;
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
// code starts
int arr[]={10,20,30,30,30,10,10,20,30};
int n=sizeof(arr)/sizeof(int);
mult... | ALGO | 0.99607 | 3.635785 |
98d6b29f-1f4d-47ce-9575-b560d55204c8 | Tanmoym047/CSE-1202 | Lab4/linear.cpp | #include <iostream>
using namespace std;
int main()
{
int n, item;
cin >> n;
int array[n];
for (int i = 0; i < n; i++)
{
cin>> array[i];
}
cout <<"Item to be searched: ";
cin >> item;
int loc = 0, check = 0;
for (int i = 0; i < n; i++)
{
if (item == array[i])... | ALGO | 0.999382 | 4.720597 |
7a32ced2-8686-4809-809e-e1af6eb7c9c3 | Ted2016/TedLeetcodeAnswers | 52. N-Queens II(c)/52. N-Queens II.cpp | #define INITIAL -99
int isValid(int* position ,int row, int column);
int totalNQueens(int n) {
int row = 0, column = 0;
int position[n];
for(int i = 0; i < n; i++) {
position[i] = INITIAL;
}
int ret = 0;
while (row < n) {
while(column < n) {
if(isValid(position,... | ALGO | 0.999989 | 5.710038 |
276af047-cf68-40a4-adff-335f2fb80587 | NitinDarker/LeetCode-is-Hard | Backtracking/ConstructLexicographicallyLargestSeq.cpp | // https://leetcode.com/problems/construct-the-lexicographically-largest-valid-sequence/description/?envType=daily-question&envId=2025-02-16
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
class Solution {
bool backtrack(int ind, vector<int> &arr, unordered_set<int> &mpp, int n) {
int siz... | ALGO | 0.999973 | 5.079621 |
773028ab-3acb-4351-a219-391e6043d7a2 | ishandutta2007/codeforces | lanpang/normal/1106/D.cpp | #include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
const int maxn = 1e6+10;
const int inf = 0x... | ALGO | 0.999987 | 3.35152 |
89f88d67-c309-42c0-8667-eeb2cdbda05d | Aty-0/S2DE | Libs/boost_1_76_0/libs/graph_parallel/test/distributed_rmat_cc.cpp | // Authors: Brian Barrett
// Nick Edmonds
// Andrew Lumsdaine
#include <boost/graph/use_mpi.hpp>
#include <boost/config.hpp>
#include <boost/throw_exception.hpp>
#include <boost/graph/distributed/adjacency_list.hpp>
#include <boost/property_map/parallel/distributed_property_map.hpp>
#include <boos... | ALGO | 0.897636 | 6.303998 |
128b6324-1973-489c-a1fc-020c471974d3 | matcher9131/AtCoder-Repo | abc303/b/main.cpp | #include <bits/stdc++.h>
#include <atcoder/modint>
using namespace std;
using ll = long long;
using mint = atcoder::modint998244353;
constexpr ll INF = 1e16;
int main() {
ll n, m;
cin >> n >> m;
vector<vector<ll>> a(m, vector<ll>(n));
for (ll i = 0; i < m; ++i) {
for (ll j = 0; j < n; ++j) {
... | ALGO | 0.999948 | 4.39237 |
f94f7c25-d00a-4835-8059-f3b98a2e56e4 | wangdz99/Sensor-Fusion-SLAM | projects/08-filtering-advanced/src/lidar_localization/src/models/registration/ndt_registration.cpp | /*
* @Description: NDT 匹配模块
* @Author: Ren Qian
* @Date: 2020-02-08 21:46:45
*/
#include "lidar_localization/models/registration/ndt_registration.hpp"
#include "glog/logging.h"
namespace lidar_localization {
NDTRegistration::NDTRegistration(const YAML::Node& node)
:ndt_ptr_(new pcl::NormalDistributionsTransf... | ALGO | 0.970427 | 6.063084 |
7110cb93-0b74-4e0d-9512-56a19107a07c | WitoldKaczor/cpp_repo | ScientificComputing/Chapter08_Templates/Chapter08_Templates/exercise02.cpp | #include <iostream>
template<typename T> T AbsoluteValue(T x)
{
return (x >= (T)0) ? x : -x;
}
int main(int argc, char* argv[])
{
double x = 1.5, y = -4.6;
int z = 3, w = -7;
std::cout << AbsoluteValue<double>(x) << '\n';
std::cout << AbsoluteValue<double>(y) << '\n';
std::cout << AbsoluteValue<int>(z) << '\n'... | ALGO | 0.99365 | 5.349953 |
7242cb20-04f0-4c98-872f-3fe9f057f413 | amitgupta7061/Dsa_Revision | 15.Graph/part_4/flightwithkstop.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
using pairr = pair<int, pair<int, int>>;
int findCheapestPrice(int n, vector<vector<int>>& flights, int src, int dst, int k) {
vector<pair<int, int>> adj[n];
for(auto it : flights){
adj[it[0]].push_back({it[1], ... | ALGO | 0.999874 | 5.042095 |
98166c17-2bcf-4420-ab57-425ff7192384 | boyadme/test | VOTR-master/CppMT/Fusion.cpp | #include "Fusion.h"
namespace cmt {
void Fusion::preferFirst(const vector<Point2f> & points_first, const vector<int> & classes_first,
const vector<Point2f> & points_second, const vector<int> & classes_second,
vector<Point2f> & points_fused, vector<int> & classes_fused)
{
FILE_LOG(logDEBUG) << "Fusion::pre... | ALGO | 0.923634 | 5.079395 |
5dda4ab1-89a4-4417-a2e5-da6da3d566b8 | baixun2307/asd | solution/0500-0599/0518.Coin Change II/Solution2.cpp | class Solution {
public:
int change(int amount, vector<int>& coins) {
int n = amount;
unsigned f[n + 1];
memset(f, 0, sizeof(f));
f[0] = 1;
for (int x : coins) {
for (int j = x; j <= n; ++j) {
f[j] += f[j - x];
}
}
retur... | ALGO | 0.999919 | 5.975054 |
a30ab350-1972-414d-b4c6-acccaae30379 | Suisuikitai/algo | full-search/double_loop/5.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
int N;
cin >> N;
string S[N];
int ans = 0;
for (int i = 0; i < N; i++)
{
cin >> S[i];
bool flg = true;
for (int j = 0; j < S[i].length() / 2; j++)
if (S[i][j] != S[i][S[i].length() - 1 - j])
{
flg = false;
... | ALGO | 0.999835 | 4.30003 |
61eefdc8-b27c-4b1d-95a2-9f5a27936fff | Pradeep772/OWL_CODING | Easy/Reach a given score/reach-a-given-score.cpp | //{ Driver Code Starts
// Driver Code
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
// } Driver Code Ends
class Solution
{
public:
// Complete this function
long long int solve(int coins[],int N,int sum, vector<vector<long long int> >&dp){
if(sum < 0 || N <= 0 ){
... | ALGO | 0.999977 | 5.920553 |
6889effb-7e03-4da6-9291-33f85d843a2f | harkhuang/DesignPatterns | cpp/3-visitor.cpp | #include <iostream>
using namespace std;
//ģʽ: Ʒ й˿ͺԱз ҹ˿ͺԱʶDzͬ Ʒϵ˿Ա
class ConcreteElementA;//ƷƷ
class ConcreteElementB;
class Element; //ΪеƷ
//VisitConcreteElementA Ϊ˿ͶƷElementķ
//VisitConcreteElementB ΪԱƷElementķ
class Visitor
{
public:
virtual ~Visitor();
virtual void VisitConcreteElementA(Elemen... | ALGO | 0.879917 | 4.93222 |
185cd479-d088-4c32-8a86-da4bf24dc56d | strivedi4u/hacktoberfest2024 | Dijkastra Algorithm.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> dijkstra(int V, vector<vector<int>> adj[], int S) {
vector<vector<int>> graph(V, vector<int>(V, 0));
for (int i = 0; i < V; i++) {
for (auto &vec : adj[i]) {
int v = vec[0];
int w = vec[1];
graph[i][v] = w;
... | ALGO | 0.999959 | 4.016585 |
4defa58c-e50e-47a1-9ce7-166647175200 | sarvex/leetcode-holy-c | solution/2000-2099/2089.Find Target Indices After Sorting Array/Solution.cpp | class Solution {
public:
vector<int> targetIndices(vector<int>& nums, int target) {
sort(nums.begin(), nums.end());
vector<int> ans;
for (int i = 0; i < nums.size(); ++i) {
if (nums[i] == target) {
ans.push_back(i);
}
}
return ans;
... | ALGO | 0.999963 | 6.561939 |
be5da077-5679-42b3-b0dc-2bf41e7afa8f | raghuvanshraj/Competitive-Programming-Archive | InterviewBit/gen_parantheses_2.cpp | #include <bits/stdc++.h>
using namespace std;
void _generateParenthesis(vector<string> &result, int opening, int closing, int n, string currString) {
if (n < 0) {
return;
}
if (n == 0) {
if (opening == closing) {
result.push_back(currString);
}
return;
}
_generateParenthesis(result, opening+1, closi... | ALGO | 0.999888 | 5.449763 |
96b587cb-c254-4496-b617-68ff6c9ed974 | nadimnesar/Online-Judges-Accepted-Solutions | CodeForces/13A/31119878_AC_62ms_16kB.cpp | #include <bits/stdc++.h>
using namespace std;
#define llu long long unsigned int
#define ll long long int
#define pb push_back
#define mp make_pair
#define pop pop_back
#define bug cout<<"bug!!!"<<endl
#define debug(x) cout<<#x<<... | ALGO | 0.999721 | 4.579653 |
cbcd5537-ea4a-43f6-a1d5-5fbe90833b02 | RafaelWei/CP | CF/Pilot/2pt/Step2/F.cpp | #include<bits/stdc++.h>
using namespace std;
struct minmaxStack {
vector<long long> s, smin{LLONG_MAX}, smax{LLONG_MIN};
bool empty() {
return s.size() == 0;
}
void push(long long x)
{
s.push_back(x);
smin.push_back(::min(x,smin.back()));
smax.push_back(::ma... | ALGO | 0.999982 | 4.35184 |
05457a91-7a09-45fb-9965-7f463cbf68f0 | delwar03/CF | A_Tile_Painting.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T> using o_set = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define endl '\n'
#define F first
#define S secon... | ALGO | 0.999985 | 5.34846 |
8e9eed9b-381c-4e52-bb0b-72ade0779a40 | en30/online-judge | atcoder/abc029_b.cpp | #include <bits/stdc++.h>
#include "../include/template"
int main() {
string S;
int ans = 0;
rep(i, 12) {
cin >> S;
ans += (count(all(S), 'r') != 0);
}
cout << ans << endl;
return 0;
}
| ALGO | 0.979919 | 3.047724 |
1ec18295-e2e6-4bef-9625-700a546ec644 | nitish7134/Algorithmic-Toolbox | AlgorithmicToolbox/Week5/LongestCommonSubsequenceofThreeSequences.cpp | #include <bits/stdc++.h>
#define IOS \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL); \
cerr.tie(NULL)
#define ll long long
#define test \
int t; \
cin >> t; \
while (t--)
#define fo(i, n) for (ll i = 0;... | ALGO | 0.999975 | 4.366251 |
cd54de2e-3b72-4b80-b1ad-2b943454ba49 | team-cloud-alpha/CollegeStuff | Trimester-VI/DS-II/BST.cpp | #include<iostream>
#include <queue>
using namespace std;
class Node {
private:
Node* left;
Node* right;
string key;
string meaning;
public:
Node(string k, string m) : key(k), meaning(m), left(NULL), right(NULL) {}
friend class BinaryTree;
string getKey() const {return key;}
string getM... | ALGO | 0.999756 | 4.978571 |
e702cd9d-1bee-4aad-be3f-07f43a1f6f72 | dominikjalowiecki/Programming-Projects | c++/modular_arithmetic/zadanie_4.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
unsigned int getNWD(int a, int b)
{
if(b == 0) return abs(a);
return getNWD(b, a % b);
}
unsigned int getNWW(int a, int b)
{
unsigned int nwd = getNWD(a, b);
return abs(a * b) / nwd;
}
int main()
{
cout << getNWW(6, 14) << endl; // "4... | ALGO | 0.999735 | 4.744953 |
d64227b0-9166-40ec-a0b3-167e93f6ba79 | izenecloud/sf1r-lite | source/core/common/QueryNormalizer.cpp | #include "QueryNormalizer.h"
#include <util/ustring/UString.h>
#include <cctype> // isspace, tolower
#include <algorithm> // sort
using namespace sf1r;
using izenelib::util::UString;
namespace
{
enum CharType
{
DefultChar = 0,
AlphaChar,
ChineseChar,
SpaceChar
};
struct AppleType
{
UString major... | TOOL | 0.860681 | 4.120388 |
77909387-b1db-4295-a676-bf5ecbdcf433 | tum-db/udo-runtime | src/udo/i18n.cpp | #include "udo/i18n.hpp"
#include <cstdio>
#include <limits>
#include <vector>
//---------------------------------------------------------------------------
// UDO runtime
// (c) 2016 Thomas Neumann
//---------------------------------------------------------------------------
using namespace std;
//---------------------... | TOOL | 0.8827 | 6.952385 |
14173b8a-d176-434a-9919-e5403029e770 | KTVo/Old_Sorts-Scheduling | Singly_Linked_List_Pract_1/SLinked_main.cpp | #include <iostream>
#include <cstdlib>
#include "SLinked.h"
using namespace std;
int main(int argc, char** argv) {
SLinked x;
x.insert(3);
x.insert(44);
x.insert(555);
x.insert(6);
x.insert(777777);
x.deleteNode(2);
x.display();
return 0;
}
| ALGO | 0.872751 | 3.820839 |
c01afcd8-e6de-49d8-a231-8e8e132dadd6 | Manikandan-Rangarajan/CodeTantra-CPP | Day 2/hard/hard1.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int arr[] = {5,4,3,2,1};
int len = sizeof(arr)/sizeof(arr[0]);
for(int i=0;i<len-1;i++){
for(int j=i+1;j<len;j++){
if(arr[i]>arr[j]){
int temp = arr[j];
arr[j] = arr[i];
arr[i] = tem... | ALGO | 0.999968 | 3.886601 |
1a66b982-9533-4599-a2c3-29ccfeea4b35 | 0qinghao/VTM12.3_LIP | source/Lib/CommonLib/MatrixIntraPrediction.cpp | /** \file MatrixIntraPrediction.cpp
\brief matrix-based intra prediction class
*/
#include "MatrixIntraPrediction.h"
#include "dtrace_next.h"
#include "UnitTools.h"
#include "MipData.h"
MatrixIntraPrediction::MatrixIntraPrediction():
m_component(MAX_NUM_COMPONENT),
m_reducedBoundary (MIP_MAX_INPU... | ALGO | 0.999161 | 6.647057 |
f0b14a6d-b6dd-4865-a9ad-a629b44fba29 | RaghuvirSingh23/Codeforces-Solutions | codeforces/266-A-Stones on the Table.cpp | #include <bits/stdc++.h>
#include <string>
using namespace std;
int main() {
int k; cin >> k;
string s; cin >> s;
int skip = 0;
int count = 0;
for(int i = 0; i < s.length(); i++){
if(skip == 0){
for(int j = i+1;; j++){
if(s[j]==s[i]){
count++;
skip++;
... | ALGO | 0.999934 | 4.028414 |
482ff2cd-8097-442d-8702-bc4e6d7eb4f3 | SuperScary/Ender-5-BL-CLTouch | Marlin/src/gcode/bedlevel/mbl/G29.cpp | /**
* G29.cpp - Mesh Bed Leveling
*/
#include "../../../inc/MarlinConfig.h"
#if ENABLED(MESH_BED_LEVELING)
#include "../../../feature/bedlevel/bedlevel.h"
#include "../../gcode.h"
#include "../../queue.h"
#include "../../../libs/buzzer.h"
#include "../../../lcd/marlinui.h"
#include "../../../module/motion.h"
#in... | TOOL | 0.931231 | 7.837335 |
08174daa-93aa-431c-b06d-1498bb0d391b | zhouyium/myoj | 4409/4409.cpp | //4409: 盒子包裹问题
//http://<IP_ADDRESS>/problem.php?id=4409
#include <bits/stdc++.h>
using namespace std;
using LL=long long;
void solve() {
int n;
cin >> n;
vector<int> numbers;
for(int i = 0; i < n; i++) {
int temp;
cin >> temp;
numbers.push_back(temp);
}
unordered_map<int,int> counter;
for(int i = 0; i... | ALGO | 0.999812 | 4.060277 |
9f894e87-8633-4bf5-8c50-36f69d32f0ea | IntelSTORMteam/Projects | kcfi/llvm-kcfi/tools/clang/tools/clang-check/ClangCheck.cpp | #include "clang/AST/ASTConsumer.h"
#include "clang/Driver/Options.h"
#include "clang/Frontend/ASTConsumers.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Rewrite/Frontend/FixItRewriter.h"
#include "clang/Rewrite/Frontend/FrontendActions.h"
#include "clang/StaticAnalyzer/Frontend/FrontendActions.h"
#inc... | TOOL | 0.947196 | 7.614973 |
4ce23e2b-01f2-4d37-96ff-e30c470631f5 | Doveqise/Cloud | Codes/C++/4107.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6 + 5;
int n, m, ans, cnt = 0;
int c[maxn], son[maxn], t[maxn], l[maxn], r[maxn];
bool cmp(int a, int b)
{
return son[a] + c[a] < son[b] + c[b];
}
void dfs(int x)
{
if (!son[x])
return;
for (int i = l[x]; i <= r[x]; i++)
dfs(t[... | ALGO | 0.999855 | 3.700722 |
859a8ae0-be09-48a7-bf1c-c45fa9c1b325 | sandeshkhadase/Leetcode-Solutions | Leetcode Solutions/solution/3000-3099/3098.Find the Sum of Subsequence Powers/Solution.cpp | class Solution {
public:
int sumOfPowers(vector<int>& nums, int k) {
unordered_map<long long, int> f;
const int mod = 1e9 + 7;
int n = nums.size();
sort(nums.begin(), nums.end());
auto dfs = [&](auto&& dfs, int i, int j, int k, int mi) -> int {
if (i >= n) {
... | ALGO | 0.999981 | 5.913485 |
a630756c-5dbc-4fc4-8b23-5e08d67a89ee | dboglobal/DBOGLOBAL | DboClient/Tool/NtlPathEngine/FullSource/code/libs/PathEngine_Core/ShapeCorners.cpp | #include "platform_common/Header.h"
#include "ShapeCorners.h"
#include "interface/LocalisedConvexShape.h"
#include "interface/QueryContext.h"
#include "interface/CornerProvider.h"
#include "libs/Mesh2D/interface/tMesh.h"
#include "libs/Mesh2D/interface/MeshTraversal.h"
#include "libs/Mesh_Common/interface/MeshTraversal... | ALGO | 0.964592 | 7.40309 |
0d331c94-96fd-4566-b5f4-da69021906ea | graceemlin/codeforces | 2033/2033c.cpp | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
ios::sync_with_stdio(0);
cin.tie(0);
long long t;
cin >> t;
while (t--) {
long long n;
cin >> n;
vector<long long> elements(n);
for (long long i = 0; i < n; ++i) {
cin >> elements[i];
}
bool eve... | ALGO | 0.999863 | 4.326108 |
009903f4-e30b-446d-a639-c8f382670d93 | IHPC-G6/Ant-Colony-Optimization | Parallel/02/ACO/Ant.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <ctime>
#include "ACOGraph.h"
#include "ACO.h"
#include "Ant.h"
ACO* colony;
ACOGraph* graph;
std::vector<int> allowed_nodes;
std::vector<double> eta;
int current_node;
std::vector<double> pheromone_delta_matrix;
double solution_cos... | ALGO | 0.99999 | 4.274793 |
1f4cf47e-9935-4f15-a8e1-6a8b4dce5978 | flageagle777/soal3 | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
fad88651-4e80-457a-9b6d-958b6d6823ba | velazqua/competitive-programming | online-judges/Project-Euler/PE105/PE105.cpp | /* Name: Alex Velazquez
* Start Date: September 03, 2011 @ 09;42AM
* End Date: ???
* Purpose: To solve the Project Euler problem #105
* Link: http://projecteuler.net/index.php?section=problems&id=105
* */
#include <iostream>
#include <set>
#include <vector>
#include <cmath>
#include <fstream>
#include <sstream>... | ALGO | 0.999805 | 4.659496 |
af034b47-52b2-4314-9a8b-57059f9b2aa3 | pyetras/algorytmy-matura | calkowanie_numeryczne.cpp | // to chyba chodzi o pole pod wykresem
double f(double x){ // jakas tam funkcja
return x*x - 3*x + 2;
}
int main (int argc, char * const argv[]) {
double a = -5, b = 5, e = 0.01; // zakres i przyblizenie
double i, s=0;
// metoda prostokatow
for(i=a; i<b; i+=e) s += e * f(i + (e/2)) ;
cout << "prostokaty: " << ... | ALGO | 0.999907 | 4.898139 |
86d7272f-4563-4a61-98d8-e117c050ddc4 | digital-nomad-cheng/study | cpp/udacity_cpp/02_foundations/03_a_star_search/A_star_add_nodes_to_open_vector.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
enum class State {kEmpty, kObstacle, kClosed};
vector<State> parseLine(string line)
{
istringstream sline(line);
int n;
char c;
vector<State> row;
State curstate;
... | ALGO | 0.999783 | 5.029855 |
2691d865-b418-4616-87ea-dea45a066138 | developermanash/DSA-SHEET | sorting/Bubble sort different approach.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int arr[1000];
int n; cin>>n;
for(int i=0;i<n;i++){
cin>>arr[i];
}
for(int i=n-2;i>=0;i--){
bool swapped=0;
for(int j=0;j<=i;j++){
if(arr[j]>arr[j+1]){
swapped =1;
swap(arr[j],arr[j+1]);
... | ALGO | 0.999994 | 4.011184 |
baa2c660-2aa4-4449-b3c3-da8d92009d2a | JoelSoliz/team-book | cpp/graph/DFS.cpp |
vector<bool> vis(tam);
void dfs(int node){
vis[node] = 1;
for(int x : g[node])
if(!vis[x])
dfs(x);
} | ALGO | 0.999458 | 3.721195 |
10115274-2bff-4706-870f-67202b7ebc12 | bothemrun/CAP-Complete-Algorithmic-Programming | Leetcode_All_Solved/1478.cpp | //m0
//recursion with memo. partition dp.
// [why median?]
//for a partition(houses that share 1 mailbox),
//prove the best place for the mail box is the median of the houses of the partition.
// [proof by induction]:
// [Base Case]:
//(1) for 2 house partition, the best place is anywhere between them, since the su... | ALGO | 0.999986 | 5.734073 |
cd14d5f2-5919-4e23-a452-57de59f41463 | happylun/StyleTransfer | src/StyleSynthesis/Segment/SegmentGroupApxCvx.cpp | #include "SegmentGroupApxCvx.h"
#include <fstream>
#include "Mesh/MeshUtil.h"
#include "Segment/SegmentMeshApxCvx.h"
#include "Segment/SegmentMeshPriFit.h"
#include "Segment/SegmentUtil.h"
#include "Utility/PlyExporter.h"
#include "Data/StyleSynthesisConfig.h"
using namespace StyleSynthesis;
#define OUTPUT_PROGR... | ALGO | 0.990562 | 4.849813 |
92ade1f6-74f3-4937-8849-29cc60d7d5fc | 18629469616/18629469616 | 第5章:排序与查找/8、演示代码(四)/4、HZOJ-242-最大平均值.cpp |
/*************************************************************************
> File Name: 242.cpp
> Author: hug
> Mail: <EMAIL>
> Created Time: 四 5/23 20:21:52 2019
************************************************************************/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#includ... | ALGO | 0.999985 | 3.582296 |
2da206a1-c3e4-4f76-bafe-ebc5f1b8551b | moomoo-95/programmers | Stack&Queue/stock price.cpp | // /ť ֽİ Level 2
// 0 ʴ ȸϿ ū Ÿ answer
#include <string>
#include <vector>
#include <iostream>
using namespace std;
void main() {
vector<int> prices = {1, 2, 3, 2, 3};
vector<int> answer;
bool check;
for (int i = 0; i < prices.size() - 1; i++) {
check = true;
for (int j = i + 1; j < prices.size(); j++) {
... | ALGO | 0.99992 | 4.086427 |
a2589600-be54-4f9b-8050-01b5807761ed | vinhdq842/Cpp-CP | 2019/DACO.cpp | //
// Created by admin on 20/10/2019.
//
#include <iostream>
#include <memory.h>
using namespace std;
#define ll long long
int main() {
ll n;
cin >> n;
ll arr[n], result[n];
fill(result, result + n, 1);
for (ll i = 0; i < n; i++) {
cin >> arr[i];
}
ll rs = 0;
ll rsIndex = 0;... | ALGO | 0.999999 | 4.140312 |
9261324c-1471-46d9-8521-6d069e945397 | JaideepReddyP/competitive_coding | atcoder/beginner 326/f2.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
vector<int> a;
string ans = "";
int n, x, y;
void solve() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> n >> x >> y;
a.assign(n, 0ll);
for(int i = 0; i < n; i++) cin >> a[i];
vector<int> v, h;
for(int i = 0; i < n... | ALGO | 0.999947 | 4.196309 |
6f34cdfc-d6e8-4870-bd11-e9587ba51cc5 | Jorgeromeu/pbrt-v3-light-portals | src/shapes/nurbs.cpp | // shapes/nurbs.cpp*
#include "shapes/nurbs.h"
#include "shapes/triangle.h"
#include "paramset.h"
#include "texture.h"
namespace pbrt {
// NURBS Evaluation Functions
static int KnotOffset(const Float *knot, int order, int np, Float t) {
int firstKnot = order - 1;
int knotOffset = firstKnot;
while (t > kn... | ALGO | 0.998274 | 5.520708 |
c8f088e7-56d2-4fb9-a56a-54922e6ec677 | sebas2503/Competitiva | 7.cpp | #include <bits/stdc++.h>
using namespace std;
// ejercicio 7
int main(){
char arr[10] = {'A','B','C','D','E','F','G','H','I','J'};
do{
for (int i = 0; i < 10; ++i) cout << arr[i];
cout << endl;
} while(next_permutation(arr, arr+10));
return 0;
}
| ALGO | 0.999637 | 3.284055 |
2371d099-d4a1-457c-8454-7a4e567c6459 | andrey18083/C-Python | C++/algos3/Потоки/82.cpp | #include <iostream>
#include <vector>
#include <cstring>
#include <queue>
#include <algorithm>
struct Edge {
int a, b, c, f;
bool del = false;
Edge(int a, int b, int c, int f) : a(a), b(b), c(c), f(f) {}
};
const int INF = 1e9;
int n, m, s, t;
std::vector<Edge> e;
std::vector<std::vector<int>> g;
std::vec... | ALGO | 0.999991 | 4.416875 |
1bab5c63-4d3e-4098-ba62-2c0eb6be9fc2 | Vkrisztian01/Competitive-Programming-Portfolio | Dynamic Programming/Coin Combinations I.cpp | // Problem Name: Coin Combinations I
// Link to the Problem: https://cses.fi/problemset/task/1635
// Link to the Solution: https://cses.fi/paste/f3207fec4bc7de1e6ff28f/
#include <iostream>
#include<vector>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
vector<int>nums(n);
for(int i=0;i<n;i++... | ALGO | 0.999987 | 4.663634 |
af337deb-787c-4bef-9213-efd52bc81950 | pyou20/- | 3.3.继承方式/源.cpp | #include<iostream>
using namespace std;
class Base1 {
int a, b, c;
public:
void initBase1(int a, int b, int c) {
this->a = a;
this->b = b;
this->c = c;
}
int getA()const {
return a;
}
int getB()const {
return b;
}
protected:
int getC()const {
return c;
}
};
class Base2 {
int x, y, z;
public:
vo... | ALGO | 0.962867 | 3.223153 |
7aeab4c7-39fb-4aff-aedf-c3144031eab9 | AHMAD7Y/ProblemSolving | TopCoder Problems - Div 1 Hard/013_SRM_404_Div1_Hard_SoftwareCompanies.cpp | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
class SoftwareCompanies
{
public:
vector<string> produceData(vector<string> name,vector<string> process,vector<int> cost,vector<int> amount,string comp1,string comp2)
{
prepare(name,process,cost,amount,comp1,comp2);
com... | ALGO | 0.999879 | 3.558027 |
93887d8f-4ed4-4c55-aaff-d342fd894394 | Lucas1Rodrigues/CursoAlgoritmos | desafios/campeonato.cpp | #include<iostream>
using namespace :: std;
int main(){
int Cv,Ce,Cs,Fv,Fe,Fs,Pc,Pf;
cin >> Cv >> Ce >> Cs >> Fv >> Fe >> Fs;
Pc=(3*Cv)+Ce;
Pf=(3*Fv)+Fe;
if(Pc==Pf){
if(Cs==Fs){
cout << "=";
}else{
if(Cs>Fs){
cout << "C";
}else{
... | ALGO | 0.999943 | 3.643275 |
e39e58ee-9611-46a5-a3a5-a0fbd03e8aaf | Aditya27T/lat-pemdas-pengkondisian | tugas_rumah/tugas2.cpp | #include <iostream>
using namespace std;
int main() {
int pilihan;
float r, sisi, panjang, lebar, tinggi;
cout << "Menu Penghitungan Luas Permukaan" << endl;
cout << "1. Luas Permukaan Bola" << endl;
cout << "2. Luas Permukaan Kubus" << endl;
cout << "3. Luas Permukaan Balok" << endl;
cout... | TOOL | 0.875823 | 3.371994 |
69cfdb79-8a16-4658-a011-f7d982dfd8e6 | SamuelVargha/udemy_cpp_20_masterclass | S8_bitwise_operators/L61_shift_operators/main.cpp | #include <iostream>
#include <bitset>
int main (){
unsigned short int value {0xff0u};
std::cout << "Size of short int " << sizeof(short int) << std::endl; // 16 bits
std::cout << "value: " << std::bitset<16>(value)
<< ", dec: " << value << std::endl;
// shift left by one bit
value = s... | TOOL | 0.88943 | 4.615224 |
f1d2d7a1-e5c3-43f2-96ed-9dbcb92c835f | mzabala1/244smzabala1 | parciales/pruebaParcial02/EcoA/procesarecos.cpp | #include "eco.h"
#include <iostream>
using namespace std;
int
main(void) {
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
int nVal, retraso;
float factor;
cin >> nVal >> retraso >> factor;
#ifdef debug
cout << "valores: " << nVal
<< " retraso: " << retraso
<< " factor: " << factor << end... | ALGO | 0.930398 | 3.410691 |
297cf39c-9a7c-4e00-bc56-8b28d7a8bb52 | anubhawbhalotia/Competitive-Programming | LeetCode/108. Convert Sorted Array to Binary Search Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* divCon(int l, int r, vector<int>& nums)
{
if(l > r)
{
... | ALGO | 0.999995 | 6.478315 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.