uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
d731457c-2c02-446c-93d6-30ff8191f178 | waydxd/COMP2012-PA3 | bst.cpp | #include "bst.h"
#include "animal.h"
#include <cstddef>
using namespace std;
/**
* Returns true if "src" contains *any* words in "filterWords" (case-insensitive).
* e.g.:
* containAnyWords("Example string", "example") == true
* containAnyWords("Example string", "amp") == true
* containAnyWords("Example str... | TOOL | 0.864525 | 4.897178 |
c46bd5db-c9d0-4aad-80e5-85a606b1c940 | Koki-Yamaguchi/competitive-programming | codeforces/1513/b/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; (i) < (int) (n); (i) ++)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define dump(x) cerr << #x << " = " << x << '\n';
using ll = long long;
template<typename T, typename U> ostream& operator << (ostream& ... | ALGO | 0.999955 | 4.868104 |
98283249-c307-474d-a290-015ea52629dc | Tydus/libmysql | extlib/yassl/taocrypt/src/dsa.cpp | #include "runtime.hpp"
#include "dsa.hpp"
#include "sha.hpp"
#include "asn.hpp"
#include "modarith.hpp"
namespace TaoCrypt {
void DSA_PublicKey::Swap(DSA_PublicKey& other)
{
p_.Swap(other.p_);
q_.Swap(other.q_);
g_.Swap(other.g_);
y_.Swap(other.y_);
}
DSA_PublicKey::DSA_PublicKey(const DSA_PublicKey&... | TOOL | 0.945164 | 7.606144 |
fc99a338-8ff1-4dc0-a674-27a24787fcb6 | DirkH78/CarND-MPC-Project | src/Eigen-3.3/doc/snippets/Tutorial_solve_triangular.cpp | Matrix3f A;
Vector3f b;
A << 1,2,3, 0,5,6, 0,0,10;
b << 3, 3, 4;
cout << "Here is the matrix A:" << endl << A << endl;
cout << "Here is the vector b:" << endl << b << endl;
Vector3f x = A.triangularView<Upper>().solve(b);
cout << "The solution is:" << endl << x << endl;
| ALGO | 0.999593 | 3.045018 |
c6beb78f-5e12-4dc0-97bc-5736073a5d66 | second-state/wasmedge-seL4-projects | projects/llvm/mlir/lib/Analysis/LinearTransform.cpp | #include "mlir/Analysis/LinearTransform.h"
#include "mlir/Analysis/AffineStructures.h"
namespace mlir {
LinearTransform::LinearTransform(Matrix &&oMatrix) : matrix(oMatrix) {}
LinearTransform::LinearTransform(const Matrix &oMatrix) : matrix(oMatrix) {}
// Set M(row, targetCol) to its remainder on division by M(row, ... | ALGO | 0.961953 | 7.861148 |
dd459a33-e5ac-4261-80f2-fdd2f22efdb2 | Mamta-Patil/DSA | while_for_loop/1_to_n_forloop.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout << "Enter value of n :" << endl;
cin >> n;
for(int i=1;i<=n;i++)
{
cout << i <<endl;
}
}
| ALGO | 0.985181 | 3.506342 |
f144c0e6-46a3-4a75-b192-1f2bdf31fbb2 | WolfireGames/overgrowth | Libraries/qhull_git_22feb2012/src/user_eg3/user_eg3.cpp | #//! user_eg3.cpp -- Invoke rbox and qhull from C++
#include "RboxPoints.h"
#include "QhullError.h"
#include "QhullQh.h"
#include "QhullFacet.h"
#include "QhullFacetList.h"
#include "QhullLinkedList.h"
#include "QhullVertex.h"
#include "Qhull.h"
#include <cstdio> /* for printf() of help message */
#include <ostream... | ALGO | 0.991331 | 3.833974 |
6e003e1b-15a7-4518-93cf-10653135c5d1 | ethan-leonard/UW_CSS343 | In-Class/3.3.25/main.cpp | 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), left(left), right(right) {}
};
// 617. Merge Two Binary Trees
c... | ALGO | 0.999865 | 6.489218 |
7dfa4abe-71fb-44a1-abb5-02aaf8583d4d | ishandutta2007/codeforces | rfpermen/normal/1722/B.cpp | #include<bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
template<class A, class B>
ostream& operator<<(ostream& os, const pair<A, B> &p) {
os << '(' << p.first << ',' << p.second << ')';
return os;
}
template<class T>
ostream... | ALGO | 0.999726 | 3.426539 |
8c0c6bca-7d9d-4c59-ab0e-5ee7d162c03f | DmanADYP/cryto-base | src/psbt.cpp | #include <psbt.h>
#include <util/strencodings.h>
PartiallySignedTransaction::PartiallySignedTransaction(const CMutableTransaction& tx) : tx(tx)
{
inputs.resize(tx.vin.size());
outputs.resize(tx.vout.size());
}
bool PartiallySignedTransaction::IsNull() const
{
return !tx && inputs.empty() && outputs.empty(... | TOOL | 0.910231 | 7.281735 |
767091c6-335c-49a7-92e9-b7a26c50bc1d | clinicalml/dgc_predict | matlab/thirdparty/bayesopt/src/kernel_functors.cpp | #include <stdexcept>
#include "log.hpp"
#include "parser.hpp"
#include "ublas_extra.hpp"
#include "kernel_functors.hpp"
#include "kernels/kernel_atomic.hpp"
#include "kernels/kernel_const.hpp"
#include "kernels/kernel_linear.hpp"
#include "kernels/kernel_hamming.hpp"
#include "kernels/kernel_matern.hpp"
#include "kern... | CONFIG | 0.962988 | 7.215826 |
a661d86c-5d9a-41a6-a019-4a9cb0bf356e | mahadi-zulfiker/DS-Exam | Same_or_Not.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
stack<int> s;
queue<int> q;
for (int i = 0; i < n; i++)
{
int val;
cin >> val;
s.push(val);
}
for (int i = 0; i < m; i++)
{
int val;
cin >> val;
q.p... | ALGO | 0.999992 | 3.943841 |
81c3c314-b65c-49f6-b69a-b90ba3a6edd3 | ishandutta2007/codeforces | leileikunle/normal/1519/A.cpp | #pragma GCC optimize(3)
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define ios ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define pb push_back #define po pop_back
#define YES cout<<"YES\n" #define Yes cout<<"Yes\n" #define NO cout<<"NO\n" #define No cout<<"No\n"
#define for00 for(i... | ALGO | 0.999577 | 4.251615 |
8327236e-6cc7-409f-bd5b-cde06928ac11 | SuseelKumarG/cpsolns | J_1_Shoething_Easy_Version.cpp | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, l... | ALGO | 0.999365 | 3.668474 |
a25a6c4f-b062-4f46-afbe-56ccb1144d75 | aman2000jaiswal14/Dynamic_Programming | problem26_evaluate_expression_true_boolean_paranthesis.cpp | #include<bits/stdc++.h>
#include<string>
using namespace std;
int toint(char c)
{return int(c)-48;
}
int solve(string s,int i,int j,int istrue)
{
if(i>j)
return 0;
if(i==j)
{
if(toint(s[i])==istrue)
return 1;
else
return 0;
}
int ans=0;
for(int k=i+1;k<=j-1;k+=2)
{
int lt=solve(s,i,k-1,1); //... | ALGO | 0.999995 | 4.481743 |
3dcc7beb-af8e-4ebb-ad79-01ca7b7df6ec | Emran-Ali/CodeForces | 28_05_2023/1dEsiar.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n,k,ans=0;
cin>>n>>k;
string s; cin>>s;
for(int i=0; i<n; i++)
{
if(s[i]=='B')
{
ans++;
i+=k-1;
}
}
cout<<ans<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
while(t--)
... | ALGO | 0.99978 | 3.910889 |
19939cb4-2209-4db0-8506-4205e3c18f6d | gauravjha0711/DSA | stl/stack.cpp | #include<iostream>
#include<stack>
using namespace std;
int main(){
stack<string> s;
s.push("Gaurav");
s.push("Kumar");
s.push("Jha");
cout<<"before Top: "<<s.top()<<endl;
s.pop();
cout<<"After pop, Top: "<<s.top()<<endl;
cout<<"size: "<<s.size()<<endl;
cout<<"Empty or not: "<<s.emp... | ALGO | 0.895606 | 3.921577 |
914c076d-a891-412c-9e53-3d26ed69d4cb | hariom-nabira/dsa | 1529-max-difference-you-can-get-from-changing-an-integer/1529-max-difference-you-can-get-from-changing-an-integer.cpp | ///cfs
class Solution {
public:
int maxDiff(int num) {
auto replace = [](string& s, char x, char y) {
for (char& digit : s) {
if (digit == x) {
digit = y;
}
}
};
string min_num = to_string(num);
string max_n... | ALGO | 0.99968 | 5.750365 |
fe7b033b-faee-4dd4-97eb-0a17357839a5 | metrixcreate/RepSnapper | Libraries/Boost1.40/libs/regex/tools/generate/tables.cpp | /*
* LOCATION: see http://www.boost.org for most recent version.
* FILE tables.cpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: Generates code snippets programatically, for cut-and
* paste into regex source.
*/
#include <map>
#include <vector>
#include <string>
#i... | TOOL | 0.916625 | 4.254793 |
202c11f3-f95c-4d89-a4b0-8c98fcdee4ce | halogenOS/android_packages_apps_OTAUpdates | jni/boost_1_57_0/libs/spirit/classic/example/fundamental/functor_parser.cpp | #include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/classic_functor_parser.hpp>
#include <boost/spirit/include/classic_assign_actor.hpp>
#include <iostream>
#include <vector>
#include <string>
///////////////////////////////////////////////////////////////////////////////
//
// Demonstrate... | TOOL | 0.865333 | 7.243232 |
cc466010-4711-4566-a49c-11b929187876 | dimkashelk/spbspu-labs-2022-aap-904-a | zhuravlev.ivan/I4/main.cpp | #include <iostream>
#include <cstddef>
#include <fstream>
#include <cstring>
#include "check_input_data.h"
#include "count_rows_with_same_elements.h"
#include "count_max_sum_diag.h"
int main(int argc, char* argv[])
{
if (argc != 4)
{
std::cerr << "condition not met\n";
return 1;
}
std::ifstream input(a... | ALGO | 0.964896 | 5.475223 |
d2e30b2b-f824-44c3-92ae-a782f26fb7d6 | Krythz43/CP-Archieve | codeforces/1166d.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define rep(i,n,z) for(int i=z;i<n;i++)
#define rrep(i,z) for(int i=z;i>=0;i--)
#define lli long long int
#define nl cout<<endl
#define vi vector<int>
#define vlli vector<long long int>
#define umap u... | ALGO | 0.998375 | 3.042139 |
c8615126-f001-44e8-b9a5-8bac69c1951f | bdmariobd/TAIS-2020-UCM | 1.NumeroCasos.cpp |
// Nombre y Apellidos
// Comentario general sobre la solución,
// explicando cómo se resuelve el problema
#include <iostream>
#include <fstream>
#include <...>
#include "..." // propios o los de las estructuras de datos de clase
// función que resuelve el problema
// comentario sobre el coste, O(f(N)), donde N es... | ALGO | 0.914982 | 3.066522 |
bd0adc56-ea20-403f-83e3-83931de1c279 | raincross7/code-similarity | codes/train_code/problem193/problem193_188.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};
void solve() {... | ALGO | 0.999461 | 3.509368 |
e4606de6-5e2a-49ce-9bc9-64cad4d64507 | sm-amoled/AlgorithmPS | 백준/bj_1629_곱셈/bj_1629_곱셈.cpp | #include <iostream>
using namespace std;
long long remains(int A, int B, int C) {
if(B == 1) return A % C;
long long temp = remains(A, B/2, C);
if(B % 2 == 0) {
return (temp*temp) % C;
} else {
return ((temp*temp) % C * A) % C;
}
}
int main() {
int A, B, C;
cin >... | ALGO | 0.999987 | 4.67521 |
0cfbd20e-b236-4864-a8e9-e79d4de4fac8 | raincross7/code-similarity | codes/train_code/problem037/problem037_414.cpp | #include <iostream>
#include <functional>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <map>
#include <iomanip>
#include <complex>
#include <random>
#include <bitset>
#include <list>
// #include <prettyprint.hpp>
using namespace std... | ALGO | 0.999818 | 3.396304 |
cfad82ec-3af9-491b-bf4d-30e2a4a37911 | libriscv/libriscv | lib/libriscv/rvv_instr.cpp | #include "rvv.hpp"
#include "instr_helpers.hpp"
namespace riscv
{
static const char *VOPNAMES[3][64] = {
{"VADD", "???", "VSUB", "VRSUB", "VMINU", "VMIN", "VMAXU", "VMAX", "???", "VAND", "VOR", "VXOR", "VRGATHER", "???", "VSLIDEUP", "VSLIDEDOWN",
"VADC", "VMADC", "VSBC", "VMSBC", "???", "???", "???", "VMERGE", "... | TOOL | 0.875803 | 7.391851 |
2305c091-b3cb-4ed1-8501-1a54cfe2b7e8 | alexandraback/datacollection | solutions_1673486_0/C++/squark/A.cpp | #include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define fi first
#d... | ALGO | 0.999754 | 3.53476 |
03a547b0-f92c-4240-919e-5a651e6b4506 | tianny0078/JointDeformation | joint_deformation/MedicalSurgery/include/eigen/doc/tutorial.cpp | #include <Eigen/Array>
int main(int argc, char *argv[])
{
std::cout.precision(2);
// demo static functions
Eigen::Matrix3f m3 = Eigen::Matrix3f::Random();
Eigen::Matrix4f m4 = Eigen::Matrix4f::Identity();
std::cout << "*** Step 1 ***\nm3:\n" << m3 << "\nm4:\n" << m4 << std::endl;
// demo non-static set.... | TOOL | 0.945769 | 4.17468 |
241b6a52-dfd7-4d0e-b8cb-79836ab097b3 | taoyilee/gem5 | src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage1.cpp | /*****************************************************************************
stage1.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************... | ALGO | 0.981299 | 5.389117 |
ad121aef-71b9-48a9-9fb8-402926ed633b | hgs25/DataStructuresClass | SortArray.cpp | /*
* SortArray.cpp
*
* Created on: Sep 19, 2016
* Author: Juan
*/
//Sorting an array
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n;
cout << "enter array size n:" << endl;
cin >> n;
int a[n];
cout << "enter numbers:" << endl;
for(int i=0; i<n; i++)
{
cin ... | ALGO | 0.997847 | 4.453207 |
38e4cfe9-68a1-4d7e-917f-48b1638a699a | PetricoreCP/CSES | RangeQueries/DynamicRangeSumQueries.cpp | // Range Queries
// Fenwick Tree Sum Queries
// https://cses.fi/problemset/task/1648
#include <bits/stdc++.h>
using namespace std;
template<typename T>
struct FenTree
{
int n;
vector<T> bit;
FenTree(const vector<T>& v)
{
n = v.size() + 1;
bit.resize(n);
for (int i = 1; i < n; ... | ALGO | 0.999937 | 5.512235 |
086c6e8e-2370-4147-9481-a9322b45efcb | swapnil-tayal/DSA | 0310-minimum-height-trees/0310-minimum-height-trees.cpp | class Solution {
public:
vector<int> findMinHeightTrees(int n, vector<vector<int>>& edges) {
if(edges.size() == 1){
return { edges[0][0], edges[0][1] };
}
if(edges.size() == 0) return { 0 };
vector<int> adj[n];
vector<int> inD(n, 0);
for(... | ALGO | 0.999989 | 5.882414 |
28d0b71a-8c90-42c1-9cb4-383c29cfcca3 | ishandutta2007/codeforces | _su1sen/normal/1250/C.cpp | /**
* author: otera
**/
#include<bits/stdc++.h>
using namespace std;
#define int long long
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using int128_t = __int128_t;
#define repa(i, n) for(int i = 0; i < n; ++ i)
#define repb(i, a, b) for(int i = a; i < b; ++ i)
#define repc(i, a,... | ALGO | 0.999979 | 3.699571 |
a328d1ab-966f-40de-ab09-7503af2ddf04 | ishandutta2007/codeforces | mjhun/normal/374/C.cpp | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define INF (1<<20)
#define fore(i,a,b) for(int i=a,to=b;i<to;++i)
using namespace std;
typedef long long ll;
char nx[256];
char b[1204][1024];
int f[1024][1024];
bool s[1024][1024];
int n,m,r;
void dfs(int x, int... | ALGO | 0.999967 | 3.98625 |
7c5130a5-7dae-441a-ad42-031c25f0a4a6 | YoganshWagh/Leetcode | 2351-first-letter-to-appear-twice/2351-first-letter-to-appear-twice.cpp | class Solution {
public:
char repeatedCharacter(string s) {
map<char,int> mp;
for( char x : s )
{
mp[x]++;
if(mp[x]>=2) return x;
}
return 'a';
}
}; | ALGO | 0.999912 | 5.01956 |
e96bd391-f1dc-4dee-8bb2-386245da20d8 | AhmedSakour/Bookly-_app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.99887 | 6.783439 |
0bf2a239-1e98-4f49-b1c6-4993740e609f | 0Kan0/University | IP/Practica_5/Ejercicio_5,15.cpp | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cassert>
using namespace std;
bool find_in_sorted_vector(int val, int v[], int n){
for (int i=0; i<n-1; i++){
for (int j=i+1; j<n; j++){
if (v[i]>v[j]){
int a=v[i];
v[i]=v[j];
v[j]=a;
}
if (v[j]==val){
return true;
}
else{
r... | ALGO | 0.999805 | 4.662583 |
ae189e79-c75b-4150-a280-2daadb7f1321 | yiheng666/leetcode | 921. Minimum Add to Make Parentheses Valid.cpp | class Solution {
public:
int minAddToMakeValid(string s) {
int insert_left = 0,need_right = 0;
for (int i=0;i<s.size();i++){
if (s[i] == '(') need_right++;
else{
need_right--;
if (need_right == -1){
insert_left++;
... | ALGO | 0.999648 | 5.954988 |
905c05dc-7fd8-439f-aa76-521ce6b9473c | freudshow/practice | src/trans.cpp | #include<iostream.h>
using namespace std;
class TransTile
{
public:
char current;
char next;
char input;
TransTile(char C,char I,char Ne){
current = C;
next = Ne;
input = I;
}
};
class DFA
{
public:
//构造状态集各个元素
string States;
char startStates;
string final... | ALGO | 0.99945 | 3.732304 |
e9e1eb5a-b0f3-46a7-98e9-e4d15af34ee0 | freelan-developers/freelan | libs/freelan/src/tools.cpp | /**
* \file tools.cpp
* \author Julien KAUFFMANN <<EMAIL>>
* \brief Generic purposes functions and classes.
*/
#include "tools.hpp"
#include <string>
#include <boost/system/system_error.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#ifdef WINDOWS
#... | TOOL | 0.927138 | 6.36546 |
489d9edb-960c-4a83-8aa9-5f34b5eb57be | big-quantum/all_code | code/p230-(5).cpp | #include<bits/stdc++.h>
using namespace std;
int ans,j;
char s[15],number[15];
int main(){
for(int i=0;i<=12;i++)
s[i]=getchar();
for(int i=0;i<=12;i++){
if(s[i]!='-'){
if(s[i]=='X'){
number[9]=10;
break;
}
number[j]=s[i]-'0';
j++;
if(j!=10) ans=ans+number[j-1]*j;
}
}
ans=ans%11;
if(n... | ALGO | 0.999466 | 3.01201 |
2b1173f6-bc26-4070-9752-838983ade1de | DizzyRicTH/c-112 | C++ practice/14_break_continue.cpp | #include <iostream>
int main()
{
// break = break out the loop "if" it match the condition.
// continue = skip that thing.
//normal "for"
for( int i = 1; i <= 20; i++){
std::cout << i << '\n';
}
std::cout << "------------------------------------------" << '\n';
//next
//with "... | TOOL | 0.904662 | 3.424513 |
a0941a34-bb4e-45fc-9aeb-ae2634679124 | Uroojfatimagithub/OOP | Total numbers.cpp | Exercise 1
Write a program which prompts user to enter a string of text. Once entered, you need to present a
summary of the text in the following manner.
Total number of vowels in the text.
Total number of spaces in the text.
Total number of upper case characters in the text.
Program:
#include "stdafx.h"
#include <iost... | TOOL | 0.997497 | 4.942098 |
69a7f7ad-d98b-4486-adee-d812f75c63af | Sefayet-Alam/New-CP-submissions_vol_3 | B_Turtle_Math_Fast_Three_Task.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
//VVI
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define ll long long
#define ff first
#defi... | ALGO | 0.999787 | 3.966129 |
222526bd-c5a7-4531-8abd-dc3d184777d3 | SChenga39/Practice | nowcoder/KY207_二叉排序树.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 0x3F3F3F3F;
const long long INFLL = 0x3F3F3F3F3F3F3F3F;
#define endl '\n'
#define int long long
void solve();
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);
solve();
return 0;
}
/*
* 描述
输入待插入节点数和 N 个互不相同的正... | ALGO | 0.999936 | 4.26944 |
84483cf0-0b6a-47f9-9081-75b38de61939 | Abhi575k/cache-security-eval-cachefx | CacheFX/crypto/speck.cpp | #include <crypto/speck.h>
#define ROR64(x, r) (((x) >> (r)) | ((x) << (64 - (r))))
#define ROL64(x, r) (((x) << (r)) | ((x) >> (64 - (r))))
#define ROR32(x, r) (((x) >> (r)) | ((x) << (32 - (r))))
#define ROL32(x, r) (((x) << (r)) | ((x) >> (32 - (r))))
#define SPECK128R(x, y, k) ... | ALGO | 0.999607 | 4.022795 |
15048e80-47ba-49ea-a983-c67dd72aa0c4 | yashi2407/Leetcode-Submissions | 3461-find-the-minimum-area-to-cover-all-ones-i/3461-find-the-minimum-area-to-cover-all-ones-i.cpp | class Solution {
public:
int minimumArea(vector<vector<int>>& grid) {
vector<vector<int>>vis(grid.size(),vector<int>(grid[0].size(),false));
int minRow = INT_MAX, minCol = INT_MAX, maxRow = INT_MIN, maxCol = INT_MIN;
for(int i=0;i<grid.size();i++){
for(int j=0;j<grid[0].size();j+... | ALGO | 0.99974 | 6.452854 |
ae95e632-a84f-4b00-80ea-85d4045c9b7f | SWEG-2015EC-Batch/Coding-Geeks | ETS1520_15_Yonas_Eneyew/character identifier.cpp | #include <iostream>
#include <cctype>
bool isUppercase(char ch) {
return std::isupper(ch);
}
bool isLowercase(char ch) {
return std::islower(ch);
}
bool isDigit(char ch) {
return std::isdigit(ch);
}
bool isSpecialChar(char ch) {
return !std::isalnum(ch);
}
bool isVowel(char ch) {
ch = std::tolo... | TOOL | 0.968312 | 5.502917 |
2a282855-93a1-4e36-8321-abd12bd87571 | goropikari/CompetitiveProgramming | atcoder/abc354/e.cpp | // https://atcoder.jp/contests/abc354/tasks/abc354_e
// 2025年07月21日 14時54分22秒
#include <bits/stdc++.h>
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;
// using mint = modint998244353;
// using mint = modint1000000007;
// using vmint = vector<mint>;
// modint::set_mod(10);
// using mint = modi... | ALGO | 0.999984 | 5.597075 |
34db55a5-4c3f-4c87-b93d-1258f68ccb63 | rohan3004/GeeksforGeeks-Solution | Difficulty: Medium/Flood fill Algorithm/flood-fill-algorithm.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void dfs(vector<vector<int>>& image, int sr, int sc, int originalColor, int newColor) {
int n = image.size();
int m = image[0].size();
// Boundary con... | ALGO | 0.985115 | 6.368132 |
bbf9c9f6-e29d-4e13-a3f3-b63c9e695826 | ishandutta2007/codeforces | atoiz/normal/1036/F.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <limits>
#define double long double
using namespace std;
long long powll(long long x, long long p)
{
if (pow(x, p) > 8223372036854775800ll) return 8223372036854775800ll;
long long ans = ... | ALGO | 0.999536 | 4.127174 |
d5a1e446-d148-4847-9117-2b0b71d843c0 | SuryaKshetra/project.github.io | Ravi/fenwick_tree.cpp | ```cpp
#include <iostream>
#include <vector>
using namespace std;
// Fenwick Tree (Binary Indexed Tree) class
class FenwickTree {
public:
FenwickTree(int n) {
// Initialize Fenwick Tree with size n
tree.resize(n + 1, 0); // Index 0 is unused
size = n;
}
// Update the tree with a ... | ALGO | 0.99995 | 7.369855 |
a722a4a4-30a6-4d9f-8ef2-71548b5a61fd | rko0211/codeforces-question-solve | dentist_akoi.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n, k;
cin >> n >> k;
int a[k];
for (int i = 0; i < k; i++)
cin >> a[i];
map<int, int> m;
for (int i = 0; i < k; i++)
{
m[a[i]]++;
}
for (auto &it : m)
{
if (it.second % 2 == 1)
{
n--;
}
}
cout << n << end... | ALGO | 0.999927 | 4.213728 |
3e4418d3-35f5-4562-98c5-a5f7b4398191 | TCGBench/TCGBench | data/problems/problems_canonical/problems_canonical/B3614/6.cpp | #include <bits/stdc++.h>
using namespace std;
stack<unsigned long long int> a;
int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int T;
cin>>T;
while(T--){
int n;
cin>>n;
while(n--){
string p;
cin>>p;
if(p=="push"){
unsigned long long int t;
cin>>t;
a.push(t);
}
if(p=="pop... | ALGO | 0.9792 | 4.355399 |
35618e41-e6cc-4d8c-8262-816dedd227e9 | Cameron-Calpin/Code | src - C++/Recursion/findElementInArray.cpp | #include <iostream>
#include <stdio.h>
#include <ctime>
#include <cstdlib>
using namespace std;
int getIndexInArray(int* array, int elem, int count);
void sortArray(int* array, int count);
bool isSorted(int* array);
void displayArray(int* array);
#define SIZE 5
int main() {
int count = 0;
int findElem;
int getIn... | ALGO | 0.999808 | 4.703173 |
4c7722f8-ce08-44b6-96e8-785b121e73fc | Naman4925/LeetCode | 1678-goal-parser-interpretation/1678-goal-parser-interpretation.cpp | class Solution {
public:
string interpret(string command) {
string ans;
for(int i=0;i<command.size();i++){
if(command[i]=='(' && command[i+1]==')'){
ans+='o';
}
else if(command[i]=='(' && command[i+1]!=')'){
continue;
}
... | ALGO | 0.99971 | 5.166678 |
6bf41c90-17a9-4b83-a130-945a613895d8 | noprops/RRGCodingAndCrypto | cocos2d/cocos/platform/linux/CCDevice-linux.cpp | #include "platform/CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "platform/CCDevice.h"
#include <X11/Xlib.h>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <sstream>
#include <fontconfig/fontconfig.h>
#include "platform/CCFileUtils.h"
#i... | TOOL | 0.902701 | 5.597022 |
02e11538-3461-4edc-8dc3-bbd460f88fbd | Anamicca23/GFG---DSA-code | Difficulty: Medium/Longest subarray with Atmost two distinct integers/longest-subarray-with-atmost-two-distinct-integers.cpp | class Solution {
public:
int totalElements(vector<int> &arr) {
// code here
int n = arr.size();
int i = 0;
unordered_map<int, int> mp;
int res = 0;
int start = 0;
while(i < n){
mp[arr[i]]++;
while(mp.size() > 2){
mp[a... | ALGO | 0.999838 | 5.656815 |
9ff4fd81-c72a-40f8-b735-55e0b923ada9 | mhdnazrul/comparative-programming-solutions | vjudge-solutions/Bootcamp_Fall_24 Week 7 Practice Problems (Level 0)/A-Functions.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define FAST_IO ios::sync_with_stdio(false); cin.tie(nullptr);
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
const ll mod = 1e9 + 7;
void solve() {
vi nums(4);
for(int i=0; i<4; ++i){
cin >> nums[i]... | ALGO | 0.998007 | 4.316143 |
7ee54eed-33e0-4175-a063-5cbce0c18eb6 | Saba-mt/gem5 | src/systemc/tests/systemc/misc/semantic/2.5/T_2_5_1_1.cpp | /*****************************************************************************
T_2_5_1_1.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.945228 | 4.302574 |
86cc7213-f1f0-4f3a-bd3a-490b2b4eb98b | ishandutta2007/codeforces | ngyupeng06/normal/1495/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define mp make_pair
#define pb push_back
ll n, m, arr[100005], l[100005], r[100005], thing;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i=0; i<n; i++){
cin >> arr... | ALGO | 0.999994 | 4.43007 |
68a2ebcc-35fb-4a9a-abd4-19ec6096cbc3 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_11186_2.cpp | #include <bits/stdc++.h>
using namespace std;
long long x[100001][26], sze = 1;
void insert(string &s) {
long long i = 0, v = 0;
while (i < (long long)s.length()) {
if (x[v][s[i] - 'a'] == -1)
v = x[v][s[i++] - 'a'] = sze++;
else
v = x[v][s[i++] - 'a'];
}
}
long long dfs(long long node) {
fo... | ALGO | 0.999997 | 5.246055 |
b851aca5-4843-4ee3-906a-cd1cf3862c21 | sansuiso/LBDReconstruction | src/utils/main_lbd_operator_norms.cpp | #include <iostream>
#include <string>
#include <vector>
#include <getopt.h>
#include <opencv2/opencv.hpp>
#include "ILinearOperator.hpp"
#include "ILBDOperator.hpp"
int main(int argc, char *const *argv)
{
std::vector<std::string> lbdNames;
lbdNames.push_back("Freak");
lbdNames.push_back("Random Freak");
lbdN... | ALGO | 0.982522 | 4.55091 |
02b042ed-e063-4c99-a089-a6a675ddbd93 | pingchungchang/CP | CF1674D.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(){
int n;
cin>>n;
vector<int>v(n);
for(int i = 0;i<n;i++)cin>>v[i];
vector<int>vv = v;
sort(vv.begin(),vv.end());
for(int i = n-2;i>=0;i-=2){
if(v[i]>v[i+1])swap(v[i],v[i+1]);
}
for(int i = 0;i<n;i++){
if(v[i] ... | ALGO | 0.999958 | 4.14713 |
5c805774-cc3e-41d7-9480-69ca4bbfb10e | AramaAnastasya/Tyuiu.AramaAG.Sprint0.c- | Tyuiu.AramaAG.Sprint0.Task4.V2/Tyuiu.AramaAG.Sprint0.Task4.V2.cpp | // Tyuiu.AramaAG.Sprint0.Task4.V2.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <iostream>
#include "../Tyuiu.AramaAG.Sprint0.Task4.V2.Lib/Tyuiu.AramaAG.Sprint0.Task4.V2.Lib.cpp"
using namespace std;
int main()
{
ISprint0Task4* service = new Service1();... | TOOL | 0.979769 | 4.456531 |
ccf55dfc-d38a-4168-b67d-4ade2fe52dcb | orlahyhemmie/Newsapp | 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.998841 | 6.783336 |
74c83dbb-dd03-47e1-99ab-c0dbbefaa547 | Esheta10/LeetCode-Solutions | 0019-remove-nth-node-from-end-of-list/0019-remove-nth-node-from-end-of-list.cpp | /**
* 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:
int lengthOfLinkedLi... | ALGO | 0.999944 | 5.771646 |
598673c4-e6a5-4141-85d9-02229c355508 | marcinr12/FEMproject | FEMproject/jacobiMethod.cpp | #include "jacobiMethod.h"
vector<vector<double>> podzielL(vector<vector<double>> tab)
{
vector<vector<double>> l(tab.size());
//uzupelnij zerami
for (int i = 0; i < tab.size(); i++)
for (int j = 0; j < tab.size(); j++)
l[i].push_back(0);
for (int i = 0; i < tab.size(); i++)
for (int j = 0; j < i; j++)
... | ALGO | 0.999988 | 3.135532 |
03323b5f-f165-40cf-b162-095a287354f3 | kmjp/procon | srm/661-680/671/BearPaints.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<to;x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ZERO(a) memset(a,0,sizeof(a))
#define MINU... | ALGO | 0.99988 | 4.579849 |
b16e4217-af5d-488a-9e32-99ffce0e6579 | yuhan4688/2023aaia3 | week06/week06-2b.cpp | //week06-2b.cpp vector array step3 4
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> a; //step03.vector array
int now;
while(cin >> now){//step01.input
a.push_back(now);//step03.vector array
for(int b:a) cout << b << ' ';
cout << "\n";//step04.print array
//cout << now << ... | ALGO | 0.997408 | 3.31885 |
62a3341a-3256-4baa-89f6-cc8b856929b8 | Syed-56/DSA | Backtracking/Basics/sum-N-nums.cpp | #include <iostream>
using namespace std;
int sumTill(int n) {
if(!n) return n;
return n + sumTill(n-1);
}
int main() {
int n =5;
int sum = sumTill(5);
cout << "Sum of numbers till " << n << " = " << sum;
} | ALGO | 0.999861 | 5.128853 |
0bcd881b-463e-4ef6-8ebc-6176e14e1d79 | SaranshBangar/GeeksforGeeks-Solutions | Difficulty: Basic/longest substring containing '1'/longest-substring-containing-1.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
int maxlength(string s);
int main()
{
int t;
cin>>t;
while(t--)
{
string s;
cin>>s;
cout<<maxlength(s)<<endl;
cout << "~" << "\n";
}
return 0;
}
// } Driver Code Ends
int maxlength( string s)
{
int ans=0;
for (int i=0;i<s.length();i++)
{... | ALGO | 0.998327 | 5.593719 |
2c5ec966-907e-4cda-94e0-a0bca86abd37 | lpryszcz/last | src/alp/njn_random.cpp | /*****************************************************************************
File name: njn_random.cpp
Author: John Spouge
Contents: Additive random number generator
// Modelled after "Algorithm A" in
// D.E. Knuth (1981) The art of computer programming, volume 2, page 27.
// 7/26/90 Warren Gish
***************... | ALGO | 0.998226 | 5.234856 |
9c938d76-cf39-4083-91a3-342e84d0c255 | spad1e/competitive-programming | codeforces/cf1906/H.cpp | #include <bits/stdc++.h>
#define pii pair<int, int>
#define ll long long
using namespace std;
const int MX = 2e5 + 3;
const int MOD = 998244353;
ll dp[26][MX];
ll fac[MX], inv[MX];
ll power(ll a, int b) {
ll res = 1;
for (; b; b>>=1, a=a*a%MOD) if (b&1) res=res*a%MOD;
return res;
}
void initfac() {
fac[0] =... | ALGO | 0.999998 | 5.964558 |
71dace7d-7a2c-4642-827c-96e1f7cbf4c6 | noushinpervez/Contest | Beginner Practice/Summation from 1 to N.cpp | #include <iostream>
using namespace std;
int main()
{
long long N, sum = 0;
cin >> N;
sum = N * (N + 1) / 2;
cout << sum;
return 0;
}
| ALGO | 0.997776 | 4.348538 |
48db743a-54ac-48f0-8d4a-0aa0d46cb256 | rpasta42/OpenGLSuperBible | Src/GLTools/src/math3d.cpp | // math3d.cpp
// Math3D Library, version 0.95
// Implementation file for the Math3d library. The C-Runtime has math.h, these routines
// are meant to suppliment math.h by adding geometry/math routines
// useful for graphics, simulation, and physics applications (3D stuff).
// This library is meant to be useful on Win... | ALGO | 0.997728 | 6.282286 |
fb5aafa1-325d-4252-874a-5bcc636a99e2 | ryanberckmans/topicmapping | Sources/TopicMapping/sig_topics.cpp |
void word_corpus::dotpr_similarity_of_connected_words(map<pair<int, int> , int> & cooc) {
cooc.clear();
RANGE_loop(doc_number, docs_) {
if(doc_number%1000==0 and doc_number!=0){
cout<<"computing word co-occurrences. doc_number::"<<doc_number<<endl;
}
deqii & wn_occs_... | ALGO | 0.998229 | 4.150031 |
d515766f-14ef-403a-a086-9142cae404e9 | Syed-HamzaShah/playground | CountTheNumberOfConsistentStrings.cpp | class Solution
{
public:
int countConsistentStrings(string allowed, vector<string> &words)
{
int ans = 0;
unordered_set<char> s;
for (char ch : allowed)
{
s.insert(ch);
}
for (int i = 0; i < words.size(); i++)
{
bool consistent = t... | ALGO | 0.99984 | 5.890853 |
03ca6799-4190-485a-890d-e11a55d5db54 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_11842_9.cpp | #include <bits/stdc++.h>
using namespace std;
void readi(int &x) {
int v = 0, f = 1;
char c = getchar();
while (!isdigit(c) && c != '-') c = getchar();
if (c == '-')
f = -1;
else
v = v * 10 + c - '0';
while (isdigit(c = getchar())) v = v * 10 + c - '0';
x = v * f;
}
void readll(long long &x) {
l... | ALGO | 0.999977 | 3.815369 |
25e0cc3e-0bc8-4d11-bc8f-ca27a08bf1bd | sumit763/Codsoft | task-3.cpp | #include <iostream>
#include <ctime>
#include <random>
#include <stdlib.h>
using namespace std;
char board[9] = {' ',' ',' ',' ',' ',' ',' ',' ',' '};
void show_board();
void get_X_player_choice();
void get_O_player_choice();
void get_computer_choice();
int count_board(char symbol);
char check_winner();
void compute... | ALGO | 0.992858 | 4.329246 |
b88ba90c-8624-44da-9b2a-3847510fc201 | Luc1d1ty/DataStructures_Algorithms | CPP/problem_solving/cf/practice/546A.cpp | #include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
#define endl "\n"
using namespace std;
int main(void)
{
fastio;
int costOfFirst, currentMoney, totalAmount, totalValue = 0;
cin >> costOfFirst >> currentMoney >> totalAmount;
fo... | ALGO | 0.999825 | 3.499619 |
ab3bc06a-465c-4345-96d8-8cc98444726f | Guhan000/Leetcode-Problems | 448-find-all-numbers-disappeared-in-an-array/448-find-all-numbers-disappeared-in-an-array.cpp | class Solution {
public:
vector<int> findDisappearedNumbers(vector<int>& nums) {
set<int> s;
vector<int> ans;
int ss = nums.size();
for(int i=0;i<ss;i++){
s.insert(nums[i]);
}
for(int i=1;i<=ss;i++){
if(s.find(i)==s.end()){
ans.... | ALGO | 0.999313 | 4.92893 |
0970c5a0-4680-42d3-8179-d6372b576e49 | VShilenkov/AcceleratedCPP | chapter07/exercise09/main.cpp | /**
* @file main.cpp
* @author VShylienkov
* @brief Параграф 07. Упражнение 09. Страница 170.
*
* (Задание повышенной сложности.) Реализация функции nrand, приведенная в
* разделе 7.4.4, не будет работать для аргументов, превышающих значение
* RAND_MAX. Обычно это ограничение — н... | ALGO | 0.997909 | 5.481989 |
43ed54cd-d812-428e-8385-6fd308ffbc5a | QuhiQuhihi/algorithm_test | solutiion/11/3.cpp | #include <bits/stdc++.h>
using namespace std;
string str;
int count0 = 0; // 전부 0으로 바꾸는 경우
int count1 = 0; // 전부 1로 바꾸는 경우
int main(void) {
cin >> str;
// 첫 번째 원소에 대해서 처리
if (str[0] == '1') {
count0 += 1;
}
else {
count1 += 1;
}
// 두 번째 원소부터 모든 원소를 확인하며
for (int i = ... | ALGO | 0.99992 | 5.153126 |
05792b8f-4048-45c8-b355-e871c704b0ba | BibhabenduMukherjee/cppmaster1 | Bit Magic/check_pow_of_4.cpp | #include <bits/stdc++.h>
using namespace std;
// any number is a power of 4 if
// the floor value of (logn/log4) and the ceil
// value of (logn/log4) is equal
///////------0R------///////////
// a) There is only one bit set in the
// binary representation of n (or n is a power of 2)
// b) The count of zero bits be... | ALGO | 0.999343 | 5.314044 |
b0e5dc46-55ab-47db-8a46-96885f27023d | Teddygat0r/CSES | Sorting_And_Searching/Concert_Tickets/Concert_Tickets.cpp | #include <bits/stdc++.h>
using namespace std;
int binaryLess(vector<int> vc, int val)
{
int left = 0;
int right = vc.size();
int result = -1;
while (right > left)
{
int middle = (right + left) / 2;
if (vc[middle] > val)
{
right = middle;
}
else i... | ALGO | 0.999998 | 4.200185 |
2460cf14-132c-45a8-adc7-1cdc8849eec8 | dev-naman2005/CodeOFNaman | Logical_Or_DivisibleBy3and5.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
// int n;
// cout<<"Enter the number: ";
// cin>>n;
// if (n%3==0 and n%5==0)
// // if (n%15==0)
// {
// cout<<"Divisible by 5 and 3";
// }
// else
// {
// cout<<"Not divisible by 5 and ... | ALGO | 0.97488 | 3.430806 |
b95dec89-b497-4099-8b78-71ada81f8074 | dltpal07/algorithm | baekjoon/정렬_1181.cpp | //https://www.acmicpc.net/problem/1181
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
int main(void)
{
int N, len = 1,i=0;
string str, temp;
vector<string> s;
vector<pair<int, string>> comp;
cin >> N;
for (int i = 0; i < N; i++)
{
cin >>... | ALGO | 0.999933 | 4.498351 |
9dc3a9d7-46ce-4402-9b97-a4c29a7a595d | victoragnez/icpc-latin-america-brazil-solutions | 2015 Brazil Subregional/B.cpp | #include <stdio.h>
int main() {
int n, c, ans = 0, b = -0x3f3f3f3f;
scanf("%d%d", &n, &c);
for (int i = 0; i < n; i++) {
int v, pr = ans;
scanf("%d", &v);
if (b + v > ans) ans = b + v;
if (pr - v - c > b) b = pr - v - c;
}
printf("%d\n", ans);
}
| ALGO | 0.999972 | 3.077075 |
16430433-09b4-4a99-b4d3-f17d1e819a51 | wiencko/Practice-Code | Contest Code/Contest_10_25/F_Facts2.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main(int argc, char *argv[]) {
int num;
unsigned long long current;
while(cin >> num){
current = 1;
for(int i=1; i<=num; i++){
current *= i;
while(current%10==0){
current/=10;
... | ALGO | 0.999358 | 4.005416 |
6cacb7af-7a35-45ed-b29c-d2a3545380f3 | MayKoder/Physics-2_Jake_Inferno_Pinball | Fisica-2_Jake_Inferno_Pinball/Box2D/Box2D/Collision/b2Collision.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/b2Distance.h>
void b2WorldManifold::Initialize(const b2Manifold* manifold,
const b2Transform& xfA, float32 radiusA,
const b2Transform& xfB, float32 radiusB)
{
if (manifold->pointCount == 0)
{
return;
}
switch (manifold->type)
{
... | ALGO | 0.998913 | 7.752912 |
ceedd375-025e-4d0c-bb4e-a8050674fa33 | gustialfian/basic-cpp | 5. function-method.cpp | #include <stdio.h>
int varGlobal = 1;
void fungsiPrototype();
int perkalian(int a, int b)
{
return (a*b);
}
int main(){
int varLokal;
// call function
fungsiPrototype();
printf("\n");
varLokal = perkalian(2,2);
printf("fungsi perkalian %i\n", varLokal);
printf("fungsi perkalian %i\n",... | TOOL | 0.910186 | 4.631986 |
2e910475-4107-42c3-a221-70bdafa7ef2c | Soham-KT/Codes | C++/DSA/Babbar/Binary Search Tree/creating_bst.cpp | #include <iostream>
#include <queue>
using namespace std;
class Node{
public:
int val;
Node *left;
Node *right;
Node(int val){
this->val = val;
this->left = nullptr;
this->right = nullptr;
}
};
Node* createBST(Node* root, int data){
... | ALGO | 0.999938 | 5.284419 |
a7d27a03-32ac-42fd-95bd-d720086c912a | ani37/CF-codes | 1138/D.cpp | #include<bits/stdc++.h>
#define LL long long int
#define M 1000000007
#define endl "\n"
#define eps 0.00000001
LL pow(LL a,LL b,LL m){ a%=m;LL x=1,y=a;while(b > 0){if(b%2 == 1){x=(x*y);if(x>m) x%=m;}y = (y*y);if(y>m) y%=m;b /= 2;}return x%m;}
LL gcd(LL a,LL b){if(b==0) return a; else return gcd(b,a%b);}
LL gen(LL start... | ALGO | 0.999996 | 4.324673 |
1d768698-2275-4dea-bc45-e40efa392516 | Factoriall/Algorithm-2021 | Simulation/22251_VillanHosuk.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <algorithm>
using namespace std;
int displayOn[10][7] = { // ִ κ ǥ
{0, 0, 0, 1, 0, 0, 0},
{1, 1, 0, 1, 1, 0, 1},
{0, 1, 0, 0, 0, 1, 0},
{0, 1, 0, 0, 1, 0, 0},
{1, 0, 0, 0, 1, 0, 1},
{0, 0, 1, 0, 1, 0, 0},
{0, 0, 1, 0, 0, 0, 0},
{0, 1, 0, 1, 1, 0, 1},
... | ALGO | 0.999218 | 3.566728 |
823e2dc4-985b-4686-b671-e5a4b8c6be9d | ishandutta2007/codeforces | tob123/normal/1082/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int n = 1e5+10;
int N, M;
vector<int> S[n];
vector<int> R[n];
int main(){
cin.tie(0);
ios_base::sync_with_stdio(false);
cin >> N >> M;
for(int i=0; i<N; i++){
int s, r;
cin >> s >> r;
S[s].push_back(r);
}
for(int i=0; i... | ALGO | 0.999459 | 3.590745 |
bbe0cb66-c133-48ab-b89d-f0b444f27bad | rainlee/wikioi | 1201-最小数和最大数.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
int max,min;
while (cin >> n)
{
int temp;
for (int i = 0; i < n; i++)
{
cin >> temp;
if (0 == i)
{
max = min = temp;
}
else
{... | ALGO | 0.999888 | 3.603816 |
8f542612-cc65-4cd9-8745-c5dadb3593d2 | DurgaVarun/LEETCODE_PROBLEMS | 1917-maximum-average-pass-ratio/1917-maximum-average-pass-ratio.cpp | class Solution {
public:
double maxAverageRatio(vector<vector<int>>& cls, int extra) {
auto gain = [](int p, int t) {
return (double)(p + 1) / (t + 1) - (double)p / t;
};
// Max-heap to store classes by their gain in decreasing order
priority_queue<pair<double, pair<int,... | ALGO | 0.999889 | 6.173479 |
504f9104-b992-494a-b746-55546f5d4ebb | jay-tau/CP | Codeforces/gym/452362/C_Do_the_Magic.cpp | /**
* author: jaytau
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
#define endl "\n"
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define all(x) (x).begin(), (x).e... | ALGO | 0.999754 | 4.743856 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.