uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
379f94b2-6ad1-4c13-a74c-67af80575ae4 | Marya45/CP31sheet | Rated1200/1635C.cpp | #include<bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define int long long
void solve(){
int n;
cin>>n;
vector<int> arr(n);
for(int i=0;i<n;i++){
cin>>arr[i];
}
if(arr[n-2] > arr[n-1]){
cout<<"-1\n";
}
... | ALGO | 0.99949 | 3.972333 |
1e48609f-c983-438e-9358-44e5b6d9a67e | NeymarL/SeedCup2016 | KMP.cpp | /**
* 实现KMP算法
*/
#include "headers.h"
int nxt[1000];
/**
* 以下为KMP算法匹配字符串
* @param S [description]
* @param T [description]
*/
void get_next(string S, string T)
{
int j, k;
unsigned long tlen = T.length();
unsigned long slen = S.length();
j = 0;
k = -1;
nxt[0] = -1;
while (j < tlen){... | ALGO | 0.999629 | 4.167836 |
aa82f687-4eee-4970-aeb3-d819c049aecf | prikshit-1103/CodingNinjaRevision | PalindromicSubstringCount.cpp | //Given a string S, count and return the number of substrings of S that are palindrome.
//Single length substrings are also palindromes. You just need to calculate the count, not the substrings.
//Input Format :
//String S
//Output Format :
//count of palindrome substrings
int countPalindromeSubstrings(char s[]) {
... | ALGO | 0.998881 | 3.667081 |
ff97a1be-e174-42fe-aed7-9cb044ad687f | Adnan-Alaref/Unity_Project_Subway | FirstGame/Library/PackageCache/com.unity.ide.visualstudio@2.0.12/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.95963 | 6.969462 |
19fa8818-4d8b-4c4b-b0a6-2121758ccf30 | sarvex/leetcode-d | solution/0700-0799/0764.Largest Plus Sign/Solution.cpp | class Solution {
public:
int orderOfLargestPlusSign(int n, vector<vector<int>>& mines) {
vector<vector<int>> dp(n, vector<int>(n, n));
for (auto& e : mines) dp[e[0]][e[1]] = 0;
for (int i = 0; i < n; ++i) {
int left = 0, right = 0, up = 0, down = 0;
for (int j = 0, k ... | ALGO | 0.999969 | 6.31593 |
49ecfe7d-5fbc-436d-8eb7-4493dfdd79ff | JLUVicent/leetcode_solution | 面试题01.07.旋转矩阵/面试题01.07-旋转矩阵.cpp | class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
for( int i = 0; i < matrix.size(); i++){
for( int j = 0; j < i; j++){
swap(matrix[i][j],matrix[j][i]);
}
}
for( int i = 0; i < matrix.size(); i++){
reverse( matrix[i].begin... | ALGO | 0.999986 | 6.275828 |
c2429cd5-b363-4762-bd7d-80ed78c61e0f | colesmith54/competitive-programming | codeforces/Journey.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
vector<vector<int>> g(n + 1);
vector<double> prob(n + 1, 0);
prob[1] = 1;
for (int i = 0; i < n - 1; ++i) {
int u, v;
cin >> u >> v;
g[u].push_back(v);
g[v].push_back(u);
}
... | ALGO | 0.998494 | 4.348595 |
c10828d9-d16c-449d-8c4a-2418113417a4 | millandeep/NeetcodeSheet | twoSum2.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> twoSum(vector<int> &numbers, int target)
{
vector<int> ans(2);
int start = 0;
int end = numbers.size() - 1;
while (start < end)
{
int sum = numbers[start] + numbers[end];
if (sum == target)
{
ans[0] = st... | ALGO | 0.999899 | 6.0896 |
3aacbbc3-e188-4fd1-b6f1-357e26cb1175 | Code-Practitioners/Diversified-Programming | Backtracking/subsets2.cpp | class Solution
{
public:
vector<vector<int>> subsetsWithDup(vector<int> &nums)
{
vector<vector<int>> ans;
if (nums.size() == 0)
return ans;
sort(nums.begin(), nums.end());
vector<int> sub;
subset(nums, ans, sub, 0);
return ans;
}
void subset(... | ALGO | 0.999897 | 6.12388 |
3d958b4b-c013-46ef-8a19-0383605b58c3 | Girish1845/Leetcode-Solved | 0567-permutation-in-string/0567-permutation-in-string.cpp | class Solution {
public:
bool isFreqSame(int freq1[],int freq2[]){
for(int i=0;i<26;i++){
if(freq1[i]!=freq2[i]){
return false;
}
}
return true;
}
bool checkInclusion(string s1, string s2) {
int freq[26]={0};
for(int i=0;i<s1.le... | ALGO | 0.999974 | 6.22286 |
17358efd-1a2a-4944-ac70-4dc2e1ac8296 | Harleen365/100_Days_Coding_Challenge | Day 57/Product _of_ Array_ Except _Self.cpp | class Solution {
public:
vector<int> productExceptSelf(vector<int>& nums) {
int n=nums.size();
vector<int>ans(n,1);
int leftpro=1;
for(int i=0;i<n;i++){
ans[i]*=leftpro;
leftpro*=nums[i];
}
int rightpro=1;
for(int i=n-1;i>=0;i--){
... | ALGO | 0.999962 | 6.003809 |
5de8f3c4-4463-4ee9-a9c6-fec7bc2ceaee | seaneshbaugh/rosetta-euler | c++/001/001.cpp | #include <iostream>
int main() {
int sum = 0;
for (int i = 0; i < 1000; i++) {
if (i % 3 == 0 || i % 5 == 0) {
sum += i;
}
}
std::cout << sum << "\n";
return 0;
} | ALGO | 0.999699 | 4.813598 |
9772150d-a973-47bd-a83e-e00c9510640f | Thisayang/Codeforces | 984A_Game.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n;
while(cin>>n)
{
int x[1001];
for(int i=0;i<n;i++)
{
cin>>x[i];
}
sort(x,x+n);
if(n%2==1) cout<<x[n/2]<<endl;
else cout<<x[n/2-1]<<endl;
}
return 0;
} | ALGO | 0.999953 | 3.812861 |
339e082e-fe7b-4bbb-b348-1570a075c8e4 | alexandraback/datacollection | solutions_5634947029139456_0/C++/everiq/task.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
inline unsigned to_num(const std::string& s)
{
unsigned r = 0;
unsigned t = 1;
for (char c: s)
{
if (c == '1') r |= t;
t <<= 1;
}
return r;
}
inline int count_bits(unsigned value)
... | ALGO | 0.999936 | 4.746581 |
afa303a6-ef87-49bc-9614-1284d719de9e | shawakation/PAT | Basic Level/1049/main.cpp | #include <iostream>
using namespace std;
float sum(float arr[],int a,int b)
{
float sum3=0;
for (int k=a;k<=b;k++) sum3+=arr[k];
return sum3;
}
int main()
{
int n;
cin>>n;
float *a=new float[n];
float sum2=0;
for (int i=0;i<n;i++) cin>>a[i];
for (int i=0;i<n;i++) {
for (int j=i;j<n;j++) sum2+=sum(a,i,j);
}
... | ALGO | 0.999748 | 3.557734 |
a2406f95-5e1d-4ffa-b764-c5771cb39f6d | ishandutta2007/codeforces | nigus/normal/1721/D.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, b, a) for(int i = b - 1; i >= a; i--)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
... | ALGO | 0.999926 | 4.061877 |
10f3ab0e-9c22-467c-af54-00744ba4dba0 | QbitQuantum/Basics | Исходники/Vector2DMath.cpp | Vector2D Nlerp(const Vector2D &a, const Vector2D &b, Float t) {
Vector2D v;
Lerp(a, b, t, &v);
v.Normalize();
return v;
} | TOOL | 0.993385 | 5.541104 |
824ddb0a-c131-47f3-a177-61f80835839a | andreiarnautu/Algorithmic-Problems | calatorie.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
FILE *fin=freopen("calatorie.in","r",stdin);
FILE *fout=freopen("calatorie.out","w",stdout);
long long int N, A[51][501], Sum;
bool Used[51][501];
void Run()
{
int a, b;
scanf("%d", &N);
if( N == 1 )
{
printf("Consu... | ALGO | 0.999318 | 3.30631 |
0e4eb646-9a49-4a10-bf65-89313fbfd393 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2020/November/AdaAndDishes_20210101141632.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999939 | 3.505482 |
5a1053ab-e869-4952-8c7e-c79cf5cddb68 | jhonatheberson/data-structure | c++/listasLab/Aula6/q11c.cpp | #include <iostream>
#include <cmath>
using namespace std;
typedef struct s{
int chave; // chave (contedo armazenado)
struct s *next; // ponteiro para o prximo elemento
} No;
No *criarCabeca(){
No *cabeca = new No (); // alocaao
if (cabeca!=NULL){ // apenas pra verificar se a alocaao foi bem sucedida
cabeca->ch... | ALGO | 0.99819 | 3.802919 |
3b9b07ae-d29e-4d6f-97c1-03ce9eb37612 | yuxaij/noip_ro | lv3/mcs/std/brute.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
const int MAXN = int(1e5);
const int MAXD = 17;
const int MAXK = 20;
const int INF = int(1e9);
using namespace std;
int tmpi;
char tmpc;
int n, q;
int maxk;
int a[MAXN + 10];
int f[MAXN + 10][21];
int g[MAXN + 10][21];
... | ALGO | 0.999912 | 4.12358 |
3cb02958-9c64-48d1-82ae-6286a0f6ce02 | MishkatIT/codeforces-atcoder-submissions | Assiut University Training - Newcomers/Contest #2/A. Timon and Pumbaa.cpp | /*
author : MishkatIT
created : Sunday 2023-01-29-23.56.09
*/
#include<bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
fio;
long long a, b;
cin >> a >> b;
cout << max((long long)0, a - b);
return 0;
} | ALGO | 0.999603 | 3.399196 |
0dfc2e5a-2605-4b9a-a043-42720011663e | Xeokj/Baekjoon | 11725.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> tree;
vector<int> parent;
vector<bool> visited;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int N, a, b, i;
cin >> N;
tree.resize(N + 1);
parent.resize(N + 1);
visited.resize(N + 1, 0);
for (i = 0; i < N - 1; i++) {
cin >> ... | ALGO | 0.999992 | 5.233653 |
f02f7020-ab6a-441b-aa04-16eaefd7c2af | thakurtpr/LitHub | 2379-maximum-total-importance-of-roads/2379-maximum-total-importance-of-roads.cpp | class Solution {
public:
long long maximumImportance(int n, vector<vector<int>>& roads) {
vector<long long> degree(n, 0);
for (vector<int>& edge : roads) {
degree[edge[0]]++;
degree[edge[1]]++;
}
sort(degree.begin(), degree.end());
long long value =... | ALGO | 0.999954 | 6.15253 |
537c99eb-873b-4cf4-8012-0ff9c0b4d539 | salim002/Cpp-Codes | 12_practice_c++/50_lower_and_upper_bound_in_multiset.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
vector<int> v={1, 3, 4, 4, 4, 5, 7, 7, 7, 7, 8, 9, 10};
// int idx=upper_bound(v.begin(), v.end(), 7)-v.begin();
// cout<<idx<<endl;
multiset<int> st(v.begin(), v.end());
// auto idx = st.lower_bound(6);
// auto idx = st.lower_bound(7);
... | ALGO | 0.999758 | 3.84256 |
ea18428f-8156-4fe6-a0c7-edaa05d114a4 | mahabubr/xpsc | week-01/Scorable Problems for Division 4/Sale.cpp | #include<bits/stdc++.h>
#define ll long long int
#define dl double
#define pi pair<int, int>
#define B_INF LLONG_MAX
#define S_INF LLONG_MIN
#define vi vector<int>
#define endl '\n'
using namespace std;
void solve() {
ll n;
cin >> n;
vector<ll> arr(n);
for (ll i = 0; i < n; i++) {
cin >> a... | ALGO | 0.999371 | 5.079656 |
571090d7-c160-4425-85df-42c40a5975b9 | dhruvgarg02/Leetcode-Submissions | code/15.3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
sort(nums.begin(), nums.end());
vector<vector<int>> res;
int n = nums.size();
for(int i = 0; i < n-2; i++) {
int lo = i + 1;
int hi = n - 1;
int s... | ALGO | 0.999976 | 5.91605 |
1975d8ea-6c7c-486c-865e-f1ccc05e9f3d | wltn716/algorithm_practice | baekjoon/io/10950.cpp | // 문제: https://www.acmicpc.net/problem/10950
#include <iostream>
using namespace std;
int main() {
int T;
cin >> T;
for(int i=0;i<T;i++) {
int A, B;
cin >> A >> B;
cout << A+B << '\n';
}
return 0;
} | ALGO | 0.999676 | 5.878436 |
4da76433-8b81-4917-ac1d-e219663321ce | Abhishek-Verma0/awesome-Leetcode-Daily | Leetcode2025/May/3373-MaximizeTheNumberOfTargetNodesAfterConnectingTrees II.cpp | class Solution {
public:
int dfs(int node, int parent, int depth,
const vector<vector<int>>& children, vector<int>& color) {
int res = 1 - depth % 2;
color[node] = depth % 2;
for (int child : children[node]) {
if (child == parent) {
continue;
... | ALGO | 0.999878 | 5.879804 |
e9ff3446-7d1b-475b-b88f-fa7a1f1b6821 | tkhrotn/ZKfinder | solver/lower_bound.cpp | #include "lower_bound.hpp"
#include "globals.hpp"
#include <iostream>
#include <limits>
#include <bitset>
using namespace std;
using namespace procon26;
int LowerBound::calculateBySubsetSumProblem(int num_open_block, int remain_order) {
bitset<MAX_BLANK + 1> bs(1);
// solve subset sum problem by dynamic progra... | ALGO | 0.991622 | 3.355061 |
e37c7544-4308-41ee-80f9-83f7c696f59b | devahub/leetcode_problems | 0450-delete-node-in-a-bst/0450-delete-node-in-a-bst.cpp |
class Solution {
public:
TreeNode* deleteNode(TreeNode* root, int key) {
if(root!=NULL){
if(key<root->val)
root->left=deleteNode(root->left,key);
else if(key>root->val)
root->right=deleteNode(root->right,key);
else{ ... | ALGO | 0.99999 | 6.376868 |
cb82c0b0-5c36-4041-ae42-f78ad4d48744 | LovelyBika/DSA-Practice | LovelyCode/Sorting/2BubbleSort.cpp | #include<bits/stdc++.h>
using namespace std;
//my first approach
/* this is not bubble sort because it comparing with evey element not adjacently
and i is fixed */
void MybubbleSort(int ar[],int n){
int temp;
int didSwap=0;
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(ar[j]<ar[... | ALGO | 0.999954 | 4.374741 |
25215e85-037b-4f4b-97ca-87e08259290e | AhmedBakrXI/Design-and-Analysis-of-Algorithm-Project | 01.Task 1/CLI_Backend/First Algorithm - Divide and Conquer/main.cpp | #include <iostream>
#include <cstdlib>
#include <random> // Include the C++11 random library for random number generation
#include <cstring>
using namespace std;
int gridSize, xCoordinate, yCoordinate, count = 0; // Declare global variables to store grid size, coordinates, and tile count
int grid[128][128]; // Declar... | ALGO | 0.956853 | 7.108364 |
170d09e3-3c9d-4114-af76-646cd3327f06 | ziadtaher8545/cp | Sqrt_decomposition.cpp | class Sqrt_decomposition {
vector<long long > v, bl;
int sq, n;
public:
Sqrt_decomposition(int n, vector<long long >& a) {
v = a;
sq = (int)sqrt(n) + 1;
bl = vector<long long >(sq, 0);
this->n = n;
build();
}
void build() {
for (int i = 0; i < n; i++)... | ALGO | 0.999877 | 4.238658 |
9af770fc-b0ef-4553-89d3-766045abac6c | medntknw/DSA | c++/sorting/Insertion.cpp | #include <iostream>
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#i... | ALGO | 0.999993 | 4.836837 |
4f42acf3-20e4-4236-ba9a-a56d394d41d2 | mayanksinha963/DSA | input/quick_sort_2.cpp | #include<iostream>
using namespace std;
print (int a[], int n)
{
for (int i = 0; i < n; i++)
{
cout<<a[i]<<" ";
}
cout<<endl;
}
int partition (int a[], int low, int high)
{
int pivot = a[low];
int i = low + 1;
int j = high;
int temp ;
do
{
while (a[i] <= pivot )
... | ALGO | 0.999925 | 5.031752 |
682b2880-7df7-4252-a33b-e4ce70f67374 | rhks7410dyd/PSstoringplace | Binary_search/boj10815.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#define endl '\n'
#define INF 987654321
using namespace std;
vector<int> input_num;
vector<pair<int,int>> target_num;
bool ans[500000];
int n,m;
void Solve();
void Input();
int find_num(int le,int target_num);
int main(){
cin.tie(NULL); cout.tie(NULL);
... | ALGO | 0.999997 | 4.220754 |
9f9ab2c6-fe52-4c71-9cb2-1e248095b568 | chm994483868/AlgorithmExample | Algorithm_C/offer_backup/46_TranslateNumbersToStrings/TranslateNumbersToStrings.cpp | //==================================================================
// ָOfferԹپͱ⡷
// ߣκ
//==================================================================
// 46ַַ
// Ŀһ֣ǰ¹Ϊַ0"a"1
// "b"11"l"25"z"һֿж롣
// 122585ֲͬķ룬Ƿֱ"bccfi""bwfi""bczi""mcfi"
// "mzi"ʵһһжֲͬķ뷽
#include <string>
#include <iostream>
using namespace st... | ALGO | 0.998935 | 4.631461 |
e5573d2b-8071-4f14-9cb6-da896ce900fc | wilda0864/SENIOR-LIVING | 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.998733 | 6.76775 |
82342a19-94bd-40c3-8920-ce214a2c1b25 | Innnoa/STL | Container library/queue/front/main.cpp | /**
* ClassName: ${NAME}
* package: ${PACKAGE_NAME}
* Description:
* @Author: innno
* @Create: 2024/2/27 - 21:54
* @Version: v1.0
*/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
auto que = queue<int>{};
que.push(1);
... | ALGO | 0.999949 | 4.171596 |
15b5097b-fee8-46aa-8279-9034d0e68e36 | goropikari/CompetitiveProgramming | atcoder/abc229/c.cpp | /*https://atcoder.jp/contests/abc229/tasks/abc229_c*/
// #include <atcoder/all>
// using namespace atcoder;
// using mint = modint998244353;
// using mint = modint1000000007;
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i, n) for (int i = 0; i < (n)... | ALGO | 0.999986 | 4.422393 |
7cd39139-be55-4f45-96cc-9d510c88c9e6 | sayak22/Leetcode-Problems | 264-ugly-number-ii/ugly-number-ii.cpp | class Solution {
public:
int nthUglyNumber(int n) {
// Initialize an array to store ugly numbers.
vector<int> arr(n + 1);
// Create pointers for factors 2, 3, and 5.
int i2, i3, i5;
i2 = i3 = i5 = 1;
// The first ugly number is always 1.
arr[1] = 1;
... | ALGO | 0.999994 | 7.180882 |
9b540d7e-4202-4f99-892d-05eb3ba478b6 | crxcrxcrx/kaoyan | 408/4-3.cpp | #include <stdio.h>
int main() {
int total = 0; // ʼΪ0
for (int s = 1; s <= 10; s++) {
for (int w = 1; w <= 20; w++) {
for (int e = 1; e <= 40; e++) {
for (int y = 1; y <= 40; y++) {
if (s + w + e + y == 40 && 10 * s + 5 * w + 2 * e + y == 100) {
total += 1;
}
}
}
}
}
printf("%d", ... | ALGO | 0.998605 | 3.852635 |
b0587f82-063c-41bd-8d83-9cdf474c5a45 | Torng030/CPE_49 | 10008 - What's Cryptanalysis/10008 - What's Cryptanalysis-array版.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
cin.ignore();
int count[100]={0},tmp=0;
for(int i=0;i<n;i++)
{
string s;
getline(cin,s);
for(int j=0;j<s.size();j++)
{
if(toupper(s[j])>='A'&&toupper(s[j])<='Z')
{
count[toupper(s[j])]++;
tmp++;
}
}
}
while(tmp--... | ALGO | 0.999569 | 3.707847 |
7512e057-7dae-48ca-8c16-f7fa9a704c25 | star-platinum127/uva | cf 1350 B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=100005;
int arr[maxn];
int dp[maxn];
int main(int argc, char** argv) {
int t;
cin>>t;
while(t--){
int n;
cin>>n;
for(int i=1;i<=n;i++){
cin>>arr[i];
}
int ans=0;
for(int i=n;i>0;i--){
dp[i]=1;
for(int j=i*2;j<... | ALGO | 0.999848 | 3.990482 |
a538fb47-1dcf-48c5-ab5e-a7a26aa9789a | chrisuye/Spring_2018_C | homework 420.cpp | #include <iostream>
using namespace std;
int main()
{
float x;
cout<<"please enter temp in farenhit"<<endl;
cin>>x;
if (x<=32)
{
cout<<"Freezing"<<endl;
}
if (x>=212)
{
cout<<"Boiling"<<endl;
}
else
{
cout<<"Liquid"<<endl;
}
}
| TOOL | 0.997426 | 3.484601 |
6d75437a-97a7-4211-a5de-1ddcac4950a2 | odanado/Procon | yukicoder/02/No0222.cpp | #include <algorithm>
#include <functional>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <cl... | ALGO | 0.999959 | 3.991472 |
909cc6fe-990d-4ebb-a057-f8c1df89e3c3 | TheFenrisLycaon/DSA-C-- | cp/CodeForces/1200-1299/1257B.cpp | #include <cstdio>
int main(){
long t; scanf("%ld", &t);
while(t--){
long x, y; scanf("%ld %ld", &x, &y);
bool ans(true);
if(x == 1){ans = (y == 1);}
else if(x == 2 || x == 3){ans = (y <= 3);}
puts(ans ? "YES" : "NO");
}
return 0;
}
| ALGO | 0.999295 | 4.047442 |
2c57003d-a4a5-4291-9c85-96ccb267c107 | ishandutta2007/codeforces | dorost/normal/1637/B.cpp | /* * In the name of GOD */
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
const int N = 102;
int a[N];
void solve() {
int n;
cin >> n;
int sum = 0;
for (int i = 0; i < n; i++) {
cin >> a[i];
sum += (i + 1) * (n - i);
if (a[... | ALGO | 0.999747 | 4.108459 |
3745acb2-8e46-4ced-afb9-60ec377cd22b | kifriosse/astfri | libastfri-serialize/examples/exampleFunction.cpp | #include <libastfri/inc/ExprFactory.hpp>
#include <libastfri/inc/StmtFactory.hpp>
#include <libastfri/inc/TypeFactory.hpp>
// int compare(int a,int b=10)
// {
// if (a > b)
// {
// return a;
// }
// else{
// return b;
// }
// }
int main() {
auto& statements = astfri::StmtFactory:... | TOOL | 0.933365 | 5.112659 |
12444b8b-a468-401e-a1a1-cffcbd14740e | alexandraback/datacollection | solutions_5648941810974720_1/C++/pvs/x.cpp | #include <cstdio>
#include <cstdint>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
int m[256], d[10];
int main() {
int n;
scanf("%d\n", &n);
for (int i=0; i<n; ++i) {
memset(m, 0, sizeof(m));
memset(d, 0, sizeof(d));
char s[2001]; scanf("%s\n", s);
for (int j=0;... | ALGO | 0.998883 | 3.781689 |
c53dc74e-7090-45fd-a16f-e7f71b1f112e | NcEternal/PACS_Challenge_3 | src/Parameter_Communication.cpp | #include "Parameter_Communication.hpp"
#include <mpi.h>
namespace laplace {
/* Function to let rank 0 communicate the parameters of the problem to the other ranks */
void communicate(parameters& p, int rank, int size) {
/* No process to communicate to */
if (size < 2)
return;
/* Broadcast domain bounds */
MP... | ALGO | 0.995916 | 5.330052 |
46ced35f-991c-4b24-a7ca-b4c0866fc92d | Quinsh/LeetCode | ProblemsSolved/QueuesStacks/150_evaluateReversePolishNotation.cpp | #include <string>
#include <vector>
#include <queue>
#include <stack>
#include <utility>
#include <set>
#include <unordered_map>
#include <unordered_set>
using namespace std;
/**
* DATE: 2024.06.17
* INTUITION: just use stack to evaluate the expression from start to back?
*
* TC: O(N) - one pass algorithm.
* SC... | ALGO | 0.99995 | 6.589884 |
68542c3c-37f8-4b62-8ee9-9bfdc52905d8 | kuldeepsaini23/DSA-C-plus-plus | Week-4(Searching and Sorting)/Assignment/Question5.cpp | #include<iostream>
#include<numeric>
using namespace std;
//* Book Allocation
// N--> no of books
// M -> no of students
bool isPossibleSolution(int A[], int N, int M, int sol){
int pageSum = 0;
int counter = 1;
for (int i = 0; i < N; i++)
{
/* code */
if(A[i]>sol){
return false;
}
if(pag... | ALGO | 0.999959 | 4.977329 |
f1aa76c3-4ca5-41d8-be2a-24c259ebeb0b | swapnildubey29/Data-Structure-and-Algorithms | stacks/LLstack.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{ // linked list defined;
int data;
Node* next;
Node(int x){
data = x;
next = NULL;
}
};
struct Mystack
{
Node* head;
int sz; //stack defined
Mystack(){
head = NULL;
... | ALGO | 0.998679 | 3.796664 |
01a39224-91d0-4eeb-82c1-00ede74b430a | ishandutta2007/codeforces | conorgallagher23/normal/1539/A.cpp | #include<bits/stdc++.h>
#define LL long long
#define mp make_pair
#define fi first
#define se second
using namespace std;
LL read(){
char ch=getchar(); LL x=0,fl=1;
for(;!isdigit(ch);ch=getchar()) if(ch=='-') fl=-1;
for(;isdigit(ch);ch=getchar()) x=(x<<3)+(x<<1)+(ch-'0');
return x*fl;
}
void solve(){
LL n=read(),... | ALGO | 0.999904 | 3.623093 |
10ae54b6-5966-49d7-95b6-964542eb5359 | rimonsarmah/CP_CipherSchools | Assignment 1/peakelement.cpp | #include<bits/stdc++.h>
using namespace std;
int findPeak(vector<int> arr){
int beg = 0, last = arr.size()-1;
while(beg<last){
int mid = beg + (last - beg) / 2;
if(arr[mid]>arr[mid+1])
last = mid;
else
beg = mid + 1;
}
return beg;
}
int main(){
vecto... | ALGO | 0.999918 | 4.417722 |
0bbb3056-dae9-43b5-9b2a-edfbfc296e6a | kishanrajput23/Wipro-Unix-CPP-Systems | Self Practice/Sum Of Series Questions/01.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main() {
double sum=0,a;
int n,i;
cout<<"We have to calculate the sum of the series of a number by using below pattern"<<endl;
cout<<"1+1/2^2+1/3^3+…..+1/n^n "<<endl;
cout<<"\nEnter The Value Of n :\n";
cin>>n;
for(i=1;i<=n;++i) {
... | ALGO | 0.999393 | 3.899387 |
cc075b6f-4b2d-45de-82b1-55e2d7ffd369 | SayemImran/XPSC | WEEK10/T_MEX_Repetition.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll find_mex(const vector<ll> &v)
{
ll n = v.size();
vector<bool> vec(n + 2, false);
for (auto x : v)
{
if (x <= n)
vec[x] = true;
}
for (ll i = 0; i <= n + 1; ++i)
{
if (!vec[i])
retur... | ALGO | 0.999994 | 3.838149 |
7c0a411f-de47-402d-97aa-3cb16ccc7cbc | IITH-Compilers/bullseye | boost_1_76_0/libs/mpl/example/fsm/player2.cpp | #include <vector>
#include <ctime>
#include <iostream>
#if defined(BOOST_DINKUMWARE_STDLIB) && BOOST_DINKUMWARE_STDLIB < 310
namespace std { using ::clock_t; }
#endif
namespace mpl = boost::mpl;
using namespace mpl::placeholders;
// A metafunction that returns the Event associated with a transition.
template <class ... | ALGO | 0.877127 | 7.725194 |
dff6b5c3-0faa-4d34-aa34-f6086f878967 | Hussam-Turjman/FLDServer | third_party/opencv/modules/calib3d/src/quadsubpix.cpp | #include "precomp.hpp"
#include <limits>
#include <utility>
#include <algorithm>
#include <math.h>
namespace cv {
inline bool is_smaller(const std::pair<int, float>& p1, const std::pair<int, float>& p2)
{
return p1.second < p2.second;
}
static void orderContours(const std::vector<std::vector<Point> >& contours... | ALGO | 0.999827 | 6.562594 |
9a8403a5-281f-4eac-b56a-add025d46829 | ahmedsalamay/CodeForce | A. Football/main.cpp | /*#include <iostream>
#include<string>
using namespace std;
int main()
{
int x=0,z=0;
string s;
getline(cin,s);
char c,d;
for(int i=0;i<s.size();i++)
{
if(x>=7)
break;
c=s[i];
if(s[i]=='0')
x=0;
x=x+c-48;
}
for(int i=0;i<s.size();... | ALGO | 0.999398 | 3.444132 |
570ac906-c4de-473a-9472-9f54bc86c191 | NaF1sh/problem-solving-1 | codeforces/A_Quirky_Quantifiers.cpp |
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
printf("%d", n % 2);
return 0;
} | ALGO | 0.999372 | 3.259507 |
84361bdc-e23b-4a04-9432-04dcaae0404c | zgbdsg/opencv-binary-kmeans | NormalizeFea.cpp | #include "common.h"
Mat NormalizeFea(Mat& fea, int row)
{
Mat newfea;
if (row == 1)
{
int nsmp = fea.cols;
double* powersum = new double[nsmp];
/*ÿеƽ*/
for (int i = 0; i < nsmp; i++)
{
powersum[i] = 0;
for (int j = 0; j < fea.rows; j++)
{
powersum[i] = powersum[i] + fea.at<double>(j, i)*fea.... | DATA | 0.994186 | 4.05408 |
97321e9a-8a07-47a6-b374-00ec019fdc43 | MohamedOsamaa74/LeetCode-Solutions | 704-binary-search/704-binary-search.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int st = 0, en = nums.size()-1, md;
while(en>=st){
md = st+en >> 1;
if(nums[md]==target) return md;
else if(nums[md]>target) en = md-1;
else st = md+1;
}
return -1;
... | ALGO | 0.999962 | 6.152449 |
a6496243-bcc9-4f98-818a-24bd83de1574 | amanswarnakar/LeetCode | 387-first-unique-character-in-a-string/387-first-unique-character-in-a-string.cpp | class Solution {
public:
int firstUniqChar(string s) {
map<char, int> mp;
for(char ch : s){
mp[ch]++;
}
for(int i = 0; i < s.size(); i++){
if(mp[s[i]] == 1) return i;
}
return -1;
}
}; | ALGO | 0.999776 | 6.055495 |
1876b344-9bcd-4858-8bfe-9d7de464b639 | jhdgo1225/algorithm-archive | baekjoon/Bruteforce/8891.cpp | #include <iostream>
using namespace std;
int main()
{
int T, a, b; cin >> T;
while (T--)
{
cin >> a >> b;
int y1 = 1, y2 = 1;
while (1 + y1*(y1+1)/2 <= a) y1++;
while (1 + y2*(y2+1)/2 <= b) y2++;
int x1 = 1 + (a - (1 + y1*(y1-1)/2));
int x2 = 1 + (b - (1 + y2*(y2-1)/2));
y1 -= x1 + 1;
y2 -= x2 + 1;
... | ALGO | 0.999924 | 4.782604 |
fc12cda5-03d6-496d-9666-846ebd9086d7 | IsrakAhmed/Codeforces_solutions | B/B. Coin Games.cpp |
/*
Name : Israk Ahmed
E-Mail : <EMAIL>
Github : github.com/IsrakAhmed
Institution : University of Rajshahi
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define asort(v) sort((v).begin(),(v).end()) // Ascending Order Sort
#define dsort(v) sor... | ALGO | 0.99987 | 5.723613 |
6daf2aad-8a2f-4545-9242-f45bdaf01f72 | zpqqq10/jittor-instant-neus | contrib/mipnerf/python/jnerf/ops/op_include/eigen/doc/examples/TutorialLinAlgInverseDeterminant.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Matrix3f A;
A << 1, 2, 1,
2, 1, 0,
-1, 1, 2;
cout << "Here is the matrix A:\n" << A << endl;
cout << "The determinant of A is " << A.determinant() << endl;
cout << "The inverse of A is:\n... | ALGO | 0.999031 | 4.186114 |
5f36e3c4-c4fd-45a2-a0f7-2c603d797797 | Hardik-Kumar1101/DS-Algorithm | Array/Kadens_alogritm.cpp | #include<bits/stdc++.h>
using namespace std;
/*
this algorithm is use to find maximun sub array in
given array
*/
int maxSubArray(int arr[], int n)
{
int crente=0;
int ans=arr[0];
for(int i=0;i<n;i++)
{
crente += arr[i];
ans = max(ans,crente);
crente = max(crente,0);
... | ALGO | 0.999896 | 4.375459 |
113eeb32-089f-4810-bbc8-0af863be9fb5 | roshan07273/Leetcode-Questions-Solution | check_if_bit_is_set_or_not.cpp | class Solution
{
public:
// Function to check if Kth bit is set or not.
bool checkKthBit(int n, int k)
{
int mask = 1 << k;
bool set = mask & n;
if(set != 0 ) return true;
else false;
}
};
| ALGO | 0.99689 | 5.684002 |
b7d4b8f5-187d-4818-b877-b40cdba56ada | aryan57/cp-archive | Google_Coding_Competitions/Round F 2021 - Kick Start 2021/Graph Travel.cpp | /*
group : Google Coding Competitions - Round F 2021 - Kick Start 2021
name : Graph Travel.cpp
srcPath : /home/aryan/Desktop/cp-workspace/Graph_Travel.cpp
url : https://codingcompetitions.withgoogle.com/kickstart/round/0000000000435bae/0000000000888764
*/
/*
author : aryan57
created : 19-September-2021 00:14:44 I... | ALGO | 0.999956 | 4.421254 |
0da0a134-c5ed-44fb-8d68-efe709be1870 | Saheb/gsoc2013 | src/ogdf/minisat/Minisat.cpp | // disable VC++ warnings when using fopen
#define _CRT_SECURE_NO_WARNINGS
#include <ogdf/minisat/Minisat.h>
using MinisatInternal::Var;
using MinisatInternal::Lit;
using MinisatInternal::lbool;
using MinisatInternal::vec;
namespace Minisat
{
void Clause::addMultiple ( int Amount, ... )
{
va_list params;
Var param... | ALGO | 0.996075 | 5.716465 |
782de03c-0ceb-4c6c-ae99-76f0e784ace1 | amnashah110/Data-Structures-in-Cpp | ADTs/Stack.cpp | #include <iostream>
using namespace std;
class Stacks {
int top;
public:
int arr[10];
Stacks() {
top = -1;
}
void push(int data) {
if(top >= 9) {
cout << "Stack Overflow" << endl;
} else {
arr[++top] = data;
}
}
void pop() {
if(top < 0) {
cout << "Stack Empty" << endl;
} else {
to... | ALGO | 0.996863 | 4.469202 |
ebd38ad4-99e9-4061-8263-b9833d0c64a5 | AmanPratap965/LeetCode_Practice | Left View of Binary Tree - GFG/left-view-of-binary-tree.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
vector<int> leftView(struct Node *root);
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->... | ALGO | 0.99946 | 6.843035 |
3b29e46b-c107-4b4d-9814-459cd64322ad | Jaewan-Kim/Universal-Hashing | UH/UH/Source.cpp | #include "UHash.h"
using namespace std;
int main() {
int input;
UHash table;
do {
cout << "Input a 5 digit int to put in the table(0 to exit): ";
cin >> input;
if (input !=0)
table.add_int(input);
} while (input != 0);
table.display();
} | ALGO | 0.899936 | 3.571615 |
8d02f592-6c6a-4c02-b504-dfaaa276ede3 | uparkh/leetcode-solutions | NeetCode 150/C++/Depth 6. Graphs/(M) Surrounded Regions.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
// My 1st Solution -- Inside Out
// Search for Os on the inside to expand out to remembering that the only
// way an O blob is not surrounded is if an O cell is on the perimeter of
// the board.
// Does *not* pass all test cases. Ed... | ALGO | 0.999916 | 7.014441 |
25a65a50-484f-4d55-83c6-3d98b3b35687 | roytam1/UXP | intl/icu/source/common/bytestriebuilder.cpp | #include "unicode/utypes.h"
#include "unicode/bytestrie.h"
#include "unicode/bytestriebuilder.h"
#include "unicode/stringpiece.h"
#include "charstr.h"
#include "cmemory.h"
#include "uhash.h"
#include "uarrsort.h"
#include "uassert.h"
#include "ustr_imp.h"
U_NAMESPACE_BEGIN
/*
* Note: This builder implementation stor... | TOOL | 0.965303 | 7.573488 |
5588fd3f-2735-4d8f-9090-e98a8ad0937c | Rubix982/Spectre | CodeForces/TemporarilyUnavailable.cpp | #include "stdc++.h"
using namespace std;
typedef unsigned long long ull;
int main(void) {
int t;
cin >> t;
while ( t-- ) {
int a, b, c, r;
cin >> a >> b >> c >> r;
if ( 2 * r > abs(b - a) )
std::cout << "0" << "\n";
else if ( c > a || b < c ) {
... | ALGO | 0.999695 | 3.836315 |
663f0a88-4a17-45c1-9303-d33f0bec24d1 | Lxyyy0608/Cku | 05_01.cpp | #include <iostream>
using namespace std ;
class Circle
{
private:
// 私有成员变量,用于存储圆的半径
double radius;
public:
//设置半径
Circle (double r)
{
radius = r;
}
// 计算圆的面积
double CS()
{
// 使用公式 Pi * r^2 计算面积
return 3.14159 * radius * radius;
}
// 计算圆的周长
... | ALGO | 0.950614 | 5.691395 |
f05e31e2-8cc0-478e-a20d-04996441c8a3 | Diesik/EmersonJason_48102 | Hmwrk/Assignment_3/Gaddis_8thEd_Chap4_Prob4_Rectangles/main.cpp | /*
File: main
Author: Jason Emerson
Created on October 4, 2016, 4:15 PM
Purpose: Compare the area of rectangles
*/
//System Libraries
#include <iostream> //Input/Output objects
using namespace std; //Name-space used in the System Library
//User Libraries
//Global Constants
//Function prototypes
... | TOOL | 0.987462 | 4.183736 |
679d5882-effd-4a3b-8958-13e06b6d3cf2 | leicheng-tensor/BMCG | comparison/BiGAMP/comparison_codes/spams-matlab/prox/mex/mexFistaFlat.cpp | #include <mex.h>
#include <mexutils.h>
#include <fista.h>
// alpha = mexFistaFlat(X,D,alpha0,param)
using namespace FISTA;
template <typename T>
inline void callFunction(mxArray* plhs[], const mxArray*prhs[],
const int nlhs) {
if (!mexCheckType<T>(prhs[0]))
mexErrMsgTxt("type of argument 1 is not con... | ALGO | 0.996004 | 5.899721 |
ccc63e4a-d865-4b6c-bc7c-db0ea89823af | GATB/gatb-core | gatb-core/src/gatb/kmer/impl/PartitionsCommand.cpp | #include <gatb/kmer/impl/PartitionsCommand.hpp>
#include <gatb/tools/collections/impl/OAHash.hpp>
#include <gatb/tools/collections/impl/Hash16.hpp>
#include <gatb/tools/misc/impl/Stringify.hpp>
using namespace std;
using namespace gatb::core::system;
using namespace gatb::core::system::impl;
using namespace gatb::co... | TOOL | 0.913581 | 5.993465 |
9042c8c0-6bf7-4ee7-9984-2407236a02b8 | ROCm/flang | flang-classic/17.0-4/llvm-classic/llvm/lib/CodeGen/MachineSink.cpp | #include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "... | ALGO | 0.9992 | 3.433263 |
75e4ed23-62e4-4a73-966c-c0612ec70234 | Alok-2004/problemSolving | countSquareSubMatricesWithAllOnes_LC1277.cpp | /*
1277. Count Square Submatrices with All Ones
Given a m * n matrix of ones and zeros, return how many square submatrices have all ones.
*/
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int solve(int row , int col , vector<vector<int>>&dp , vector<vector<int>>& matrix){
if(row >= dp.size... | ALGO | 0.999934 | 5.366197 |
3a6dd8cd-46cc-423b-a4e1-d7e1bdd399c7 | thisis2838/hl2-speedrun-mod | mathlib/randsse.cpp | #include <math.h>
#include <float.h> // Needed for FLT_EPSILON
#include "basetypes.h"
#include <memory.h>
#include "tier0/dbg.h"
#include "mathlib/mathlib.h"
#include "mathlib/vector.h"
#include "mathlib/ssemath.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
// see knuth vo... | TOOL | 0.990301 | 5.928762 |
bc2f6f09-cbcb-4a9f-b8e8-ee67a2a726fe | BonexGoo/Boss2D | Boss2D/addon/opencv-3.1.0_for_boss/samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp | /**
* @function moments_demo.cpp
* @brief Demo code to calculate moments
* @author OpenCV team
*/
#include BOSS_OPENCV_U_opencv2__imgcodecs_hpp //original-code:"opencv2/imgcodecs.hpp"
#include BOSS_OPENCV_U_opencv2__highgui__highgui_hpp //original-code:"opencv2/highgui/highgui.hpp"
#include BOSS_OPENCV_U_opencv2__... | ALGO | 0.967 | 7.447738 |
8f6f6fb2-4cab-467b-a486-9ec4addda446 | cscvlab/3D-Objects-Compression | submodules/libigl/include/igl/edge_collapse_is_valid.cpp | IGL_INLINE bool igl::edge_collapse_is_valid(
const int e,
const Eigen::MatrixXi & F,
const Eigen::MatrixXi & E,
const Eigen::VectorXi & EMAP,
const Eigen::MatrixXi & EF,
const Eigen::MatrixXi & EI)
{
using namespace Eigen;
using namespace std;
// For consistency with collapse_edge.cpp, let's determine... | ALGO | 0.994894 | 6.333734 |
91cf510e-9121-4655-b5ca-cbbe669cdfd6 | jasbeersinghchauhan/ALMS-winUI3 | book.cpp | #include "pch.h"
#include "book.h"
#include <iostream>
#include <cppconn/prepared_statement.h>
Book::Book() : year(0), quantity(0) {}
Book::Book(const std::string& title, const std::string& author, const std::string& isbn, int year, int quantity)
: title(title), author(author), isbn(isbn), year(year), quantity(qua... | TOOL | 0.966634 | 6.313275 |
e77b18ab-81dd-475c-9973-55e37709dd65 | alikhanmurat/PP1 | Lab7/Lab7A.cpp |
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int degree(int x){
return pow(2, x);
}
int main(){
ll x;
cin >> x;
cout << degree(x);
}
| ALGO | 0.999582 | 4.318372 |
4e5de648-18ab-4847-94f0-aaea27710369 | Adnan-Nafess/DSA | 02-Sorting/03-Insertion-Sort.cpp | #include <iostream>
using namespace std;
int main ()
{
int arr[1000];
int n;
cout<<"Enter the size of array: ";
cin>>n;
for(int i=0; i<n; i++)
cin>>arr[i];
for(int i=1; i<n; i++)
{
for(int j=i; j>0; j--)
{
if(arr[j] < arr[j-1])
swap(arr[j], arr[... | ALGO | 0.999797 | 3.87371 |
e351dc01-1627-43ff-bcc4-97dbaf9fd8bb | Bruno-rasq/Beecrowd-solutions | beginner/pagina01/1037/1037.cpp | #include <iostream>
using namespace std;
int main(){
double a;
cin >> a;
if(a >= 0 && a <= 25) cout << "Intervalo [0,25]\n";
if(a > 25 && a <= 50) cout << "Intervalo (25,50]\n";
if(a > 50 && a <= 75) cout << "Intervalo (50,75]\n";
if(a > 75 && a <= 100) cout << "Intervalo (75,100]\n";
if(a > 100 || a < 0)... | ALGO | 0.998209 | 3.875985 |
b38270e3-b65d-4dbf-8f6b-17e18344fe70 | AbhiiPrajapati/Daily-dose-of-C- | numpattern2.cpp | #include <iostream>
using namespace std;
main()
{
int n;
cout << "enter N : ";
cin >> n;
int count = 1;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= i; j++)
{
cout << count << " ";
count++;
}
cout << endl;
}
return 0;
} | ALGO | 0.999394 | 3.699345 |
96e37034-dc94-4bfc-8a48-6adf8d06c2a8 | OmkarK2553/TE_LP2 | Assi2.cpp | #include <bits/stdc++.h>
using namespace std;
#define N 3
class Node
{
Node *par;
int mat[N][N];
int x, y;
int level;
int cost;
friend class Solution;
};
class Solution
{
public:
bool isSafe(int x, int y)
{
if (x >= 0 && x < N && y >= 0 && y < N)
{
return t... | ALGO | 0.999849 | 4.872426 |
d923cc16-82fa-413b-a821-c3e65540923d | Nightwind0/bugbots | bb2/BugBots.cpp | #include "utility.h"
#include "BugBot.h"
#include "food.h"
#include "clump.h"
#include "mainbrain.h"
#include "soundmanager.h"
#include <cmath>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include "sutil.h"
#include "MapHandler.h"
const extern int SCREENWIDTH;
const extern int SCREENHEIGHT... | TOOL | 0.977119 | 3.663502 |
63632424-a26e-4824-ab45-6738b4f4df9e | eye-anirban/Object-Oriented-Programming-Laboratory | oop3.6.cpp | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,
C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.
*********... | ALGO | 0.984215 | 4.672082 |
d94868a6-0b9c-486e-96d0-6018c0b7e351 | jonascreations/hw3-newest | scheduler_fcfs.cpp | /**
* Assignment 3: CPU Scheduler
* @file scheduler_fcfs.cpp
* @author ??? (TODO: your name)
* @brief This Scheduler class implements the FCSF scheduling algorithm.
* @version 0.1
*/
//You must complete the all parts marked as "TODO". Delete "TODO" after you are done.
// Remember to add sufficient and clear commen... | ALGO | 0.997779 | 4.787446 |
06af1cdf-cc5e-4fb9-9d44-2108c6e7a4f9 | ArielQuinn/AIProject | Competition/solvers/enumerative/esolver-synth-lib/src/z3-4.3.1/src/sat/sat_cleaner.cpp | #include"sat_cleaner.h"
#include"sat_solver.h"
#include"trace.h"
#include"stopwatch.h"
namespace sat {
cleaner::cleaner(solver & _s):
s(_s),
m_last_num_units(0),
m_cleanup_counter(0) {
reset_statistics();
}
/**
- Delete watch lists of assigned literals.
... | ALGO | 0.997332 | 5.663961 |
bb9f8a8c-6171-42a2-a3d7-f7555aeb2679 | VulpesCorsac/Leetcode | 1021. Remove Outermost Parentheses - Easy/solution.cpp | static auto _ = [] () { ios_base::sync_with_stdio(false); cin.tie(nullptr); return 0; } ();
class Solution {
public:
string removeOuterParentheses(string S) {
string result;
int opened = 0;
for (const auto& symbol: S) {
if (symbol == '(') {
if (opened) {
... | ALGO | 0.999852 | 6.317182 |
f9ca18f4-9954-4100-ad7a-b4d966048f8b | sarvex/leetcode-haskell | solution/0100-0199/0108.Convert Sorted Array to Binary Search Tree/Solution.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.999998 | 7.195937 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.