uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
864d0961-0a08-464c-8a9e-466704d3b321 | 0x4248/GPT-code-repository | repository/1115/code.cpp | #include <iostream>
#include <cmath>
#include <cstdlib>
using namespace std;
typedef unsigned long long ull;
ull gcd(ull a, ull b) {
if (b == 0) {
return a;
}
else {
return gcd(b, a % b);
}
}
ull modPow(ull base, ull exp, ull mod) {
ull result = 1;
base = base % mod;
while... | ALGO | 0.999611 | 4.737144 |
2e33bda4-e6e9-43c4-a54e-a789efa9fe76 | tx995976/codes_daily | contest_code/whut/whut@2/l.cpp | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
#include<queue>
#include<vector>
int _mod = 1919810;
std::unordered_map<std::string,int> hash;
std::vector<int> pos[11];
long long dp[11];
int n,m;
int hash_id = 1;
int main(){
std::string word;
scanf(" %d %d",&n,&m);
for(int... | ALGO | 0.999959 | 4.139797 |
e753ff25-104e-4f50-9c89-66f8a1825461 | realshak7781/Interview_DS_Algo | Heaps/2593. Find Score of an Array After Marking All Elements.cpp | using ll = long long;
class Solution {
private:
ll approach2(vector<int>&nums){
int n=nums.size();
vector<bool> vis(n,false);
vector<vector<ll>> arr;
for(int i=0;i<n;i++){
arr.push_back({nums[i],i});
}
sort(arr.begin(),arr.end());
ll score=0;
for(int i=0;i<n;i++){
ll ... | ALGO | 0.999995 | 5.046612 |
e98bf32c-b6e1-44b4-9a68-e530b118c4ac | haozx1997/C | 计算几何/poj 2826.cpp | //http://blog.sina.com.cn/s/blog_71dbfe2e0101f7zb.html
//http://dev.gameres.com/Program/Abstract/Geometry.htm#ʸĸ
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<stdlib.h>
#include<math.h>
using namespace std;
const double eps=1e-8;
#define zero(x) (((x) > 0 ? (x) : (-x)) < eps)
do... | ALGO | 0.999375 | 3.91048 |
566dfc6c-caf5-4ae3-9566-fb3b2aea72e9 | Shakti184/LEETCODE | Easy/Sum of dependencies in a graph/sum-of-dependencies-in-a-graph.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int sumOfDependencies(vector<int> adj[], int V) {
// code here
int ans=0;
for(int i=0;i<V;i++){
a... | ALGO | 0.999952 | 6.156307 |
0fa45b95-ee8b-487a-ac07-5eeee2926adb | hydra-Cody/CpTemplates | code1.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 LagaKar ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#defin... | ALGO | 0.999417 | 4.274473 |
1bcc60b7-0c49-4ac3-adf9-82ffc4f83bb5 | knknkn1162/ant_competitive_solution | 2.3.8.1/abc011_4_101.cpp | #include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstd... | ALGO | 0.998639 | 3.811196 |
7f5f8383-2233-4eea-9e65-89dfd6e98c31 | minSsan/algorithm | 삼성SW역량기출/240921/[24.09.21]2021상반기(오후1번).cpp | // https://www.acmicpc.net/problem/21610
#include <iostream>
#include <vector>
using namespace std;
int n, m;
int dr[9] = {0, 0, -1, -1, -1, 0, 1, 1, 1};
int dc[9] = {0, -1, -1, 0, 1, 1, 1, 0, -1};
int water[50][50];
vector<pair<int, int>> clouds;
bool is_valid(int row, int col) {
return row >= 0 && row < n &... | ALGO | 0.999257 | 5.471261 |
c239a35a-2900-43f2-a402-8ea130ae613e | mohamadzah/Milestone-2 | StringReverser.cpp | //
// Created by zahalka on 15/01/2020.
//
#include "StringReverser.h"
#include "algorithm"
StringReverser::StringReverser() = default;
/**
* reverse string
* @param pr
* @return string reversed.
*/
string StringReverser::solve(string pr) {
string temp = pr;
//reverse the string and send back.
reverse... | ALGO | 0.992537 | 4.229581 |
db5af58d-3ef2-4bcc-ae0b-ac8ce6800abf | suchacutesnake/pat | 1001.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int a, b, result;
cin >> a >> b;
result = a + b;
string output = to_string(result);
if(output.length() > 3) {
if(output[output.length() - 4] != '-') {
output.insert(output.length() - 3, ",");
}
}
... | ALGO | 0.998524 | 4.974965 |
0322e9c1-8eb8-4731-8a1f-500582cbf7e2 | mahdihasnat/2-1-kodes | DSA/Assignment 8 on Disjoint Set Union/solution.cpp | #include<iostream>
using namespace std;
class DisjSet
{
int *Rank, *Parent,n;
public:
DisjSet(int n):n(n)
{
Rank = new int [n+1];
Parent = new int [n+1];
for(int i=0; i<=n; i++) Parent[i]=-1 ;
}
void MakeSet(int x)
{
if(x>n)
{
cout<<x <<" out ... | ALGO | 0.988762 | 3.674887 |
69db7aa4-78aa-470d-9bc4-43c32eb75fe4 | dodofaf/olymp | netoi/2022/round_1/castle2022/castle2022.cpp | #include <iostream>
#include <list>
#include <vector>
using namespace std;
int main()
{
int n, m;
cin>>n>>m;
vector<list<int>> in(n), out(n);
for (int i=0;i<m;++i) {
int x, y;
cin>>x>>y;
x--;
y--;
out[x].push_back(y);
in[y].push_back(x);
}
for (int i=0;i<n;++i) {
if (in[i].empty() && !out[i].empty... | ALGO | 0.999947 | 4.030093 |
55e6da58-346d-4469-b093-4e101a163f60 | cdherreram/cpp_aprendiendo | debugging/overUnderFlow.cpp | #include <cmath> // math.h math.cpp
#include <cstdlib> // stdlib.h
#include <iostream>
int main(int argc, char **argv) {
std::cout.precision(16);
std::cout.setf(std::ios::scientific);
double under = 1.0, over = 1.0;
int N = std::atoi(argv[1]);
std::cout << "N \t under \t\t\t\t over" << std::endl;
f... | ALGO | 0.980631 | 4.177993 |
9be296a7-5fe1-458e-82cc-ff177bc96fcd | bhara2104/competitive-programming | code_forces/halloumi_boxes.cpp | // https://codeforces.com/contest/1903/problem/A
#include<iostream>
#include<vector>
using namespace std ;
int main(){
int test ;
cin >> test ;
while(test--){
int a , b ;
cin >> a >> b ;
vector<int> vec ;
for(int i = 0 ; i < a ; i++){
int temp ;
cin >> temp ;
vec.push_back(temp) ;
}
bool... | ALGO | 0.999946 | 4.481709 |
13c9bbf1-968f-46a4-bebe-81e79e4d466c | utkarshsp206/DSA | Strings/ReverseWords.cpp | //! LeetCode Problem : 151. Reverse Words in a String
#include<bits/stdc++.h>
using namespace std;
string reverseWords(string s) {
string result;
int i=0;
int n=s.length();
while(i<n){
while(i<n && s[i]==' ') i++;
if(i>=n) break;
int j=i+1;
... | ALGO | 0.999931 | 5.218203 |
fcdf65ce-c419-47f0-8512-e8edf43a43e7 | ojusvini/DAA-Codes | daaaa/prims.cpp | #include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
struct node
{
struct node *left,*right,*parent;
int w,i,f;
};
void heapify(struct node *ctr)
{
if(ctr -> left == NULL)
return ;
else
{
heapify(ctr->left);
if((ctr -> left)-> w < ctr -> w)
{
swap((ctr -> left)-> w,ctr->w);
... | ALGO | 0.999952 | 3.228988 |
4166d99c-9bd2-454b-9315-829513a0ae82 | Whaleman0423/c_plus_practice | ntu_cool_class_basic/10.6_範圍型迴圈與泛型迭代函式/range_loops_and_generic_iterators_3.cpp | #include <iostream>
using namespace std;
int main() {
int v[5] = {1, 2, 3, 4, 5};
// for (auto p = begin(v); p != end(v); p++){
for (int* p = &v[0]; p != &v[5]; p++){ // 等同於此行
int n = *p;
cout << n << " ";
}
return 0;
} | ALGO | 0.986352 | 3.270669 |
5d6ead2e-d487-4102-bc1b-82ba08862d45 | basecode-lang/basecode | share/prototypes/bootstrap-redux/ext/boost-1.70.0/libs/contract/example/features/introduction_public.cpp | #include <boost/contract.hpp>
#include <vector>
#include <cassert>
template<typename T>
class pushable { // Somewhat arbitrary base (used just to show subcontracting).
public:
void invariant() const {
BOOST_CONTRACT_ASSERT(capacity() <= max_size());
}
virtual void push_back(T const& value,
... | TOOL | 0.861245 | 6.127324 |
61adcb53-9d73-43f9-b84e-cf4f690fe442 | shobhitgupta2570/LeetCode-DSA | graph/1857LargColValInADirecGraph.cpp | // class Solution {
// public:
// int largestPathValue(string colors, vector<vector<int>>& edges) {
// int n = colors.size();
// vector<vector<int>> adj(n);
// vector<int> indegree(n,0);
// for(auto &it : edges){
// adj[it[0]].push_back(it[1]);
// indegree[it[... | ALGO | 0.99877 | 5.901898 |
d459ad40-3d90-46b1-94e6-170dc1f8bf5f | khan9t2zishan/gfg-potd | 2024/04 - April/17-04-2024.cpp | /*
Author : Zishan Khan
Date : 17/04/2024
Problem : Count Pairs in an Array
Difficulty : Hard
Problem Link : https://www.geeksforgeeks.org/problems/count-pairs-in-an-array4145/1
*/
//{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
#include <ext/pb_ds/assoc_container.hpp>
#... | ALGO | 0.999835 | 6.204915 |
7cce12be-9754-4ba6-b533-958066efc861 | pbzweihander/computer_programming | final_exam/sorting_pairs/src/final_02.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
typedef struct {
char name[129];
int grade;
} Student;
int compare_with_name(const Student* a, const Student* b) {
int s = strcmp(a->name, b->name);
if (s == 0)
return a->grade - b->grade;
return s;
}
int compa... | ALGO | 0.999482 | 5.105141 |
ea7ee237-6663-404e-98aa-c1b78a20dd24 | sleeyax/cronet-binaries | src/third_party/libc++abi/src/src/fallback_malloc.cpp | #include "fallback_malloc.h"
#include <__threading_support>
#ifndef _LIBCXXABI_HAS_NO_THREADS
#if defined(__ELF__) && defined(_LIBCXXABI_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")
#endif
#endif
#include <__memory/aligned_alloc.h>
#include <assert.h>
#include <stdlib.h> // for malloc, calloc, free
#include <str... | TOOL | 0.940871 | 7.641335 |
9114dbb4-6ec4-4551-910d-f3ec9f026a78 | eunbi9n/Algorithm | Programmers/lv1/최대공약수와_최소공배수/eunbikim.cpp | // int getLCM(int large, int small) {
// for (int i = 1; i < INT_MAX / large; i++) {
// if ((large * i) % small == 0)
// return large * i;
// }
// }
#include <vector>
#include <cmath>
#include <climits>
using namespace std;
int getGCD(int n, int m) {
int max = 1;
if (n > m)
... | ALGO | 0.999807 | 6.025848 |
9bf974d7-831d-4f27-909d-7b7e08ca57a5 | hal-uw/gpu_variability_sc22_artifact | sec5c_lammps/src/pair_beck.cpp | /* ----------------------------------------------------------------------
Contributing author: Jonathan Zimmerman (Sandia)
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "pair_beck.h"
#include "atom.h"
#include "comm.h"
... | ALGO | 0.999018 | 6.5913 |
76b9e456-4b04-4335-abe2-0db4d2138069 | urashima0429/keipro_practice | atcoder/abc/abc179/c.cpp | #include <iostream>
using namespace std;
typedef long long ll;
int main() {
ll N, res = 0;
cin >> N;
for (ll i = 1; i < N; ++i){
res += (N / i) + (N % i ? 0 : -1);
}
cout << res << endl;
return 0;
} | ALGO | 0.999946 | 3.622334 |
b6f9cabf-3d27-491b-adcd-a9ad3d4d6feb | Wbrta/ACM | 2016安徽省赛/纸上谈兵.cpp | #include <queue>
#include <stack>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int n, m, k;
namespace NetworkFlow {
const int maxn = 505;
const int maxm = 100005;
const int INF = 0x3f3f3f3f;
typedef struct node {
int v, cap, nxt;
node(int a = 0, int b ... | ALGO | 0.999931 | 3.825409 |
6e322625-c308-4d72-a7d4-f1eca74e2f74 | ByteWizard-018/Object-Oriented-programming-Lab | 7. IIT Madras InstaInfluencer Fest '25/code.cpp | #include <bits/stdc++.h>
using namespace std;
class customsort
{
public:
bool operator()(pair<int, int> a, pair<int, int> b)
{
return a.second > b.second; // custom sort for sorting
}
};
class GraphAlgorithm
{
// private:
public:
int no_of_events;
int no_of... | ALGO | 0.99991 | 4.686056 |
a706ee49-c460-4970-bdc0-4cb2b554345a | elixered/leetcode | 1351-count-negative-numbers-in-a-sorted-matrix/1351-count-negative-numbers-in-a-sorted-matrix.cpp | class Solution {
public:
int countNegatives(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
int i = 0;
int j = n-1;
int ans = 0;
while(i<m && j>=0)
{
if(grid[i][j]<0)
{
ans += m-i;
... | ALGO | 0.999996 | 6.312102 |
b676ddf2-8623-4695-be4a-b782b848276d | ishandutta2007/codeforces | natsugiri/normal/508/E.cpp | #include<stack>
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c... | ALGO | 0.999916 | 3.915721 |
32f346a1-c14c-45cb-ba9d-a9c1d9890829 | hjiang13/LLMs-in-IR | POJ-104/90/93.cpp | #include <iostream>
using namespace std;
void main()
{
int t,m,n,i;
int way(int x,int y);
cin >> "%d",&t);
for(i=1; i<=t; i++)
{
cin >> "%d %d",&m,&n);
cout << "%d\n",way(m,n));
}
}
int way(int x,int y)
{
int m,n;
m=x; n=y;
if(x==1||y==1||x==0)
return(1);
else if(x<y)
return(way(x,x));
else
return(way(x-y,y)+way(x,y-1)... | ALGO | 0.999821 | 3.618711 |
1b86ca9d-cdff-44d1-9eb9-96642f36d716 | cofls6581/AlgorithmCPP | 홍단알/BOJ9095.cpp | /*
BOJ9095
<1, 2, 3 더하기>
문제
정수 4를 1, 2, 3의 합으로 나타내는 방법은 총 7가지가 있다. 합을 나타낼 때는 수를 1개 이상 사용해야 한다.
1+1+1+1
1+1+2
1+2+1
2+1+1
2+2
1+3
3+1
정수 n이 주어졌을 때, n을 1, 2, 3의 합으로 나타내는 방법의 수를 구하는 프로그램을 작성하시오.
*/
#include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(0); cin.tie(NULL);
int dp[12] = { 0,... | ALGO | 0.999918 | 4.417524 |
2410a030-abe4-414d-bed2-280062757374 | Vineet2511SRM/CPP | WEEK1 TUTORIAL/Question4.cpp | #include <iostream>
using namespace std;
int main()
{
int a, b, c, d;
cout << "Enter first fraction : ";
char slash; // To consume the slash ("/") character
cin >> a >> slash >> b;
cout << "Enter second fraction : ";
cin >> c >> slash >> d;
int numerator = a * c;
int denominator = b *... | ALGO | 0.994677 | 5.472876 |
b7b70c1c-ed37-4dbc-a10b-82d3f9d9a2ab | ishandutta2007/codeforces | krk/normal/618/E.cpp | #include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long double ld;
typedef pair <ld, ld> ldld;
const int Maxn = 300005;
const int Maxd = 3;
const int Maxm = 2097152;
const ld pi = acos(-1.0l);
struct matrix {
ld m[Maxd][Maxd];
matrix(int diag = 0) {
fill((ld*)m, (ld*)m + Maxd *... | ALGO | 0.999836 | 4.032103 |
5064d0df-827f-4841-af38-9e84503e2a2a | lhlalyl/leetcode | 917_仅仅反转字母/test.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
string s{};
string s1;
int j = s.size() - 1;
for (int i = 0; i < s.size(); i++)
{
if ((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z'))
{
if ((s[j] >= 'a' && s[j] <= 'z') || (s[j] >= 'A' && s[j] <= 'Z'))
s1.push_back(s[j... | ALGO | 0.999767 | 4.024625 |
0eb1cd5f-8cb2-437d-bc10-283864dd1c88 | thecreatorsir/DailyDSA | Array/two-repeated-elements.cpp | #include<bits/stdc++.h>
using namespace std;
void func(vector<int> v, int n) {
int var = 0;
for (int i = 0; i < n + 2; i++) {
var = abs(v[i]);
if (v[var - 1] < 0) {
cout << var << " ";
}
else {
v[var - 1] = -v[var - 1];
}
}
c... | ALGO | 0.999872 | 4.170791 |
4455954b-520a-4054-9b60-090b4e6bbfbb | Nancy-2310/Some-Important-DSA-problems | removeduplicates1.cpp | #include<bits/stdc++.h>
#include <bits/stl_iterator.h>
#include<iostream>
using namespace std;
void removeduplicates(int arr[],int n){
set <int> st;
for(int i=0;i<n;i++){
st.insert(arr[i]);
}
int index=0;
for(auto it:st){
arr[index]=it;
index++;
}
int k=st.size();
... | ALGO | 0.99978 | 4.213963 |
720b440a-891e-4f72-8af1-4e773c1a2448 | XibinZ/ddpg1 | src/cpp/flyBall.cpp | //
// This function updates continuous states using the ODE4 fixed-step
// solver algorithm
//
void flyBall::rt_ertODEUpdateContinuousStates(RTWSolverInfo *si )
{
time_T t { rtsiGetT(si) };
time_T tnew { rtsiGetSolverStopTime(si) };
time_T h { rtsiGetStepSize(si) };
real_T *x { rtsiGetContStates(si) };
OD... | ALGO | 0.999942 | 5.939816 |
a0a58002-55f0-4400-8a8c-3eb85fbedba8 | teochaban/royalblue | Algorithms/matrixexponentiation.cpp | #include <bits/stdc++.h>
#define MAXN 100100
#define DIM 2
#define pii pair<int, int>
#define pb push_back
typedef long long ll;
using namespace std;
ll mod = 1e9 + 7;
struct matrix{
ll a[DIM][DIM];
matrix(){
memset(a, 0, sizeof(ll) * DIM * DIM);
}
void init(){
a[0][0] = 0; a[0][1] = 1;
a[1][0] = 1; a[1][1... | ALGO | 0.999969 | 3.869879 |
5a775fb2-3b2a-4c0b-a28d-5f4a340a0ace | iffyaiyan/pid_control_project | src/PID.cpp | #include "PID.h"
#include <limits>
using namespace std;
/*
* TODO: Complete the PID class.
*/
PID::PID() {}
PID::~PID() {}
void PID::Init(double Kp_, double Ki_, double Kd_,PID_Type pid_type_)
{
Kp=Kp_;
Ki=Ki_;
Kd=Kd_;
prev_cte=0.0;
cte_i=0.0;
pid_type=pid_type_;
for (int i=0;i<3;i++)
{
p[i]=0.0;
dp[i... | ALGO | 0.92488 | 5.067895 |
611fd226-89c3-4317-9148-3332fe7736b8 | PotapovaSofia/DIHT-MIPT | Parallel_programming/fft/2var/main.cpp | #include <iostream>
#include <vector>
#include "FFT.h"
int main() {
int n, m, x;
std::vector<int> a;
std::vector<int> b;
std::cin >> n >> m;
for (int i = 0; i < n; i++) {
std::cin >> x;
a.push_back(x);
}
for (int i = 0; i < m; i++) {
std::cin >> x;
b.push_back(x);
}
std::vector<int> c = multiply(a, ... | ALGO | 0.999985 | 3.222445 |
c7fdb6b8-6331-419f-aca1-3939932a133d | Soubhik752blaze/DSA | Trees/Binary Search Trees/recoverBST.cpp | // Question :- Given the root of a binary search tree with 2 nodes swapped, fix it and print it.
#include <bits/stdc++.h>
using namespace std;
class node
{
public:
int val;
node *left;
node *right;
};
node* first; // first violation
node* previous; // to keep track of last node occ... | ALGO | 0.999997 | 5.549243 |
a7ffa182-dbc6-418d-aeb9-d2ffa522ce65 | asukaneko/cpp | 图论/欧拉路/欧拉路.cpp | #include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+1;
int n,m,st=1,cnt[2]={0,0},d[maxn],du[maxn][2];//cnt={出口,入口}
vector<int>g[maxn];
stack<int>s;
void dfs(int now){
for(int i=d[now];i<g[now].size();i=d[now]){//字典序最小
d[now]=i+1;
dfs(g[now][i]);
}
s.push(now);
}
int main(){
c... | ALGO | 0.999999 | 4.081555 |
c96a6686-dc79-4fae-84a6-62f24ffeeef6 | coeing/cframework | framework/ext/boost/libs/algorithm/string/example/rle_example.cpp | // Boost string_algo library example file ---------------------------------//
// See http://www.boost.org for updates, documentation, and revision history.
/*
RLE compression using replace framework. Goal is to compress a sequence of
repeating characters into 3 bytes ( repeat mark, character and repetition... | ALGO | 0.99938 | 5.659916 |
68a8a6b7-5eb2-4768-ab44-247730a2cf30 | moqsad/solved-problems | UVA/10610_Gopher and Hawks.cpp | #include "bits/stdc++.h"
using namespace std;
int visit[1050], i;
double dist[1050], num[1050][1050];
int bfs(int x, int y);
queue <int> Q;
int main()
{
int j;
double f[1050], g[1050], a, b, x, y;
char arr[50], in[25], out[25];
while(scanf("%lf %lf", &a, &b) == 2)
{
if(a == 0 && b == 0)
... | ALGO | 0.999847 | 3.281517 |
a6e72dc7-38ff-4285-afb2-9fef9dc676c6 | SoyPay/dacrs | src/bloom.cpp | #include "bloom.h"
#include "core.h"
#include "hash.h"
//#include "script.h"
#include <math.h>
#include <stdlib.h>
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
#define LN2 0.6931471805599453094172321214581765680755001343602552
using namespace std;
CBloomFilter::CBloomFilter(unsigned in... | ALGO | 0.960833 | 6.542652 |
a6180495-f19f-4654-b0b0-1179ea66e31b | kobe24o/LeetCode | algorithm/leetcode1520.cpp | class Solution {
public:
vector<string> maxNumOfSubstrings(string s) {
vector<int> start(26,-1), end(26,-1);
int i = 0, n = s.size(), l, r, last = -1;
for(i = 0; i < n; ++i)
{
char ch = s[i];
if(start[ch-'a'] == -1)
start[ch-'a'] = i;
end[ch-'a'] = i;
}
vector<... | ALGO | 0.999986 | 5.403423 |
f522a2c5-9dfb-49dd-882a-6758fd9c4211 | freaky0112/Homework | data structure/HW8/樹的最長路徑/樹的最長路徑/main.cpp | #include <iostream>
using namespace std;
struct Node{
int key=-1;
int* neighbors;
int length=0;
int weight=0;
bool visted[2]={true,true};
};
Node* list;
Node* current;
int N;//树的节点树
Node* queue;
int head,tail,length=0;
void Enqueue(Node *node){
tail=(tail+1)%N;
queue[tail]=*node;
leng... | ALGO | 0.999915 | 3.902202 |
69deb174-ab03-4309-8deb-4b71451d83b8 | claudiorodolfo/introducao_programacao | exercicios/cpp/Arrays/Q15.cpp | /*
------------------------------------------------
15. Crie um algoritmo/fluxograma/programa que
preencha um array com números aleatórios e, em
seguida, ordene esses números de forma
decrescente.
*/
#include <iostream>
#include <clocale>
#include <cstdlib>
using namespace std;
int main() {
setlocale(LC_ALL,"Portu... | ALGO | 0.992147 | 4.557229 |
ab43e5ed-fd4d-4082-a757-094e11c7612e | Goelshiva1611/Leetcode_Problems | 2914-find-the-safest-path-in-a-grid/find-the-safest-path-in-a-grid.cpp | // step1- multisourcebfs
// step2- binary search
// step3- simplebfs
class Solution {
public:
typedef long long int ll;
vector<int> x = {0, 1, -1, 0};
vector<int> y = {1, 0, 0, -1};
bool check_possible(vector<vector<int>>& final, int sf) {
queue<pair<int, int>> qu;
int n = final.size();
... | ALGO | 0.999923 | 5.571269 |
93ef8767-64fb-43da-b2e6-99adff50ad40 | onweg/YaPracticum | 01 Основные компоненты C++/01 Спринт 1/09 Шаблоны функций/02 Вычисляем term frequencies/Задание 1/src/main.cpp | #include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
map<string, int> ComputeTermFreqs(const vector<string>& terms) {
// реализуйте функцию
}
int main() {
const vector<string> terms = {"first"s, "time"s, "first"s, "class"s};
for (const auto& [term, freq] : ComputeTe... | ALGO | 0.995714 | 5.245655 |
bdaf4eaa-bead-4a89-bc02-d0971cc70362 | DexterSamir/CodeVentures | HackerEarth/producthack.cpp | #include <bits/stdc++.h>
using namespace std;
//Compiler version g++ 6.3.0
int main()
{
long prod=1;
int n ;
cin>>n;
int a[2000];
for(int i=0;i<n;i++) cin>>a[i];
for(int i=0;i<n;i++){
if(a[i]!=0)
prod=(prod * a[i])%1000000007 ;
}
cout<<prod;
} | ALGO | 0.999884 | 3.873162 |
6c0e006b-ca60-4433-a14b-4ea58d714c57 | JeffersonCarvalh0/codeforces-problems | round-490-div3/B/main.cpp | # include <iostream>
# include <string>
# include <algorithm>
using namespace std;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n;
string s;
cin >> n >> s;
int idx = 1;
for (auto it = s.begin(); it < s.end(); ++it, ++idx) {
if (s.size() % idx == 0) reverse(... | ALGO | 0.999978 | 4.663837 |
50b7a3de-6b1e-48fe-bd45-fd9161fca3b3 | BeneditoNogueira/test | data_structures/trie_modern.cpp | /**
* @file
*
* @author Anmol3299
* \brief A basic implementation of trie class to store only lower-case strings.
*/
#include <iostream> // for io operations
#include <memory> // for std::shared_ptr<>
#include <string> // for std::string class
/**
* A basic implementation of trie class to store only lower... | ALGO | 0.999457 | 6.978986 |
4dfa7f2c-11ff-4a94-a67d-2031c567b301 | Yashraj78yadav/c_plus_practice | pattern_program/solid_rectangle.cpp | #include<iostream>
using namespace std;
int main(){
int n,rows,column;
cout<<"Enter the value of n ."<<endl;
cin>>n;
for( rows=0;rows<n;rows++){
for(column=0;column<n+2;column++){
cout<<"* ";
}
cout<<endl;
}
return 0;
} | ALGO | 0.999553 | 3.477952 |
2c9db37d-830b-4dcb-b83b-1cf251644cf9 | fengqiao18/vscode | 2022/10/1013/P1855.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 405;
int w[N], v[N], f[N], dp[N][N];
int main() {
int V, m, n;
cin >> n >> V >> m;
for (int i = 1; i <= n; i++) {
cin >> v[i] >> w[i];
}
for (int i = 1; i <= n; i++) {
for (int j = m; j >= w[i]; j--) {
for (int k = V; k >= v[i]; k--) {
... | ALGO | 0.999991 | 4.578077 |
ea413c1e-a774-4433-a90b-5b0d76148467 | kandarpkakkad/30-Day-Challenge-CPP | Day10 - Backtracking/day10_q4.cpp | #include<bits/stdc++.h>
using namespace std;
/*
https://www.geeksforgeeks.org/subset-sum-backtracking-4/
Input:
7 35
10 7 5 18 12 20 15
Output:
10 7 18
10 5 20
5 18 12
20 15
*/
void print_subset(vector<long long> t, long long M) {
for (long long i = 0; i < M; i++) {
cout << t[i] << " ";
}
cout << end... | ALGO | 0.999957 | 4.348444 |
61243921-3c02-450b-bae6-440e942bacb8 | yash291/Eye-Motion-Tracking | opencv-master/modules/photo/src/denoising.cuda.cpp | #include "precomp.hpp"
#include "opencv2/photo/cuda.hpp"
#include "opencv2/core/private.cuda.hpp"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_CUDAARITHM
# include "opencv2/cudaarithm.hpp"
#endif
#ifdef HAVE_OPENCV_CUDAIMGPROC
# include "opencv2/cudaimgproc.hpp"
#endif
using namespace cv;
using names... | ALGO | 0.994896 | 6.02358 |
c5c2dbee-e204-43ee-b21f-db41d855bfeb | huangallen2008/cppcode | code/contest/AA/TOICAMP/2025/Day1/E.cpp | #include<bits/stdc++.h>
using namespace std;
// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,sse4,bmi2,popcnt")
#define int long long
#define REP(i,n) for(int i=0;i<(n);i++)
#define REP1(i,n) for(int i=1;i<=(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define RREP1(i,n) for(int i=(n);i>=1... | ALGO | 0.999985 | 4.400849 |
b1c20fb0-6860-4170-90bd-c0b16a61f151 | Anonymous-Authors-zkCross/zkCross | Solidity/liblll/Compiler.cpp | /** @file Compiler.cpp
* @author Gav Wood <<EMAIL>>
* @date 2014
*/
#include <liblll/Compiler.h>
#include <liblll/Parser.h>
#include <liblll/CompilerState.h>
#include <liblll/CodeFragment.h>
using namespace std;
using namespace dev;
using namespace dev::eth;
bytes dev::eth::compileLLL(string const& _src, dev::sol... | TOOL | 0.970049 | 6.114989 |
3173179a-5d16-4255-8858-097cc13f2cd0 | EatAllBugs/autonomous_learning | 11_learning_materials/self_driving_car/project_10_MPC_control/src/Eigen-3.3/unsupported/test/NumericalDiff.cpp | #include <stdio.h>
#include "main.h"
#include <unsupported/Eigen/NumericalDiff>
// Generic functor
template<typename _Scalar, int NX=Dynamic, int NY=Dynamic>
struct Functor
{
typedef _Scalar Scalar;
enum {
InputsAtCompileTime = NX,
ValuesAtCompileTime = NY
};
typedef Matrix<Scalar,InputsAtCompileT... | TEST | 0.977173 | 6.185318 |
ed45dfa4-2d30-4e69-a4b0-8701c49f0976 | chapel-lang/chapel | third-party/llvm/llvm-src/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp | #include "clang/StaticAnalyzer/Core/PathSensitive/SimpleConstraintManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include <optional>
namespace clang {
namespace... | TOOL | 0.942533 | 7.017562 |
8bc4ce35-3fea-427a-afcd-23a846ef0707 | Sajjad5591/binary-search-project | binary-search-project/binary-search-project.cpp |
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cstdio>
using namespace std;
int main()
{
int a[] = { 1,4,5,7,9,12,15,18,22,25,29,40,50 };
int element;
int left = 0;
int right = sizeof(a) / sizeof(a[0]) - 1; // size of array - 1
cout << "enter your value" << endl;
cin >> element;
while (... | ALGO | 0.998484 | 4.085893 |
8de9ac31-e374-4506-a6ba-4fa060fa0991 | gghtn/BOJ | cpp/1292.cpp | #include <iostream>
using namespace std;
int main() {
int a, b, sum = 0, i = 1, num = 1;
cin >> a >> b;
while(num <= b) {
for (int j = 0; j < i; j++) {
if (num >= a && num <= b) sum += i;
num++;
}
i++;
}
cout << sum;
return 0;
} | ALGO | 0.999455 | 3.329944 |
6c97900b-3333-4fab-b3cc-c462a1774c84 | ahayas485/Programming | Cpp Files/kadaane_algo.cpp | #include <iostream>
using namespace std;
long int max(long int a,long int b){
if(a>b){
return a;
}
return b;
}
int main(){
int t;
cin>>t;
while(t--){
long int n,i,curr_max,max_so_far;
cin>>n;
long int a[n];
cin>>a[0];
curr_max = max_so_far = a[0]... | ALGO | 0.999724 | 3.622729 |
2089ecb7-83dd-4c7c-9372-b8a8ba636cc4 | ErenBtrk/CPPHowToProgramExercises | Chapter 21/21.20.cpp | #include <iostream>
#include <iterator>
#include <algorithm>
void printBackward(const std::string& str)
{
std::reverse_iterator rIterator(str.crbegin());
while( rIterator != str.crend())
{
std::cout << *rIterator;
rIterator++;
}
}
int main()
{
std::string str;
std::cout << "Ent... | ALGO | 0.988845 | 5.065614 |
1962c17f-c97d-45d4-b6d6-f8ec7db357d8 | ahzay/slamv2 | src/mappernode/linemodel.cpp | //
// Created by user on 7/13/23.
//
#include "linemodel.h"
#include <Eigen/Eigenvalues>
#include "entity.h"
LineModel::LineModel(const string &file, const CmdLineOptions &options) : Model(file, options) {}
Matrix<double, 1, -1> LineModel::dfs(const Entity &e, const Data &d) const {
const auto measurement = d.ge... | ALGO | 0.995203 | 5.851699 |
cf7d2b19-016f-478d-b579-e0f834723d6c | vidhi2002/Striver-sSheet | 1828-queries-on-number-of-points-inside-a-circle/1828-queries-on-number-of-points-inside-a-circle.cpp | class Solution {
public:
vector<int> countPoints(vector<vector<int>>& p, vector<vector<int>>& q) {
vector<int> ans;
for(int i=0;i<q.size();i++)
{
int count=0;
for(int j=0;j<p.size();j++)
{
int k=(q[i][0]-p[j][0])*(q[i][0]-p[j][0])+(q[i][1]-... | ALGO | 0.999648 | 5.027688 |
022438bf-b8f8-4795-9f50-67f6eb0209db | lanhuong1999/Data-Structures-and-Algorithms | Contest3/contest3/bai9/main.cpp | #include <bits/stdc++.h>
#define maxn 1005
using namespace std;
pair<int,int>a[maxn];
int n,dem;
long long res;
bool sortPair(pair<int,int>x, pair<int,int>y){
return x.second>y.second;
}
void solve(){
sort(a,a+n,sortPair);
int vs[maxn]={0};
for(int i=0;i<n;i++){
for(int j=a[i].first-1;j>=0;j--){... | ALGO | 0.999594 | 3.909642 |
d0b673ba-46f4-467a-8bfe-5b1dcb3bf249 | Evbw/NYU-Tandon-Bridge-Summer-2023 | Week 10/hw10_q1.cpp | #include <iostream>
#include <string>
//Declare functions
std::string* createWordsArray(std::string sentence, int& outWordsArrSize);
//Precondition: sentence is a valid string and outWordsArrSize is a valid integer
//Postcondition: A new array containing individual words will be returned
void printArray(std::string* ar... | TOOL | 0.992989 | 4.881691 |
b3681c96-90ed-4cf9-9000-53b316122ac9 | 07Sushant/Data-Structures-and-Algorithms | DPP/Unit 1/Imagine you are developing a program.cpp | #include <stdio.h>
void swap(float *a, float *b) {
float temp = *a;
*a = *b;
*b = temp;
}
void bubbleSort(float arr[], int n) {
int maxIterations = 2;
for (int i = 0; i < n - 1 && i < maxIterations; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
... | ALGO | 0.999947 | 4.243403 |
da84c1e7-30c1-4472-a482-638c57ae7062 | Tonmoy-Roy/Competitive-Programing | A_Divisible.cpp | #include <bits/stdc++.h>
#define ll long long int
#define no cout << "NO" << endl;
#define yes cout << "YES" << endl;
#define test \
ll tc; \
cin >> tc; \
while (tc--) \
{ \
solve(); \
}
#define faster \
ios_base::sync_with_stdio(0); \
cin.ti... | ALGO | 0.99997 | 3.405044 |
5a1a5917-20cf-4043-8fc3-37bcca737cde | Avatarchik/cs16-client | dlls/hostage_localnav.cpp | #include "stdafx.h"
#include "cbase.h"
#include "monsters.h"
#include "weapons.h"
#include "player.h"
#include "hostage.h"
float CLocalNav::s_flStepSize;
int CLocalNav::qptr;
EHANDLE CLocalNav::queue[MAX_HOSTAGES];
int CLocalNav::tot_inqueue;
float CLocalNav::nodeval;
float CLocalNav::flNextCvarCheck;
float CLocalNav:... | ALGO | 0.998819 | 3.72603 |
6a469cdb-7331-4df8-a72c-17bffb271add | kholubow/Kurs_Cpp | Kurs cz.79 Sortowanie przez wybór.cpp | #include <iostream>
using namespace std;
void PokazStan(); // Deklaracja procedury
const int ile = 4;
int tab[ile];
int main()
{
/*
Wybieramy warto minimaln i przesuwamy j na sam pocztek.
*/
// Pobieranie danych od uytkownika do tablicy.
for (int i = 0; i < ile; i++)
{
cout << "Podaj " << (i+1) << " licz... | ALGO | 0.999605 | 4.164291 |
cd0ad1b3-3466-4184-aa03-23d63573413b | allwinner-ics/platform_external_llvm | lib/CodeGen/LatencyPriorityQueue.cpp | #define DEBUG_TYPE "scheduler"
#include "llvm/CodeGen/LatencyPriorityQueue.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
bool latency_sort::operator()(const SUnit *LHS, const SUnit *RHS) const {
// The isScheduleHigh flag allows nodes with wraparound dependencies that... | ALGO | 0.969531 | 7.389482 |
8fcd6f03-d4b9-414d-a00d-874bf9d5eca0 | HassnHamada/CP-Solutions | cses2077.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10, M = 3e1 + 10, MOD = 1e9 + 7, HV = 151, INF = 0x3f3f3f3f, EMP = -1;
vector<int> grf[N];
int lvl[N], cnt[N];
vector<int> ans;
void dfs(int n, int p = 0)
{
lvl[n] = lvl[p] + 1;
int children = 0, mn = INF, back_edge = 0;
... | ALGO | 0.999916 | 4.901765 |
f9af032b-44cd-4ede-af58-7e7f19b5c10a | Fridhi-Rochdi/Competitive-programming-competion | perfectpermetition.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 100000;
vector<bool> sv(N + 1, true);
void sieve() {
sv[0] = sv[1] = false;
for (int i = 2; i * i <= N; i++) {
if (sv[i]) {
for (int j = i * i; j <= N; j += i) {
sv[j] = false;
}
}
}
}
voi... | ALGO | 0.999602 | 5.066133 |
ad9641f8-9109-48fb-934d-edb7938325eb | PratheekB/suv | llvm/libc/src/math/aarch64/round.cpp | #include "src/math/round.h"
#include "src/__support/common.h"
namespace __llvm_libc {
LLVM_LIBC_FUNCTION(double, round, (double x)) {
double y;
__asm__ __volatile__("frinta %d0, %d1\n\t" : "=w"(y) : "w"(x));
return y;
}
} // namespace __llvm_libc
| ALGO | 0.997249 | 6.622436 |
bcc1b039-cead-4aac-84f3-c78629ad52e1 | HolyWaters95/FYS4150_Project_2 | Programs/N_trans_runtimes.cpp | #include <iostream>
#include "armadillo"
#include <cmath>
#include "catch.hpp"
#include "time.h"
using namespace std;
using namespace arma;
vector<int> readvalues(string file);
mat Toeplitz_Matrix(int N, double d, double a);
vector<int> offdiagmaximum(mat T, int N);
mat eigenvalues(mat T, double eps);
void eigtest_N_... | ALGO | 0.991786 | 5.537418 |
6e7f2d95-260b-463b-a027-1798cd9e2068 | ishandutta2007/codeforces | xh092113/normal/1491/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define rg register
#define In inline
#define ll long long
const int N = 1e5;
namespace IO{
In ll read(){
ll s = 0,ww = 1;
char ch = getchar();
while(ch < '0' || ch > '9'){if(ch == '-')ww = -1;ch = getchar();}
while('0' <= ch && ch <= '9'){s = 10 * s + ch - '0';... | ALGO | 0.999985 | 4.268341 |
b81515a6-5a02-460c-8e55-9ea8b1ff706f | Paramee0598/0203 | 0203/Source.cpp | #include <stdio.h>
int main() {
int i, space, rows, k = 0;
char n = 65 ;
printf("Enter the number of rows: ");
scanf_s("%d", &rows);
if (rows >= 0) {
for (i = 1; i <= rows; ++i, k = 0) {
for (space = 1; space <= rows - i; ++space) {
printf(" ");
}
... | ALGO | 0.984618 | 3.615226 |
e8071ae6-89d0-4af0-9ad8-ad284e815ceb | Kristoff-starling/Problem-Solving-Solutions | 2020/Problem Solving II - 01/八数码问题.cpp | //I'll always miss you like a darling.
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define LD long double
#define ull unsigned long long
#define x first
#define y second
#define pb push_back
#define pf push_front
#define mp make_pair
#define Pair pair<int,int>
#define pLL pair<LL,LL>
#define pii... | ALGO | 0.999744 | 3.122667 |
d6ec615d-19f3-453b-88fb-afae49e4602f | BSU2016gr09/ArtsiomKiseliov | 1_semestr/1-1.cpp | #include <iostream>
#include<clocale>
using namespace std;
void isNatural(float n)
{
if (n > 0 && floor(n) == n);
else exit;
}
int summa(int m)
{
int sum = 0;
while (m > 0)
{
sum += m % 10;
m /= 10;
}
return sum;
}
int main()
{
setlocale(0, "");
float k;
cout << "Ââåäèòå ÷èñëî: ";
cin >> k;
isNat... | ALGO | 0.99698 | 3.91605 |
9d3b22ed-25e2-43e5-8808-cd5a93ae6cf6 | zslomo/leetcode | 232. Implement Queue using Stacks.cpp | #include<stack>
using namespace std;
class Queue {
private:
stack<int> s;
public:
// Push element x to the back of queue.
void push(int x) {
s.push(x);
}
// Removes the element from in front of queue.
void pop(void) {
stack<int> st;
st = reverse(s);
st.pop();
s = reverse(st);
}
// Get the front ele... | ALGO | 0.999197 | 5.091598 |
6d3861f3-961a-431c-a4f3-9af012a8530c | sinian666/codes_41_16 | cpp_副本10/chapter_tree/avl_tree.cpp | /**
* File: avl_tree.cpp
* Created Time: 2023-02-03
* Author: what-is-me (<EMAIL>)
*/
#include "../utils/common.hpp"
/* AVL 树 */
class AVLTree {
public:
TreeNode *root; // 根节点
private:
/* 更新节点高度 */
void updateHeight(TreeNode *node) {
// 节点高度等于最高子树高度 + 1
node->height = max(height(no... | ALGO | 0.999039 | 6.080603 |
929c48da-e7db-40de-97ca-fd2f79d44df6 | Stenardt-9002/CODECHEF-Datastructure-and-algo | List_Edit-DSAbySD_AB/DP/1-Knapsack(343).cpp | // https://practice.geeksforgeeks.org/problems/knapsack-with-duplicate-items4201/1
#include <bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds ;
typedef long long int ll;
#define DEBUG_var 1
#define fastIO ios_base::sync_with_s... | ALGO | 0.999995 | 4.467648 |
4a8c2a30-675c-4957-887e-2a8ca7fb507c | nuo534202/Competitve-Programming | Luogu/P3372.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ls (p << 1) // 左半区间
#define rs (p << 1 | 1) // 右半区间
#define mid ((l + r) / 2)
const int N = 1e5 + 10;
int n, m, a[N];
struct node { int sum, tag; } t[N << 2];
inline int read() {
int x = 0, f = 1; char c = getchar();
while (c < '0... | ALGO | 0.999941 | 4.879982 |
7dc8b4b8-3688-41cb-8691-e4d3b40b2b85 | FarzadForuozanfar/Cpp_Cource_Ex | Assignments/Template_Class/main3.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
class rational
{
private:
double num1;
double num2;
double num3;
public:
rational(double number1,double number2,double number3)
{
num1=number1;
num2=number2;
num3=number3;
}
double sum()
{
return (num1+num2)/num3;
}
double min... | ALGO | 0.979151 | 3.597883 |
ddc9029a-b5d0-4374-8cde-50153852c28c | haris71rc/Leetcode | 882-peak-index-in-a-mountain-array/peak-index-in-a-mountain-array.cpp | class Solution {
public:
int peakIndexInMountainArray(vector<int>& arr) {
int start=0;
int end=arr.size()-1;
int mid = start + (end-start)/2 ;
while(start<end){
if(arr[mid]<arr[mid+1]){
start = mid+1;
}
else{
end=mi... | ALGO | 0.999971 | 5.695839 |
9f05839e-e39c-4820-99e8-279fd691689f | psrisank/ece565-finalproject | src/systemc/tests/systemc/misc/user_guide/chpt11.2/mean.cpp | /*****************************************************************************
mean.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.999236 | 4.609841 |
50ef93d8-1ca5-4a17-a77e-32d4989dfa8d | oleg-cherednik/HackerRank | C++/Strings/Strings/solution.cpp | #include <iostream>
using namespace std;
int main() {
string a = "";
string b = "";
cin >> a >> b;
cout << a.length() << " " << b.length() << endl;
cout << a << b << endl;
cout << b.at(0) << a.substr(1) << " " << a.at(0) << b.substr(1) << endl;
return 0;
} | ALGO | 0.999738 | 3.718098 |
76633fee-e578-4b1d-a040-217b7037e666 | lazywon/baekjoon-algorithm | 5397_키로거.cpp | // #include <bits/stdc++.h>
// using namespace std;
// int main() {
// ios::sync_with_stdio(0);
// cin.tie(0);
// int n;
// cin >> n;
// while(n--) {
// list<char> L; //vector
// list<char>::iterator cursor = L.begin();
// string s;
// cin >> s;
// int ... | ALGO | 0.999895 | 5.057809 |
d14b1007-ccb4-4b91-bf9b-64e6e3a1a1ce | Bluuur/Cpp_course | HZAU_itc/cycle/Cycle05.cpp | /*
【问题描述】
一辆卡车违反交通规则,撞人后逃跑。现场有三人目击事件,但都没有记住车号,只记下车号的一些特征。
甲说:牌照的前两位数字是相同的;
乙说:牌照的后两位数字是相同的,但与前两位不同;
丙是数学家,他说:四位的车号所构成的数字正好等于某一个整数的平方。请根据以上线索求出车号。
【输入形式】
无
【输出形式】
直接显示一个四位整数表示肇事车号
*/
#include <iostream>
using namespace std;
int main(){
int first = 0;
int third = 0;
double num;
for(first = ... | ALGO | 0.997953 | 3.977159 |
64ce7117-2d0c-4eef-8894-0416fba47a51 | PraeThipwarin/lab12 | lab12_1.cpp | #include<iostream>
#include <ctime>
using namespace std;
long long int fibonacci(long long int);
int main(){
clock_t start = clock();
cout << "Result: " << fibonacci(50) << "\n";
clock_t end = clock();
double elapsed = double(end - start)/CLOCKS_PER_SEC;
cout << "Elapsed Time: "<< elapsed << " sec... | ALGO | 0.999497 | 4.753407 |
9f56f089-afe3-4312-9662-2be236811007 | MariaImran/PFweek5-CS-2022-14 | task8.cpp | #include<iostream>
#include<cmath>
using namespace std;
main()
{
int hours, minutes;
cout<<"Enter hours:";
cin>>hours;
cout<<"Enter minutes:";
cin>>minutes;
minutes = hours*60;
minutes = minutes+15;
hours = minutes/60;
minutes = minutes - (hours*60);
if(hours >= 24){
hours = hours - 24;
cout<<"time is:" <<... | ALGO | 0.975751 | 3.467912 |
d439938b-cffc-42d7-913c-f0d73d029608 | sstarodubov/algorithm_research | C++/codeforces/easy-100-marathon/268.cpp | #include <iostream>
#include <map>
#include <cmath>
#include <string>
#include <stack>
#include <vector>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cstring>
#include <algorithm>
#include <csignal>
#include "helper.h"
#include <tuple>
using namespace std;
typedef vector<int> vi;
class ... | ALGO | 0.999149 | 4.748394 |
e61a9260-e813-4acb-97e7-460d46f898dc | Jesan-Sikder/COMPITIVE-PROGRAMMING | CPP PROGRAMMING MASTER/PassByReference.cpp | #include<iostream>
using namespace std;
void swap(int &a,int &b)
{
cout<<&a<<" "<<&b<<endl;
int temp;
temp=a;
a=b;
b=temp;
}
int main()
{
int x=10,y=20;
swap(x,y);
cout<<&x<<" "<<&y<<endl;
cout<<x<<" "<<y;
return 0;
}
| ALGO | 0.995497 | 4.063428 |
4d7c9e0d-ad89-4a5a-891c-6c0629a349af | guilhermesena1/Coding-Competitions | Interviews/HackerRank/jobs_challenge/palantir/b.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.984673 | 3.957732 |
bc0f4f31-4b14-435f-982b-45b771240bf3 | Juke-Rog/rog | src/server/collision/Maps/MapTree.cpp | #include "MapTree.h"
#include "ModelInstance.h"
#include "VMapManager2.h"
#include "VMapDefinitions.h"
#include "Log.h"
#include <string>
#include <sstream>
#include <iomanip>
#include <limits>
#ifndef NO_CORE_FUNCS
#include "Errors.h"
#else
#define ASSERT(x)
#endif
using G3D::Vector3;
namespace VMAP
{
... | TOOL | 0.952938 | 7.271386 |
2519017e-cc58-4553-948b-1b3bf47155a0 | TheDev05/CARDIO | Striver/Trees/40_Search in a Binary Search Tree.cpp | #include <bits/stdc++.h>
using namespace std;
class TreeNode
{
public:
int val;
TreeNode *left, *right;
TreeNode(int temp)
{
this->val = temp;
this->left = this->right;
}
};
TreeNode *traverse(TreeNode *root, int target)
{
if (root == NULL)
return NULL;
if (target... | ALGO | 0.999961 | 4.926327 |
2b9b4dd1-0300-46b0-9237-a9966f60a0b8 | morris821028/UVa | volume117/11736 - Debugging RAM.cpp | #include <stdio.h>
#include <map>
#include <iostream>
using namespace std;
int main() {
int b, v, q, bytes[256];
char s[1024];
while(scanf("%d %d", &b, &v) == 2) {
map<string, int> R;
unsigned long long val[256] = {};
for(int i = 1; i <= v; i++) {
scanf("%s %d", s, &bytes[i]);
R[s] = i;
}
for(int ... | ALGO | 0.977128 | 3.701562 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.