uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
35f65772-80b0-422b-82f2-42716d577476 | Abhi-Tom-2004/CodeConverter | C-Plus-Plus-master/graph/bridge_finding_with_tarjan_algorithm.cpp | #include <algorithm> // for min & max
#include <iostream> // for cout
#include <vector> // for std::vector
class Solution {
std::vector<std::vector<int>> graph;
std::vector<int> in_time, out_time;
int timer = 0;
std::vector<std::vector<int>> bridge;
std::vector<bool> visited;
void dfs... | ALGO | 0.999992 | 6.180532 |
d4f2ef1a-ae1a-4784-bb46-f25cca0022c0 | iamslash/learntocode | leetcode/SwiminRisingWater/a.cpp | #include <cstdio>
#include <vector>
#include <queue>
// // 44ms 66.67%
// // 10.1MB 0.00%
// // dijkstra
// // O(N^2lgN) O(N^2)
// class Solution {
// public:
// int swimInWater(std::vector<std::vector<int>>& G) {
// int n = G.size();
// int rslt = std::max(G[0][0], G[n-1][n-1]);
// std::priority_queue<... | ALGO | 0.999858 | 5.803306 |
e0ca3315-69eb-4eff-9604-424277a16698 | welidemezene/CSEC-problem-solved | A_Deletions_of_Two_Adjacent_Letters.cpp | //wolidemedhin_ICPC_mezene
#include <bits/stdc++.h>
using namespace std;
int main() {
// Optimize I/O performance
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin>>t;
while(t--){
string s;
cin>>s;
char c;
cin>>c;
vector<int>nums;
for... | ALGO | 0.999978 | 4.94872 |
9967ade2-f7ce-461f-b2c2-547f64649ff7 | alantao912/autodiff | ComputationGraph.cpp | #define _USE_MATH_DEFINES
#include <cmath>
#include <memory>
#include "ComputationGraph.h"
#include "Parser.h"
ComputationGraph::ComputationGraph(const std::string &input) {
Parser p(input);
std::unique_ptr<ASTNode> root = p.parsePDE();
this->output = consumeNode(root.get(), nullptr);
}
bool ComputationG... | ALGO | 0.999275 | 6.300726 |
904518e2-caea-4a3d-8d5f-a6ea69dc278a | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_5559_7.cpp | #include <bits/stdc++.h>
using namespace std;
const int SIZE = 320;
struct entry {
int u, v, w;
entry() {}
entry(int iu, int iv, int iw) {
u = iu;
v = iv;
w = iw;
}
};
int A[SIZE], B[SIZE];
char g[SIZE][SIZE];
int pre[SIZE][SIZE];
vector<entry> ans;
void push_ans(int u, int v, int w) {
if (w) {
... | ALGO | 0.999984 | 3.629718 |
b45af477-c861-4231-852c-ceb1294d7c5c | MAA1117/DSA | cses/graphs/rooms.cpp | // https://cses.fi/problemset/task/1192
#include <bits/stdc++.h>
using namespace std;
#define SET_IO() ios_base::sync_with_stdio(false), cin.tie(nullptr);
using ll = long long;
void solve() {
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; ++i) {
cin >> v[i];
}
}
int main() {
SET_IO();
... | ALGO | 0.999346 | 5.322488 |
2f8461e3-4555-4d9a-8db5-b36f3d99fe24 | SkynetRTN/radio-cartographer | BackgroundCUDA.cpp | #include "BackgroundCUDA.h"
#include "RCR.h"
#include "Tools.h"
#include "Debugger.h"
#include <iostream>
#include <future>
std::vector<double> clean(Baseline &baseline)
{
baseline.rejectPoints();
baseline.returnPoints();
baseline.setLocalModels();
std::vector<double> results = baseline.getResults();
... | ALGO | 0.960983 | 5.101736 |
43f35fe4-1037-4749-a6e9-0f0a263272d6 | RoshanSharma20/leetcode_answers | 0076-minimum-window-substring/0076-minimum-window-substring.cpp | class Solution {
public:
string minWindow(string s, string t)
{
string ans="";
int res=INT_MAX,x=-1,y=-1;
int start=0,end=0,count=0;
map<char,int> nodes;
for(auto it:t)
nodes[it]+=1;
count=nodes.size();
while(end<s.size())
{
... | ALGO | 0.999986 | 6.327148 |
52c3a2c2-c7ef-4417-99d3-836121fd84e4 | FXLYawa/XCPC-Template | 数据结构/CDQ分治(三维偏序).cpp | #include <bits/stdc++.h>
using namespace std;
#define al(a) (a).begin(),(a).end()
#define lowbit(x) (x&-x)
class tree_array{ //树状数组
public:
vector<int> array;
void add(int pos,int x){}
int ask(int pos){}
};
//主体 三维偏序
struct node... | ALGO | 0.999477 | 3.302431 |
1fa357bb-a0e9-46b9-9727-7126e57d2c82 | Yasg-uru/DSA-practice- | leetcode-submissions/870_Advantage_Shuffle.cpp | class Solution {
public:
vector<int> advantageCount(vector<int>& nums1, vector<int>& nums2) {
//now first we need to create vector with pair for storing particular index with value
vector<int>result(nums1.size(),-1);
vector<pair<int,int>>sortnums;
queue<int>remaining;
for(int... | ALGO | 0.999992 | 5.967018 |
b303f648-a39e-4ba7-adb1-5de0da3e520f | hhh07/multi_nat | ctcdecode/third_party/boost_1_67_0/libs/math/tools/generate_rational_test.cpp | #define BOOST_MATH_POLY_METHOD 0
#define BOOST_MATH_RATIONAL_METHOD 0
#include <boost/random.hpp>
#include <boost/math/tools/rational.hpp>
#include <iostream>
#include <fstream>
#include "mp_t.hpp"
int main()
{
using namespace boost::math;
using namespace boost::math::tools;
static const unsigned max_order ... | TEST | 0.94498 | 5.052736 |
eb7eb906-c9ec-4220-9a4d-0be7efac4b0c | parsa/blaze | blazetest/src/mathtest/operations/dmatdmatmin/SDaMDa.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | TEST | 0.939683 | 7.434881 |
c86f74eb-515b-47d4-a937-8d13b93a9d4b | rpuntaie/c-examples | cpp/algorithm_partial_sort.cpp | /*
g++ --std=c++20 -pthread -o ../_build/cpp/algorithm_partial_sort.exe ./cpp/algorithm_partial_sort.cpp && (cd ../_build/cpp/;./algorithm_partial_sort.exe)
https://en.cppreference.com/w/cpp/algorithm/partial_sort
*/
#include <algorithm>
#include <array>
#include <functional>
#include <iostream>
auto print = [](auto co... | ALGO | 0.9999 | 6.011569 |
ce81073e-a865-4418-a46c-0d3a681864b0 | puras/puras-code | c++/C1-39/demo_2.cpp | //
// Created by puras on 2025/7/27.
//
#include<iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
for (int j = n; j <= m; j++) {
int flag = 1;
if (j <= 1) {
flag = 0;
} else if (j == 2) {
flag = 1;
} else {
for (int i = ... | ALGO | 0.999958 | 3.969855 |
4ea2473a-2a3e-4e9b-a04a-58c94cfdeb8d | borhan008/my-journey-to-cp | Season 1/Sorting/CF948A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t, x;
vector<int> v;
cin >> t;
for(int i=0; i<t; i++){
cin >> x;
v.push_back(x);
}
sort(v.begin(), v.end());
cout << (t%2 == 0 ? v[t/2-1] : v[t/2 ]);
} | ALGO | 0.999926 | 4.493318 |
947abada-ef05-4201-a93f-e714fae779bc | ishandutta2007/codeforces | peterr/normal/1307/A.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 100;
int a[MAXN];
int main()
{
int t;
cin >> t;
while (t--)
{
int n, d;
cin >> n >> d;
fill(a, a + n, 0);
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < d; i++)
{
... | ALGO | 0.999956 | 3.574576 |
3d1b145a-a8db-4148-8d6b-6ead63877b5e | HaibaraAiChan/dgl_range_sampler | third_party/cccl/libcudacxx/libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax.pass.cpp | // <algorithm>
// template<LessThanComparable T>
// pair<const T&, const T&>
// minmax(const T& a, const T& b);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
template <class T>
void
test(const T& a, const T& b, const T& x, const T& y)
{
std::pair<const T&, const T&> p = std::minmax(a, b);... | TEST | 0.968668 | 5.790234 |
8abd9ab9-2c7a-426f-821b-68333260c2f6 | sju1026/CodingTestPractice2 | Code/기본문제 코드 모음/Cpp/BackTracking.cpp | #include <iostream>
#define MAX 9
using namespace std;
/*int n, m;
int rs[MAX] = { 0, };
bool chk[MAX] = { false, };
void Recur(int num) {
if (num == m)
{
for (int i = 0; i < m; i++)
{
cout << rs[i] << ' ';
}
cout << '\n';
return;
}
for (int i = 1; i <= n; i++)
{
if (chk[i] == false)
{
chk[i... | ALGO | 0.99981 | 3.55823 |
94203aac-9765-4a97-8511-276277d2eb02 | AparaV/project-euler | Problem 009/Problem_009.cpp | /**Problem 9: Find Special Pythagorean Triplet
**@author Aparajithan Venkateswaran
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
//check whether given 3 numbers are a Pythagorean triplet
bool isPythTriplet(int a, int b, int c){
std::vector<int> myVector = {a, b, c};
std::sor... | ALGO | 0.999922 | 4.439515 |
f52d2069-2e3f-4472-a1cb-d9e10a6abaf5 | nazalnihad/DSA | Sorting/quick_sort.cpp | #include <iostream>
using namespace std;
int sort(int arr[], int low, int high)
{
int pivot = arr[high];
int i = low - 1;
for (int j = low; j <= high - 1; j++)
{
if (arr[j] < pivot)
{
i++;
swap(arr[i], arr[j]);
}
}
swap(arr[i + 1], arr[high]);
... | ALGO | 0.999929 | 5.145504 |
d8acc12d-f126-4b73-a491-e4d084b92c23 | Tamim0133/CP_Resources | Data_structures/Heap/01_Insert_delete_getMax_in_Heap.cpp | #include <bits/stdc++.h>
using namespace std;
class MaxHeap
{
public:
vector<int> v;
MaxHeap()
{
}
// Complete Binary tree er height Logn so complexity O(logn)
void upHeapify(int i)
{
while (i > 0 and v[i] > v[(i - 1) / 2])
{
swap(v[i], v[(i - 1) / 2]);
... | ALGO | 0.999428 | 4.499135 |
8cbbc6e0-791d-4b7c-a1b1-fac2152cf985 | MaciejWisniewskiK/CF24 | edu162/e.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
void dfs1(const vector<vi> &graph, vi &tree_siz, vi &big_son, int w, int fat) {
tree_siz[w] = 1;
for (int s : graph[w]) {
... | ALGO | 0.999932 | 4.78897 |
e26cdfb2-9280-479b-92c1-bd25b7e629ad | IEcheandia/remarkable | Filter_LineTracking/parallelMaximum.cpp | /*!
* @copyright Precitec Vision GmbH & Co. KG
* @author Simon Hilsenbeck (HS)
* @date 2010-2011
* @file
*/
#include "parallelMaximum.h"
#include <system/platform.h> ///< global and platform specific defines
#include <system/tools.h> ///< debug assert integrity assumptions
#include "module/moduleLo... | ALGO | 0.969573 | 5.734505 |
27949780-d7b9-4d7f-bd35-1c126e6e94ca | ivanchuchulski/fmi-data-structures-and-algorithms | homeworks/hw4/dsa-hw4-t2-brute.cpp | #include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
using std::cout;
using std::cin;
using int64 = long long int;
class NumPair
{
public:
int _first;
int _second;
NumPair() = default;
NumPair(const NumPair& other) = default;
~NumPair() = default;
NumPair& operator=(const NumPair& othe... | ALGO | 0.999924 | 3.700683 |
129a6a12-b145-4f0b-9342-4acca7693775 | abhinav8925/Codeforces-Solutions | Ten Words of Wisdom .cpp |
/*
***** !!!!! JAI SHREE KRISHNA !!!!! *****
Date -> 21st July 2023
Code by - Abhinav Anand
Problem link -> https://codeforces.com/contest/1850/problem/B
*/
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define ll long long int
#define endl "\n"
using namespace std;
int N=1000001;
vec... | ALGO | 0.999906 | 4.900899 |
c17702cd-5e9d-4425-86c3-1ffe8249cb15 | Domperazzo/muoni | Misura_velocita/distribuzione_tempi.cpp | /*
c++ -o distribuzione_tempi distribuzione_tempi.cpp `root-config --glibs --cflags`
./distribuzione_tempi 9.5cm
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cmath>
#include <vector>
#include "TApplication.h"
#include "TCanvas.h"
#include "TGraphErrors.h"
#include "TH1F.h"... | DATA | 0.909574 | 3.835784 |
4f3320f5-c400-4151-a51d-66db443edf74 | ZaBarudo/tiny-gpu-lang-backend | libcxx/src/hash.cpp | #include <__hash_table>
#include <algorithm>
#include <stdexcept>
#include <type_traits>
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wtautological-constant-out-of-range-compare")
_LIBCPP_BEGIN_NAMESPACE_STD
namespace {
// handle all next_prime(i) for i in [1, 210), special case 0
const unsigned small_primes[] = {
0, 2... | ALGO | 0.999139 | 6.935822 |
cf0dbe66-454c-4aaa-8d3f-07dbbcd5d8b2 | realharryhero/newllvmproject | llvm/lib/CodeGen/MachinePostDominators.cpp | #include "llvm/CodeGen/MachinePostDominators.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/GenericDomTreeConstruction.h"
using namespace llvm;
namespace llvm {
template class DominatorTreeBase<MachineBasicBlock, true>; // PostDomTreeBase
namespace DomTreeBuilder {
template void Calculate<MBBPostDomTr... | ALGO | 0.99896 | 7.661369 |
63962589-53db-4c19-af46-2ceaff349934 | Uday-Berad22/GFG-questions | Medium/Count of distinct substrings/count-of-distinct-substrings.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
int countDistinctSubstring(string s);
int main()
{
int t,l,i,j;
int temp;
cin>>t;
while(t--){
string s;
cin>>s;
cout<<countDistinctSubstring(s)<<endl;
}
}
// } Driver Code Ends
/*You are required to complete this method */
class Node... | ALGO | 0.999948 | 6.299147 |
a54427be-17eb-4977-8695-d3e4e7974f9e | ashirwadsangwan/DS-and-Algos---UCSD | Algorithmic-Toolbox/w4_divCon/2_majority_element/majority_element.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using std::vector;
int get_majority_element(vector<int> &a, int left, int right) {
if (left == right) return -1;
if (left + 1 == right) return a[left];
//write your code here
return -1;
}
int main() {
int n;
std::cin >> n;
vector<int> a(n);
f... | ALGO | 0.99995 | 4.436155 |
609b0002-5537-47d2-8a2b-5c03e7de2332 | PanduDcau/Cpp-C--Projects | Birthday Algo/Algo KMP Birthday Pi.cpp | #include<iostream>
#include<bits/stdc++.h>
#include<fstream>
#include<cstdio>
#include<conio.h>
#include<string.h>
#include <sstream>
#include<vector>
#include<algorithm>
#include <iostream>
#include <string>
using namespace std;
void computeLPSprefix(int M, int* prefix,char* pat); //KMP Algorithm
int main()
{ ... | ALGO | 0.993709 | 3.012165 |
bcf0505e-879a-40e3-82a4-24cc2aed6f45 | baisefengchelll/codelearning | code/datastruct/sqstack/hanoi.cpp | #include <iostream>
using namespace std;
void towersOfHanoi(int n, int x, int y, int z){
// 把塔x顶部的n个碟子移到塔y,用塔z作为中转地
if(n>0){
towersOfHanoi(n-1, x, z, y);
cout << "Move top disk from tower " << x
<< " to top of tower " << y <<endl;
towersOfHanoi(n-1, z, y, x);
}
}
int main(... | ALGO | 0.999664 | 5.066701 |
d468fcc5-2779-4999-901b-a18ec9eeba02 | seanxdonovan/Crypto | Core/fs.lib/Hash.cpp | #include "precomp.h"
#include "declarations.h"
#include "Hash.h"
namespace fs
{
// Thomas Wang's 64 bit Mix Function
// href="http://www.concentric.net/~Ttwang/tech/inthash.htm"
#if 0
qword Hash(qword key)
{
key += ~(key << 32);
key ^= (key >> 22);
key += ~(key << 13);
key ^= (key >> 8);
key += (key << ... | ALGO | 0.936725 | 5.180372 |
91ddae05-f8b7-45aa-b116-4de51d2faa36 | jonasvdd/GPU-programming | GPU_3/filters/Histogram_CPU.cpp | // Created by jonas on 16.05.18.
#include "Histogram_CPU.h"
#include <cmath>
#define BYTE_RANGE 255
//unsigned char keepInBounds(int value){
// value = std::max(0, value);
// return (unsigned char) std::min(255, value);
//}
Image *Filters::HistogramCPU::Filter(Image *sourceImageOne) {
Image *destinationI... | ALGO | 0.961175 | 5.040769 |
6c255e79-35e8-4a11-a647-99a008d291d6 | ptquanh/leetcode-cpp-practices | 1579. Remove Max Number of Edges to Keep Graph Fully Traversable.cpp | //Union find
//originally thought as a graph problem
//hint: Always use Type 3 edges first, and connect the still isolated ones using other edges.
//Runtime: 1236 ms, faster than 75.00% of C++ online submissions for Remove Max Number of Edges to Keep Graph Fully Traversable.
//Memory Usage: 139 MB, less than 50.00% of ... | ALGO | 0.999917 | 5.555622 |
faa6c3e6-a1e2-420b-8f88-aab3079f7e3a | rishig1030/cpp-problems | binarytree/rootToNode.cpp | // find the path from root to node
#include<iostream>
#include<vector>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int data){
this->data = data;
this->left = NULL;
this->right = NULL;
}
};
Node* buildtree(Node* root){
cout<<"Ente... | ALGO | 0.999989 | 4.137586 |
0151037a-8bd7-4162-a9a6-838915284632 | Hidra27zz/DSA_Leetcode_exercise | LL: Interview_Leetcode Exercise/Binary to Decimal/LinkedList.cpp | #include <iostream>
using namespace std;
class Node {
public:
int value;
Node* next;
Node(int value) {
this->value = value;
next = nullptr;
}
};
class LinkedList {
private:
Node* head;
int length;
public:
LinkedList(... | ALGO | 0.999677 | 5.184175 |
8d654687-d8fa-4166-9ba2-65c2098bc3bf | ishandutta2007/codeforces | alon-tanay/normal/1704/B.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using ll = long long;
using ld = long double;
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
#define f first
#define s second
#define... | ALGO | 0.999854 | 4.867994 |
dd128dab-d120-4bfe-84ba-e6984f07993f | IsseiMori/AtCoder | abc128/mainC.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> light_switches(M, 0);
for ( auto& switches : light_switches ) {
int k;
cin >> k;
for ( int i = 0; i < k; i++ ) {
int s;
cin >> s;
s... | ALGO | 0.999971 | 4.735015 |
41a816a3-dac7-4b47-ad17-407c1405dd64 | AjithAj2125/DSA_GFG | Array/check_if_sum_exist.cpp | //Given an array find if sum exist for a given k sonsecutive elements
#include <iostream>
#include <algorithm>
using namespace std;
int findsum(int a[], int k, int s, int n)
{
int curr_sum = 0, i, ma;
for (i = 0; i < k; i++)
curr_sum = curr_sum + a[i];
for (i = k; i < n; i++)
{
curr_sum = curr_sum + a[i] - a[i ... | ALGO | 0.999143 | 3.819691 |
d94cf375-a97f-471a-bfaa-b188bdf781c4 | AGM16/Game_Car_Fisica_3D | Physics3D_class6 - solution/Bullet/src/BulletSoftBody/btSoftSoftCollisionAlgorithm.cpp | #include "btSoftSoftCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionShapes/btBoxShape.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletSoftBody/btSoftBodySolvers.h"
#include "btSoftBody.h"
#include "BulletCo... | ALGO | 0.993456 | 3.784431 |
1bf239fe-f7d6-43cc-83d0-2ad6de85719c | Seungchan0325/baekjoon | solutions/20191_2.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 987654321;
int n, m;
int cache[1'000'005];
string s, t;
int solve(int start) {
if(start == n) return 0;
int& ret = cache[start];
if(ret != -1) return ret;
int last = 0;
while(t[last] != s[start] && last < m) last++;
if(last == m)... | ALGO | 0.999984 | 4.658628 |
ca3ef954-9ade-4d04-8871-6d18ba3be270 | ishandutta2007/codeforces | tzxydby/normal/555/C.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=4000005;
struct seg
{
int tr[N],lc[N],rc[N],c=1,rt=1;
void update(int &k,int l,int r,int a,int b,int v)
{
if(a>b)
return;
if(!k) k=++c;
if(l==a&&r==b)
{
tr[k]=max(tr[k],v);
return;
}
int mid=l+r>>1;
if(b<=mid) update(lc[k],l,mid,a,b,v);
... | ALGO | 0.999881 | 5.097833 |
cca853ff-c922-400d-bc27-395eed62fc0b | SrCiruelo/Android_C-_Game | box2d/libraries/box2d/code/Box2D/Collision/b2CollideEdge.cpp | #include <Box2D/Collision/b2Collision.h>
#include <Box2D/Collision/Shapes/b2CircleShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <Box2D/Collision/Shapes/b2PolygonShape.h>
// Compute contact points for edge versus circle.
// This accounts for edge connectivity.
void b2CollideEdgeAndCircle(b2Manifold*... | ALGO | 0.999786 | 7.524832 |
33467c98-d79d-4db3-b67c-ed7eb5fb8dd3 | alexandraback/datacollection | solutions_1484496_0/C++/chEEtah/C.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
int n, m;
int nt;
int a[1000];
map<int, int> was;
int main()
{
scanf("%d", &nt);
for(int tt = 1; tt <= nt; tt++)
{
printf("Case #%d:\n", tt);
scanf("%d", &n);
for(int i = 0; i <... | ALGO | 0.9992 | 3.722202 |
cf8588d9-4a7d-49ae-8e5f-30c55b82136c | Mominul36/problem-Solving | LightOJ/Dimik OJ/Number Disaster.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
for(int i=1;i<=t;i++)
{
long long n,sum=0;
cin>>n;
while(n)
{
sum=(sum*10) +(n%10);
n/=10;
}
cout<<sum<<endl;
}
}
| ALGO | 0.999912 | 4.690573 |
fe0d610a-1970-41bf-bccc-55e74c2a9300 | boatinw99/CompetitiveProgramming | Codeforces/1269B.cpp | #include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
typedef pair<int,int> pii ;
#define mid (l+r>>1)
#define fi first
#define se second
const int N = 2e3+9 , mod = 1e9+7 ;
int n,m ;
int a[N],b[N];
int match(int add)
{
vector<int> A,B ;
for(int i=1;i<=n;i++)A.push_back((a[i]+add)%m),B.push_ba... | ALGO | 0.999994 | 4.689291 |
b82b96ed-b15a-4bc9-bd27-a721c9d3bb76 | demianespinosar/CompetitiveProgrammingProblems | HackerRank/Algorithms/Warmup/A Very Big Sum.cpp | #include <cstdio>
using namespace std;
long long ans, A, N;
int main(){
int i;
scanf("%lld", &N);
for(i = 1, ans = 0; i <= N; i++){
scanf("%lld", &A);
ans += A;
}
printf("%lld", ans);
}
| ALGO | 0.998995 | 3.206528 |
b9c051b5-dc59-4ba1-a977-609c85b4007a | jesushilarioh/DelMarCSi.cpp | SourceCode/Chapter 19/Pr19-6.cpp | // This program demonstrates a recursive function
// that calculates Fibonacci numbers.
#include <iostream>
using namespace std;
// Function prototype
int fib(int);
int main()
{
cout << "The first 10 Fibonacci numbers are:\n";
for (int x = 0; x < 10; x++)
cout << fib(x) << " ";
cout << endl;
return ... | ALGO | 0.999831 | 6.677697 |
35276308-252b-4eb9-ad4d-18a5d8366860 | anagorko/zpk2014 | home/PluszowyMis/z1/pro.cpp | #include<iostream>
using namespace std;
int main(){
unsigned int a, b, c;
cin >> a >> b >> c;
cout << a*b*c << endl;
cout << 2 * (a*b + a*c + b*c);
}
| ALGO | 0.999807 | 3.812917 |
2cc5d660-4362-421b-96fd-ea724f0fc945 | TheFenrisLycaon/DSA-C-- | cp/CodeForces/0900-0999/977A (1).cpp | //code by Nikhil Nagrale
//nikhilnagrale2 on EveryPlatform
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
while(k--){
if(n%10==0) n/=10;
else n--;
}
cout<<n<<endl;
return 0;
} | ALGO | 0.999692 | 3.28623 |
041255a6-cc1a-4c6f-8d5a-7a65bff6f3e3 | WillianYe/Multi-robot-dispatch-platform | server_ws/src/thirdparty/menge_vendor/src/Menge/MengeCore/resources/Graph.cpp | #include "MengeCore/resources/Graph.h"
#include "MengeCore/Agents/BaseAgent.h"
#include "MengeCore/Agents/SpatialQueries/SpatialQuery.h"
#include "MengeCore/BFSM/Goals/Goal.h"
#include "MengeCore/Core.h"
#include "MengeCore/resources/GraphEdge.h"
#include "MengeCore/resources/MinHeap.h"
#include "MengeCore/resources/R... | ALGO | 0.975502 | 6.738952 |
85e19ec0-522c-42e3-a7d3-fa623f111298 | kogehipo/atcoder | ABC001-200/B問題/abc028_b.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main()
{
string S; cin >> S;
vector<int> ans(6, 0);
rep(i, S.size()) {
ans[S[i]-'A']++;
}
rep(i, 6) {
if (i != 0) cout << " ";
cout << ans[i];
}
... | ALGO | 0.999865 | 3.748955 |
b23f87e4-dab9-4a30-b6c8-3c4cf6b7443e | SadmanHafizShuvo21/Schaum-s_Outline_of_Theory_and_Problems_of_Data_Structures_Seymour | Chapter 7/Chapter 7/Algo_01.cpp | #include<bits/stdc++.h>
using namespace std;
class node{
public :
int data;
node* left;
node* right;
node(int val) :
data(val), left(nullptr), right(nullptr) {}
};
void preorderTraversal(node* root){
if (root == nullptr){
return;
}
cout << root->data << " ";
preorderTr... | ALGO | 0.999987 | 5.539944 |
5ab61be3-8974-41fb-a696-3052bfb4e5ac | Sreehari0o4/Beecrowd_beginner_cpp_solutions | 1049.cpp | /*In this problem, your job is to read three Portuguese words. These words define an animal according to the table below, from left to right. After, print the chosen animal defined by these three words.
Input
The input contains 3 words, one by line, that will be used to identify the animal, according to the above tabl... | ALGO | 0.986202 | 5.10211 |
44432419-2f23-4169-97c8-5805ebff6b7f | abhinavaggarwal018/C-- | Fill Sudoku backtracking.cpp | #include<iostream>
using namespace std;
int sud[9][9]={0};
bool is_safe(int x, int y, int c)
{
for(int i=0;i<9;i++)
if(sud[x][i]==c || sud[i][y]==c)
return false;
return true;
}
bool fill_sudoku(int cnt)
{
if(cnt==81)
{
for(int i=0;i<9;i++)
{
for(int j=0;j<9;j++)
cout<<sud[i][j]<<" ";
... | ALGO | 0.998904 | 4.865478 |
efb98882-a63b-421d-a0e9-dbbb824d338f | Badhansen/UVa | 10496 - Collecting Beepers.cpp | #include<cstdio>
#include<iomanip>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<deque>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map... | ALGO | 0.999639 | 3.816058 |
5c8399eb-9a85-4877-9910-9b4b7f0393b8 | AdityaNarayan05/Leetcode-Solved-Questions | 1431-kids-with-the-greatest-number-of-candies/1431-kids-with-the-greatest-number-of-candies.cpp | class Solution {
public:
vector<bool> kidsWithCandies(vector<int>& candies, int extraCandies){
vector<bool> res;
int maxCand = *max_element(candies.begin(), candies.end());
for(int i=0; i < candies.size(); i++){
res.push_back(candies[i]+extraCandies >= maxCand);
... | ALGO | 0.999948 | 6.020973 |
27373b38-a994-4439-8df9-51a98730a2c2 | cpp-at-ariel/cpp-5779 | 11-stl-algorithms/15-runes/X_if.cpp | /**
* Demonstrates STL _if rune.
*
* @author Erel Segal-Halevi
* @since 2019-05
*/
#include <iostream>
#include <iterator>
#include <algorithm>
#include <vector>
#include <array>
#include "output_containers.hpp"
using namespace std;
int main() {
vector<int> v{4,6,8,5,4,1,3,1,4,0};
cout << "v = " << v << e... | ALGO | 0.937738 | 3.745393 |
ae4e177a-a2d3-436c-a674-90efe322ec5b | rm3d0nc4/estrutura_de_dados_i | 15_exercicio_cap8/insertion_sort.cpp | #include <iostream>
void insere(int elemento, int vetor [], int posicao) {
while (posicao > 0 && elemento < vetor[posicao-1]) {
vetor[posicao] = vetor[posicao-1];
posicao--;
}
vetor[posicao] = elemento;
}
void insertionSort(int vetor[], int tamanho) {
for(int i = 0; i < tamanho; i++) {... | ALGO | 0.999746 | 5.37181 |
8694ca24-d5f1-4413-89d5-f205b915507e | minhduc5a15/utc_code | Cpp/thuhoachcachua.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n, k;
cin >> n >> k;
vector<int> arr(n);
for (int i = 0; i < n; ++i) {
cin >> arr[i];
}
sort(arr.begin(), a... | ALGO | 0.999822 | 3.860834 |
ea3a971a-680f-4045-af83-3e5aec553ae7 | YT330113/TOP_FLUID | mathHelp.cpp | double Min(double d1, double d2) {
return d1<d2 ? d1 : d2;
}
double Max(double d1, double d2) {
return d1>d2 ? d1 : d2;
}
int Min(int d1, int d2) {
return d1<d2 ? d1 : d2;
}
int Max(int d1, int d2) {
return d1>d2 ? d1 : d2;
}
double Abs(double d1) {
return d1>0 ? d1 : -1.0*d1;
}
scalar diff(volScalarField gam... | ALGO | 0.999741 | 4.962193 |
fef7adac-93f5-485a-a140-e017da3fca80 | ValeevGroup/tiledarray | examples/gemm/ta_eigen.cpp | #include <TiledArray/util/time.h>
#include <tiledarray.h>
#include <iostream>
int main(int argc, char** argv) {
// Get command line arguments
if (argc < 2) {
std::cout << "Usage: " << argv[0] << " matrix_size [repetitions]\n";
return 0;
}
const long matrix_size = atol(argv[1]);
if (matrix_size <= 0) ... | ALGO | 0.922691 | 5.220869 |
f68da1b5-e068-4884-bd5e-64567767a5b1 | Duonghbtt/CODEPTIT | PTIT-Source-main/SPOJ PTIT/P191PROB.cpp | // https://www.spoj.com/PTIT/problems/P191PROB/
// P191PROB - Problem B - Tổng hai số
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
vector<int> v(n);
for (int i = 0; i < n; i++)
{
cin >> v[i];
}
int count = 0;
for (int i = 0; i < n - 1; i++... | ALGO | 0.999993 | 5.1122 |
278d3daa-0126-419e-ad3c-5e4fb327f4ee | edwinpaye/C-practice | Condicionales.cpp | #include <stdio.h>
void auxiliarUno(int *a, int *b, int *c, int *d){
int auxiliar;
printf("Ingrese los votos del partido Uno: ");
scanf("%d", &auxiliar);
*a = auxiliar + *a;
printf("Ingrese los votos del partido Dos: ");
scanf("%d", &auxiliar);
*b = auxiliar + *b;
printf("Ingrese los vo... | ALGO | 0.995737 | 3.728728 |
b773959d-c778-4513-8439-c44786a83624 | arpan595jain/DSA | Leetcode 2751.cpp | class Solution {
public:
vector<int> survivedRobotsHealths(vector<int>& positions, vector<int>& healths, string directions) {
int n = positions.size();
vector<vector<int>> robots;
for (int i = 0; i < n; ++i) {
robots.push_back({positions[i], healths[i], directions[i], i});
... | ALGO | 0.999981 | 6.312618 |
8a0de947-7cbf-4204-b1f0-0acd0516c644 | harshagarwal94/C-double-plus-and-C-program-files | saksham.cpp | #include <iostream>
using namespace std;
int main() {
int a=29, b=8, lcm;
if(a>b)
lcm = a;
else
lcm = b;
while(1) {
if( lcm%a==0 && lcm%b==0 ) {
cout<<"The LCM of "<<a<<" and "<<b<<" is "<<lcm;
break;
}
lcm++;
}
return 0;
}
| ALGO | 0.999892 | 3.993834 |
06ee2c54-1f55-4e0e-9754-72037b6bbdc1 | SwatiRanjangit/CPP_DSA_PRACTICE | Character_Arrays/printAllPrifexes.cpp | #include<iostream>
#include<cstring>
using namespace std;
void printAllPrefixes(char arr[]){
for(int i=0; arr[i] != '\0'; i++){
for(int j=0; j <= i; j++){
cout<<arr[j];
}cout<<endl;
}
}
int main(){
char arr[100];
cin.getline(arr,20);
printAllPrefixes(arr);
return 0;... | ALGO | 0.998902 | 3.595657 |
c838bbc1-fdf1-4e2b-8fc4-3769393ffe9e | wszhhx/Algorithm-Practice | 算法练习/PAT甲级-List Sorting (25)/List Sorting (25).cpp | #include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
typedef struct{
int ID;
char name[9];
int grade;
}STU;
bool sort_id(STU stu1, STU stu2){
return stu1.ID < stu2.ID;
}
bool sort_name(STU stu1, STU stu2){
if(strcmp(stu1.name,stu2.name) == 0)
return stu1.ID < stu2.ID;
else{
if(strcm... | ALGO | 0.999625 | 3.626404 |
be200a28-fe5d-4cdc-8391-d26c263739c8 | ishandutta2007/codeforces | qwqcorz/normal/55/D.cpp | #include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2")
#define ll long long
using namespace std;
const int N=2525;
const int M=50;
const int p=2520;
ll read()
{
ll s=0;
char c=getchar(),lc='+';
while (c<'0'||'9'<c) lc=c,c=getchar();
while ('0'<=c&&c<='9') s=s*10+c-'0',c=getchar();
... | ALGO | 0.999379 | 4.21206 |
1ce17d17-98d5-46a3-be96-8b1666faab0c | dingdingye/GIM_Model_Scaling | digits_vectorized_spec_backprop/layer.cpp | #include <iostream>
#include <vector>
#include <cassert>
#include <cmath>
#include <algorithm>
#include <iomanip> // for std::setw (nice formatting)
#include "layer.h"
#include "activations.h"
void print2D(const std::vector<std::vector<double> >& matrix)
{
for (const auto& row : matrix) {
for (auto val :... | ALGO | 0.999717 | 6.499216 |
18490478-c844-4791-8b40-0f430e5d0747 | yuforest/contests | abc_060/c/c.cpp | // g++ -o a.out a.cpp -std=c++17
// oj d https://atcoder.jp/contests/abc222/tasks/abc222_a
// oj t -c "./a.out"
// oj s https://atcoder.jp/contests/abc222/tasks/abc222_a c.cpp
#include <bits/stdc++.h>
using namespace std;
int n, k;
int c[300005];
map<int, int> mp;
long long mod = 1000000007;
#define rep(i, n) for (int... | ALGO | 0.999937 | 4.254165 |
455f5811-52f4-456a-a5a6-210b7b84b449 | vortechron/cpp-tutorial | SimpleTodoList.cpp | #include <iostream> // to use cin or cout
#include <stdlib.h> // general library
#include <string.h> // to use string related function
#include <stdio.h>
using namespace std;
struct task
{
char name[100];
struct extra{
int priority;
}info;
struct task *next;
};
// initialize global variable
task *head = NU... | ALGO | 0.999093 | 4.210844 |
9a92bc47-6611-487d-884d-92c5192d8a22 | tradecraftio/mergemine | src/rpc/server.cpp | #include <config/bitcoin-config.h> // IWYU pragma: keep
#include <rpc/server.h>
#include <common/args.h>
#include <common/system.h>
#include <logging.h>
#include <node/context.h>
#include <rpc/server_util.h>
#include <rpc/util.h>
#include <sync.h>
#include <util/signalinterrupt.h>
#include <util/strencodings.h>
#incl... | WEB | 0.948498 | 7.097447 |
35954bbd-2774-4100-9240-97cce8e5f1dd | dnr2/maratona | Livearchive ACM ICPC/2439 - Balanced Races.cpp | //https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=342&page=show_problem&problem=440
//#tag binary search
//#sol do a binary search on the answer and test if it's big enough on the sorted input.
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cstdl... | ALGO | 0.999685 | 3.504948 |
4338cfcb-495e-4fef-a0f4-e4dea9f90285 | ssysarch/orient | code/oclumency.cpp | vector <layer> oOcclu (ifstream* infile, NN NNnetw)
{
int netwSize = NNnetw.net.size();
int prect = 100;
vector <layer> PPML;
for (int i=0; i<netwSize; i++)
{
PPML.push_back(layer());
PPML[i].layer_type = NNnetw.net[i].layer_type;
}
for (int i=0; i<netwSize; i++)
{
if(PPML[i].layer_type == LI){
PP... | ALGO | 0.999149 | 3.200831 |
7af317d2-edb6-4550-a167-6bab7e5dc602 | shyam2520/DSA | 208-implement-trie-prefix-tree/208-implement-trie-prefix-tree.cpp | class Trie {
unordered_map<char,Trie*> dict;
bool eod;
Trie* curr;
public:
Trie() {
// curr=new Trie();
curr=this;
eod=false;
// return curr;
}
void insert(string word) {
// cout<<curr<<endl;
Trie* temp=curr;
for(auto& i:word)
... | ALGO | 0.999767 | 5.696385 |
61db74df-f297-4992-91c3-1e6539513caa | iotauth/iotauth_experiments | lib/node-v7.6.0/deps/icu-small/source/tools/toolutil/package.cpp | #include "unicode/utypes.h"
#include "unicode/putil.h"
#include "unicode/udata.h"
#include "cstring.h"
#include "uarrsort.h"
#include "ucmndata.h"
#include "udataswp.h"
#include "swapimpl.h"
#include "toolutil.h"
#include "package.h"
#include "cmemory.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
stat... | TOOL | 0.851008 | 5.005419 |
3f8251a5-e0a6-4c83-a63b-db4abdca41bb | Rakibul-Hassan-1/XPSC_Batch_03 | Problems/Week 3/Day 02/A_Odd_Divisor.cpp | //....................................<In the name of Allah>...............................//
//.................................<Bismillahir Rahmanir Rahim>...................................//
// Author : Rakibul Hassan
#include <bits/stdc++.h>
#define ll long long int
#define ull unsigned ll
#define vi vector<int>... | ALGO | 0.999615 | 5.104591 |
d51161b7-11fc-460b-b725-85f963fa127a | Gokulk1994/Highway-Driving-Path-Planning | src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_maxnorm.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
MatrixXf mat(2,4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
MatrixXf::Index maxIndex;
float maxNorm = mat.colwise().sum().maxCoeff(&maxIndex);
std::cout << "Maximum sum at position " << maxIndex << std:... | ALGO | 0.999774 | 4.220459 |
776228c7-2dcb-4f8f-a365-ea63ffae3fc0 | suzushi-tw/Uni-level-c-c-leetcode-practice | coding_july/binary_tree_class.cpp | #include<stdio.h>
#include<iostream>
#include<vector>
using namespace std;
class TreeNode{
public:
int num;
TreeNode *left;
TreeNode *right;
TreeNode *parent;
TreeNode(){
num=0;
left=right=parent=NULL;
}
TreeNode(int k){
n... | ALGO | 0.999893 | 4.371751 |
a4255d75-1a0b-4896-a8fe-4388b4c9323d | athuls/RL_Soar | Fall2011/boost_1_46_0/libs/graph/example/edge-iter-constructor.cpp | using namespace boost;
template < typename T >
std::istream & operator >> (std::istream & in, std::pair < T, T > &p) {
in >> p.first >> p.second;
return in;
}
int
main()
{
typedef adjacency_list <
listS, // Store out-edges of each vertex in a std::list
vecS, //... | ALGO | 0.986832 | 5.199588 |
71b4d0ec-923d-4944-a20e-8d271281c1df | ropensci/melt | src/test_multiple_hypotheses.cpp | #include "test_multiple_hypotheses_utils.h"
#include "utils.h"
#include "EL.h"
#include <RcppEigen.h>
#include <string>
#include <vector>
// [[Rcpp::export]]
Rcpp::List test_multiple_hypotheses(const double alpha,
const Eigen::Map<Eigen::VectorXi> &q,
... | TEST | 0.969309 | 4.341687 |
951974e8-68f1-4724-8723-5b4e8080761a | floreaadrian/AlgCodes | SPOJ/TRICENTR.cpp | #include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
int main()
{
int t;
double a, b, c, da, db, dc, s, r, m;
cin>>t;
while(t--)
{
cin>>a>>da>>db>>dc;
s = 3.0*a*da/2.0;
b = 2.0*s/3.0/db;
c = 2.0*s/3.0/dc;
r = a*b*c/4.0/s;
m = 4.0*(r*r-(a*a+b*b+c*c)/9.0);
m = (m<0.0) ? 0.0 :... | ALGO | 0.998918 | 3.465986 |
b8e69ae5-6c5a-406c-afc9-f053a96b92cc | vvviktor/LeetCode_Problems | 1326_Minimum_Number_of_Taps_to_Open_to_Water_a_Garden/sort_solution.cpp | #include <cstdlib>
#include <queue>
#include <vector>
class Solution {
public:
int minTaps(int n, std::vector<int>& ranges) {
auto comp = [](const std::pair<int, int>& lhs,
const std::pair<int, int>& rhs) -> bool {
return lhs.first > rhs.first;
};
std::... | ALGO | 0.999986 | 5.83174 |
a4af3e4c-9de2-46c3-8de6-f12a58ac47a8 | hftor/DataStructures-BugsAndAnts | INHERITANCE AND POLYMORPHISM./INHERITANCE AND POLYMORPHISM./Bug.cpp | #include "Bug.h"
#include "World.h"
using namespace std;
Bug::Bug(World* aWorld, int xcoord, int ycoord) : Organism(aWorld, xcoord, ycoord){
myMoves = 0;
notEatenRounds = 0;
}
char Bug::representation() const{
return 'X';
}
OrganismType Bug::getType() const{
return BUG;
}
int Bug::size() const{
r... | TOOL | 0.92964 | 4.206395 |
c1ea8897-5adc-4fe1-9927-97a78afca0fb | dycforever/program | algo/3sum.cpp | #include <assert.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <vector>
#include <iterator>
#include <functional>
using namespace std;
template <typename T>
void PRINT_ELEMENTS(T coll){
copy(coll.begin(), coll.end(), ostream_iterator<typename T::value_type>(cout, " "));
cout << endl;
... | ALGO | 0.999949 | 5.020092 |
be71ba6a-3f65-49f8-aabe-828e4a0b6cb0 | munna516/Online-Judge | CODECHEF/TLG.cpp | #include <iostream>
using namespace std;
int main()
{
int round, x = 0, y = 0, sub;
cin >> round;
for (int i = 1; i <= round; i++)
{
int a, b;
cin >> a >> b;
x += a;
y += b;
if (x > y)
{
sub = x - y;
}
else
{
sub = y - x;
}
}
return 0;
} | ALGO | 0.999928 | 3.37242 |
e5f2119d-03fb-445a-ae8b-b298415e56ed | 2281940985/DataStruct | Sort/insertion_sort.cpp | #include<iostream>
#include<vector>
using namespace std;
//δѡһԪأԪԪһȽϴСԪز뵽ȷλá
void InsertionSort(vector<int> &nums)
{
for(int i = 1; i < nums.size(); ++i)
{
int base = nums[i];
int j = i - 1;
while (j >= 0 && base < nums[j])//ÿһֶѾõұԪؽбȽϣΪұԪ
//ԪСֱӽԪƣұ߱ȽϣԴֱȽϵbaseСԪأʱӦýbaseڸԪصҲ
... | ALGO | 0.999907 | 4.872367 |
a4487065-1b41-448f-b37e-c22a9ff2c23c | psallwixx/lab04.1 | lab04.1/4.1.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int k, N, i;
double S;
cout << "k = "; cin >> k;
cout << "N = "; cin >> N;
S = 0;
i = k;
while (i <= N)
{
S += (sin(cos(1. * i))) / (1 + cos(1. * i) * cos(1. * i));
i++;
}
cout << S << endl;
S = 0;
i = k;
do {
S += (sin(cos(1. ... | ALGO | 0.999537 | 3.537575 |
9a0d1c04-0ff7-4019-812c-9e5103df0195 | os-moussao/problem-setting | Hard/max-min-pair-diff/solution/max_min_pair_diff.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n; cin >> n;
int a[n];
for (int &i: a) cin >> i;
sort(a, a+n);
int ans = 1e9;
for (int i = 0; i < n/2; i++) {
ans = min(ans, a[i+n/2]-a[i]);
}
cout << ans;
} | ALGO | 0.99993 | 3.800431 |
4921accb-73a7-42c6-84ab-727663946169 | suchita03probuz6/formulaes | BINARY.CPP | #include<stdio.h>
#include<conio.h>
#include<iostream.h>
class binoper
{ public :
int a,b;
public :
void set(int x,int y)
{
a=x;
b=y;
}
void operator +(binoper cob2)
{
int c = a+ cob2.a;
int d = b+cob2.b;
cout<<c<<d;
}
void display()
{
cout<<a<<b;
} };
int main()
{ ... | ALGO | 0.863458 | 4.380291 |
9aa72e84-1bca-4b6f-ad28-22997a24ec31 | UraraO/some-simple-sample | backup/LRU_Cache.cpp |
#include <iostream>
#include <vector>
#include <unordered_map>
#include <list>
#include <chrono>
using namespace std;
// 使用自己设计的链表实现,普通LRU
class LRUCache {
public:
LRUCache(int capacity) : cap(capacity), m_umap(), m_list() {}
void m_push(int key, int val) {
node* pnode = new node(key, val);
m_umap[key] = pno... | ALGO | 0.996072 | 5.615067 |
e94985dd-d3b4-4415-a7d6-38a46d64f1f5 | has2/Problem-Solving | boj/Tree/Segment/BOJ6549.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
using namespace std;
typedef long long ll;
const ll inf = numeric_limits<ll>::max();
vector<ll> rec;
vector<int> segtree;
int maketree(int l, int r, int cur_node) {
int m = (l+r)/2;
if (l == r) return segtree[cur_node]... | ALGO | 0.999384 | 4.282081 |
327716cd-a25a-4390-8f9d-d3b128e20862 | mauriceyeng/2021SummerTrainingCPP | coding/Array/arrayreverse.cpp | #include<bits/stdc++.h>
using namespace std;
void reverses(string& st){
int n=st.length();
for(int i=0;i<n/2;i++)
{
swap(st[i],st[n-i-1]);
}
}
int main(){
string st;
cout<<"Enter string: ";
cin>>st;
reverses(st);
cout<<st;
return 0;
} | ALGO | 0.999301 | 4.997497 |
6de475c4-dfb5-45c3-8573-cd4fef0e610f | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_7242_1.cpp | #include <bits/stdc++.h>
using namespace std;
long long M = 100001;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
string s;
cin >> s;
vector<char> v;
for (long long i = 0; i < s.length(); i++) {
v.push_back((char)s[i]);
}
long long c, m = M;
c = count(v.begin(), v... | ALGO | 0.999142 | 3.961127 |
77e8f74f-66ac-4c1e-8b8e-27f5110972fb | lclpsoz/competitive-programming | ARCHIVE/uri/5-math/1212.cpp | #include <bits/stdc++.h>
using namespace std;
typedef struct _numb{
char str[15];
int size;
} Numb;
int i, j, k;
Numb a, b;
int val, qnt, carry, big;
char res[15];
int main (){
scanf("%s %s", a.str, b.str);
while (a.str[0] != '0' || b.str[0] != '0'){
qnt = 0;
carry = 0;
a.size = strlen(a.str);
b.size... | ALGO | 0.999714 | 3.690167 |
7d7a5252-5084-4a6b-b475-4e352b399de8 | jcardoso13/DVC | Code/testMatrixMult.cpp | //import custom libraries
#include "versat.hpp"
//import c libraries
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#if nVI > 0 && nVO > 0
// Use Xreads and xwrites instead of nMEM
#define IO_VERSAT 1
extern versat_t *FPGA_mem;
#else
#define IO_VERSAT 0
#endif
#defi... | TOOL | 0.899334 | 3.468812 |
562027f5-fb63-41bd-a10b-c585f9a30dcc | KylerM-23/Univeristy-Lectures | ECE1310-C-Programming/Exercise 61-80/Exercise 70-1/Exercise 70/Exercise 70.cpp | #include <iostream>
using namespace std;
int function(int n)
{
if (n == 0)
{
return -1;
}
else if (n == 1)
{
return 2;
}
else
{
return function(n - 1) + 3 * function(n - 2);
}
}
void main()
{
cout << function(3)<<"\n";
}
| ALGO | 0.99971 | 4.627243 |
4f573b4d-0ddc-4379-8d98-91517e266498 | bigmtn1113/Baekjoon | BOJ_10818/10818.cpp | #include <iostream>
using namespace std;
int main() {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int N, num;
int max = -0x7fffffff, min = 0x7fffffff;
cin >> N;
for (int i = 0; i < N; i++) {
cin >> num;
if (num > max)
max = num;
if (num < min)
min = num;
}
cout << min << " " << max;
} | ALGO | 0.999976 | 4.28898 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.