uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
b84b8493-600d-4bba-9c8a-173649ae3b6e
rizzwaaaan/test_smart_bin
flutter_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.998007
6.76775
b08d8cfe-1080-4af8-9a74-358756520148
epsilonorion/usv_lsa_sim_copy
uwsim_resources/uwsim_bullet/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
//#define DISABLE_BVH #include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h" #include "BulletCollision/CollisionShapes/btOptimizedBvh.h" #include "LinearMath/btSerializer.h" ///Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization. ///Uses an interface to a...
ALGO
0.937632
7.193789
ca84badd-7f48-4b9e-b977-28611c6c84ed
pratyushchamola/codeforces
D_1_388535_Easy_Version.cpp
#include<bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> using namespace std; using namespace chrono; // using namespace __gnu_pbds; #define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define MOD 1000000007 #define MOD1 998244353 #define INF...
ALGO
0.999548
4.298002
256e652d-9955-4b68-8d24-54528fa773de
jasch-shah/Java-Programs
MergeandSort.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { //code int t; vector<int> a; cin>>t; while(t-- > 0) { int n,m; //n is no of arrays and m is no of elements in each array cin>>n; int temp; for(int i=0;i<n;i++) { cin>>m; ...
ALGO
0.999774
3.474371
29be761f-a918-48dd-a931-a846d346e8c3
SinclairPythonAkoto/Learning-C_plus_plus
Educative/module1/Operators/challenge1.cpp
/* In this challenge you are given a character that is stored in a variable named character. - Write a code that makes the same variable, character, - then store the character preceding the one originally stored in it - (if the character is B, the character before is A) */ #include <iostream> using namespace std; in...
ALGO
0.999725
3.561433
3a948cbf-3f9d-4b13-bbd0-c65958b5b91a
terickson87/HackerRank
Pointer/Pointer.cpp
// https://www.hackerrank.com/challenges/c-tutorial-pointer/problem #include <stdio.h> void update(int *a,int *b) { int sum = *a + *b; int diff = *a - *b; if (diff < 0) { diff *= -1; } *a = sum; *b = diff; } int main() { int a, b; int *pa = &a, *pb = &b; scanf("%...
ALGO
0.999835
4.646291
3101c120-5825-4377-a406-b06693696f1c
ishandutta2007/codeforces
enem/normal/251/B.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 M1 1000000007 #define M2 998244353 #define ll long long #define ld long double #define pll pair<ll,ll> #define REP(i,a,b) for(ll i=a;i<b;i++) #define REPI(i,a,b...
ALGO
0.99999
3.823075
41d3a745-d86c-4fe0-9aaa-8fbba9d2c92f
ishandutta2007/codeforces
kotatsugame/normal/1737/D.cpp
#include<iostream> using namespace std; int N,M; int G[500][500]; int U[250000],V[250000],W[250000]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int T;cin>>T; for(;T--;) { cin>>N>>M; for(int i=0;i<N;i++)for(int j=0;j<N;j++) { if(i==j)G[i][j]=0; else G[i][j]=1e9; } for(int i=0;i<M;i+...
ALGO
0.999981
4.59572
14415017-1d18-4504-a532-1c97205146ab
NeoAnomaly/xray
3rd party/boost/libs/smart_ptr/src/sp_collector.cpp
#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS) #include <boost/assert.hpp> #include <boost/shared_ptr.hpp> #include <boost/detail/lightweight_mutex.hpp> #include <cstdlib> #include <map> #include <deque> #include <iostream> typedef std::map< void const *, std::pair<void *, size_t> > map_type; static map_type & get_map() {...
TOOL
0.913771
5.35972
e7b25232-6e90-4d26-ba4f-6aa39f1b60c9
ishandutta2007/codeforces
lucina/normal/1421/A.cpp
#include<bits/stdc++.h> using namespace std; int const nax = 3e5 + 10; int main() { cin.tie(0)->sync_with_stdio(false); int T; for (cin >> T ; T -- ;) { int a, b; cin >> a >> b; cout << (a ^ b) << '\n'; } }
ALGO
0.999919
4.95226
075de9f0-749e-4035-b685-d8a3be06bd78
Peanutzzz/CppRTS
C++RTS/cocos2d/cocos/base/ccUTF8.cpp
#include "base/ccUTF8.h" #include "platform/CCCommon.h" #include "base/CCConsole.h" #include "ConvertUTF.h" NS_CC_BEGIN namespace StringUtils { std::string format(const char* format, ...) { #define CC_MAX_STRING_LENGTH (1024*100) std::string ret; va_list ap; va_start(ap, format); char*...
TOOL
0.970799
6.070928
acadcb41-74f5-4086-bfb9-256472d86c79
theo543/LFA_Tema_3
pushdown/PushdownFSM.cpp
#include <algorithm> #include <stdexcept> #include <cassert> #include "PushdownFSM.h" void PushdownFSM::add_transition(const Transition &trans) { transitions[{trans.from_state, trans.from_stack, trans.from_symbol}].push_back(trans); } void PushdownFSM::add_final_state(std::size_t state) { final_states.insert(...
ALGO
0.91942
6.386027
2b9ffa52-b5be-42e4-b890-2189c579f2d9
HieuHuyNguyenzz/Online-Courses-Self-Notes
Stanford CS161 Design and Analysis of Algorithms I/Algorithms implementation/1. Merge Sort.cpp
#include<bits/stdc++.h> using namespace std; vector<int>merge(vector<int>x, vector<int>y){ int n = x.size()+y.size(), i = 0, j = 0; vector<int>res; for(int k=0;k<n;k++){ if(i==x.size()){ res.push_back(y[j]); j++; } else if(j==y.size()){ res.push_...
ALGO
0.999987
5.078269
e4358da0-c9df-4db6-aabf-9a62ee586d52
AnupamPokhrel16/OOP-assignment
pro.cpp
#include <iostream> using namespace std; int main (){ int firstnumber =1; int secondnumber=2; int finalanswer; cout<< "write your first number "<<endl; cin>> firstnumber; cout << "write your second number"<<endl; cin >>secondnumber; finalanswer>> firstnumber*secondnumber; cout<< "yo...
ALGO
0.99073
3.319522
ebe682f2-109d-48bf-9053-964b0f177e7a
burtscher/Indigo2Suite
codes/omp/bfs-omp/BFS_OMP_V_Data_Push_IntType_ReadModifyWrite_Determ_Default_NoFieldBug_Atomic_NoRangeBug_NoBoundsBug2_NonDup.cpp
typedef int data_type; #include "bfs_vertex_omp.h" static void init(const int src, data_type* const dist, data_type* const dist_n, const int size, const ECLgraph g, int* const wl1, int &wlsize, int* const time) { // initialize dist array for (int v = 0; v < size; v++) { const data_type temp = (v == src) ? 0 : ...
ALGO
0.999925
3.944723
4dca965b-5f6b-4332-8969-f89dd15b8b45
P79N6A/Codes-1
OJ-JSK(计蒜客)/2016 计蒜客/初赛第4场/遗失的支付宝密码(中等)(WA).cpp
#include<algorithm> #include<cctype> #include<cmath> #include<cstdio> #include<cstring> #include<iomanip> #include<iostream> #include<map> #include<queue> #include<set> #include<sstream> #include<stack> #include<string> #define ll long long #define pr(x) cout << #x << " = " << (x) << '\n'; using namespace std; const i...
ALGO
0.999989
3.989195
46f13013-2132-46e3-881a-b2d2b89ac4ae
alexandraback/datacollection
solutions_5634947029139456_1/C++/Williammed/main.cpp
#include <iostream> #include <algorithm> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> using namespace std; char s[205]; long long a[205], b[205], c[205]; int n,l; bool check(long long t) { for (int i=0; i<n; i++) c[i]=a[i]^t; sort(c, c + n); for (int i=0; i<n; i++)...
ALGO
0.999887
3.315109
89dd9b60-3c1a-42a8-8efa-a685ab156c96
ishandutta2007/codeforces
meyi/normal/1168/E.cpp
#include<bits/stdc++.h> using namespace std; #define ri register int typedef long long ll; const int maxn=1<<12; template<class T>inline bool ckmin(T &x,const T &y){return x>y?x=y,1:0;} template<class T>inline bool ckmax(T &x,const T &y){return x<y?x=y,1:0;} int a[maxn],k,n,p[maxn],pos[maxn],q[maxn],sum; void modify(in...
ALGO
0.999909
3.102371
e141a29b-6524-4bde-9396-6f5063c623c5
Zhiyuan122/hackerRank-notes
CPP/Easy/13classOop.cpp
/* 使用 vector<int> 来存储多个考试分数 vector<int> v; v.push_back(10); // 添加元素 10 到 v 的末尾 cout << v[0]; // 输出第一个元素 int sum = accumulate(v.begin(),v.end(),0); // 求和) */ #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <cassert> using namespace std; class Student { private: ...
ALGO
0.999624
4.254879
2f5c8d1a-f936-4425-bc15-c54c9f864756
RaykkonerD/Beecrowd
Cpp/q1079.cpp
#include <iostream> #include <iomanip> using namespace std; int main(){ int q, i; float n1, n2, n3, media; cin >> q; for(i=0; i < q; i++){ cin >> n1 >> n2 >> n3; media = ((n1*2+n2*3+n3*5)/10); cout << fixed << setprecision(1) << media << endl; } return 0; }
ALGO
0.998958
3.661857
3661aa9a-cbdd-47a9-b295-212ec09840a5
ayuvi447/cppp
vickycpp/Training/week 1/Que4.cpp
#include<iostream> #include <string> #include <vector> #include <set> using namespace std; int arraySum (vector<int> arr){ int sum = 0; for(int n : arr){ sum += n; } return sum; } int arraySum (set<int> arr){ int sum = 0; for(int n : arr){ sum += n; } return sum; } ...
ALGO
0.999834
4.339783
5ee0b895-c0a2-4923-9eb9-6d4b4ba08fb7
subhasishpinku/FLUTTER_VBS_LLP-main
provider_01/provider01/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.997989
6.76073
659c1c80-a951-479d-8793-13671666bfa6
Ranajit2005/CPP-Practice-github
Practice/GraphUsingQueue.cpp
#include<iostream> using namespace std; class Q{ int size; int front; int rear; int *arr; public: Q(int s){ size = s; front = rear = -1; arr = new int[size]; //to be remember } bool isFull(Q *q); bool isEmpty(Q *q); void EnQ(Q *q,int ); int DeQ(Q *q); ...
ALGO
0.999297
4.269276
437a83dd-3332-4ed8-854e-90aa1e2d70fe
ishandutta2007/codeforces
doped.silicon/normal/152/C.cpp
#include <bits/stdc++.h> using namespace std; #define lli long long int #define pb() push_back() #define pp() pop_back() int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); lli n,m; cin>>n>>m; lli ar[m][26]; for(int i=0;i<m;i++) { for(int j=0;j<26;j++) { ar[i][j]...
ALGO
0.999993
4.229774
0d97efa2-a435-4c8c-98c2-fc7455203f44
kunidesuyo/competitive-programming
ABC/201~250/217/B.cpp
#include <bits/stdc++.h> #include <cmath> #define all(x) (x).begin(),(x).end() using ll = long long; const ll INF = 1LL<<60; using namespace std; int main() { string s[3]; for(int i = 0; i < 3; i++) cin >> s[i]; vector<int> ans(4, 0); for(int i = 0; i < 3; i++) { if(s[i] == "ABC") { ...
ALGO
0.99976
4.195794
ce7ab5a7-86b8-4581-b2a1-0100f2e90cde
chiseungii/Algorithm_Study
JUNGOL/Beginner/#2071 파스칼 삼각형/파스칼 삼각형.cpp
#include <iostream> #include <vector> using namespace std; int main() { int n,m; cin>>n>>m; vector<vector<int>> pas; for(int i=0; i<n; i++){ vector<int> v(n); pas.push_back(v); } pas[0][0] = 1; for(int i=1; i<n; i++){ pas[i][0] = pas[i][i] = 1; for(int j=1; j<i; j++) pas[i][j] = pas[i-1][j]+pas[i-1][...
ALGO
0.999994
3.012886
a1f12974-3d0c-49db-8b4a-483ec1181c33
raincross7/code-similarity
codes/train_code/problem413/problem413_185.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(n);i++) #define rep1(i,n) for(int i=1;i<=(n);i++) #define all(x) (x).begin(),(x).end() #define V vector typedef V<int> vi; typedef V<vi> vvi; typedef long long ll; typedef pair<ll, ll> P; typedef tuple<int, int, int> T; constexpr auto INF = I...
ALGO
0.999968
4.026941
243a79ef-834e-489a-aacf-e2646991ace4
mohammad-ghaderi/codeforces
old_contest/Codeforces Round 967 (Div. 2)/C.cpp
#include<bits/stdc++.h> #define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); #define ll long long #define endl "\n" using namespace std; const int _MOD{(int)1e9 + 7}; int mod(const int n, const int m=_MOD){ return ((n % m) + m) % m; } // #define ONLINE_JUDGE const int SIZE = 1001; ...
ALGO
0.999331
3.638292
2dd195f6-7105-4cb9-a76a-856957cf13f0
nkcuong218/bai_thuc_hanh_1_C-
demtu.cpp
#include <sstream> #include <iostream> #include <string.h> #include <vector> using namespace std; int main() { int t; cin >> t; while (t--) { cin.ignore(); string s; getline(cin, s); stringstream ss(s); string token; vector<string> ans; while (ss >...
ALGO
0.994618
4.126365
53bc565f-45f9-4e8b-91f1-dabc0148560b
CR400AF2001/NJUSE-CPP-Advanced-Programming
考试/2/Q171/test.cpp
#include <iostream> #include <string> #include <vector> using namespace std; class weibo { public: int owner; int weiboid; int thetype; weibo(int thisowner, int thisid, int thistype) { owner = thisowner; weiboid = thisid; thetype = thistype; } }; class user { public: int id; int watch; vector<int> wat...
TOOL
0.952296
3.414454
17b4106f-9f4f-4b12-a160-e8a46e8f880b
sinha-sahil/ProblemSolving
01_Algorithms/Maths/FrugalNumber.cpp
#include<iostream> using namespace std; int digits(int n){ int dig=0; int count=0; if(n%2==0){ while(n%2==0){ count++; n/=2; } if(count>1) dig+=2; else if(count==1) dig++; } for(int i=3; i*i<n+1; i++){ count=0; while(n%i==0){ count++; n/=i; } if(count>1) dig+=2; else if(count==1) dig+...
ALGO
0.99956
4.000415
a7c266e5-08e9-4fd3-bcf3-3e102da94436
SP0N9E/Study4Job
LeetCode/101.对称二叉树.cpp
/* * @lc app=leetcode.cn id=101 lang=cpp * * [101] 对称二叉树 * * https://leetcode-cn.com/problems/symmetric-tree/description/ * * algorithms * Easy (52.32%) * Likes: 895 * Dislikes: 0 * Total Accepted: 172.5K * Total Submissions: 329.3K * Testcase Example: '[1,2,2,3,4,4,3]' * * 给定一个二叉树,检查它是否是镜像对称的。 *...
ALGO
0.999959
6.603057
f53a3061-05f1-462c-86c1-58f3315228ba
Jin-Dae/jin-dae.github.io
BOJ10845.cpp
#include<iostream> #include<queue> #include<cstring> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n,b; cin>>n; queue<int> q; for(int i=0;i<n;i++){ string a; cin>>a; if(a=="push") {cin>>b; q.push(b);} else if(a=="front"){ if(q.empty()) cou...
ALGO
0.999021
4.12964
90578621-90a9-4fe1-84ca-6fba3adf254f
Sandra-Rosa/demo
maxminarray.cpp
#include<iostream> using namespace std; int main(){ int n; cout<<"Enter the size of the array "; cin>>n; int array[n]; for(int i=0;i<n;i++){ cin>>array[i]; } int maxno=array[1],minno=array[1]; for(int i=0;i<n;i++){ if(array[i]>maxno){ maxno = array[i]; ...
ALGO
0.999908
3.653328
732585a0-f3cb-4cd8-ba10-d5c4b33fb8cc
MuntasirMac/codes
CodeForces/118A.cpp
#include<cstdio> #include<cstring> using namespace std; int main() { char c[104],i,l; scanf("%s",c); l = strlen(c); for(i=0; i<l; i++) { if(c[i] >= 'A' && c[i] <= 'Z') c[i] = c[i] + 32; } for(i=0; i<l; i++) { if(c[i] != 'a' && c[i] != 'e' && c[i] != 'i' && c[i] != ...
ALGO
0.998925
3.343269
dd588bfa-fd11-4547-9848-4a3c954ca4f7
jc0rmita/VScode
finalsfunction.cpp
#include <iostream> #include <conio.h> #include <windows.h> using namespace std; void sqr1(void){ system("cls"); int n1, sqr; cout<<" Enter a number: "; cin>>n1; sqr = n1* n1; cout<<sqr; getch(); } int sqr2 (void){ system("cls"); int n2, sqr2; cout<<" Enter a numb...
TOOL
0.860393
3.279446
522a33a3-cc7f-4d73-a8a5-0757abca29bb
kajaveom/LeetCodeSolutions
0658-find-k-closest-elements/0658-find-k-closest-elements.cpp
class Solution { public: vector<int> findClosestElements(vector<int>& arr, int k, int x) { int s = 0, e = 0; int i = 0, j = 0; int minSum = INT_MAX, sum = 0; while(j < arr.size()){ sum += abs(arr[j]-x); if(j-i+1==k){ if(sum < ...
ALGO
0.999999
5.718884
9ab0a455-bccb-4656-b876-34396b1ca6f9
DatouNie/cworkspace
resort.cpp
/************************************************************************* > File Name: resort.cpp > Author: Datou_Nie > Mail: <EMAIL> > Created Time: 2017年09月09日 星期六 15时35分27秒 ************************************************************************/ #include<iostream> using namespace std; int main() { int t;...
ALGO
0.999754
3.978402
a7a20846-928e-417f-ad41-8021a5fb6bc2
pearsonalan/avr-experiments
seven-seg/display-digit/display-digit.cpp
#include <Arduino.h> // Seven Segment display: // // A // ----- // F | | B // | G | // ----- // E | | C // | | // ----- . DP // D // // Wiring to the ATmega328: // A - PB0 // B - PB1 // C - PB2 // D - PB3 // E - PB4 // F - PC0 // G - PC1 // DP - ...
TOOL
0.866582
5.634676
41e83279-ca05-4e7c-ba89-210a88f29a49
Corycle/OI-Codes
Bashu OnlineJudge/2840.cpp
#include<iostream> #include<iomanip> #include<cmath> #include<cstdio> #include<cstring> #include<algorithm> #include<cstdlib> #include<stack> #include<queue> #include<map> #include<ctime> #include<vector> #define ll long long using namespace std; const ll inf=0x3f3f3f3f; const ll N=50005; ll read(){ ll s=0,f=1;char c=...
ALGO
0.999488
3.830721
fb0cbd46-04f5-44b7-a096-ac0bda27278e
SanskritiKushik5/Problem-Solving
Search & Sort/selection-sort.cpp
#include <bits/stdc++.h> using namespace std; void SelectionSort(int arr[], int n) { int minindex, temp; for (int i=0; i<n-1; i++) { minindex = i; for (int j=i+1; j<n; j++) { if (arr[j] < arr[minindex]) minindex = j; } if (i != minindex) ...
ALGO
0.999808
5.139395
8ea51f82-4152-4b7c-af03-c61cf56b80ea
SaniTheWay/DataStructresAlgorithms_Cpp
arrays-vector/best_time_to_buy_and_sell_stocks_i.cpp
// Question : Best Time to Buy and Sell Stock // Question Link : https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ // Approaches: Array, Dynamic Programming // 1. Brute Force(O(n^2)) // 2. Using Space- make an auxilary arr and store the max element from back. TC- O(n) but SC- O(n) // ...
ALGO
0.998934
5.601456
051baa20-f302-49e2-a688-c92b27e05369
ishandutta2007/codeforces
falldream/normal/333/B.cpp
#include<algorithm> #include<iostream> #include<cstdio> #define MN 1000 #define Rep(i,a,b) for(int i=a;i<=b;++i) using namespace std; inline int read() { int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } int n,r[MN+...
ALGO
0.999925
3.266179
7b53f4e3-b900-49b6-ac47-7ab288e322db
PaukIsUha/optimizing_formating_code
predictions/full_output_predicted_submissions/Codenet/p00641/116075191/7.cpp
#include <iostream> using namespace std; int n, b[2][100100], f[2][100100]; bool v[100100]; int dfs(int s, int now, int maxi, int num) { v[now] = true; for (int i = 0; i < 2; i++) { if (!v[b[i][now]]) { if (maxi == f[i][now]) num++; else if (maxi < f[i][now]) { maxi = f[i][now]; ...
ALGO
0.999889
3.836349
43010acb-4b47-4c06-97c5-813393f18175
idriss-arto/leetcode
32.最长有效括号.cpp
/* * @lc app=leetcode.cn id=32 lang=cpp * 动态规划,栈,计数器 ! [32] 最长有效括号 */ // @lc code=start #include <string> #include <vector> #include <stack> using namespace std; /* * 利用两个计数器 left 和 right * 首先,我们从左到右遍历字符串, * 对于遇到的每个 '(',我们增加 left 计数器,对于遇到的每个 ')' ,我们增加 right 计数器。 * 每当 left 计数器与 right 计数器相等时,我们计算当前有效字符串的长度,并且记录...
ALGO
0.999919
5.924265
de6442f2-4dfb-4fcb-b6ff-de671ce31feb
demqa/Language
Libs/BinaryTree/bin_tree.cpp
#include "bin_tree.h" #define CATCH_TREE_ERRORS \ do{ \ if (TreeVerify(tree)) \ { \ return TreeDump(tree); \ } \ }while(0); #define CATCH_NODE_ERRORS \ do{ \ if (N...
ALGO
0.900743
5.057404
eb787345-46a1-4396-88a0-a0c919ee85a7
mfmullen/Bloch_Simulator_CPU
magnetization.cpp
#include "magnetization.hpp" #include "math.h" #include "mex.h" //Default Constructor, a lone spin at the origin that is thermally relaxed. magnetization::magnetization() : mx(0.0),my(0.0),mz(1.0),xpos(0.0),ypos(0.0),zpos(0.0),bin(0), offres(0.0), volume(1){} void magnetization::rotate(const doubl...
TOOL
0.981384
5.9215
cb33f770-78a3-4b1f-870c-07ea9eeb6ffa
ishandutta2007/codeforces
xietutu/normal/863/A.cpp
#include <bits/stdc++.h> using namespace std; string s; bool flag; bool check(int l, int r) { while (l < r) { if (s[l++] != s[r--]) return false; } return true; } int main() { cin >> s; int l = s.size(); for (int i = l; i >= 1; --i) { if (check(0, i - 1)) flag = true; if...
ALGO
0.999882
5.200081
5a3654c1-23f0-4ed0-96d7-576d3444675c
insectkorea/my-cp
abc328/e/main.cpp
/** * author: insectkorea * create-mm-dd hh:mm:ss **/ #include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; // clang-format off /* accelration */ // 高速バイナリ生成 #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") // cin cout の結びつけ解除, stdioと同期しない(入出力非同期化) // cと...
ALGO
0.999856
4.81347
443dba97-ce89-488b-8122-299ff9243558
Nrali282/Competitive-Coding
Leetcode/Subtree of Another Tree.cpp
/* Solution by Nirali Rathod *********************************************************** Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false otherwise. A subtree of a binary tree tree is a tree tha...
ALGO
0.999918
6.410731
5b0d14ee-0304-4cd5-bd01-e4fc0408a1b5
zuhaib786/CSES_SOLUTIONS
Graph Algorithms/RoundTripII.cpp
#include<bits/stdc++.h> #define MAX 1000000007 using namespace std; pair<int, int> cycle_node = make_pair(-1,-1); void printSet(set<int> &s) { cout<<"[ "; for(auto x:s) { cout<<x<<" "; } cout<<"]"<<endl; } void dfs(vector< vector<int>>&nodes, vector<int>&visited, set<int> &ancestors, vector<...
ALGO
0.999985
3.921029
d228f53c-3eb5-47c7-bc6e-4fde0333b58d
PrathamTech/cpp
Day 15/Duplicate_String3.cpp
#include <iostream> #include <sstream> #include <map> using namespace std; int main() { string x; getline(cin, x); stringstream obj(x); string temp; map<string, int> wordCount; while (obj >> temp) { wordCount[temp]++; } for (const auto& entry : wordCount) { cout << en...
TOOL
0.990621
5.248278
6f3aac35-1e71-4b9b-b6d4-e2e10b25c2c5
syedyasar/CPP_Edabit
Very_Easy/97_Buggy_Code_Part6.cpp
/* Source: Edabit Link : https://edabit.com/challenge/ebQDyQYgs9Hd5jo3K Date: 06/30/2021 Buggy Code (Part 6) Mubashir wants to remove numbers from a given string! Help him by fixing the code in the code tab to pass this challenge. Look at the examples below to get an idea of what the function should do. Examples rem...
ALGO
0.998812
5.659968
31a2e522-06c6-4974-ad67-cd712f18719d
Pk-T/Gesture-Recognition-OpenCV
nestk/deps/opencv/modules/legacy/src/face.cpp
/////////////////////////////////////////////// //// Created by Khudyakov V.A. <EMAIL> ////////////////////////////////////////////// #include "precomp.hpp" #include "_facedetection.h" Face::Face(FaceTemplate * lpFaceTemplate) { //init number of face elements; m_lFaceFeaturesNumber = lpFaceTemplate->GetCount(...
ALGO
0.971034
3.889304
317482d7-fcab-4571-b71a-eb61f004648b
matouskozak/chess
src/Pawn.cpp
#include "Pawn.h" /***************************Public***************************/ /** * Generate all pseudo legal pawn moves * @param empty - bitboard with empty squares * @param opponentPieces - bitboard with opponent pieces * @param flags - current chessboard flags * @return list with pointers to pseudo legal mo...
ALGO
0.952371
4.894743
c7f7f904-2139-430b-a603-0fff4df17d8a
vickyguptaa7/CrackYourPlacement
45DaysChallenge/Arrays/Medium/Find_All_Duplicates_in_an_Array.cpp
class Solution { public: vector<int> findDuplicates(vector<int>& nums) { vector<int>dup; for(int i=0;i<nums.size();i++) { if(nums[abs(nums[i])-1]>0) { nums[abs(nums[i])-1]=-nums[abs(nums[i])-1]; } else { ...
ALGO
0.999928
5.574222
ad4b2289-ad41-4113-8cbb-5605d5f63372
justsheep/PAT-BasicLevel
1047.cpp
/* 1047 编程团体赛 (20 分) 编程团体赛的规则为:每个参赛队由若干队员组成;所有队员独立比赛;参赛队的成绩为所有队员的成绩和;成绩最高的队获胜。 现给定所有队员的比赛成绩,请你编写程序找出冠军队。 输入格式: 输入第一行给出一个正整数 N(≤10 4 ),即所有参赛队员总数。随后 N 行,每行给出一位队员的成绩,格式为:队伍编号-队员编号 成绩,其中队伍编号为 1 到 1000 的正整数,队员编号为 1 到 10 的正整数,成绩为 0 到 100 的整数。 输出格式: 在一行中输出冠军队的编号和总成绩,其间以一个空格分隔。注意:题目保证冠军队是唯一的。 输入样例: 6 3-10 99 11-5 87 102-1...
ALGO
0.998776
4.043061
e97530bb-8e02-45a7-852a-0650a613d274
xieh1987/MyLeetCodeCpp
0739 Daily Temperatures.cpp
class Solution { public: vector<int> dailyTemperatures(vector<int>& T) { int n = T.size(); vector<int> res(n, 0); stack<int> st; for(int i=0;i<n;++i) { while(!st.empty()&&T[i]>T[st.top()]) { int t = st.top(); st.pop(); res[t...
ALGO
0.999959
6.154563
582b619b-eb96-4dce-b636-96fb358d94c7
Lalit-N97/learning-from-lc
lc-2816.cpp
/** Medium - Double a Number Represented as a Linked List https://leetcode.com/problems/double-a-number-represented-as-a-linked-list Written By : LalitN97 **/ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNo...
ALGO
0.999987
6.004167
1e56e01d-83dd-4dd0-9e2f-bad127f5a8d9
23f2002007/leetcode
solution/2000-2099/2075.Decode the Slanted Ciphertext/Solution.cpp
class Solution { public: string decodeCiphertext(string encodedText, int rows) { string ans; int cols = encodedText.size() / rows; for (int j = 0; j < cols; ++j) { for (int x = 0, y = j; x < rows && y < cols; ++x, ++y) { ans += encodedText[x * cols + y]; ...
ALGO
0.999754
6.13975
1ec37b21-3e02-41b8-b5db-2e8b7f286e6d
theomkargharge/DSA
Array/codestudiosumofproduct.cpp
#include <iostream> using namespace std; long long int forsum(long long int n, long long int q) { int temp = 0; for (int i = 0; i <= n; i++) { if (q == 1) { temp = temp + i; } } return temp; } long long int forProduct(long long int n, long long int q) { in...
ALGO
0.999757
4.527602
6064c1f0-6185-4243-9401-58e73382138f
connieya/cpp_algorithm
jungle/week4/2579.cpp
#include "bits/stdc++.h" using namespace std; int arr[301]; int dp[301]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin >> n; for (int i = 1; i <=n ; ++i) { cin >> arr[i]; } dp[1] = arr[1]; dp[2] = arr[1]+arr[2]; for (int i = 3; i <=n ; ...
ALGO
0.999983
4.12643
35c50355-b8fe-4ba0-8072-3b074cb90da4
Tanvir274/C-plus-plus
DataStructure_Algorithom/linklist_insert_sortedly.cpp
#include<bits/stdc++.h> using namespace std; struct linklist { int data; struct linklist* next; }; linklist* head; void insert_data(int value) { linklist* node=(linklist*) malloc(sizeof(linklist)); node->data=value; node->next=NULL; if(head==NULL || head->data> node->data) { nod...
ALGO
0.999612
3.925
ebc2e9fd-2885-45b9-83eb-c6e0adde6a48
AntonioPalese/LeetCode
MergeTwoSortedLists/main.cpp
#include <stack> #include <cmath> #include <stdio.h> #include <cstdlib> #include <string> #include <numeric> #include "LinkedList.h" class Solution { public: ListNode* mergeTwoLists(ListNode* list1, ListNode* list2) { ListNode* c1 = list1; ListNode* c2 = list2; ListNode* head = nul...
ALGO
0.999838
5.633732
56956eb4-eb92-4e2a-b5ef-579e913aa99a
githubhj/ACA_Project3
project3/protocols/MOESI_protocol.cpp
#include "MOESI_protocol.h" #include "../sim/mreq.h" #include "../sim/sim.h" #include "../sim/hash_table.h" extern Simulator *Sim; /************************* * Constructor/Destructor. *************************/ MOESI_protocol::MOESI_protocol (Hash_table *my_table, Hash_entry *my_entry) : Protocol (my_table, my_...
ALGO
0.876051
5.877148
16bafd84-9918-4e96-8ede-c0e887895ec0
ishandutta2007/codeforces
peltorator/normal/1548/B.cpp
#ifdef ONPC #define _GLIBCXX_DEBUG #endif #include <bits/stdc++.h> #define sz(a) ((int)((a).size())) #define char unsigned char using namespace std; // mt19937 rnd(239); mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); typedef long long ll; typedef long double ld; const int N = 412345; l...
ALGO
0.999861
4.232229
11fdd5df-f15a-4e23-80de-d6d9e4b45803
rsk0315/library
test/yc_703_onoff.test.cpp
#define PROBLEM "https://yukicoder.me/problems/no/703" #include <cstdint> #include <cstdio> #include <algorithm> #include <vector> #include "algorithm/online_to_offline_optimization.cpp" int main() { size_t n; scanf("%zu", &n); std::vector<int> a(n), x(n), y(n); for (auto& ai: a) scanf("%d", &ai); for (au...
ALGO
0.9993
4.102973
a93bdc24-3a86-4739-a6a0-e1c4d992dbed
tranthaituananh/Leetcode
0001-0500/0042/0042.trapping-rain-water.cpp
/* * @lc app=leetcode id=42 lang=cpp * * [42] Trapping Rain Water */ // @lc code=start class Solution { public: int trap(vector<int> &height) { int n = height.size(); if (n == 0) return 0; int left = 0, right = n - 1; int leftMax = height[left], rightMax = heigh...
ALGO
0.99998
7.318009
c4d1a070-628f-45d5-ae93-cda609a3bd58
gitkaichen/mesa-posh
src/gallium/drivers/swr/rasterizer/core/rasterizer.cpp
/**************************************************************************** * Copyright (C) 2014-2018 Intel Corporation. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the...
ALGO
0.888425
6.169462
9a184ffc-f832-4aa2-8bc2-932a76b4956c
nbutacm/NBUTACM
2019级/[标程]Div2 2019每周练习(二)/G 小梁的暑期生活.cpp
#include<iostream> #include<string> #include<algorithm> #include<cmath> using namespace std; struct competition { int begin, end; }; bool cmp(competition a, competition b) { return a.end < b.end; } int main() { int n; while (cin >> n) { if (n == 0) { break; } competition book[105]; for (int i = 1; i <...
ALGO
0.99985
4.025033
ad3d8ba5-b80a-43d5-b80f-be720e693858
dasbd72/leetcode
problems/0070-climbing-stairs/main.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: vector<int> _dp; int climbStairs(int n) { _dp.assign(n + 1, 0); return dp(n); } int dp(int n) { if (_dp[n]) { return _dp[n]; } if (n == 1 || n == 2) { return _dp[n] ...
ALGO
0.999844
5.842404
1a95aada-b9d4-46cb-ba34-cfd53f494736
ihSomik/problem-solving
vjudge/somik_2103147-ac/CodeForces/1359A/40591194_AC_15ms_4kB.cpp
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n, m, k; cin>>n>>m>>k; /* n/k is the number of cards got each player x is the number of jokers in the winner's hand y is the maximum number of jokers among a...
ALGO
0.999516
3.557816
2becd933-dee4-4285-9517-20ba63a9b475
esix/competitive-programming
lightoj/~contest-727/B/main.cpp
#include <stdio.h> #include <string> using namespace std; #define MAX_SIZE 100002 int main(){ int T; scanf("%d", &T); for(int t = 1; t <= T; t++) { int n; scanf("%d", &n); long long int weights[MAX_SIZE][2] = {0}; long long int total_sum = 0; long long int res[MAX_SIZE] = {0}; int nei...
ALGO
0.999874
3.911721
d08ec057-091c-49fb-9817-f589f64f3b48
feof81/morganaPublic
tests/morganaFields/feStaticField2dGlobalManipTest3.cpp
#include <cmath> #include <iostream> #include <boost/mpi.hpp> #include <boost/mpi/environment.hpp> #include <boost/mpi/communicator.hpp> #include "pMapItem.h" #include "pMapItemShare.h" #include "geoShapes.h" #include "meshInit2d.hpp" #include "feQr2d.hpp" #include "feStaticField2d.hpp" #include "feStaticField2dGlo...
DATA
0.89122
4.215038
a86950c3-85a3-4e29-8495-5184f7fca8d1
miti/Codes
dijaktra.cpp
#include<stdio.h> #include<cstring> #define LIMIT 10000 using namespace std; int edge[LIMIT][1000],v[LIMIT],visited[LIMIT],tym[LIMIT][1000]; unsigned long long distance[LIMIT]; int main() { int n,m,s,e,min_d,pos,next,i,j,t,tc; scanf("%d",&tc); for(int k=0;k<tc;k++) { scanf("%d%d%d%d",&n,&m,&s,&e); memset(visited...
ALGO
0.999932
4.122997
cb7bdc25-10db-401f-b53e-fe69fd935027
Chen-0117/Image-Understanding
420 final project/dlib/dlib-19.24/examples/hough_transform_ex.cpp
/* This is an example illustrating the use of the Hough transform tool in the dlib C++ Library. In this example we are going to draw a line on an image and then use the Hough transform to detect the location of the line. Moreover, we do this in a loop that changes the line's position slightly eac...
ALGO
0.975384
7.122585
1e624de0-720e-4803-95ec-6fdde194f82b
anubhavvsharma/Anubhav_22BCS14738
arrays/26_removeDuplicates.cpp
class Solution { public: int removeDuplicates(vector<int>& nums) { int j=1; for(int i=1;i<nums.size();i++){ if(nums[i]!=nums[i-1]){ nums[j]=nums[i]; j++; } } return j; } };
ALGO
0.999803
6.082592
9b528a5f-20a3-468d-84f6-087cb5b47e98
moniccax/C_Programming_2013
Aulas/05_30_2011/30_05_2011.CPP
/***************************************************************** * Autor: Gilmar Machado Grossi * * Compilador: gcc no Linux Ubuntu 10.04 * * Ambiente: Tela de scroll da Konsole * * Modelo de memoria: Small ...
ALGO
0.930886
3.872995
a1a6d84c-6b8a-44ba-843a-2679dfd27052
PrachiJadhav14/Flutter
Cack_Image_Assignment/flutter_application_21/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.997613
6.76073
ad037b4b-6fd1-4522-9e57-fb677d0659f0
wilmercastrillon/Ejercicios-Uva-Judge-Online
Competitive Programming 3/(Computational) Geometry/Basic Geometry - Part 2/815 Flooded.cpp
#include <bits/stdc++.h> #define forr(i,n) for(int i = 0; i < n; ++i) #define forab(i,a,b) for(int i = a; i < b; ++i) #define pb(x) push_back(x) using namespace std; typedef long long int lli; int main(){ //freopen("salida.txt", "w", stdout); int n, m, x, caso = 1; double vol; while(cin >> n >> m, n)...
ALGO
0.999331
3.432848
9a15c632-ccb2-4aa8-8d2c-2c22b36579dd
PhilippUsenko/410901
Букшта/laba4/codep1.cpp
#include <iostream> using namespace std; int main() { const int ms = 100; int nn = 0, pn = 0; int n; int pm[ms]; int nm[ms]; int m[ms]; cout << "введите кол-во элементов массива\n"; cin >> n; if (n >100) { cout << "размерность должна быть меньше 100"; return 0; } cout << "введите элементы массива\n"; fo...
ALGO
0.99946
3.188165
0515fdc2-e31c-46f3-8400-a1bcd9ce4aaf
Henry-lsy/cpp-utils-tool-box
stacktrace/main.cpp
// #define BOOST_STACKTRACE_USE_BACKTRACE #include <cstdlib> #include <exception> #include <iostream> #include "custom_stacktrace.hpp" void func_c() { throw std::runtime_error("Simulated exception to trigger std::terminate"); } void func_b() { func_c(); } void func_a() { func_b(); } // main 函数 int mai...
TOOL
0.918919
5.942394
d6ae7232-ba64-4515-a026-97533ee97016
i2p/i2p-browser
modules/fdlibm/src/s_nearbyint.cpp
#include <fenv.h> #include "math_private.h" /* * We save and restore the floating-point environment to avoid raising * an inexact exception. We can get away with using fesetenv() * instead of feclearexcept()/feupdateenv() to restore the environment * because the only exception defined for rint() is overflow, and ...
TOOL
0.900353
6.454156
80eb8469-d41b-4685-ba64-697cae4485a0
enochii/leetcode-solution
81.cpp
#include <vector> #include <algorithm> using namespace std; //31 的加强版 //就是加了可重复这个条件 //感觉这个想法其实有点万金油 //就是找到minimum,这个可以参考前面的 //然后其实两边就都是有序的了... //Binary Search //Rotated sorted array search class Solution { public: bool search(vector<int>& nums, int target) { //先找到最小值 int l=0,r=nums.size(); ...
ALGO
0.999997
6.090326
78cfb499-9abf-4b7a-8bde-2c0f6cb909ce
jlevy44/UnrealAI
CarAI/joshua_work/old/tutorial/Code/08_code/Bullet/Lib/bullet-2.77/Demos/ConvexHullDistance/ConvexHullDistanceDemo.cpp
/// /// Convex Hull Distance Demo shows distance calculation between two convex hulls of points. /// GJK with the btVoronoiSimplexSolver is used. /// #include "GL_Simplex1to4.h" #include "LinearMath/btQuaternion.h" #include "LinearMath/btTransform.h" #include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolve...
ALGO
0.998614
5.816984
e9e0a66b-9401-4794-a901-0977b2eeadb0
prakash870/LeetCode-Solved
Kth smallest element - GFG/kth-smallest-element.cpp
//{ Driver Code Starts //Initial function template for C++ #include<bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: // arr : given array // l : starting index of the array i.e 0 // r : ending index of the array i.e size-1 // k : f...
ALGO
0.999417
5.288867
250d30b7-e457-4555-86dc-63a3bc5bfc21
ketan-suthar/Algorithms
Number Theory/Multip Inverse/FermatsLittleTheorem.cpp
#include <bits/stdc++.h> #define lli long long int using namespace std; lli power(lli a, lli n, lli mod) { lli res=1; while(n) { if(n%2) { res = ((res%mod) * (a%mod))%mod; n--; } else { a = ((a%mod) * (a%mod))%mod; n/=2; } } return res; } int main(int argc, char const *argv[]) { lli a,m...
ALGO
0.99974
4.938823
54b21aa3-7cf1-4f0b-bf60-ccc449a4bd61
samyaSunibirDas0118/CSE225_DS-Algo
CSE-225-Data-Structure-Lab/Linked List/Printing Linked List in forward and backward order using Recursion/main.cpp
#include <iostream> using namespace std; struct Node { int info; Node* next; }; void PrintForward(Node* head) { //Base case if(head == NULL) return; //Recursive case else { //Printing before function call cout <<" "<<head->info; PrintForward(head->next); ...
ALGO
0.999839
4.62981
500f95c6-3256-4b5e-afd2-f9cb14361852
Nguyenbaha/CP-Algorithms
codefores/DFS/Kiem_tra_thanh_phan_lien_thong.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; const int N = 2e5+5 ; //😁😁😁😁😁😁😁😁😁😁😁 vector<int> g[N]; vector<bool>used(N,false); int n,m; void dfs(int u) { used[u] = true; for(int i: g[u]) if(!used[i]) ...
ALGO
0.999485
4.706409
60b9cf16-89ae-4db5-beb6-a8d21566b5b5
FerdynandSebastianMonroySalazar/Progra1Works
Ejercicios Cap5 Programando en C++/problemaPeterMinuit.cpp
//Ejercicio 5.29 //Ferdynand Monroy Febrero 2025 #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { double principal = 24.0; int anios = 387; cout << "Tasa de interes" << setw(20) << "Monto en deposito" << endl; cout << fixed << setprecision(2); for (double ...
ALGO
0.975126
4.044184
4f588c7e-6d68-4cdd-b1f7-03ba3d3e505c
deoliaman00/LEETCODE-SOLUTIONS
Aggressive Cows - GFG/aggressive-cows.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 func(vector<int> stalls, int i, int k) { /* cows=>k i=>limit required minimum to be held at last...
ALGO
0.999971
6.064677
004b5faf-0258-4c43-8ab4-b550611bfe01
yexis/OI
nowcoder/牛客周赛60/b.cpp
#include <iostream> #include <vector> #include <string.h> #include <algorithm> #include <numeric> #include <set> #include <array> #include <cassert> #include <cstdio> #include <cstring> #include <iostream> #include <iomanip> #include <string> #include <sstream> #include <vector> #include <queue> #include <stack> #inclu...
ALGO
0.999951
3.275711
6d37280c-b1ab-4601-9b27-f65dda5876a7
kshprenger/algorithms
Itmo/codeforces/edu/segtree/3/contraversion.cpp
#include <vector> #include <iostream> #include <stdint.h> using namespace std; struct segtree{ vector <int32_t> data; int32_t size; void init(int32_t n){ size = 1; while (size<n) { size*=2; } data.assign(2*size,0); } void construct(vector<int32_...
ALGO
0.99998
4.534033
346c2b4c-e118-4929-8a46-7fc746f3f9a0
sir-rasel/Online_Judge_Problem_Solve
Codeforces/codeforces_1339B.cpp
#include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef tuple<int,int,int> tiii; const int mod = 1e9+7; int main(){ int test; scanf("%d",&test); while(test--){ int n; scanf("%d",&n); vector<int>a(n); for(int i=0;i<n;i++) { scanf("%d",&a[i]...
ALGO
0.999792
3.521516
75d408a4-e694-473d-9385-0ca7501b8b91
phdsky/ORBSLAM24Windows
Thirdparty/eigen/bench/benchmarkSlice.cpp
// g++ -O3 -DNDEBUG benchmarkX.cpp -o benchmarkX && time ./benchmarkX #include <iostream> #include <Eigen/Core> using namespace std; using namespace Eigen; #ifndef REPEAT #define REPEAT 10000 #endif #ifndef SCALAR #define SCALAR float #endif int main(int argc, char *argv[]) { typedef Matrix<SCALAR, Eigen::Dynam...
TOOL
0.860115
3.688043
d9426a2a-f02d-438c-9c35-7f7921bbf0de
adityanjr/code-DS-ALGO
CodeForces/Complete/700-799/796A-BuyingAHouse.cpp
#include <cstdio> int main(){ const int D = 10; long n, m, k; scanf("%ld %ld %ld\n", &n, &m, &k); long minDist(n); for(long p = 1; p <= n; p++){ long a; scanf("%ld", &a); if(a <= 0 || a > k){continue;} long dist = (p > m) ? (p - m) : (m - p); minDist = (minDist < dist) ...
ALGO
0.999775
3.588983
f02d26f8-8d7f-4d5a-8112-ac09995edc97
vamcrizer/cpp-ptit
long/10. SUM OF REMAINDERS WHEN DIVIDED BY K.cpp
#include<bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using str = string; int main(){ //ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin.tie(0) -> sync_with_stdio(0); int t; cin >> t; while(t--){ ll n, k; cin >> n >> k; ll sum = 0; for(int i=1; i<=n; i++){ su...
ALGO
0.999893
3.952575
fdd284e3-15d6-47eb-af1d-538db922fb8c
jinjjij/baekjoon
CPP/solved/랜덤마라톤 56/1297 - TV 크기/main.cpp
#include <iostream> #include <vector> #include <cmath> int main(){ std::ios::sync_with_stdio(false); std::cin.tie(NULL); std::cout.tie(NULL); double D, H, W; std::cin >> D >> H >> W; double a = sqrt(D*D/(H*H+W*W)); std::cout << (int)(H*a) << " " << (int)(W*a); return 0; }
ALGO
0.999168
3.548684
cc469da4-0fb0-4626-b6a4-319209f96d5c
AshutoshKumar0206/codeforcesSolutions
1400RatingQuestions/SetConstruction.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long void solve(){ int n; cin>>n; vector<vector<char>>v(n, vector<char>(n)); for(int i=0; i<n; i++){ for(int j=0; j<n; j++){ cin>>v[i][j]; } } unordered_map<int, set<int>>mp; for(int i = 0; i<n; i++){ for(int j = 0; j<n; j++){ if(v...
ALGO
0.999809
4.639137
f094fdd9-7b37-4b78-ace4-bd0171a7f6c8
SamarthAroraa/COMPETITIVE-CODING
segment trees/Maximum Sum In Subarray.cpp
#include<bits/stdc++.h> #define deb(x) cerr<<#x<<" "<<x<<endl; #define ll long long using namespace std; class node{ public: int bps,bss,sum,maxsum; }; void buildtree(node*tree,int n, int arr[], int s, int e,int ad){ if(s==e){ // if(arr[s]<0){ // tree[ad].bps=0; // tree[ad].bss=0; // tree[ad].sum=0; // ...
ALGO
0.999975
3.978232