uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b63d2e36-deb1-4a04-80ca-41e44703c918 | YXHXianYu/AIChallenger | map.cpp |
#ifndef MAP_cpp_
#define MAP_cpp_
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<queue>
const int MAP_X = 25;
const int MAP_Y = 11;
int mapB[MAP_X+1][MAP_Y+1] = {}; // ͼ
int mapC[MAP_X+1][MAP_Y+1] = {}; //
void map_init() {
for(int i = 1; i <= MAP_X; i++)
mapB[i][1] = mapB[i]... | ALGO | 0.874027 | 3.541717 |
7714f6fa-d38e-430e-8faa-97a17e98f956 | byam/algorithms | atcoder/contest/abc/contest/abc241/c.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
//#include <atcoder/all>
// using namespace atcoder;
using namespace std;
// func
#define rep(i, first, last) for (int i = (first); i < (last); i++)
#define rrep(i, last, first) for (int i = (last); i >= (fi... | ALGO | 0.999634 | 5.003208 |
c819d92b-4a52-4e47-bfee-e486e68ec21f | bcburin/imepp-code | hw_0+/c.cpp | #include <iostream>
int main(int argc, char const *argv[]) {
// Get number of elements
long n, *v;
std::cin >> n;
// Allocate memory
v = new long[n];
// Read input
for (int i = 0; i != n; ++i) std::cin >> v[i];
// Calculate output
long prev = v[0], total = 0, diff;
for (long i =... | ALGO | 0.999964 | 5.090096 |
55a44dd0-fd84-43f9-9999-727a608cae30 | yuyi-7/BlueBriadge | 特殊的数字.cpp | #include<stdio.h>
int main()
{
int i,j,temp,sum;
for(i=100 ; i<999 ; i++)
{
temp = i;
sum = 0;
while(temp)
{
j = temp%10;
sum = sum + j*j*j;
temp = temp/10;
}
if(sum == i)
{
printf("%d\n",i);
}
}
return 0;
}
| ALGO | 0.999857 | 3.31558 |
0a69eea5-8f38-4e01-8425-e39403ed562f | MapleCheatOsuLeak/Osu-Stable-Loader | Osu Stable Loader/Dependencies/CryptoPP/xed25519.cpp | // xed25519.cpp - written and placed in public domain by Jeffrey Walton
// Crypto++ specific implementation wrapped around Andrew
// Moon's public domain curve25519-donna and ed25519-donna,
// https://github.com/floodyberry/curve25519-donna and
// https://gith... | TOOL | 0.987753 | 7.422906 |
78584a43-8e54-4657-bbbe-7a69390b3ebc | sarvex/leetcode-kotlin | solution/1200-1299/1288.Remove Covered Intervals/Solution.cpp | class Solution {
public:
int removeCoveredIntervals(vector<vector<int>>& intervals) {
sort(intervals.begin(), intervals.end(), [](const vector<int>& a, const vector<int>& b) { return a[0] == b[0] ? b[1] < a[1] : a[0] < b[0]; });
int cnt = 1;
vector<int> pre = intervals[0];
for (int i... | ALGO | 0.999881 | 5.945465 |
185f085e-cabd-434f-a1ff-02db4721d60a | Xohail69/Leetcode | 2370-longest-ideal-subsequence/2370-longest-ideal-subsequence.cpp | class Solution {
public:
int longestIdealString(string s, int k) {
// Similar to longest increasing subsequence with slight modification, consider a DP array of size 26 where each index coresponds to the size of maximum subsequence which ends with the character i (here characters are mapped from 0 - 25... | ALGO | 0.999912 | 5.822685 |
ecbc9f9e-50b5-47ef-9272-cc5241b7a4c1 | xuedingedexingkong/fvm_solver | gmsh/gmsh-4.13.1-source/gmsh-4.13.1-source/contrib/MeshOptimizer/VertexCoord.cpp | #include <iostream>
#include <algorithm>
#include "GmshMessage.h"
#include "GFace.h"
#include "GEdge.h"
#include "MVertex.h"
#include "MLine.h"
#include "VertexCoord.h"
SPoint3 VertexCoordParent::getUvw(MVertex *vert) const
{
GEntity *ge = vert->onWhat();
switch(ge->dim()) {
case 1: {
SPoint3 p(0., 0., 0.);
... | TOOL | 0.89827 | 5.583485 |
2f0cc418-31ce-4bce-aca6-04fb03e9d0a6 | call-me-bammer/montmartre-hill | baekjoon/27323/main.cpp | #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << a * b << '\n';
return 0;
}
| ALGO | 0.991523 | 4.173733 |
ccdb3370-d1b2-44af-8e3e-bcf18c9b4e2d | ShantoOBS/Interview_DS_Algorithm | Linked List/Linked_list.cpp | // Online C++ compiler to run C++ program online
#include <iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(int data){
this ->data=data;
this ->next=next;
}
};
void insertAthead(node* &head,int d){
node* n=new node(d);
n->next=... | ALGO | 0.999624 | 4.336328 |
9c1aca57-a5c9-400e-b0ae-6d651f6170a3 | gafeol/curso-cpp | C2/Aula5/ponteiro.cpp | #include <iostream>
using namespace std;
void calcula(int* y) {
cout << "calcula " << *y << " " << y << endl;
(*y)++;
cout << "calcula " << *y << " " << y << endl;
}
int main() {
int x = 10;
cout << "main " << x << " " << &x << endl;
calcula(&x);
cout << "main " << x << " " << &x << endl;
} | TOOL | 0.912691 | 5.143842 |
24cd3dad-9ed4-4753-9d5f-de24cdc6f5bd | Sookmyung-Algos/2021algos | algos_assignment/2nd_grade/최예헌_honi/week2/1806.cpp | #include <iostream>
using namespace std;
int main(){
cin.tie(0); cout.tie(0);
ios_base::sync_with_stdio(false);
int N,S;
int num[100001];
int s=0,e=0,sum=0,count=0,min;
cin>>N>>S;
min=N; //min값을 최대의 경우로 설정
for (int i=0;i<N;i++)
cin>>num[i]; ... | ALGO | 0.99999 | 3.610728 |
37609162-57c3-4c77-81a0-391d43c2d18e | raincross7/code-similarity | codes/train_code/problem229/problem229_282.cpp | #include <cstdio>
#include <iostream>
#include <utility>
using namespace std;
int main(){
int n;
int a[100];
int count=0;
scanf(" %d", &n);
for(int i=0; i<n; ++i) scanf(" %d", &a[i]);
//selection sort
for(int i=0; i<n; ++i){
int minj=i;
for(int j=i; j<n; ++j){
if(a[j]<a[minj]) minj=j;
}
if... | ALGO | 0.999679 | 3.212092 |
38d1e874-dd1f-4f2d-b02a-9f579f800225 | luqmanarifin/cp | Educational Codeforces Round 116/a.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 105;
char s[N];
int main() {
int t;
scanf("%d", &t);
while (t--) {
scanf("%s", s);
int n = strlen(s);
if (s[0] != s[n - 1]) {
s[n - 1] = s[0];
}
printf("%s\n", s);
}
return 0;
}
| ALGO | 0.999959 | 3.846795 |
c27bce80-03df-4023-b143-11e384e3a597 | tranleduy2000/c_cpp_compiler | app/src/main/assets/examples/cpp/lexicographical-order.cpp | // C++ Program to Sort Elements in Lexicographical Order (Dictionary Order)
// This program sorts the 10 strings (entered by the user) in lexicographical order (dictionary order).
#include <iostream>
using namespace std;
int main()
{
string str[10], temp;
cout << "Enter 10 words: " << endl;
for(int i = ... | ALGO | 0.995847 | 5.104803 |
d26d9cdd-309e-4589-8ab5-38d024b26503 | ishandutta2007/codeforces | alexandr_ts/normal/1036/E.cpp | #include <bits/stdc++.h>
#define fr(i, n) for (ll i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<vector<ll> > mat;
const ld PI = acos(-1);
const ll INF = 2e9;
const... | ALGO | 0.998692 | 4.098851 |
34880a7b-4c2d-4f3f-bae8-80ea9061d487 | HimanshuSingour/DSA---Full-Dynamic-Programming- | DP on Grids/Space Optimisation/Ninjas_and_his_friend_3d.cpp | #include<bits/stdc++.h>
using namespace std;
int solve(vector<vector<int>> &grid , int n ,int m, vector<vector<vector<int>>> &dp){
vector<vector<int>> prev(m + 1 , vector<int>(m + 1 , 0));
vector<vector<int>> curr(m + 1 , vector<int>(m + 1 , 0));
for(int j1 = 0; j1 < m; j1++){
for(int j2 = 0; j2 <... | ALGO | 0.999928 | 5.013622 |
086f0458-66e8-45fc-a5ed-9f3363d86630 | kartikeyapandey20/My-DSA-jorney | C++ language/STL/map.cpp | #include<iostream>
#include<map>
using namespace std;
int main(){
//in a map there is a key value pair meaing for particular key there will be value
//example 1-"hello" here 1 is key and hello is the value
//if it is map it will in sorted order
//if it is an unordered may it will not be in sorted orde... | ALGO | 0.869829 | 3.818165 |
8ddf8bcc-ef09-4953-94ba-90017b4f5931 | vinhveer/Study_Semester3_2023-2024 | KTLT/Hello/QuyHoachDong.cpp | #include <iostream>
#include <algorithm>
using namespace std;
#define MAX 100
int n;
int a[MAX], l[MAX], lis[MAX];
void Init()
{
for (int i = 0; i < n; i++)
{
l[i] = 1;
lis[i] = -1;
}
}
void Dynamic()
{
for (int i = 1; i < n; i++)
for (int j = 0; j < i; j++)
if (a... | ALGO | 0.999989 | 4.824107 |
b5925fea-b8bc-4e12-8715-9b4afd9209c0 | rajivranjanmars/leetcode | 0020-valid-parentheses/0020-valid-parentheses.cpp | class Solution {
public:
bool isValid(string s)
{
// create a stack to store opening brackets
stack<char> st;
// loop through each character in the input string
for(char &ch:s)
{
// if current character is an opening bracket, push the corresponding closing bracket onto the stack
i... | ALGO | 0.997741 | 6.44186 |
07b1cd53-006d-44f4-9c62-ee3818844f31 | lacram/study | Baekjoon/save/13305.cpp | #include <iostream>
#include <vector>
#include <cstring>
#include <fstream>
#include <algorithm>
using namespace std;
int n;
int costs[100000];
int dist[100000];
int main(){
ios_base :: sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// ifstream cin;
// cin.open("input.txt");
cin >> n;
for (i... | ALGO | 0.999923 | 3.059315 |
811614ad-f6e4-49e9-85ac-cbaffffd1a48 | ashishkushwaha56/LeetCode-Leethub | Prime List - GFG/prime-list.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node *next;
Node(int num){
val=num;
next=NULL;
}
};
// } Driver Code Ends
//User function Template for C++
/*
class Node{
public:
int val;
Node *next;... | ALGO | 0.999896 | 4.596678 |
df4b5c7f-533a-4c09-9734-4356e86135dc | minseokim0629/baekjoon | 11726.cpp | #include <iostream>
using namespace std;
int dp[1001];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int N;
cin >> N;
dp[0] = 1;
dp[1] = 2;
for (int i = 2; i < N; i++)
{
dp[i] = (dp[i - 1] + dp[i - 2]) % 10007;
}
cout << dp[N - 1] << '\n';
... | ALGO | 0.999948 | 4.958464 |
47516f7d-b4e2-4597-bbd2-75bc1a41beee | Ronnie-Leon76/C-CPlusPlus-Code-Snippets | template.cpp | template <class findMin>{
findMin GetMin(findMin a){
int min = 0;
for(int i = 0;i<sizeof(a.Ms);i++){
if(Ms[i]<min){
min = Ms[i];
}
}
}
} | ALGO | 0.992049 | 3.123873 |
dea2f7d7-1179-4644-9bb3-5e8ea0c220fe | suanhaitech/cppstudy2023 | zhangjinghong_cppfiles/冒泡排序.cpp | #include<iostream>
using namespace std;
int main(){
int arr[9] = {8,9,2,5,0,1,4,3,7};
cout <<"排序前"<<endl;
for(int i = 1; i< 9 ; i ++){
cout << arr[i] <<" ";
}
cout << endl;
//开始冒泡排序
//总排序轮数为元素个数-1
for(int i = 0; i<9-1 ; i++){
//内层循环对比 次数 = 元素个数 - 当前轮数 -1
for(int ... | ALGO | 0.999963 | 3.60738 |
05a62a72-81c6-48e8-bf09-45ee6dd7a99f | larryzhou1111/Leetcode-1 | 001~100/50. Pow(x,n).cpp | // Sol1: res *= x for n times
// Time: O(n)
class Solution {
double helper(double x, int n) { //when n >= 0
if (x == 0 || x == 1) return x;
if (x == -1) return (n % 2 == 0)? 1 : -1;
double res = 1;
while (n--) {
res *= x;
if (res == 0) break;
... | ALGO | 0.999994 | 6.010058 |
b43c69c4-b25f-42c0-a277-7e6e6c6fe427 | loal123/CP | tlx/TLX_TLX_Special_Open_Contest_April_Fools_2024/C_Creating_Scientific_Notations.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vl vector<ll>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define SZ(x) ((int)... | ALGO | 0.999022 | 5.314662 |
3f522fee-22a9-4106-bbc2-79a1bc06655c | WKolodziejski/TCC-continuation | img.cpp | #include <opencv2/videoio.hpp>
#include "opencv/cv.cpp"
#include "opencv/draw.hpp"
#include <opencv2/imgproc.hpp>
#include "av1/ransac.h"
#include "av1/corner_detect.h"
using namespace std;
using namespace cv;
using namespace cv::xfeatures2d;
using namespace std::chrono;
// Usado para gerar imagens mais facilmente
in... | ALGO | 0.953018 | 4.011452 |
1e23d4f2-8d2c-448d-ae11-05fa79a9e3b4 | ishandutta2007/codeforces | jiangly/normal/1721/C.cpp | #include <bits/stdc++.h>
using i64 = long long;
void solve() {
int n;
std::cin >> n;
std::vector<int> a(n), b(n);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
}
for (int i = 0; i < n; i++) {
std::cin >> b[i];
}
for (int i = 0, j = 0; i < n; i++) {
w... | ALGO | 0.999982 | 4.552934 |
847d8f2b-7efc-4a37-9179-3bc44549b805 | aloneCR/Study | 51Nod/51nod1416.cpp | #include <stdio.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
const int maxn = 50 + 5;
char a[maxn][maxn];
int vis[maxn][maxn];
int n, m;
const int dx[] = {0, 0, -1, 1};
const int dy[] = {1, -1, 0, 0};
bool dfs(int x, int y, int px, int py) {
vis[x][y] = -1;
for(int i = 0; i... | ALGO | 0.999972 | 3.801712 |
046b7d0a-15f3-4c4f-a5d2-65ffbf83b180 | hemoye/ACM | C_C++/杭电题目分类/基础题/1106.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int MAXN = 1004;
int main(int agrc, char *agrv[])
{
int arrAy[MAXN];
char str[MAXN];
while (~scanf("%s", str)){
int flage(0), count(0);
int len = strlen(str);
memset(arrAy, 0, len);
for (... | ALGO | 0.999559 | 3.426298 |
ab6b4787-f075-4c51-9793-a4ca89353fbf | ishikabansal04/DataStructures_And_Algorithms | Graphs/dijkstra.cpp | //using Adjacency Matrix
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<climits>
using namespace std;
int findMinVtx(int *weights, bool*visited, int size){
int minvtx=-1;
int minwt=INT_MAX;
for(int i=0;i<size;i++){
if(!visited[i] && weights[i]<minwt){
... | ALGO | 0.999991 | 4.302611 |
f4e027e0-613e-492e-85b8-425098d0a281 | kjh01140/codetree-TILs | 241222/숫자들의 합 중 최대/maximum-of-sum-of-numbers.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int ans = 0;
int main() {
int X, Y; cin >> X >> Y;
for(int i=X ; i<=Y; i++){
int num = i;
int sum = 0;
while(true){
sum+= num%10; //일의 자리 합
num = num/10;
if(num < 10) {
s... | ALGO | 0.999912 | 4.369465 |
0390cc3c-403e-4747-8f18-26d21710f2a0 | anirudt/dlib-fr-fork | examples/object_detector_ex.cpp | /*
This is an example illustrating the use of dlib's bag-of-visual-word based
tools for detecting objects in images. In this example we will create three
simple images, each containing some white squares. We will then use the
sliding window classifier tools to learn to detect these squares.
If t... | ALGO | 0.925976 | 7.924053 |
d595639d-f81b-4c35-aa5a-33375def2d43 | north-h/Match_code | 2023/Codeforces Round 827 (Div. 4)/C.cpp | /*
Author : north_h
File : C.cpp
Time : 2023/8/3/14:29
_ _ _
_ __ ___ _ __| |_| |__ | |__
| '_ \ / _ \| '__| __| '_ \ | '_ \
| | | | (_) | | | |_| | | | | | | |
|_| |_|\___/|_| \__|_| |_|___|_| |_|
|_____|
*/
#pragma GCC optimize(3)
#in... | ALGO | 0.999008 | 4.595425 |
94de33c1-0d7a-4b58-8469-b1b5f55ac530 | thilio/Competitive-Programming | OJ/Codeforces/1480C - Searching Local Minimum.cpp | #include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define fr(i,n) for(int i=0;i<n;i++)
#define frr(i,n) for(int i=1;i<=n;i++)
#define ms(x,i) memset(x,i,sizeof(x))
#define dbg(x) cout << #x << " = " << x << endl
#define all(x) x.begin(),x.en... | ALGO | 0.999983 | 3.395751 |
99c334fe-5e52-47e0-81f0-3075eba4c403 | aldenngsk/Orb25---ShadowFit-Apollo- | 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.998799 | 6.776823 |
6bc12da7-4c1a-4935-85a4-1fac4e9139fb | ssj-gz/Competitive-Programming | hackerrank/nimble-game.cpp | // Simon St James (ssjgz) 2017-11-30
#include <iostream>
using namespace std;
int main()
{
// Took me a while, as it is tempting to consider this game from a "square-centric" point
// of view, whereas you really have to take a coin-centric one!
//
// Take a single-coin example: this is plainly equal t... | ALGO | 0.999806 | 4.685837 |
0214c5aa-35fd-4528-9a7f-e87ee848e159 | danieltrt/SBFL | playground/java_codex/syntax/REPLACE_CHARACTER_C1_C2_C2_C1_STRING_S.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <numeric>
#include <algorithm>
using namespace std;
string f_gold ( string s, char c1, char c2 ) {
... | ALGO | 0.99991 | 5.258265 |
1d10d365-a14b-4b4e-97ea-49445adb6876 | Kale-teck/Listas_Algoritmos | Algoritmos/Lista_02-main/questao_o.cpp | #include <iostream>
using namespace std;
int main()
{
int n, m;
cout << "Digite um número : ";
cin >> n;
m = n*2;
if(m > 30) {
cout << n << " Multiplicado por 2 é " << m << endl;
} else {
cout << " resultado menor que 30 não pode ser publicado ! ";
}
return 0;
} | ALGO | 0.872959 | 3.444312 |
3a895ca6-c56c-4df9-803c-4a3e0953d23e | zirm/dl2504693 | Hmwk/Homework_Set_1/SavitchChap1Prob5/main.cpp | /*
* File: Problem 5 Savage Ch1
* Author: David Leanos
*
* Created on June 25, 2014, 8:49 PM
*/
//System Level Libraries
#include <iostream>
using namespace std;
//User Defined Libraries
//Global Constants
//Function Protypes
//Execution Begins Here
int main(int argc, char** argv) {
int number_first, n... | ALGO | 0.912181 | 3.681986 |
bd335e86-faf0-4af6-89ea-55516d7cfda2 | navin9973/Data_Structure | array2/6vectorInput.cpp | // #include <iostream>
// #include <vector>
// using namespace std;
// int main()
// {
// vector<int> vec(5); // jb size diya hua rhta h tb
// for (int i = 0; i <= 5; i++)
// {
// cin >> vec[i];
// }
// for (int i = 0; i <= 5; i++)
// {
//
// cout << vec[i];
// }
/... | ALGO | 0.998573 | 3.798778 |
475bb2e3-d2c5-4c3c-86a8-a6fd4a83b0cd | salim002/Cpp-Codes | 52_Codeforces/17_Codeforces 2/173.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ld> vd;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
const int mod = 1000000007;
// const int mod = ... | ALGO | 0.999902 | 4.542242 |
ba148317-300d-4cc1-83d0-96cc209b13da | Gomainuo89/main_01 | Reverse_num.cpp |
#include <iostream>
using namespace std ;
int main(){
int r , x ;
int a = 0 ;
cout<<"Enter The value number : ";
cin>>x;
while(x != 0){
r = (x % 10);
a = a*10 + r ;
x = (x - r)/10 ;
}
cout<<"The reverse value number : " << a ;
return 0 ;
}
| ALGO | 0.998978 | 3.891015 |
eaaf45a5-38ba-4ff2-abc6-b63a2332b1d8 | abliveira/swe | Data Structures/5 Graph/2 Adjacency Matrix/Adjacency Matrix.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
Adjacency Matrix Representation of a Graph
Adjacency Matrix: A 2D array where rows and columns represent vertices, and values indicate edge existence (1 for an edge, 0 for no edge). Efficient for dense graphs but uses O(n²) space.
Example ... | ALGO | 0.997708 | 7.527463 |
0f831a60-fcc8-4486-98c9-a339d2e8af21 | zslomo/leetcode | 42. Trapping Rain Water.cpp | #include<vector>
#include<stack>
#include<algorithm>
using namespace std;
class Solution {
public:
int trap(vector<int>& height) {
if (height.empty()) return 0;
vector<int> lefthighest = { 0 };
int righthighest = 0;
int ret = 0, curr;
for (int i = 1; i < height.size(); i++) {
lefthighest.push_back(max(hei... | ALGO | 0.999969 | 6.637557 |
35fa8f31-f2a0-4d93-a7d0-0d5a6f899b3b | SHRUTI-SINGH16/internship-prep | 11-STACK/03-balanced-paranthesis.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
////TC=O(N) SC=O(N)
// bool matching(char ch1, char ch2){
// if((ch1=='(' && ch2==')') || (ch1=='[' && ch2==']') || (ch1=='{' && ch2=='}')){
// return true;
// }
// return false;
// }
// bool isBalanced(string str){
// stack<char>... | ALGO | 0.994916 | 5.979634 |
5f5c7f89-f4c0-4f40-acd7-d7c6d75b6277 | abhirams2020/Leetcode-Tracker2 | 173-binary-search-tree-iterator/173-binary-search-tree-iterator.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999958 | 6.464595 |
4571c053-7c97-49e6-953b-27705607ec27 | Chaste/Chaste | crypt/src/division_rules/CryptVertexBasedDivisionRule.cpp | #include "CryptVertexBasedDivisionRule.hpp"
#include "WntConcentration.hpp"
#include "StemCellProliferativeType.hpp"
template <unsigned SPACE_DIM>
c_vector<double, SPACE_DIM> CryptVertexBasedDivisionRule<SPACE_DIM>::CalculateCellDivisionVector(
CellPtr pParentCell,
VertexBasedCellPopulation<SPACE_DIM>& rCellPo... | ALGO | 0.985546 | 6.00882 |
f98a361e-1481-459c-8817-34410cf3f4cf | rfjck/biogas | lib/irr/irr.cpp | #define LOW_RATE 0.00001
#define HIGH_RATE 0.5
#define MAX_ITERATION 1000
#define PRECISION_REQ 0.0000001
#include "irr.h"
double computarIRR(float inversion_inicial, float flujos_caja[], int anios_flujo){
double *flujos;
flujos= new double[anios_flujo+1];
flujos[0]= -inversion_inicial;
for(int anio=1;anio<=anios... | ALGO | 0.999976 | 4.319679 |
d8b08b6f-560c-48ad-9a69-47c238474f49 | TengFeiyang01/Algorithm | ACODE/cf/Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2)/c.cpp | #include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
using i64 = long long;
void solve() {
int x;
std::cin >> x;
std::vector<int> ans{x};
while (x != (x & -x)) {
x -= x & -x;
ans.push_back(x);
}
while (x != 1) {
x -= x / 2;
ans.push_back(x);
}
std::cout << ans... | ALGO | 0.999952 | 4.733433 |
62300851-8e02-4c6e-9804-25322e96e89e | neal2018/oj_env | codeforces/762/f.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
constexpr ll MOD = 998244353;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
ll T;
cin >> T;
while (T--) {
int n, m, k, last = 0;
cin >> n >> m >> k;
for (int i = 0; i < k; i++) {
int pos = last;
for (int j = 0; j... | ALGO | 0.999811 | 4.57253 |
8b3e4d32-6c23-40fa-bee4-89a673adfb1a | utkarsht/SPOJ-problems | UCV2013I(radius of circle).cpp | #include<stdio.h>
#include<math.h>
#define scanint(x) scanf("%d",&x)
#define PI 3.14159265358979
int main()
{
int r,n;
while(1)
{
scanint(r); scanint(n);
if(r==0 && n==0) break;
n=n+n;
double result=sin((double)PI/n);
printf("%.2f\n",r/result);
}
}
| ALGO | 0.998582 | 3.140083 |
aeb9f1a4-15c1-4a88-bcb4-3c60029275a6 | ishandutta2007/codeforces | hydro-bot1/normal/817/D.cpp | // Hydro submission #6229adabe016cd75c1b4cf81@1646898603385
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 201000, MAXN = 200100;
typedef pair<ll, ll> PLL;
typedef pair<int, int> PII;
int a[1001000];
int lupper[1001000], rupper[1001000];
int rlower[1001000], llower[1001000];
void ... | ALGO | 0.9999 | 3.321258 |
6442d9b9-bf3c-4d13-a4a1-8dd67268917d | sfofgalaxy/Second-Year-Summary-of-Software-Engineering-Coursework-in-Zhejiang-University | 面向对象程序设计/教师内部资料/新教材/OOP/OOP even numbered exercise/Exercise05_42.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double commission = 0;
double salesAmount = 1;
// Enter the desired commission
cout << "Enter the desired commission: ";
double commissionSought;
cin >> commissionSought;
for (salesAmount = 1; commission < commissionSought; sales... | ALGO | 0.957695 | 4.122076 |
ed81bf8d-3905-4f82-b066-e568df52a44f | dhruvchandralohani/Networking | Selective Repeat (new).cpp | #include <iostream>
#include <time.h>
#include <unistd.h>
#define MAX 30
using namespace std;
struct frame
{
int data;
int sq;
bool isSent;
};
frame *rs=new frame[MAX];
int n=0,rscount=0;
void Sender(frame *s)
{
cout<<"\nSender: Data:"<<s->data<<" sq:"<<s->sq;
sleep(2);
}
void Receiver(frame *r)
{
r->isSent=true;... | ALGO | 0.968693 | 3.548762 |
5768efd9-4cdb-4f38-ac69-a8b3b84b5701 | SubhradeepSS/dsa | Tree/max sum path .cpp | int util(TreeNode* root,int &res){
if(!root)
return 0;
int l=util(root->left,res);
int r=util(root->right,res);
int m1=max(l,r);
int m2=max(m1+root->val,root->val);
int m3=max(m2,l+r+root->val);
res=max(m3,res);
return m2;
}
int maxPath... | ALGO | 0.999958 | 5.820895 |
938cec80-653f-47b7-9965-e1254ab19945 | Priya-Thakur25/LeetCode | 0131-palindrome-partitioning/0131-palindrome-partitioning.cpp | class Solution {
public:
bool checkPalindrome(int start, int end, string s){
while(start <= end){
if(s[start] != s[end]) return false;
start++;
end--;
}
return true;
}
void solve(string s, vector<vector<string>>&ans, vector<string>temp, int index){
if(index >= s.length()){
... | ALGO | 0.999987 | 6.494668 |
85121c91-e08c-4c04-9091-d5fe7cf815f0 | kkpan11/apple-llvm-project | libcxx/test/std/algorithms/alg.sorting/alg.binary.search/lower.bound/lower_bound.pass.cpp | // <algorithm>
// template<ForwardIterator Iter, class T>
// constexpr Iter // constexpr after c++17
// lower_bound(Iter first, Iter last, const T& value);
#include <algorithm>
#include <vector>
#include <cassert>
#include <cstddef>
#include "test_macros.h"
#include "test_iterators.h"
#if TEST_STD_VER > 17
... | TEST | 0.99589 | 7.076389 |
baa7eaf6-91a8-4208-8eca-bf5e9ac5c41d | SatyamBhargav/PerXTrack | 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.998859 | 6.785645 |
e6606f23-d73f-4467-a0e7-168d467534cd | Metaleg/old-University-projects | old/mpi/example.cpp | //
// Created by metalleg on 10.03.19.
//
#include "mpi.h"
#include <stdio.h>
#include <math.h>
double f( double a );
double f( double a )
Функция интеграла
{
return (4.0 / (1.0 + a*a));
}
int main( int argc, char *argv[])
{
Объявление переменных:
- флаг окончания вычислений
- параметр погрешности вычисления
... | ALGO | 0.999901 | 4.367409 |
79858a90-2b19-4f5c-a6bc-7fea2eb231b8 | aashritha-7/CODES | anagram.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s1,s2;
cin>>s1;
cin>>s2;
int hash[26] = {0};
int f;
for(int i=0;i<s1.length();i++)
{
hash[s1[i] - 'a']++;
hash[s2[i] - 'a']--;
}
for(int i=0;i<26;i++)
{
if (hash[i]==0)
{
f=... | ALGO | 0.999997 | 3.966825 |
1e4ff9f8-095b-4878-93f2-e83f0c24c0e5 | Khanna14Aman/codes | sorting_algorithm/bubblesort.cpp | #include<iostream>
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
int main()
{
fio;
#ifndef ONLINE_JUDGE
freopen("Error.txt","w",stderr);
freopen("output.txt", "w", stdout);
freopen("input.txt", "r", stdin);
#endif
int n,i,j,temp,flag;
cout<<"enter size of an ar... | ALGO | 0.999919 | 3.407616 |
ef8ab33c-a586-4d9e-9b2e-8980906fa45c | Ajayapk007/DSA | Week3/2DArray/Rotate2d90.cpp | #include <iostream>
#include <vector>
using namespace std;
void Rotate( vector<vector<int>> &arr){
int temp = 0;
}
void printarray( vector<vector<int>> &arr){
cout << " Normal Print "<< endl;
for (size_t i = 0; i < arr.size(); i++)
{
for (size_t j = 0; j < arr[0].size(); j++)
{
... | ALGO | 0.999691 | 4.339058 |
3d1f9de0-703e-46d5-aa22-23e0fe8d3650 | kanhaiyasulay/Leetcode | 2792-neighboring-bitwise-xor/neighboring-bitwise-xor.cpp | class Solution {
public:
bool doesValidArrayExist(vector<int>& derived)
{
int n = derived.size();
if(n == 1 && derived[0] == 1) return false;
if(n == 1 && derived[0] == 0) return true;
vector<int> ans(n, -1);
if(derived[n-1] == 0)
{
ans[0] = 1;
... | ALGO | 0.999906 | 5.777528 |
4c4ea6a5-e231-45bc-9ff8-95c517279def | Mark-Jeonel-Kenn-Gob/DSA-CPE010-CPE21S4 | HOA6.1_DSA/main (2).cpp | #include <iostream>
struct Node {
int data;
Node* next;
};
// Function to create a new node
Node* createNode(int data) {
Node* newNode = new Node();
if (newNode == NULL) {
std::cout << "Memory error\n";
return NULL;
}
newNode->data = data;
newNode->next = NULL;
return n... | ALGO | 0.999971 | 6.055699 |
8429643f-5dc5-4c5e-a5df-ed18029c3cc9 | br0hit/Prep | CSES/sumoffourvalues_1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define ll long long
#define endl "\n"
#define fr(i, a, n) for (i = a; i < n; i++)
#define fr1(i, n) for (i = n; i >= 0; i--)
#define F first
#define S second
int modval = 1e9 + 7;
void solve()
{
int n, x;
cin >> ... | ALGO | 0.99998 | 3.868757 |
bfd2c36c-a773-44cd-ae01-a9797c07e641 | abhisek30/Interview-Prep | C++/Problems/Two_Odd_Occuring.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
int XOR=0,n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
//naive Solution
/* for(int i=0;i<n;i++){
int... | ALGO | 0.999914 | 3.414401 |
eaf79cf4-0c40-4115-a27b-5dac6444a2e1 | DAISYzxy/AutoGenSECYAN | SECYAN/extern/ABY/src/abycore/DGK/dgkparty.cpp | #include "dgkparty.h"
/**
* initializes a DGK_Party with the asymmetric security parameter and the sharelength and exchanges public keys.
* @param mode - 0 = generate new key; 1 = read key
*/
DGKParty::DGKParty(uint32_t DGKModulusBits, uint32_t shareBitLength, channel* chan, uint32_t readkey) {
m_nShareBitLength ... | ALGO | 0.982149 | 4.622194 |
62f9e84c-2b36-46a9-875f-601962e28d01 | farzamdorostkar/amon | llvm-project-17.0.6.src/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp | #include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/Dialect/Vector/Transforms/VectorDistribution.h"
#include "mlir/IR/AffineExpr.h"
#include "ml... | ALGO | 0.959853 | 7.288041 |
9734f9be-6235-46fa-95a7-b2dac162568b | Hardyy00/Codeforces | 800-Rating/alphabetical_string.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t ;
cin >> t;
while(t--){
string s;
cin >> s;
int n = s.size();
int fre[26]{0};
for(int i=0;i<n;i++) fre[i] = 1;
int tot =n;
bool al = false;
int in = -1;
... | ALGO | 0.99999 | 3.983553 |
1857369b-b9d3-4798-bf09-0a37bfd8b156 | FatimaJahara/Data-Structure-and-Algorithms-implementation-using-C-plus-plus | Data structure/Stack/Evaluate_Prefix.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node* next;
};
Node* top;
void Push(int x);
void Pop();
int EvaluatePrefix(char *p,int l);
bool IsEmpty();
int Perform(char op,int a,int b);
char topp()
{
char n=top->data;
return n;
}
int main()
{
//bool check;
int i,l... | ALGO | 0.999826 | 3.77908 |
e9969810-76fb-40fd-9ce7-51c8d8c4e2ef | rajyan/AtCoder | AGC/AGC033/B.cpp | //#include <iostream>
//#include <sstream>
//#include <cstdio>
//#include <cmath>
//#include <vector>
//#include <string>
//#include <algorithm>
//#include <map>
//#include <set>
//#include <queue>
//
//#ifdef _DEBUG
//#define DMP(x) cerr << #x << ": " << x << "\n"
//#else
//#define DMP(x) ((void)0)
//#endif
//
//const... | ALGO | 0.999889 | 4.348258 |
6726f15c-0242-422a-bf36-c6c4089266c1 | staatsty/CSE_335 | Homework09/main.cpp | /*
* File: main.cpp
* Author: Tyler Staats
*
* Created on February 12, 2018, 10:10 AM
*/
#include <cstdlib>
#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include "BubbleSortDecreasing.h"
#include "BubbleSortIncreasing.h"
#include "BubbleSortTemplate.h"
#include "IntegerVectorSorta... | ALGO | 0.998748 | 4.908445 |
45e58f60-b524-4029-9875-0e48545a7713 | ZJWang9928/PAT-Solutions | Basic/1051.cpp | /*由于实部、虚部都保留两位小数,
* 所以当A、B的值介于0与-0.01之间时,
* 必须要把它们设置为零,
* 否则会有用例无法通过
*/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
double r1, r2, p1, p2, a1, a2, b1, b2, reta, retb;
int main() {
ios::s... | ALGO | 0.999629 | 3.423217 |
2f09f147-cf91-49f9-add8-17412cdf38b5 | RoushanKhalid/CP_Clown | CF_C - Next Alphabet.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
char str; cin>>str;
int x=str+1;
if(x>122) x=97;
cout<<char(x)<<endl;
return 0;
} | ALGO | 0.984913 | 3.287729 |
785b9f6e-7b54-4554-be3b-9ca042ab0c08 | bounty-coder/Algorithms | Trees/24.1 Sum Tree.cpp | // Given a Binary Tree. Check for the Sum Tree for every node except the leaf node. Return true if it is a Sum Tree otherwise, return false.
// A SumTree is a Binary Tree where the value of a node is equal to the sum of the nodes present in its left subtree and right subtree. An empty tree is also a Sum Tree as the su... | ALGO | 0.998445 | 4.693656 |
5dec313a-599d-41dd-8feb-f946b34171c9 | WarrenGames/Bob-the-blob | libraries/inGame/sources/levels/textures/drawing/inferDrawingPosition.cpp | #include "levels/textures/drawing/inferDrawingPosition.h"
#include "levels/maps/gameMap.h"
#include "levels/textures/drawing/screenScrolling.h"
#include "levels/maps/mapsConsts.h"
#include "consts/includeOptions.h"
int getMatrixSquarePosition(int axisCornerPixelPosition, int widthSquare)
{
return -axisCornerPixelPosi... | TOOL | 0.8579 | 4.858965 |
c05e885d-c561-467d-a6fc-ceb0c8692bd4 | SenseLogic/MYST | BOOST/boost_1_76_0/libs/geometry/doc/src/examples/algorithms/line_interpolate_strategy.cpp | // Boost.Geometry
// QuickBook Example
//[line_interpolate_strategy
//` Shows how to interpolate points on a linestring in geographic coordinate system
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
using namespace boost::geometry;
int main()
{
typedef model... | ALGO | 0.995096 | 6.163486 |
467a0c1c-5da0-4026-884c-30e0f5a94e35 | darden1/tradingrrl | 06_ga_optimizer/tradingrrl_.cpp | #include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <iostream>
#include <math.h>
#include <ctime>
#include "tradingrrl_.h"
using namespace std;
namespace tradingrrl{
// Constructor
cppTradingRRL::cppTradingRRL(int T, int M, int init_t, double mu, double sigma, double rho, int n... | ALGO | 0.999651 | 4.854671 |
dec69ff2-9719-4ada-a320-6eab0bfb129d | nhan0504/Algorithm-Toolbox | Week3/change.cpp | #include <iostream>
#include<vector>
using namespace std;
int get_change(int m) {
int n = 0;
vector<int> coin;
coin.push_back(10);
coin.push_back(5);
coin.push_back(1);
for (int i = 0; i != coin.size(); i++) {
if (m != 0) {
n += m / coin[i];
m = m % coin[i];
}
else {
break;
}
}
return n;
}
in... | ALGO | 0.999459 | 5.161396 |
69b78e54-1d69-4ac3-8430-c59245fdc674 | tomer00/DSA | Trees/diaTree.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node* left, * right;
Node(int val) {
data = val;
left = right = NULL;
}
void addLeft(int val) {
if (left == NULL) {
left = new Node(val);
return;
}
left->data = v... | ALGO | 0.999955 | 6.111809 |
74865fa0-be33-4e5e-ab30-bf03ca6aa09f | gaurav167/competitive-codes | 586-div1-div2/e.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define trace1(x) cout<<#x<<": "<<x<<endl;
#define trace2(x, y) cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define trace3(x, y, z) cout<<#x<... | ALGO | 0.999845 | 3.737184 |
57f7ee9e-cd0c-48d4-850e-71d97a0638d0 | QinWenYan1/Primer_CPP | Chapter03_String_Vector_Array/exercises/exercise_3_43-45.cpp | #include <iostream>
#include <iterator>
/*
* Exercise 3.43:
* Write three different versions of a program to print the
* elements of ia. One version should use a range for to manage the
* iteration, the other two should use an ordinary for loop in one case using
* subscripts and in the other using pointers. In all th... | TOOL | 0.963543 | 4.621416 |
45b77e04-9c82-4b28-9ea8-95b8cb568f41 | Himanshu07-debug/POTD | GFG/Oct/Multiply-2-LL.cpp | long long multiplyTwoLists(Node *first, Node *second) {
// code here
int mod = 1e9 + 7;
long long a = 0, b = 0;
Node* curr = first;
while(curr != NULL){
a = ((a*10)%mod + (curr -> data))%mod;
curr = curr -> next;
}
curr = second;
while(curr != NUL... | ALGO | 0.999864 | 4.506275 |
5f4f643f-f27d-485c-aafc-a1994af17da4 | yukiogiwara/sphswe | src/simulator.cpp | #include "simulator.hpp"
SPHSWE::SPHSWE(float scale, float delta_time) {
// Set cordinates
min_cord_ = glm::vec3(-scale/2.0f, 0.0f, -scale/2.0f);
max_cord_ = glm::vec3( scale/2.0f, 0.0f, scale/2.0f);
// Set parameters
delta_time_ = delta_time;
mass_ = 2.0;
density_ = 998.29;
viscosity... | ALGO | 0.958112 | 3.555734 |
e820b870-d2b0-4fa9-867d-f9da26fefcd0 | man02123/leetcode-solutions | 0875-koko-eating-bananas/0875-koko-eating-bananas.cpp | class Solution {
public:
int minEatingSpeed(vector<int>& p, int h) {
int l=1;
int r=*max_element(p.begin(),p.end());
while(l<r)
{
int mid=l+(r-l)/2;
if(check(p,mid,h))
r=mid;
else
l=mid+1;
}
return l;... | ALGO | 0.99996 | 5.622946 |
cda34d18-ef77-4809-b1fb-0f2f43216ad1 | Knremo/CPP-Primer-notes | exercises/unit9ex/9.11-13/demo.cpp | #include <vector>
#include <list>
#include <iostream>
using namespace std;
//9.11
void f1()
{
vector<int> iv1;
vector<int> iv2(iv1);
vector<int> iv3{1,2,3,4,5};
vector<int> iv4(iv3.begin(), iv3.end());
vector<int> iv5(10,10);
}
//9/12
//9.13
int main()
{
list<int> lst = {1,2,3,4,5};
... | TOOL | 0.885238 | 3.569216 |
28e7a234-e465-4c53-a9b9-fdb42f69f7ae | dhananjayhareesh/music_player | 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.998784 | 6.761023 |
9dfde79b-4289-4320-9c9e-ac14b822d710 | gfugante/Numerical-Treatment-of-Experimental-Data-TNDS-2018 | esVecchi/01/esercizio 1.3 (da consegnare)/esercizio1.3.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <iomanip>
#include "Modulo.h"
using namespace std;
int main ()
{
cout << "Punto 1" << endl;
cout << "Il programma verifica la precisione del calcolatore per eseguire determinate operazioni." << endl;
cout << scientific << setprecision ... | ALGO | 0.976096 | 3.531053 |
74db35e9-44b0-48d5-86cd-a6442a4aa245 | ToolDAQ/boost_1_66_0 | libs/geometry/example/c07_custom_ring_pointer_example.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
#include <iostream>
#include <boost/foreach.hpp>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/register/ring.hpp>
BOOST_GEOMETRY_REGISTER_RI... | TOOL | 0.989711 | 7.39356 |
fea0f39c-b2e8-4483-b834-a623a38f731f | GunjanBhanwal/Leetcode_questions | 0349-intersection-of-two-arrays/0349-intersection-of-two-arrays.cpp | class Solution {
int check(int a,vector<int>& nums1){
for(int i=0;i<nums1.size();i++){
if(a==nums1[i]){
return 1;
}
}
return 0;}
public:
vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
vector<int> ans;
int m=nums1.size();
int n=n... | ALGO | 0.99998 | 5.579223 |
85d126f1-f8ff-4bd1-abcd-0f726e7d1ee8 | naturalsimplicity/algorithms | contests/stack_queue_deque/f.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
using namespace std;
void Solve()
{
queue<int> q1, q2;
for (int i = 0; i < 5; ++i) {
int a;
cin >> a;
q1.push(a);
}
for (int i = 0; i < 5; ++i) {
int b;
... | ALGO | 0.999959 | 3.601419 |
065a8e9c-9c06-42e9-a0cb-0e8a337ed07c | rhb2/playground | random/sum.cpp | /*
* Program to find the longest contiguous sequence of numbers in an array
* whose sum is below some caller-specified threshold.
*/
#include <iostream>
#include <vector>
using namespace std;
ostream &
operator<<(ostream &out, const vector<int> &v)
{
int i;
for (i = 0; i < v.size(); i++)
out << v[i] << " ";
... | ALGO | 0.999924 | 5.084803 |
cac86cba-811d-4f5c-a99d-c926c4dbdf35 | iraj007/raj | Circ;le.cpp | #include<math.h>
#include<stdio.h>
int main()
{
float r,d,c,ar;
printf("Enter the radius");
scanf("%f",&r);
d=2*r;
printf("The diameter of the circle is %f \n",d);
c=2*3.14*r;
printf("The circumference of the circle is %f \n",c);
ar=3.14*pow(r,2);
printf("The area of teh circle is %f \n ", ar);
... | ALGO | 0.948526 | 3.052662 |
ebdef83e-f298-4b06-ad3f-5abb881b6c16 | GMihai00/ProjectLC-SP | main.cpp | #include <bits/stdc++.h>
#include "UI.h"
using namespace std;
/*
const int dim = 1e5 + 7;
const int dim2 = 100;
ofstream out("txt.out");
int nr_formule_propozitionale;
map <string, int> m;
vector <string> v[dim2];
vector <string> lista_formule;
set <string> lista_literali[dim2];
vector <string> lista_formula_FNN;
... | ALGO | 0.997703 | 3.68931 |
9102035b-0073-4487-95d1-2abd09455132 | ledudon/Atcoder-BC | ABC407/C.cpp | #include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
int main(void){
string s;
cin >> s;
int count = 0;
for(int i = s.length()-1; i > 0; i--){
if(s[i-1] < s[i]) count++;
}
int ans = s.le... | ALGO | 0.9989 | 3.808119 |
c8adf68e-2ce6-4a41-87e7-bf9810480666 | Elkayee/CPP | b_42.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// ==== Bai 42: Sap xep sinh vien theo lop
class SinhVien {
public:
string ma, hoten, lop, email;
// ham nhap
void nhap() {
getline(cin, ma);
getline(cin, hoten);
getline(cin, lop);
getline(cin,... | ALGO | 0.998181 | 5.182891 |
5e8b6459-96c1-4ef5-a5af-b5b1a757a2aa | nikhil4u8/Leetcode-solutions | Leetcode Solutions/282. Expression Add Operators.cpp | /*
Ques to ask:
- Will the resultant expression follow BODMAS?
- What to return when an expression can't be formed?
- Does str contains '0', If input is "105", can we break it as "1*05"?
- Is there any division too?
- Can we return exp as "+3+5" or "-3+5"?
- Do we've paranthese in string?
Sol :... | ALGO | 0.999866 | 6.992647 |
8f8322d5-58a0-411f-bfdd-27b4031dca53 | krashish8/Sublime-Snippets | cpp-codes/hashing.cpp | //uses natural mod 2^64 , assume 0 based indexing everywhere
struct PolynomialHashing {
int N;
string s;
char offset = 0;
long long prime;
long long *fHash, *rHash, *pk;
//declare two instances with different primes as base to be more certain of not falling for anti hash cases
PolynomialHashing(string str, long... | ALGO | 0.998933 | 3.246011 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.