uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
23554b47-485c-4d3b-bd72-23d9ca68eb46 | NaveedWaddo/TLE | TLE12_L2/Week1 PrefixSum and Difference Array/7_Vacation.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef long double lld;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<vll> vvll... | ALGO | 0.999678 | 4.19559 |
f6133971-da5b-47c1-b0ac-fbd8c75eb218 | Nehagarg816/DSA-practice | Sorting/countSort.cpp | #include <iostream>
using namespace std;
void countSort(int arr[])
{
int k = arr[0];
for (int i = 0; i < 6; i++)
{
k = max(k, arr[i]);
}
int count[10] = {0};
for (int i = 0; i < 6; i++)
{
count[arr[i]]++;
}
for (int i = 1; i <= k; i++)
{
count[i] += count[... | ALGO | 0.99991 | 5.014142 |
82e1a941-85a7-4023-b12c-ee1d1b6ffff5 | mchu7797/OOPProgramming | 13th/13-1.cpp | #include <iostream>
using namespace std;
int getExp(int base, int exp) {
int value = 1;
for (int n = 0; n < exp; ++n) {
value = value * base;
}
return value;
}
int main() {
int v = getExp(2, 3);
cout << "2^3 = " << v << endl;
int e = getExp(2, -3);
cout << "2^-3 = " << e <<... | ALGO | 0.991615 | 4.378944 |
f7ce9231-2456-4221-be63-2d113cdffbcf | himanshu062/leetcode-problems | 2524-largest-positive-integer-that-exists-with-its-negative/largest-positive-integer-that-exists-with-its-negative.cpp | class Solution {
public:
int findMaxK(vector<int>& nums) {
int ans = -1;
unordered_set<int> seen;
for (const int num : nums)
if (seen.count(-num))
ans = max(ans, abs(num));
else
seen.insert(num);
return ans;
}
}; | ALGO | 0.999907 | 5.599173 |
7e229eb6-08b8-49e3-8072-399ef8eeb15b | greenfox-zerda-sparta/robertwinke | week-05/day-02/10/10.cpp | /*
* 10.cpp
*
* Created on: Nov 15, 2016
* Author: robertwinke
*/
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream my_file("tenth-exercise.txt");
ofstream output_file("tenth-output.txt");
string line;
char temp;
if (my_file.is_open()) {
while(getline(my_fil... | ALGO | 0.928502 | 4.254207 |
0fa9456d-32d0-4ac0-93f2-557af4f15367 | pathadeTush/Problems-450 | binary-tree/189-zigZag.cpp |
/*
store element to the ans level wise and (store them in reverse order alternately)
*/
//Function to store the zig zag order traversal of tree in a list.
vector<int> zigZagTraversal(Node *root)
{
// Code here
vector<int> ans;
queue<Node *> q;
q.push(root);
int flag = 0;
while (!q.empty())
... | ALGO | 0.999997 | 5.646652 |
708ce4fe-ccc3-404a-b668-952df041ef9e | ishandutta2007/codeforces | juve45/normal/660/C.cpp | #include <bits/stdc++.h>
#define dbg(x) cerr<<#x": "<<x<<"\n"
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"
#define st first
#define nd second
using namespace std;
template<class T>
ostream& operator<<(ostream& out, vector<T> v) {
out <<... | ALGO | 0.999997 | 3.527352 |
0d98ae3a-543a-448a-90f6-a44b5b6cca35 | anhvvcs/corana | libs/z3/src/smt/dyn_ack.cpp | #include "smt/smt_context.h"
#include "smt/dyn_ack.h"
#include "ast/ast_pp.h"
namespace smt {
/**
\brief Justification for dynamic ackermann clause
*/
class dyn_ack_justification : public justification {
app * m_app1;
app * m_app2;
public:
dyn_ack_justification(a... | ALGO | 0.996649 | 5.752781 |
5830a933-15dc-44f6-8cbf-99eed38ea293 | ishandutta2007/codeforces | fizzydavid/normal/687/A.cpp | //while(true)rp++;
#include<bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
typedef long long ll;
const ll INF=1<<28;
const ll LINF=1ll<<61;
//My own input/output stream
#define geti(x) x=getnum()
#define getii(x,y) geti(x),geti(y)
#define getiii(x,y,z) ... | ALGO | 0.999896 | 3.271425 |
ade1b778-2580-42f0-9352-5daf8703c0e5 | 0307kwon/kesla_project | navigation/global_planner/src/dijkstra.cpp | #include<global_planner/dijkstra.h>
#include <algorithm>
namespace global_planner {
DijkstraExpansion::DijkstraExpansion(PotentialCalculator* p_calc, int nx, int ny) :
Expander(p_calc, nx, ny), pending_(NULL), precise_(false) {
// priority buffers
buffer1_ = new int[PRIORITYBUFSIZE];
buffer2_ = new... | ALGO | 0.999867 | 5.773032 |
bd20c5b0-6118-4f59-af41-613054c6a910 | millanek/trio-sga | src/StringGraph/SGSearch.cpp | //
SGWalkBuilder::SGWalkBuilder(SGWalkVector& outWalks, bool bIndexWalk) : m_outWalks(outWalks), m_pCurrWalk(NULL), m_bIndexWalk(bIndexWalk)
{
}
//
SGWalkBuilder::~SGWalkBuilder()
{
// The pointer to the current walk should be NULL
// or else finishCurrentWalk() was not called for the last
// walk and... | ALGO | 0.99961 | 5.924976 |
c3235698-031c-48fb-9758-28624535f83f | anishverma926/DSA | 2787-ways-to-express-an-integer-as-sum-of-powers/2787-ways-to-express-an-integer-as-sum-of-powers.cpp | class Solution {
public:
int solve(int i, int n, int x, vector<vector<int>>& dp){
if(n == 0)
return 1;
int val = pow(i, x); // 1^2, 2^2, 3^2, 4^2
if(val > n) // 16 > n
return 0;
if(dp[i][n] != -1)
return dp[i][n];
int not_take = solve(i+1, n, x, dp)... | ALGO | 0.99992 | 5.95412 |
252658a0-72af-4fa1-95a7-2bfa5cbc75b0 | sahilskumar/Implementation | Basic/Dynamic Programming/Interviewbit/LIS nlogn.cpp | /*
1.LIS is strictly increasing sequence.
2.For Longest decreasing sub sequence reverse the input.(strictly decreasing order)
*/
int lengthOfLIS(vector<int>& a) {
int n=a.size();
vector<int> d(n+1, 1000000000);
for (int i = 0; i < n; i++)
*lower_bound(d.begin(), d.end(), a[i]) = a[i];//For incre... | ALGO | 0.999969 | 5.753327 |
2460fb34-e1b4-49dd-bac0-845942785a43 | Nitin-Pilkhwal/Leetcode_Problems | Easy Problems/653. Two Sum IV - Input is a BST.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <unordered_map>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
... | ALGO | 0.999998 | 6.243826 |
12da060c-4603-4fd0-bb81-82dc89218af9 | PratheekB/suv | llvm/llvm/lib/Support/MD5.cpp | #include "llvm/Support/MD5.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Endian.h"
#include <array>
#include <cstdint>
#include <cstring>
// The basic MD5 functions.
// F and G are optimized compared to the... | ALGO | 0.99905 | 7.563422 |
9b30f78e-6ce9-4891-a633-b624956dbe55 | t0whid/Solved-Problem | Codeforces/1517A. Sum of 2050.cpp | /* Allah, increase me in knowledge.
Towhid Hasan */
#include<bits/stdc++.h>
using namespace std;
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0)
#define ll long long
#define pi acos(-1.0)
#define cln(x) memset(x, 0, sizeof(x))
#define cln_set(x) memset(x, -1... | ALGO | 0.999657 | 3.748021 |
a761ade1-206d-45e6-8d4a-6688a8d1c074 | vito2carlos/webserv | parsing/conf/ConfigParser.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ConfigParser.cpp :+: :+: :+: ... | TOOL | 0.949427 | 3.75735 |
3bdf793f-b6f4-4f92-9858-10c2be423cd2 | ishandutta2007/codeforces | podurem/normal/588/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, min1 = 101, ans = 0, x, a;
cin >> n;
for (int i = 0; i < n; i++)
{
cin >> a >> x;
min1 = min(min1, x);
ans += min1 * a;
}
cout << ans;
return 0;
} | ALGO | 0.999642 | 3.584658 |
a7d03571-b5dd-4540-9c1b-fefb15968ebb | ishandutta2007/codeforces | imeimi/normal/1606/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct frac {
ll b, a;
frac(ll b, ll a) : b(b), a(a) {}
bool operator<(const frac &p) const {
return b * p.a < p.b * a;
}
};
struct fenwick {
ll fen[200005];
void update(int i, ll x) {
while (i <= 200000) {
... | ALGO | 0.99997 | 4.397534 |
25daf167-58b4-4379-aba5-27bce4e4a133 | gautamop01/Daily-Goals-Of-Coding | Leet Code/2 Weeks study Plan to Tackle DS/Pascal's Triangle.cpp | class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> ans;
for(int i=0;i<numRows;i++)
{
vector<int> row(i+1,1);
for(int j=1;j<i;j++)
{
row[j]=ans[i-1][j]+ans[i-1][j-1];
}
ans.push_b... | ALGO | 0.999953 | 5.595002 |
1846a130-5c8d-4698-8eba-2e8d0c867c35 | ducnhienbg270/Buockhoidau | Lab07/Lab07_Bai1.cpp | #include<iostream>
using namespace std;
struct Node{
char data;
Node *left, *right;
Node(char d){
data = d;
left = right = NULL;
}
};
int searchIndex(char arr[], int Start, int End, char value){
int i;
for(i = Start; i <= End; i++){
if(arr[i] == value)
retu... | ALGO | 0.999999 | 4.646789 |
288d762f-6363-4507-b692-b2d9d8bad8c6 | junrae6454/Algorithm | BOJ/5427.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
#include <queue>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
string maps[1002];
int main()
{
int testcase;
scanf("%d", &testcase);
vector<pair<int, int>> around;
around.push_back({ 0,1 });
around.push_back({ 1,0 });
aroun... | ALGO | 0.999911 | 3.984037 |
0f977e81-e6e8-4367-a091-d8ddca286984 | ishandutta2007/codeforces | nok0/normal/1538/G.cpp | /**
* author: nok0
* created: 2021.06.10 23:58:14
**/
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
#pragma region Macros
// rep macro
#define foa(v, a) for(auto &v : a)
#define REPname... | ALGO | 0.999806 | 5.172441 |
bcafe0ce-5dde-4e12-9921-ffedbd443bd3 | apaznikov/student-thesis | hpc-mpi/2023-Qian-Xinyu/matrix/matrix_pthread.cpp | #include <iostream>
#include <cstdio>
#include <chrono>
#include <pthread.h>
#define nthread 8
#define SIZE 1440
using namespace std;
int element = 6;
int* a = new int[SIZE * SIZE];
int* b = new int[SIZE * SIZE];
int* c = new int[SIZE * SIZE];
//pthread_mutex_t mutex;
void *threadFunc(void *arg)
{
int tid = (lon... | ALGO | 0.99825 | 3.588778 |
8cb3628d-ddb6-4731-8a6d-ef908d5e3cd2 | mpgaillard/SolvedProblems | COJ/TobyAndDivisors1.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;
int divis[2501];
int main(){
ios_base::sync_with_stdio(false);
int A, N, divisors, num;
for(int i=1; i<= 2500; i++) divis[i] = 1;
for(int j=2; j<= 2500; j++){
for(int k=j; k<= 2500; k+=j){
divis[k]++;
}
... | ALGO | 0.999913 | 3.456917 |
c3412f2a-550f-4e35-ab02-3a06f5e0fc6a | seclab-fudan/SyzDirect | source/llvm-project-new/libcxx/test/std/containers/sequences/vector/vector.special/swap.pass.cpp | // <vector>
// template <class T, class Alloc>
// void swap(vector<T,Alloc>& x, vector<T,Alloc>& y);
#include <vector>
#include <iterator>
#include <cassert>
#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
int main(int, char**)
{
{
int a1[] = {1... | TEST | 0.863933 | 5.274514 |
f33ac318-d585-4cf2-a939-b8632efbab01 | orisano/copr | verify/aoj/GRL_5_C.cpp | #include <copr/graph/euler_tour.hpp>
#include <copr/graph/fast_lca.hpp>
#include <cstdio>
#define mygc(c) (c) = getchar_unlocked()
#define mypc(c) putchar_unlocked(c)
template<typename T=int>inline T rd(){T x=0,m=0,k;for(;;){mygc(k);if(k=='-'){m=1;break;}if('0'<=k&&k<='9'){x=k-'0';break;}}for(;;){mygc(k);if(k<'0'||'9'... | ALGO | 0.999705 | 4.428909 |
d2e7f85b-b2dc-44d2-a333-b4d872fba1b8 | DeependraParmar/DSA | GeeksForGeeks/Merge Sort.cpp | /*
class Solution
{
public:
void merge(int arr[], int low, int mid, int high)
{
vector<int> temp;
int left = low;
int right = mid+1;
while(left <= mid && right <= high){
if(arr[left] <= arr[right])
temp.push_back(arr[left++]);
else
... | ALGO | 0.999953 | 5.339139 |
4e6c0ac4-2493-45ff-9e9a-56d1615b1408 | kpratyush12345/Codes | 4_Adding_two_numbers_without_using_plus_operator.cpp | #include <bits/stdc++.h>
using namespace std;
// Optimal Approach using Bit Manipulation
int add(int a, int b)
{
int carry = b, sum;
while (carry != 0)
{
sum = a ^ b; // Sum will be equal to XOR
carry = (a & b) << 1; // Carry will be equal to and of both a and b with left shift of ... | ALGO | 0.999822 | 5.298897 |
21bcaaf5-6a3a-4d8e-9f64-67ceaa341351 | ishandutta2007/codeforces | wzyeustia/normal/1427/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define REP(i, n) FOR(i, 0, (n)-1)
#define sqr(x) ((x) * (x))
#define all(x) (x).begin(), (x).end()
#d... | ALGO | 0.999637 | 4.002318 |
10a3941a-0475-4d25-b4f8-a7c338c2b1b9 | DayKungZa/CEDT_Algorithm | exchange.cpp | #include <bits/stdc++.h>
using namespace std;
bool check(vector<vector<double>> &graph, int n){
for(int k=0;k<n-1;k++){
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
graph[i][j] = max(graph[i][k]*graph[k][j], graph[i][j]);
}
}
}
for(int k=0;k<n;k++){
if(graph[k][k]>1) return true;
}
return false;... | ALGO | 0.999731 | 4.377915 |
48ad2d96-ef89-45f3-b981-a9398185927a | FahimCC/Problem-Solving | URI onilne judge/BEGINNER/1132 - Multiples of 13.cpp | #include<iostream>
using namespace std;
int main()
{
int x,y,t,sum = 0;
cin>>x>>y;
if(x > y)
{
t = x;
x = y;
y = t;
}
for(int i=x;i<=y;i++)
{
if(i%13 != 0)
sum = sum + i;
}
cout<<sum<<endl;
return 0;
}
| ALGO | 0.999954 | 3.818328 |
f553a5ff-87a2-4f09-b27b-8ba78c900649 | Ankit-0803/Leet | 2229-maximum-fruits-harvested-after-at-most-k-steps/2229-maximum-fruits-harvested-after-at-most-k-steps.cpp | class Solution {
public:
int maxTotalFruits(vector<vector<int>>& fruits, int startPos, int k) {
int n = fruits.size();
vector<int> sum(n + 1);
vector<int> indices(n);
for (int i = 0; i < n; i++) {
sum[i + 1] = sum[i] + fruits[i][1];
indices[i] = fruits[i][0];
... | ALGO | 0.999992 | 5.846008 |
746c58bb-c45d-4a85-869a-d6f2ae545bc5 | poorvikaa08/Cpp | Programs/factorial.cpp | #include<iostream>
using namespace std;
int factorial(int n){
int fact=1;
for(int i=1; i<=n; i++){
fact = fact*i;
}
return fact;
}
int main(){
int n;
cout << "Enter a number: " ;
cin >> n ;
cout << n << "! = " << factorial(n) << endl;
return 0;
}
| ALGO | 0.994393 | 3.964217 |
43215bd7-bb97-4355-865c-89c9cdb7b013 | DmytroVasy12/karewkrwk | 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 |
33ef1709-6637-482f-8e18-3d0ea277079a | nimit1jain/DSA-Questions | array/leetcodemonotonicarray.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "length" << endl;
cin >> n;
int arr[n];
cout << "enter elements" << endl;
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int small = 0;
int big = 0;
for (int j = 0; j < n - 1; j++)
{
if (... | ALGO | 0.999856 | 4.018027 |
aaec3e60-ea88-46e6-a4b7-6625e6391e1f | Yeluorag/ACM-ICPC-Code-Library | CQU Training/Chongqing University Weekly Training (10.31)/A.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
#define mem(a, n) memset(a, n, sizeof(a))
#define ALL(v) v.beg... | ALGO | 0.999951 | 4.411815 |
dfbba32b-eb08-432f-a55f-6631b986110a | Igg2000/Ejercicios-DAM | 1º/2EVA/C/profe/ejSobrecarga2.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
/*
Haz una app q tenga una funcin q pinte un cuadrado o una X en pantalla
Ej:
dibuja(1, n)
dibuja('*', n)
dibuja(1, n, m)-->pinta un cuad con 1 de n*n con margen m
dibuja(int n, int m) -->pinta un cuad de n*m
dibuja(char c, int n) -->pinta una X de n*n con... | TOOL | 0.851069 | 3.224003 |
a77ce64f-159c-46c7-b6aa-e758da9edab5 | noc-turne/leetcode_problems | 0971-shortest-bridge/0971-shortest-bridge.cpp | class Solution {
public:
int shortestBridge(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
int x = -1;
int y = -1;
for(int i=0;i<m;i++) {
for(int j=0;j<n;j++) {
if(grid[i][j] == 1) {
x = i;
... | ALGO | 0.999972 | 5.760901 |
04062879-7e2c-45cc-bc06-9b782cbb823e | dooooominic/CodingPractice | pyramid.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter a positive integer: " <<endl;
cin>> n;
for(int i=1;i<=n;i++){
for(int j=1;j<=n-i;j++){
cout<<" ";
}
cout<<"/";
for(int j=1; j<=i;j++){
if(i<n){
cout<<" ";
}
else{
cout<<"_";
... | ALGO | 0.99864 | 3.103102 |
0b734fc7-6a09-45eb-84e1-d1e1e89f0403 | evouga/inversemorpho | src/mesh-optimization.cpp | #include "mesh.h"
#include <iomanip>
#include "controller.h"
#include <Eigen/Dense>
#include "newton.h"
using namespace std;
using namespace Eigen;
using namespace OpenMesh;
void Mesh::elasticEnergy(const VectorXd &q,
const VectorXd &g,
double &energyB,
... | ALGO | 0.998431 | 5.595906 |
92b4d788-48ea-4edf-8e81-386563cbf4a9 | ishandutta2007/codeforces | rafbill/normal/1097/F.cpp | #pragma GCC optimize "O3"
#pragma GCC target "tune=native"
#include <stdio.h>
#include <bits/stdc++.h>
#define FOR(i, n) for(lli i = 0; i < (lli)(n); ++i)
#define FORU(i, j, k) for(lli i = (j); i <= (lli)(k); ++i)
#define FORD(i, j, k) for(lli i = (j); i >= (lli)(k); --i)
#define SQ(x) ((x)*(x))
#define all(x) b... | ALGO | 0.999359 | 4.79475 |
077848dc-dad8-4bb7-9051-33f68165a981 | lclpsoz/competitive-programming | ARCHIVE/2018-07-15-0224/rou/a.cpp | #include <bits/stdc++.h>
using namespace std;
////////////// Prewritten code follows. Look down for solution. ////////////////
#define x first
#define y second
#define pb push_back
#define foreach(x, v) for (typeof (v).begin() x=(v).begin(); x !=(v).end(); ++x)
#define For(i, a, b) for (int i=(a); i<(b); ++i)
#define ... | ALGO | 0.979301 | 4.009483 |
f31dc4d9-0c66-4349-a12d-7db6a35d71b0 | GersonCavalheiro/OpenMPSnapshot | May2023/RepCPP/94864681/1-montecarlo(openmp).cpp | #include <iostream>
#include <ctime>
#include <math.h>
#include <omp.h>
using namespace std;
double a,b;
double I,S,x,y,f;
int K;
const int N = 100*1024*1024;
double func(double xx)
{
double ff = xx*xx + 3;
return ff;
}
void main()
{
cout<<"Input a = "; cin>>a;
clock_t time = clock();
b = func(a);
K = 0;
omp_set_nu... | ALGO | 0.997575 | 3.800582 |
00dfcfc6-2241-43d0-9f79-5a3cf573b3d0 | asen-krasimirov/SDA-Course-FMI-2024 | homeworks/homework06/Asen/exercise01.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
struct Node {
long long val;
long long breadth;
Node *left, *right;
} nodes[1000000];
long long N, curVal, leftIdx, rightIdx, mostLeftBreadth = 0, mostRightBreadth = 0;
void inorderSumUp(Nod... | ALGO | 0.999989 | 3.966727 |
d0664503-df27-4040-b114-d8641e0a1dda | jujimeizuo/XCPC-Template | 06_数学/65_多项式求逆.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double PI = acos(-1);
const int N = 1e5 + 10;
struct Complex {
double x, y;
Complex(double a = 0, double b = 0): x(a), y(b) {}
Complex operator + (const Complex &rhs) { return Complex(x + rhs.x, y + rhs.y); }
Complex operator - (... | ALGO | 0.999937 | 3.118576 |
3b8ebdbf-bbf8-43ae-8e5d-c70cef580de6 | sohancms/Program1 | Data_structure_C++/shorting_and_search_algorithom/linear_search.cpp | #include <iostream>
using namespace std;
int linear_search(int a[], int n, int x) //create a linearn_search function..
{
int i;
for (i = 0; i < n; i++)
{
if (a[i] == x)
{
return i;
}
}
i = -1;
return i;
}
int main()
{
int a[5] = {10, 20, 32, 25, 50};
... | ALGO | 0.999536 | 4.92501 |
ef29dbae-88c2-4b5a-8562-c06cf31819ec | Anubhav-Raj/Coding-Ninjas | Stack/Assigment/ReverseStringUsingStack.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
// code hear
string str;
cin >> str;
stack<char> s;
// Traverse the string and push each latter into stack one by one
for (int i = 0; i < str.length(); i++)
{
char ch = str[i];
s.push(ch);
}
// to store fina... | ALGO | 0.999917 | 5.694264 |
a23081c3-a939-44a6-a64d-8dadae57aca3 | munhwas1140/PS | C++/1953.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio cin.tie(0)->sync_with_stdio(0)
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
int n;
vector<int> g[101];
int dist[101];
void go(int now, int stat) {
for(int next : g[now]) {
if(dist[next] == -1) {
dist[nex... | ALGO | 0.999935 | 3.813023 |
b2374469-59ab-4586-8a18-0869e01f58a7 | bhuppidhamii/myLeetCode | 2387-partition-array-such-that-maximum-difference-is-k/partition-array-such-that-maximum-difference-is-k.cpp | class Solution {
public:
int partitionArray(vector<int>& nums, int k) {
sort(begin(nums), end(nums));
int N = nums.size();
int i = 0;
int count = 0;
while (i < N) {
int j = i;
int max_allowed = nums[j] + k;
while (j < N && nums[j] <= max_a... | ALGO | 0.999962 | 5.974436 |
6b42168a-a06d-40ad-a2d7-c06f33570878 | fate7902/study | baekjoon/15001 ~ 20000/19532.cpp | #include <iostream>
using namespace std;
int main() {
int a, b, c, d, e, f;
cin >> a >> b >> c >> d >> e >> f;
auto g = [a, b, c](int x, int y) {return a * x + b * y == c; };
auto h = [d, e, f](int x, int y) {return d * x + e * y == f; };
for (int x = -999; x < 1000; ++x) {
for (int y = -999; y < 1000; ++y) ... | ALGO | 0.999889 | 3.210702 |
7177376d-2823-4916-8cdb-df13d0420a3e | adhamkhaled312/ASUFE-CPC-LEVEL1-Training | Week 4 sheet/B-IsItACat.cpp | //https://codeforces.com/problemset/problem/1800/A
#include <iostream>
#include <string>
using namespace std;
int main(){
int t,n;
cin>>t;
while(t--){
cin>>n;
string s,ans;
cin>>s;
for(int i=0;i<n;i++){
s[i]=tolower(s[i]);
}
for(int i=0;i<n;i++){
if(s[i]!=s[i+1]){
ans... | ALGO | 0.999617 | 4.114681 |
ec1b5f58-48a2-4a6f-93b1-b1afd7fcd236 | Vaishnavi-Waghmale/Competitive-Programming-Questions | Arrays/Practice Makes man perfect.cpp | #include <iostream>
using namespace std;
int main() {
// your code goes here
int arr[4];
int c = 0;
for(int i=0; i<4; i++){
cin>>arr[i];
}
for(int i=0; i<4; i++){
if(arr[i]>=10)
c++;
}
cout<<c<<endl;
return 0;
}
| ALGO | 0.994011 | 3.829658 |
a74deac2-76eb-4221-9589-e64351290472 | Dup4/competitive-programming | atcoder/diverta2019-2/a.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k;
int main() {
while (scanf("%d%d", &n, &k) != EOF) {
if (k == 1) {
puts("0");
} else {
printf("%d\n", n - k);
}
}
return 0;
}
| ALGO | 0.999937 | 3.703833 |
d404583c-0b6a-46e2-bd4a-0c3481adeb12 | rosegengh/GEM5_COSMOS_dataprediction | src/systemc/tests/systemc/misc/unit/data/datawidth_signed/extension/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.985021 | 5.296924 |
d25b1a84-6102-4b58-a189-061e1297ba19 | YoshikiTakashima/vert | benchmark/cpp_transcoder/FLOOR_IN_A_SORTED_ARRAY/FLOOR_IN_A_SORTED_ARRAY_towasm.cpp | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>
int min(int x, int y) { return (x < y)? x: y; }
int max(int x, int y) { return (x > y)? x: y; }
int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}... | ALGO | 0.999934 | 5.005803 |
202c7dc7-b6a3-45b9-8009-37b9af4aba2e | raincross7/code-similarity | codes/train_code/problem367/problem367_423.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int ans = 0, end_with_a = 0, begin_with_b = 0,
begin_with_a_and_end_with_b = 0;
for (int i = 0; i < n; ++i) {
string s;
cin >> s;
for (int j = 0; j < s.size() - 1; ++j) {
if (s[j] == 'A' && s[j + 1] == 'B')
... | ALGO | 0.999866 | 4.787069 |
66942037-6fd3-4041-b6cf-5acdd68a2098 | JorgeIba/Competitive-Programming-Problems | CodeForces/ICPC Colombia 2019/K. Kernel Of Love.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define lli long long int
#define ld long double
#define forn(i,n) for (int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
#define fastIO(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define SZ(s) int(s.size())
using namespace std;
typedef vector<lli> VL... | ALGO | 0.999788 | 3.935042 |
e7c3545b-bde8-4b3e-9d41-47d3585f2c8b | Sandhya-3024/DSA | DP/fibonacci.cpp | class Solution {
//Memoization
long long int mod=1e9+7;
long long int tdown(int n,vector<long long int>&dp){
if(n<=1) return n;
if(dp[n]!=-1) return dp[n];
return dp[n]=((tdown(n-1,dp)+tdown(n-2,dp))%mod);
}
public:
long long int topDown(int n) {
vector<long lo... | ALGO | 0.999998 | 6.068312 |
3718feeb-f856-4aff-a92b-44f0aad27ca6 | ishandutta2007/codeforces | mhq/normal/884/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxN = 2 *(int)1e5 + 10;
int n;
long long a[maxN];
long long ans;
priority_queue < long long > hp;
int main() {
ios_base::sync_with_stdio(false);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
hp.push(-a[i]);
}
if (n % 2 =... | ALGO | 0.99998 | 4.404857 |
5d00b0f5-b687-4094-b7e1-f19d85926c5c | karvind08/OOPS-2023 | Unit 4/Templates/21.template-class.cpp | #include <iostream>
using namespace std;
template <class T, int n>
class Example
{
T *a;
public:
Example(T *b)
{
for (int i = 0; i < n; i++)
{
a[i] = b[i];
}
}
void sum()
{
cout<<"Testing"<<endl;
// T s = 0;
// for (int i = 0; i < ... | ALGO | 0.888669 | 4.862391 |
3dc98674-41d2-4243-9e26-4433f3e768f6 | rgongw0414/Practices | leetcode/97. Interleaving String/a.cpp | class Solution {
public:
bool isInterleave(string s1, string s2, string s3) {
return dfs(0, 0, 0, s1, s2, s3);
}
bool dfs(int i, int j, int k, string& s1, string& s2, string& s3) {
if (k == s3.length()) {
return (i == s1.length()) && (j == s2.length());
}
... | ALGO | 0.999679 | 6.293061 |
b6e6e4be-fbb8-4bc5-aabd-abfc998bc1ec | ishandutta2007/codeforces | mnaeraxr/normal/830/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long int64;
typedef pair<int,int> pii;
typedef vector<int> vi;
const int oo = 0x3f3f3f3f;
const double eps = 1e-9;
const int maxn = 100000 + 10;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifdef MARX
freopen("test... | ALGO | 0.999985 | 3.629245 |
b4e10870-51f1-467e-960d-129ecfa43aa3 | king-yyf/cpcode | leetcode/lcb109/2.cpp | #ifdef sigma-yyf
#include "/Users/yangyf/Desktop/cpcode/leetcode/lc_help.hpp"
#endif
using namespace std;
using ll = long long;
using ar2 = array<int, 2>;
using ar3 = array<int, 3>;
using ar4 = array<int, 4>;
#define all(c) (c).begin(), (c).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
... | ALGO | 0.99996 | 5.18998 |
75e277c0-46ca-4aac-8e3e-0278f330232c | Senex-x/algorithms-course-1 | Week4/Task1/Source.cpp | #include <iostream>
using namespace std;
struct Node {
int val;
Node* next = NULL, * prev = NULL;
};
struct LinkedList {
Node* head = NULL, * end;
void Add(int val) {
Node* node = new Node;
node->val = val;
if (head == NULL) {
head = node;
end = node;
} else {
end->next = node;
node->prev =... | ALGO | 0.998678 | 4.684554 |
228b3668-95e6-4bb9-8e62-96f3ff74e75d | forked-llvm/Polaris-Obfuscator | libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter>
// requires ShuffleIterator<Iter> && LessThanComparable<Iter::value_type>
// constexpr void // constexpr in C++20
// make_heap(Iter first, Iter last);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
#include "Mo... | TEST | 0.872128 | 6.766248 |
c1274cdf-4d0b-4788-89b4-6f6832ff08e7 | XFeiF/DataStructures | 2-Stack/chain/chainStackFunc.cpp | #include "chainStack.h"
#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
//新建栈
PSTACK createStack(){
PSTACK pS = (PSTACK)malloc(sizeof(CSTACK));
pS->pTop = (PNODE)malloc(sizeof(NODE));
if(NULL==pS || pS->pTop == NULL){
cout<<"malloc failed\n";
exit(-1);
}els... | ALGO | 0.998443 | 3.549644 |
f5b04c34-0078-4f64-9589-70818b00daa5 | forestsen/ARAPShapeManipulation | RigidDeform/Eigen/doc/examples/QuickStart_example2_dynamic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXd m = MatrixXd::Random(3,3);
m = (m + MatrixXd::Constant(3,3,1.2)) * 50;
cout << "m =" << endl << m << endl;
VectorXd v(3);
v << 1, 2, 3;
cout << "m * v =" << endl << m * v << endl;
}
| ALGO | 0.999278 | 3.515557 |
c7b92fa0-70ab-4ed8-930c-41f1949d434e | dhanjiRajput/CPP_Jay_Sir | 5.2/Multiple_overload.cpp | #include<iostream>
using namespace std;
class Multiple_Overload
{
private:
int a,b;
public:
void setData()
{
cout<<"Enter A :";
cin>>a;
cout<<"Enter B :";
cin>>b;
}
void getdata()
{
cout<<endl<<"A : "<<a<<endl;
cout<<"B : "<<b;
}
Multiple_Overload operator+(Multiple_Overload a... | ALGO | 0.926502 | 4.033782 |
65df8566-76c2-43ee-b3ef-5716d7ead9fd | sekharbag/coding | c++/Recursion/factorialusingrecursion.cpp | #include<iostream>
using namespace std;
int fact(int n)
{
if(n==0) return 1;
return n*fact(n-1);
}
int main(){
cout<<"hello"<<endl;
cout<<fact(6);
} | ALGO | 0.998731 | 3.024699 |
3912d90b-51cf-4197-bf96-c32b61f85eba | KhaosResearch/MORPHY | lib/Bpp/bpp-phyl-2.1.0/src/Bpp/Phyl/Distance/BioNJ.cpp | //
// File: BioNJ.h
// Created by: Vincent Ranwez
// Created on: Tue Apr 11 14:23 2006
//
#include "BioNJ.h"
#include "../Tree.h"
#include <Bpp/App/ApplicationTools.h>
using namespace bpp;
// From the STL:
#include <cmath>
#include <iostream>
using namespace std;
double BioNJ::computeDistancesFromPair(const vecto... | ALGO | 0.999826 | 6.126204 |
334183df-1828-424b-a4da-9939dc9fbfad | hsson0822/Online_Judge | SWEA/D3/1217. [S/W 문제해결 기본] 4일차 - 거듭 제곱/[S/W 문제해결 기본] 4일차 - 거듭 제곱.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main(int argc, char** argv)
{
int test_case;
int T;
for(test_case = 1; test_case <= 10; ++test_case)
{
int test;
cin >> test;
unsigned long long n;
unsigned long long s;
cin >> n >> s;
unsigned long long result... | ALGO | 0.993858 | 4.163091 |
83b6c564-8fc8-4acc-86d0-6e7f62d0407c | ishandutta2007/codeforces | neko_nyaaaaaaaaaaaaaaaaa/normal/1195/F.cpp | #include <bits/stdc++.h>
using namespace std;
struct johnwick_tree{
int n;
vector<long long> tree;
johnwick_tree(int n) {
this->n = n;
tree.resize(n+3);
}
void update(int p, long long val){
for (int i = p; i <= n; i += i & -i) {
tree[i] += val;
}
}
long long sum(int p) {
long long ans = 0;
... | ALGO | 0.999968 | 4.484686 |
a71a655f-0a22-4ddb-86f2-770ce8d7aaf5 | abdirakhman/Olymp | Pre-IOI Camp /[Day 1]/B/main.cpp | /**
SXR0aXAkI0JwbXptI3FhI3Z3I293bCNqY2IjUG0jMCNicG0jVHFkcXZvLyNCcG0jQW10bjBhY2phcWFicXZvLyNNYm16dml0MSNWdyNhdGN1am16I2tpdiNhbXF9bSNQcXUjVnd6I0F0bW14MSNQcWEjaXptI2l0dCNicHF2b2EjUXYjYnBtI3BtaWRtdmEjaXZsI3d2I21pemJwMSNFcHcjcWEjYnBtem0ja2l2I3F2Ym16a21sbSNRdiNQcWEjeHptYW12a20jbXtrbXhiI0lhI3BtI3htenVxYmJtYnBHI1BtI3N2d2VtYnAj... | ALGO | 0.999945 | 4.026073 |
cf7d619e-04d3-4a4a-b476-2f3a41d65ff7 | hal-uw/gem5-multiChiplet-micro24 | src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage1.cpp | /*****************************************************************************
stage1.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************... | ALGO | 0.982338 | 5.382321 |
91c48572-8aaa-4579-bf35-1ee4a6dbc2d5 | ishandutta2007/codeforces | igori/normal/1607/E.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
while (t--)
{
int n, m;
cin >> n >> m;
string s;
cin >> s;
int maxUp = 0, maxDown = 0, maxLeft = 0, maxRight = 0;
int x = 0... | ALGO | 0.99999 | 3.746589 |
058e5e8a-603d-425a-a25e-49c4b4a4dd56 | angelRz97/PracticaFDC-Movil | version_MartinFreire/proj/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.996373 | 6.76073 |
00eb3066-943e-4caa-bb9d-d3b1681f0abb | hrit-ikkumar/hritikkumar-cp | Part-I Basic Technieques/Chapter 10 (Bit Manipulation)/3_integer_to_number.cpp | // @hritikkumar
#include<bits/stdc++.h> // all header files
#define endl '\n'
using namespace std;
string intToBinary(int);
int main(void)
{
std::ios::sync_with_stdio(false); // fastio
#ifndef ONLINE_JUDGE
freopen("input.txt","r", stdin);
freopen("output.txt", "w", stdout);
#endif
int num;
cin>>num; // in... | ALGO | 0.998906 | 3.80075 |
89dd4c9d-5a30-4dc7-bcb5-80faeb616099 | i-mkrishna/old_codes | fact_fibbo.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int factorial(int n){
if(n == 0){
return 1;
}
return n*factorial(n-1);
}
int fibonacci(int n){
if(n==0){
return 0;
}
if(n==1){
return 1;
}
cout << fibonacci(n-1) + fibonacci(n-2);
}
int main(){
... | ALGO | 0.999929 | 4.708006 |
e03ad101-10b6-4833-afb0-61b87ce3401b | ojasvagupta/Leetcode | 1915-check-if-one-string-swap-can-make-strings-equal/1915-check-if-one-string-swap-can-make-strings-equal.cpp | class Solution {
public:
bool areAlmostEqual(string s1, string s2) {
int n=s1.size();
int i=0;
vector<int> v;
int count=0;
while(i<n)
{
if(s1[i]!=s2[i])
{
v.push_back(i);
count++;
... | ALGO | 0.999972 | 6.238287 |
fe338820-1fdb-40b6-9ed6-5da6cb16a56f | mdshemul48/Data-Structures-And-Algorithms-Practice-Codes | 27. DS Priority Queue/kThsmallestElement.cpp | #include <bits/stdc++.h>
using namespace std;
void kSmallest(int *a, int n, int k)
{
priority_queue<int, vector<int>, greater<int>> pq(a, a + n);
for (int i = 0; i <= k; i++)
{
cout << pq.top() << endl;
pq.pop();
}
}
int main()
{
return 0;
} | ALGO | 0.999801 | 3.867266 |
982cc267-b818-416e-a8fb-c1d19e8e186c | biqar/adventofcode | 2019/06/puzzle_1.cpp | #pragma warning ( disable : 4786 )
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <string>
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack... | ALGO | 0.999859 | 4.45827 |
cc3c51c3-0d41-4c2a-9bbb-3da06b992079 | franshamk/scantest | deps/boost_1_82_0/libs/math/example/lambert_w_graph.cpp | /*! \brief Graph showing use of Lambert W function.
\details
Both Lambert W0 and W-1 branches can be shown on one graph.
But useful to have another graph for larger values of argument z.
Need two separate graphs for Lambert W0 and -1 prime because
the sensible ranges and axes are too different.
One would get too s... | ALGO | 0.93884 | 6.481786 |
a3279a62-ba30-4fa1-af29-e600173f4fa1 | pranavjawale01/cp.exe | CodeForces/0149-A-Business trip/0149-A-Business trip.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define ull unsigned long long
#define vi vector<int>
#define vll vector<long long>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) x.begin(), x.end()
#define pb push_back
#define ff first
#define ... | ALGO | 0.99986 | 4.042977 |
6e19b3aa-f5b6-4cee-b83c-48d06e6a080a | kenji-tojo/fab3dwire | wiregrad/debug/debug.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <Eigen/Dense>
#include <Eigen/Core>
#include "wiregrad.h"
int main()
{
using namespace Eigen;
namespace wg = wiregrad;
Matrix<float, Dynamic, 3, RowMajor> nodes;
nodes.resize(30000, 3);
for (int i = 0; i < nod... | ALGO | 0.998399 | 5.106767 |
716f11bd-a844-4fa2-89f3-88bfe4e5e951 | Md-Younus-Hossain-Ahsan/My-LeetCode-Challenges | 1040. Moving Stones Until Consecutive II.cpp | //1040. Moving Stones Until Consecutive II
#include <vector>
#include <algorithm>
class Solution {
public:
std::vector<int> numMovesStonesII(vector<int>& stones)
{
sort(stones.begin(), stones.end());
int n = stones.size();
int max_moves = max(stones[n - 1] - stones[1... | ALGO | 0.99989 | 5.723972 |
043f2ac4-c1a7-45c9-a9b0-5c94e7341dba | Mangern/kattis | automatictrading/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
template<typename t, size_t N>
using ar = array<t,N>;
using ii = ar<ll,2>;
#define all(v) begin(v), end(v)
const int INF = numeric_limits<int>::max();
const ll INFLL = numeric_limits<ll>::max();
templa... | ALGO | 0.999872 | 5.373238 |
95a610af-98ee-4f78-9b4b-4a9ba6c8aad4 | jingkongmtsu/xTron.exhole | src/gints_engine/hgp_os/energy/kinetic/hgp_os_kinetic_g_s.cpp | #include "constants.h"
#include <cstddef>
#include <math.h>
typedef int Int;
typedef size_t UInt;
#define THRESHOLD_MATH 0.00000000000001
#ifdef WITH_SINGLE_PRECISION
typedef float Double;
#else
typedef double Double;
#endif
//
// here below is a list of variables used in the... | ALGO | 0.999146 | 3.336712 |
620f9502-6de7-41bb-a8a9-6ce67295f742 | bsc-mem/Mess-Paraver | libs/boost_1_79_0/libs/graph/example/default-constructor2.cpp | using namespace boost;
template < typename Graph > void read_graph_file(std::istream& in, Graph& g)
{
typedef typename graph_traits< Graph >::vertex_descriptor Vertex;
typedef typename graph_traits< Graph >::vertices_size_type size_type;
size_type n_vertices;
in >> n_vertices; // read in number of vert... | ALGO | 0.935612 | 5.73055 |
a0eba415-b39d-46e0-84bb-a1b171db052e | alexjilavu/TemaASD | Tema1/sortari/main.cpp | #include <iostream>
using namespace std;
int n, arr[100];
void afis(int lenght){
for(int i = 0; i<lenght; i++)
cout << arr[i] << " ";
cout<<'\n';
}
void bubblesort(int arr[], int n){
int sortat = 0;
int i;
int p = 0 , it = 0;
int lenght = n;
while(!sortat){
sortat = 1;
... | ALGO | 0.999815 | 4.13667 |
d083817a-7e7c-41d3-bc58-446e470fa22e | bruce3557/Uva-Online-Judge | Q10341-1.cpp | #include <stdio.h>
#include <math.h>
#define eps 1e-7
int p,q,r,s,t,u;
double test(double x) {
return p*exp(-x)+q*sin(x)+r*cos(x)+s*tan(x)+t*x*x+u;
}
int main() {
double st,ed,mid;
while(scanf("%d%d%d%d%d%d",&p,&q,&r,&s,&t,&u) != EOF) {
st = 0.0000;
ed = 1.0000;
if(test(st)*test(ed) > 0.0000) {
pu... | ALGO | 0.999947 | 3.191624 |
69da9fcb-9fa6-4391-9fb5-8a5db53418d2 | Iconoclast42/CSCI2270 | CSCI2270/Midterm2/review2-q4.cpp | void Graph::findNodeWithMaximumAdjacent(int startVertex) {
vertex *start;
for (int i = 0; i < (int)vertices.size(); i++) {
vertices[i].visited = false;
if (vertices[i].value == startVertex) {
start = &vertices[i];
}
}
queue<vertex*> Q;
Q.push(start);
unsigned int max = 0;
int key;
start->visited = tru... | ALGO | 0.999896 | 4.17272 |
1634cd56-d034-4064-937a-4ba09f4dd05c | stevenbai0724/Codeforces-Solutions | shuffleHashing.cpp | //https://codeforces.com/problemset/problem/1278/A
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
cin.tie(nullptr)->sync_with_stdio(false);
int t; cin>>t;
while(t--){
string s, t;
cin>>s>>t;
vector<int>arr(124);
vector<int>freq(124);
... | ALGO | 0.999978 | 5.495284 |
b567a0a4-876f-45aa-9fe8-bdd27f334333 | MateiEduardPetrisor/Data-Structures | ABC_Final/ABC_Final/Source.cpp | #include <stdio.h>
#include <malloc.h>
#include <string.h>
#include <conio.h>
void newLine()
{
printf("\n");
}
enum Facultate
{
CSIE = 1,
REI = 2,
FABBV = 3,
FABIZ = 4,
MRK = 5,
};
struct Student
{
int idStudent;
char* numeStudent;
int numarMateriiStudent;
char** listaMateriiStudent;
float* noteStudent;
... | ALGO | 0.9935 | 3.34577 |
92a7ab07-b345-4438-ac6a-7d25435deb69 | mutharibayub/Competitive_Programming | codeForces/round892div2/4.cpp | #include <iostream>
#include <vector>
#include <cassert>
#include <map>
#include <set>
#include <queue>
#include <array>
#include <algorithm>
#include <functional>
#include <numeric>
using namespace std;
typedef long long ll;
template<typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;
class FenwickT... | ALGO | 0.999974 | 5.039608 |
c044cf61-7077-4aa6-9fa9-4925d7cec1b7 | tmyksj/atcoder | AtCoder Regular Contest 006/A - 宝くじ/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> e(6);
for (int i = 0; i < 6; i++) {
cin >> e[i];
}
int b;
cin >> b;
vector<int> l(6);
for (int i = 0; i < 6; i++) {
cin >> l[i];
}
int c_e = 0, c_b = 0;
for (int i = 0; i < 6;... | ALGO | 0.999939 | 3.753115 |
70a6a500-3488-4248-8cd1-61da7e1e438d | raincross7/code-similarity | codes/train_code/problem383/problem383_155.cpp | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0;i < (int)(n);i++)
using ll = long long;
const ll MOD=1000000007;
const long long INF = 1LL << 60;
const double pi=acos(-1.0);
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return f... | ALGO | 0.999778 | 4.073812 |
fa6b6e7e-6255-45fa-be33-bd2fc490dd5e | VauP/URI_Judge_SolutionsCPP | 2029.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main(){
double v, d;
while(scanf("%lf %lf", &v, &d) != EOF){
double r = d/2;
double a = pow(r, 2) * 3.14;
cout << fixed << setprecision(2) << "ALTURA = " << v/a << endl;
cout << fixed << setprecision(2) << "AREA = " << ... | ALGO | 0.992933 | 4.21522 |
1de409be-b80d-43e9-a3ab-7addc6b1d048 | jnair9/FinalProject | ext/eigen/unsupported/doc/examples/PolynomialUtils1.cpp | #include <unsupported/Eigen/Polynomials>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
Vector4d roots = Vector4d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,5,1> polynomial;
roots_to_monicPolynomial( roots, polynomial );
cout << "Polynomial:... | ALGO | 0.998121 | 4.016954 |
e399a68c-78d1-4117-933e-669d79e4a46f | Denver44/CP-and-DSA-in-CPP | DSA/7Recursion/Extra2/10PrintKeypad.cpp | #include <bits/stdc++.h>
using namespace std;
void helper(int num, string psf)
{
map<int, string> phone;
phone[2] = "abc";
phone[3] = "def";
phone[4] = "ghi";
phone[5] = "jkl";
phone[6] = "mno";
phone[7] = "pqrs";
phone[8] = "tuv";
phone[9] = "wxyz";
if (num == 0)
{
c... | ALGO | 0.999848 | 5.416045 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.