uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
86be3a4b-f75d-4af4-b505-5f224e2feeac | owhyy/cpp-primer | ch11/excersises/11.20.cpp |
#include <algorithm>
#include <cctype>
#include <iostream>
#include <map>
#include <set>
#include <string>
int main() {
std::set<std::string> exclude = {"The", "But", "And", "Or", "An", "A",
"the", "but", "and", "or", "an", "a"};
std::set<char> punctuation = {',', '.', ':', ';', ... | ALGO | 0.998898 | 5.593018 |
aeabb13a-1676-436f-920f-b9624f4998bb | khushvantkr12/Striver-A-Z | Sorting Algorithm/BubbleSort.cpp | //push the max to last by adjacet swaps
//core idea is to do adjacent swaps on each iteration and push max to the last
//best case time complexity is O(n) and worst case time complexity is O(n^2)
class Solution {
public:
// Function to sort the array using bubble sort algorithm.
void bubbleSort(vector<int>& ... | ALGO | 0.999936 | 5.758633 |
0a453fda-29a1-4b21-a969-7ee4c648427e | msaxena14/GeeksForGeeks | Problem Of The Day/Add two numbers represented by linked lists .cpp | struct Node* reverse(struct Node *head){
Node* curr = head;
Node* prev = NULL;
while(curr != NULL){
Node* next = curr->next;
curr->next = prev;
prev = curr;
curr = next;
}
return prev;
}
struct Node* addTwoLi... | ALGO | 0.999297 | 5.087093 |
0acfd06c-7174-4e8a-a180-d0d00714fd2a | Arecardo/Cpp-Review | C++/Udemy_C++/Section 16: Polymorphism/practise_polymorphism.cpp | /* - Practise_Polymorphism.cpp
-
- This is the source code for Practice Student Excecise #12
-
- Author: Xinrun Zhang
- Date: April 7, 2020
*/
#include <iostream>
using namespace std;
class Shape{
public:
virtual float area()=0; // pure virtual
virtual float perimeter()=0;
};... | TOOL | 0.921139 | 5.836876 |
879f1eea-b47a-4c4d-9780-d3e831429352 | PedruHNS/FLUTTER_APP_CUBIT_ALURA | 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 |
cdfbf5eb-c428-453e-88f3-acdaa7621056 | dooli1971039/Algorithm | Floyd-Warshall/BOJ_11404.cpp | #include <iostream>
using namespace std;
int arr[101][101];
const int INF = 987654321;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, m;
cin >> n >> m;
// ์ด๊ธฐํ
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
arr[i][j] = INF;
}
arr[i... | ALGO | 0.99998 | 4.827727 |
27a3dc59-6473-481d-b061-d4c3c9e95e52 | NobbZ/euler-pp | src/euler.cpp | #include <sstream>
#include "euler.hpp"
const std::string BASE_URL = "https://projecteuler.net/";
std::string euler::euler::url() {
std::ostringstream oss;
oss << BASE_URL << "format=" << this->id();
return oss.str();
}
std::map<int16_t, euler::euler *> euler::euler::problems = {};
| TOOL | 0.891153 | 4.708896 |
53baa11e-6501-4ffe-a508-c2d9445c09ca | rayyan21d/dsa | 7-BinarySearch/1-1DArrays/SingleElement.cpp | /*
You are given a sorted array consisting of only integers where every element appears exactly twice,
except for one element which appears exactly once.
Return the single element that appears only once.
Your solution must run in O(log n) time and O(1) space.
Example 1:
Input: nums = [1,1,2,3,3,4,4,8,8]
Output: 2
... | ALGO | 0.999948 | 6.240175 |
afdc321b-da78-4864-a240-f9d7c5b62ca3 | diaconescualexandra/Fundamental-Algorithms | Dijkstra.cpp | //orientat, poate fi ciclic, ponderat pozitiv, drum minim de la o sursa unica, O(m logn)
#include <iostream>
#include <fstream>
#include <list>
#include <utility>
#include <limits>
#include <vector>
#include <set>
using namespace std;
ifstream fin ("retea.in");
ofstream fout ("retea.out");
const int nmax = 100000;
... | ALGO | 0.999947 | 3.766092 |
6720b2db-cf30-4eda-ac91-737257818901 | MaxSmith19/The-Great-Wall-Problem | main_2A.cpp | #include <iostream>
#include <fstream>
#include <string>
#include "GreatWallBestAverage.h"
#include <chrono>
using namespace std;
using namespace chrono;
int main(int argc, char* argv[]) {
auto insertionStart = high_resolution_clock::now();//time before the algorithm has taken place
std::string filePath... | ALGO | 0.944506 | 4.224014 |
2987598a-2dd1-4b46-9cad-1b377548ddcd | ConstantinRadulicea/NXP-Cup | src/features/automatic_emergency_braking.cpp | #include "features/automatic_emergency_braking.h"
void AEB_setup(){
DistanceSensorsSetupAnalog(
DISTANCE_SENSOR1_ANALOG_PIN,
DISTANCE_SENSOR2_ANALOG_PIN,
DISTANCE_SENSOR3_ANALOG_PIN
);
pinMode(EMERGENCY_BREAK_LIGHT_PIN, OUTPUT);
digitalWrite(EMERGENCY_BREAK_LIGHT_PIN, LOW);
}
AEB_out_t au... | ALGO | 0.926341 | 4.102242 |
f54b4bd8-8eb0-4a2a-9812-0eb6bfb5021b | myeowon/DataStructure_study | 0x03_assignment/2577.cpp | //
#include <bits/stdc++.h>
using namespace std;
int result[10];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int A, B, C;
cin >> A >> B >> C;
long long product = A * B * C;
while (product > 0)
{
result[product % 10]++;
product /= 10;
}
for (int i = 0; i < 1... | ALGO | 0.999766 | 4.270457 |
1d6d8566-eab9-42a0-a2e0-101340b58438 | kenzhegaliyevn/Competitive-programming | acmp/0153/main.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <bitset>
#include <cstdlib>
#define sqr(x) (x) * (x)
#define F first
#define S second ... | ALGO | 0.999969 | 3.298753 |
50a82e80-4c8d-46bb-99df-ea3167241700 | InclinedScorpio/coding_ultimate_series | leetcode/easy ๐
โโ๏ธ/questions ๐ฏ/tree/height_depth/minimum_depth.cpp | // https://leetcode.com/problems/minimum-depth-of-binary-tree/
/**
* 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) {}
* ... | ALGO | 0.999969 | 7.075839 |
2dab8165-a463-48ea-8a9d-38656fdf2e91 | Bostrix/FSL-topup | newimage/miscmaths/armawrap/tests/newmat/tmth.cpp |
//#define WANT_STREAM
#include "include.h"
#include "newmatap.h"
//#include "newmatio.h"
#include "tmt.h"
#ifdef use_namespace
using namespace NEWMAT;
#endif
static int my_max(int p, int q) { return (p > q) ? p : q; }
static int my_min(int p, int q) { return (p < q) ? p : q; }
void BandFunctions(int l1, int u1,... | TEST | 0.99382 | 4.565629 |
9a74550e-a7a0-4dc0-ab5e-0b07a5cace2e | Shubhamsk1/cp | vishwakEVENT/B.cpp |
/* Code by shubhamsk1 */
/* Shubham S Kudekar */
#include<bits/stdc++.h>
#define int long long
#define endl "\n"
using namespace std;
/*Declare function prototypes here*/
void solve();
/*Declare Global variables here*/
/* Main function starts from here */
int32_t main() {
/*Fast IO*/
ios_base::sync_with_std... | ALGO | 0.999743 | 4.516749 |
9a4a9a9c-15cd-4f8c-bad4-51a615fadcde | anushikhov/cpp | learncpp_com/05_Operators/000_exponentiation_by_squaring.cpp | #include <iostream>
#include <cstdint> // for std::int_fast64_t
std::int_fast64_t powint(int base, int exp)
{
std::int_fast64_t result{ 1 };
while (exp)
{
if (exp & 1)
result *= base;
exp >>= 1;
base *= base;
}
return result;
}
int main()
{
std::cout << "Enter the base: ";
int base{};
std::cin >... | ALGO | 0.999686 | 6.258223 |
cadc97fe-1ea9-4275-b8ab-8f0f2f1a571d | wjshuibing/PCL_Demo | surface/src/openNURBS/opennurbs_array.cpp | /* $NoKeywords: $ */
#include <pcl/surface/openNURBS/opennurbs.h> // openNURBS declarations of functions that perform simple calculations
ON_2dPointArray::ON_2dPointArray()
{}
ON_2dPointArray::ON_2dPointArray(int c)
: ON_SimpleArray<ON_2dPoint>(c)
{}
ON_2dPointArray::ON_2dPointArray(const ON_2d... | TOOL | 0.909197 | 6.376062 |
eca66b7d-fbcb-4d0c-b9c5-50b11d79ce29 | Tongyuang/EdgeTile | EdgeTileClient/deps/opencv/modules/features2d/src/bagofwords.cpp | #include "precomp.hpp"
namespace cv
{
BOWTrainer::BOWTrainer() : size(0)
{}
BOWTrainer::~BOWTrainer()
{}
void BOWTrainer::add( const Mat& _descriptors )
{
CV_Assert( !_descriptors.empty() );
if( !descriptors.empty() )
{
CV_Assert( descriptors[0].cols == _descriptors.cols );
CV_Assert( de... | ALGO | 0.979868 | 6.568462 |
307b1384-6e19-4868-a413-ec9b3981e2a1 | SoundRabbit/voice-changer | .history/main_20190116224416.cpp | extern "C"{
#include "fftsg.c"
}
#include "overlapAdd.hpp"
#include "wavFile/wavFile.cpp"
#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
#define _USE_MATH_DEFINES
#include <cmath>
int main(){
using namespace std;
cout << "ใใกใคใซๅ (please input file name) >" << flush;
std::string fn;
... | ALGO | 0.987774 | 4.633462 |
78626b8a-5c8b-4b15-86ea-306f6670b8e2 | GitBB3/RT1_turtle_nodes | src/Distance.cpp | #include "ros/ros.h"
#include "turtlesim/Pose.h"
#include "geometry_msgs/Twist.h"
#include "std_msgs/Float32.h"
#include <string>
double THR=0.05;
float dx,dy;
double x_mv,y_mv;
ros::Publisher pub_turtle;
ros::Publisher pub_dist;
void turtleCallback(const std_msgs::Float32MultiArray::ConstPtr& msg_dist){
ROS_INFO("T... | ALGO | 0.949123 | 5.171116 |
0fc03a74-ee09-4db0-8475-161ff53cb33c | SrayanBhattacharyya/CP_SolvedProblems | codeforces/959/C.cpp | //Srayan Bhattachrayya JU EE
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lld long double
#define rep(i,n) for(ll i=0;i<n;i++)
#define rev(i,n) for(ll i=n;i>=0;i--)
#define rev_a(i,a,n) for(ll i=n;i>=a;i--)
#define rep_a(i,a,n) for(ll i=a;i<n;i++)
typedef pair <ll, ll> pll;
typedef vector <... | ALGO | 0.998564 | 3.778124 |
5a35df05-6c3a-4c03-93b7-9a20e406ffa2 | ishandutta2007/codeforces | rajat1603/normal/833/D.cpp | #include "bits/stdc++.h"
using namespace std;
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
int n;
int a[N] , b[N] , c[N] , d[N];
vector < int > v[N];
int power(int a , int b){
int res = 1;
while(b){
if(b & 1){
res = (1LL * res * a) % mod;
}
a = (1LL * a * a) % mod;
b >>= 1;
}
return res;
}
int ans;
in... | ALGO | 0.999949 | 4.852778 |
0f347e05-d295-43d9-9667-259b18314b03 | Veljko28/cpp-data-algrtms | codeforces/Subordinates.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <numeric>
#include <string>
#include <cstring>
#include <ctime>
#include <set>
#include <list>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <unordered_map>
#include <queue>
#include... | ALGO | 0.99992 | 4.031672 |
3e06b599-4265-4a89-896f-bc53bfc62d9c | Shaun1280/Program | cpp/Hash/Words1.cpp | #include<bits/stdc++.h>
typedef unsigned long long LL;
//1e6ไธๅๅ่ฏๆฐ
const LL P = 131;
using namespace std;
vector<LL>H;
inline LL Hash(string s){
LL sum = 0;
for(int i = 0; i < s.size(); i++){
sum = (sum * P + s[i]);
}
return sum;
}
int n;
int main(){
std::ios::sync_with_stdio(false);
cin ... | ALGO | 0.999918 | 4.168914 |
18ed793d-b94b-40ac-94ad-10d6bdde50d1 | taskflow/taskflow | benchmarks/for_each/omp.cpp | #include "for_each.hpp"
#include <omp.h>
// for_each_omp
void for_each_omp(size_t nthreads) {
#pragma omp parallel for num_threads(nthreads)
for(size_t i=0; i<vec.size(); i++) {
vec[i] = std::tan(vec[i]);
}
}
std::chrono::microseconds measure_time_omp(size_t num_threads) {
auto beg = std::chrono::high_res... | TOOL | 0.99154 | 5.842901 |
3d8bfb8d-db46-45be-b688-7bb93f42463e | moursalinme/Light_OJ | 1235-Coin_Change(IV).cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <cstring>
#include <cmath>
#include <sstream>
#include <iterator>
#include <bitset>
using namespace std;
void prepare_subset (vector<int64_t>& vec, int tot, int pos, int64_t sum, vector<int> reference) {
vec.emplace_back (sum);
... | ALGO | 0.999961 | 4.315089 |
beb48698-767a-4ee6-a687-792f0b5fcdaf | allenbenny419/Placement-Practice | Basics/reverse.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
long int n;
cin>>n;
long int reverse=0;
while(n>0){
int last=n%10;
reverse=reverse*10 +last;
n=n/10;
}
cout<<reverse;
return 0;
} | ALGO | 0.999968 | 4.832046 |
9e11a50f-6454-4488-8409-4eac6bbf7dd9 | yeshengm/SJTU_OJ | hw_revisited/1237_courses.cpp | #include <iostream>
#include <fstream>
using namespace std;
struct edge {
int s, t;
int next;
} e[100005];
int N, M, head[10005], cnt[10005], start, deg[10005], q[10005], op, cl = -1;
void init() {
cin >> N >> M;
for (int i = 1; i <= M; ++i) {
int from, to;
cin >> from >> to;
e[i].s = from; e[i].t = to;
e[... | ALGO | 0.999324 | 4.765706 |
4176ad61-692d-4641-ae2d-779125d38013 | NestZ/competitive-programming | AtCoder/B-TwoColorsCardGame.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
map<string, int> m;
int n;cin >> n;
int ans = INT_MIN;
for(int i = 0;i < n;i++){
string s;cin >> s;
m[s]++;
}
int t;cin >> t;
for(int i = 0;i < t;i++){
string s;cin >> s;
m... | ALGO | 0.999798 | 4.384839 |
e7b6e7c3-509b-4253-85da-5025fd44c12a | a-khakimov/training | cpp-kata/codewars/005_Array_squareUp_b.cpp | // https://www.codewars.com/kata/5a8bcd980025e99381000099/train/cpp
// Array - squareUp b!
#include <iostream>
#include <vector>
#include <numeric>
std::vector<int> squareUp(int n)
{
std::vector<int> result;
for (int i = n - 1; i >= 0; --i) {
std::vector<int> part(n);
std::iota(part.rbegin(), part.rend() ... | ALGO | 0.999739 | 5.740294 |
1eddf91b-b272-4401-ba53-98106f652419 | oscarshaitan/symtower | 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 |
3248dbb7-ff45-4487-8ac7-7723b1566204 | ghostumar/DSA | RECURSION/permutation of string.cpp | #include<iostream>
using namespace std;
void permute(string s,int i){
if(i==s.length()-1){
cout<<s<<" ";
return;
}
for(int j=i;j<s.length();j++){
swap(s[i],s[j]);
permute(s,i+1);
swap(s[j],s[i]);
}
}
int main(){
string s="ABC";
int i=0;
permute(s,i);
}
| ALGO | 0.99999 | 4.521551 |
25d32e13-bb96-4878-b8c1-065ee375685f | visionbike/ROS-Melodic-with-Python3-and-Opencv4 | melodic/src/orocos_kinematics_dynamics/orocos_kdl/src/velocityprofile_trap.cpp | /*****************************************************************************
* \author
* Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven
*
* \version
* ORO_Geometry V0.2
*
* \par History
* - $log$
*
* \par Release
* $Id: velocityprofile_trap.cpp,v 1.1.1.1.2.7 2003/07/24 13:26:15 psoetens ... | ALGO | 0.977679 | 5.888549 |
5238484b-76c2-4f17-a85a-ca0b35424837 | kripa-sindhu-007/LeetCode | 0236-lowest-common-ancestor-of-a-binary-tree/0236-lowest-common-ancestor-of-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
if (!root |... | ALGO | 0.99999 | 6.384383 |
e9e845b6-efbe-4a71-9325-b9c3be02a86a | sourcegraph/lsif-clang | libcxx/test/std/containers/sequences/list/list.ops/sort.pass.cpp | // <list>
// void sort();
#include <list>
#include <random>
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
std::mt19937 randomness;
struct Payload
{
int val;
int side;
Payload(int v) : val(v), side(0) {}
Payload(int v, int s) : val(v), side(s) {}
bool o... | TEST | 0.943109 | 6.441152 |
e14188ad-5bfa-4194-8062-1ca92b64934d | hmahajan99/InterviewBit-Solutions | Dynamic Programming/Greedy or dp/Min Jumps Array.cpp | // Given an array of non-negative integers, A, of length N, you are initially positioned at the first index of the array.
// Each element in the array represents your maximum jump length at that position.
// Return the minimum number of jumps required to reach the last index.
// If it is not possible to reach the last ... | ALGO | 0.999991 | 6.020338 |
d97cbf78-f67f-4de5-85f0-2b92fc620d68 | sarvex/leetcode-powershell | solution/0500-0599/0544.Output Contest Matches/Solution.cpp | class Solution {
public:
string findContestMatch(int n) {
vector<string> team(n);
for (int i = 0; i < n; ++i) team[i] = to_string(i + 1);
for (; n > 1; n >>= 1) {
for (int i = 0; i<n> > 1; ++i) {
team[i] = "(" + team[i] + "," + team[n - 1 - i] + ")";
}... | ALGO | 0.999745 | 5.832097 |
1f278200-0fa4-4b9f-84d5-597c5a625c3b | abtahi2024/data-structure_practice_2025 | module_22/delete_from_max_heap.cpp | #include<bits/stdc++.h>
using namespace std;
void insert_heap(vector<int>&a,int x)
{
a.push_back(x);
int idx=a.size()-1;
while(idx!=0) //O(NlogN)
{
int prt=(idx-1)/2;
if(a[idx]>a[prt])
{ swap(a[idx],a[prt]); }
else
{ break; }
idx=prt;
}
}
void del... | ALGO | 0.999972 | 4.913081 |
1b5fb6ab-bbdb-4a19-a1bc-d4ae4b420b10 | ishandutta2007/codeforces | saketh/normal/1479/B1.cpp | #include <bits/stdc++.h>
using namespace std;
// template {{{
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define resz resize
#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()
... | ALGO | 0.999991 | 4.302049 |
5b157630-0a04-4bd5-a8cf-e51c6ff02f44 | raincross7/code-similarity | codes/train_code/problem490/problem490_228.cpp | #include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize "O3"
#define rep(i,a,n) for(long long i=a; i<n; i++)
typedef long long ll;
typedef pair<int,int> P;
const ll MOD = (int)1e9+7;
const ll INF = MOD*MOD;
const double EPS = 1e-9;
const ll powll = 1LL<<1;
/*
while(!frag && cin >> a >>b, a|b)
*/
int main(... | ALGO | 0.999916 | 3.908584 |
4106271e-a8b9-446e-b2c3-b147c5bcb22c | narang-madhur/CPP | all cpp's/compare with func/compwith.cpp | //COMPARE AND CONCATENATE STRINGS USING LIBRARY FUNCTIONS
#include<iostream.h>
#include<string.h>
#include<stdio.h>
void main()
{
int i;
char str1[50],str2[50],str3[100];
cout<<"ENTER THE FIRST STRING ";
gets(str1);
cout<<"ENTER THE SECOND STRING ";
gets(str2);
i=strcmp(str1,str2);
if(i==0)
cout<<"\n... | ALGO | 0.999076 | 3.79397 |
75b00f72-553a-42c4-b2b6-da2505e9ec1d | hackybacky/my-leet | 1642-furthest-building-you-can-reach/1642-furthest-building-you-can-reach.cpp | class Solution {
public:
int furthestBuilding(vector<int>& heights, int bricks, int ladders) {
int n = heights.size();
int l = 0 , r=n-1;
int ans=0;
while(l<=r){
int mid = (l+r)/2;
priority_queue<int>pq;
for(int i=0;i<mid; i++){
... | ALGO | 0.999945 | 6.2367 |
d4936c0f-087e-47b5-acfb-a6c5353f95eb | millaker/MiGPU-llvm-project | libc/src/stdbit/stdc_count_ones_ui.cpp | #include "src/stdbit/stdc_count_ones_ui.h"
#include "src/__support/CPP/bit.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(unsigned, stdc_count_ones_ui, (unsigned value)) {
return static_cast<unsigned>(cpp::popcount(value));
}
} // n... | TOOL | 0.909791 | 6.860754 |
e6baa5c3-33cd-4c47-83bc-28d8e80a6da7 | Artanisax/CS216-2023Spring | Lab6/b.cpp | #include <iostream>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
void IO_accel()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
typedef long long ll;
typedef pair<ll, ll> pll;
const int N = 1e5+5;
pll p[N], temp[N];
inline bool ... | ALGO | 0.999803 | 4.205752 |
2e53360a-6288-4dc1-9043-f2172d560c65 | raviii21/Leetcode-Codes | find-the-highest-altitude/2-7-2023, 6_41_39 PM/find-the-highest-altitude.cpp | // Link: https://leetcode.com/problems/find-the-highest-altitude
/** Submission Info:
*
* AUTHOR: Ravi Savsani
* TITLE: find-the-highest-altitude
* RUNTIME: 0 ms
* MEMORY: 8 MB
* DATE: 2-7-2023, 6:41:39 PM
*
*/
// Solution:
class Solution {
public:
int largestAltitude(vector<int>& gain) {
in... | ALGO | 0.999869 | 6.214186 |
be9c45af-f84d-475e-8da3-07b8a96acb0f | eric7237cire/CodeJam | uva/11658 - 0 1 knapsack/main.cpp | #include "stdio.h"
#include <algorithm>
//#include <vector>
#include <cstring>
//#include "string.h"
#include <limits>
//#include <string>
#include <stdlib.h>
//#include <ctype.h>
//#include <iostream>
using namespace std;
#define FOR(k,a,b) for(int k=(a); k < (b); ++k)
#define pb push_back
typedef unsigned int ... | ALGO | 0.996982 | 3.561977 |
ca4f4de3-9822-4e35-baab-d84cf83459a2 | cleaton/platform_frameworks_av | media/libstagefright/codecs/amrwb/src/deemphasis_32.cpp | /*
------------------------------------------------------------------------------
Filename: deemphasis_32.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-----------------------------------------------------------------------... | ALGO | 0.999758 | 6.02347 |
5f83a1b6-058c-4eac-9155-bffaf8d4d3b6 | rohan3004/GeeksforGeeks-Solution | Difficulty: Medium/Koko Eating Bananas/koko-eating-bananas.cpp | class Solution {
public:
int kokoEat(vector<int>& arr, int k) {
int low = 1;
int high = *max_element(arr.begin(), arr.end());
int result = high;
while (low <= high) {
int mid = low + (high - low) / 2;
long long totalHours = 0;
// Calculate hour... | ALGO | 0.999967 | 5.915308 |
d8739739-4f39-496d-83db-b56c269c172d | shalini-jeyra/car_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.998784 | 6.761023 |
1375bcea-68e5-49bf-8dd0-af66ed0837fd | dadeba/posit_gpu | libRpack/Rgetrf_opencl.cpp | #include <mpblas.h>
#include <mplapack.h>
void Rgetrf_opencl(INTEGER const m, INTEGER const n, REAL *a, INTEGER const lda, INTEGER *ipiv, INTEGER &info,
INTEGER nbb) {
//
// -- LAPACK computational routine --
// -- LAPACK is a software package provided by Univ. of Tennessee, --
// -- Univ. o... | ALGO | 0.996354 | 4.264644 |
53da83fe-6432-4f62-a82e-1048fb81d3c8 | Misha737/SimpleTextEditor | CaesarCipher/caesar_cipher.cpp | #include "caesar_cipher.h"
#include <string>
#include <iostream>
const char SUMBOLS_UPPER[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const char SUMBOLS_LOWER[] = "abcdefghijklmnopqrstuvwxyz";
char* encrypt(char* rawText, int key)
{
algorithm(rawText, key);
return rawText;
}
char* decrypt(char* encryptedText, int key)... | ALGO | 0.999892 | 5.07144 |
b0688fb9-8ab8-41ab-8596-c49edd79456e | devhasibulislam/CodeForces-online-judge | ...rest/1692C-WheresTheBishop.cpp | #include <iostream>
#include <vector>
int main(){
const int N = 8;
long t; std::cin >> t;
while(t--){
std::vector<std::string> b(N);
long row(0), col(0);
for(long p = 0; p < N; p++){std::cin >> b[p];}
for(long p = 1; p + 1 < N; p++){
for(long q = 1; q + 1 < N; ... | ALGO | 0.997836 | 3.57983 |
077b39ae-ae6c-4509-a4f6-83ad3515a9db | oraccc/LeetCode-Solutions | c++ version/1-100/83-remove-duplicates-from-sorted-list.cpp | ListNode* deleteDuplicates(ListNode* head) {
if (head == nullptr) return head;
ListNode *prev = head;
ListNode *curr = prev->next;
while (curr) {
if (prev->val != curr->val) {
prev = curr;
curr = curr->next;
}
else {
prev->next = curr->next;
... | ALGO | 0.999717 | 5.258934 |
271fab8c-9ee9-45f3-a926-b0f055565757 | Soham-Chaudhuri/My-CPP-practice | PERFPERM.cpp | #include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long double ld;
typedef long long int lli;
typedef pair<int, int> pii;
typedef vector<vector<lli>> vvlli;
typedef vector<lli> vlli;
typedef vector<ull> vull;
typedef pair<lli, lli> plli;
#define max3(a,b,c) max(max((a),(b)),(c))
#defin... | ALGO | 0.999894 | 3.784146 |
f30dd8a3-5634-445b-982f-10f9051165c4 | harsh6754/Arsh-Goyal-Coding-Challenge | ArshGoyalCodingChallenge/medium/ThreeSum.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int>> ans;
if(nums.size() < 3) return ans;
sort(nums.begin(), nums.end());
for(int i = 0; i < nums.size()-2; ++i)
{
if(i ... | ALGO | 0.999897 | 5.969249 |
dff7e25e-93ad-4849-97b7-280bcc041435 | omarKaushru/Numb-UV-Life-activites | CSE/u/Recovered data 05-03-2015 at 01_14_24/NTFS/My pc/programing fun/bitwise.cpp | /* A bit shift example. */
#include <stdio.h>
#include <conio.h>
main()
{
unsigned int i;
int j;
i = 1;
/* left shifts */
for(j=0; j<4; j++) {
i = i << 1; /* left shift i by 1, which
is same as a multiply by 2 */
printf("Left shift %d: %d\n", j, i);
}
/* right shifts */
for(j=0; j<4; j++) {
i = i >> 1; /* right shift i... | ALGO | 0.994237 | 3.767066 |
44b2ece2-3f53-44c0-9fae-317c88690ab0 | KevinGriggs/MazeGame | MazeGame/Monster.cpp | #include <iostream>
#include <cstdlib>
#include <conio.h>
#include <fstream>
#include <String>
#include <vector>
#include <queue>
#include "MazeGame.h"
#include "Monster.h"
//The monster class. Includes a breadth first (Djikstra's) algorithm for pathing to the player. If no path is found the monster does not move.
//... | ALGO | 0.972445 | 3.864079 |
1067a223-6d5f-4fd3-b6fe-d4d830732c22 | Hasil-Sharma/leet-code | jewels-and-stones-1.cpp | // https://leetcode.com/problems/jewels-and-stones/description/
class Solution {
public:
int numJewelsInStones(string J, string S) {
unordered_set<char> jewelsMap(J.begin(), J.end());
int ans = 0;
for(char c : S)
ans += jewelsMap.count(c);
return ans;
... | ALGO | 0.98773 | 5.83938 |
3df3501b-530c-4c25-bd50-1ab05190b933 | dahiri-farid/iBullet | src/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.cpp | #include "SpuContactManifoldCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btCollisionShape.h"
#include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h"
void... | ALGO | 0.993931 | 6.255079 |
a5571295-3a42-4578-9070-da825ca90f89 | JSU-Computer-Science-118/page-259-tot6829 | main.cpp | //Tatiyana Moore
#include <iostream>
using namespace std;
int main()
{
cout << "Please enter the values of a, b, and c respectively" <<
endl;
cin >> a >> b >> c;
discriminant = (pow(b,2)) - (4*a*c);
if (a == 0)
{
cout << "Invalid Entry" << endl;
}
else if (discriminant == 0)
{
x1 = (-b) / (2 * a);
cout << "The ... | ALGO | 0.987222 | 3.369303 |
496638bd-d0d3-4202-b30a-c31bf84d2346 | Salio24/CoriEngine | CoriEngine/src/CoriCore/Physics/Physics.cpp | #include "Physics.hpp"
namespace Cori {
namespace Physics {
bool PointVsRect(const glm::vec2 point, const glm::vec2 boxSize, const glm::vec2 boxPos) {
return (point.x >= boxPos.x && point.y >= boxPos.y && point.x < boxPos.x + boxSize.x && point.y < boxPos.y + boxSize.y);
}
bool RectVsRect(const glm::vec2 re... | ALGO | 0.895126 | 5.815232 |
019015cc-814b-422d-ab88-c54b105e06eb | DotOS-Extended/android_frameworks_av | media/libstagefright/codecs/amrwb/src/wb_syn_filt.cpp | /*
------------------------------------------------------------------------------
Filename: wb_syn_filt.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-------------------------------------------------------------------------... | ALGO | 0.999917 | 4.836874 |
06a5cd2a-fb26-4bba-97bb-a878ea034ce5 | raincross7/code-similarity | codes/train_code/problem360/problem360_56.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<pair<int,int>> red(n);
vector<pair<int,int>> blue(n);
for(int i = 0; i < n; i++) cin >> red[i].second >> red[i].first;
for(int i = 0; i < ... | ALGO | 0.999227 | 4.013417 |
441fab6d-32e2-4d89-bf52-95529e1e537b | colinblundell/mojo-apps | third_party/angle/src/compiler/translator/depgraph/DependencyGraphBuilder.cpp | #include "compiler/translator/depgraph/DependencyGraphBuilder.h"
void TDependencyGraphBuilder::build(TIntermNode *node, TDependencyGraph *graph)
{
TDependencyGraphBuilder builder(graph);
builder.build(node);
}
bool TDependencyGraphBuilder::visitAggregate(
Visit visit, TIntermAggregate *intermAggregate)
{
... | ALGO | 0.939896 | 7.636686 |
2387b242-bb71-4788-afa6-de81cd8ba5bb | knockcat/AtCoder | Daiwa Securities Co. Ltd. Programming Contest 2023AtCoder Beginner Contest 331/c.cpp | // JAI SHREE RAM
// KNOCKCAT
#include <bits/stdc++.h>
using namespace std;
#define fast \
std::ios::sync_with_stdio(false); \
cin.tie(nullptr);
#define int long long int
#define endl "\n"
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
const ll mod = 1e... | ALGO | 0.999943 | 4.175946 |
6c0ad7ce-4b53-4262-a7ec-60a60b072b0c | AndrewDisco/pbinfo-solutions | solutions/getbit.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int main() {
cin >> n;
for(int i=0; i<n; ++i){
long long num;
int bit;
cin >> num >> bit;
bitset<64> b(num);
cout << b[bit];
}
return 0;
}
| ALGO | 0.998368 | 3.506773 |
4a2c7608-56ea-48cf-b3eb-9da3ceeaf21c | beratallahverdi/CizgeAlgoritmalar | Week03/LeetCode-0026.cpp | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
if (nums.size() <= 1) return nums.size();
int k = 0;
for (int i=1; i<nums.size(); i++){
if (nums[i] != nums[k])
nums[++k] = nums[i];
} // end-for
return k+1;
} // end-removeDup... | ALGO | 0.999215 | 5.990898 |
4b2fa227-6c5f-48b0-9587-512eac1a9b6b | RohitBishla/LeetCode_Practice | Disjoint set (Union-Find) - GFG/disjoint-set-union-find.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
int find(int a[],int x);
void unionSet(int a[],int x ,int z);
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n+1];
for(int i=1;i<=n;i++)
a[i]=i;
int k;
cin>>k;
for(int i=0;i<k;i++){
string s;
cin>>s;
if(s=="UNI... | ALGO | 0.999636 | 5.426256 |
99197bec-e41c-421c-86b9-f520a09a3172 | zzjjyyy/ReservoirDuck | third_party/mbedtls/library/bignum.cpp | /*
* The following sources were referenced in the design of this Multi-precision
* Integer library:
*
* [1] Handbook of Applied Cryptography - 1997
* Menezes, van Oorschot and Vanstone
*
* [2] Multi-Precision Math
* Tom St Denis
* https://github.com/libtom/libtommath/blob/develop/tommath.pdf... | TOOL | 0.991534 | 5.875934 |
05d995f2-c6c4-44f8-bda8-66dd206ea9bd | A2Zntu/DSPA | Class6/Path_extend.cpp | #include<iostream>
#include<vector>
#include<iomanip>
using namespace std;
const int VERY_LARGE = 999999;
class Path {
private:
vector<int> nodes;
int capacity;
public:
Path();
Path(int aNode);
Path(Path aShorterPath, int aNode, int capacity);
int getTail();
int getCapacity();
void print();
};
Path... | ALGO | 0.999685 | 4.18606 |
c13440ca-a098-4c55-a4a5-ce729f4f01e9 | VeloxChem/VeloxChem | src/t2c_nuclear_potential_geom_0X0/NuclearPotentialGeom020PrimRecPG.cpp | #include "NuclearPotentialGeom020PrimRecPG.hpp"
namespace npotrec { // npotrec namespace
auto
comp_prim_nuclear_potential_geom_020_pg(CSimdArray<double>& pbuffer,
const size_t idx_npot_geom_020_0_pg,
const size_t ... | TOOL | 0.872644 | 4.064704 |
5bb20438-19c9-4068-b418-8e032feadc16 | GaussGreen/old-code | ito33/ihg/tests/coreinterface/cb/main.cpp | #include "ito33/beforestd.h"
#include <iostream>
#include <math.h>
#include "ito33/afterstd.h"
#include "ito33/sharedptr.h"
#include "ito33/finance/computationalflags.h"
#include "ito33/finance/modeloutput.h"
#include "ito33/finance/sessiondata.h"
#include "ito33/finance/equity.h"
#include "ito33/finance/numeraire.h"... | ALGO | 0.900918 | 7.150727 |
16ce52c6-1c77-490b-b027-ed15b0621d27 | sunghoonism/heart_station_mobile_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.998799 | 6.776823 |
bfbb1dfb-8b69-4106-8f7e-06b94f858102 | kalectro/pcl_groovy | tools/mesh2pcd.cpp | #include <pcl/visualization/pcl_visualizer.h>
#include <pcl/io/pcd_io.h>
#include <pcl/common/transforms.h>
#include <vtkPLYReader.h>
#include <vtkOBJReader.h>
#include <vtkPolyDataMapper.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/console/print.h>
#include <pcl/console/parse.h>
using namespace pcl;
using nam... | TOOL | 0.863842 | 7.009643 |
ff20b64c-7fb9-4a11-a473-dd0828a55627 | Phantasm-Studios/UnrealEngine | Engine/Source/ThirdParty/CryptoPP/5.6.2/include/zlib.cpp | // zlib.cpp - written and placed in the public domain by Wei Dai
// "zlib" is the name of a well known C language compression library
// (http://www.zlib.org) and also the name of a compression format
// (RFC 1950) that the library implements. This file is part of a
// complete reimplementation of the zlib compression... | TOOL | 0.916482 | 7.252782 |
9144a265-3cda-4d15-a27d-401dcaa52265 | avivilla/problem_solve | Segment Tree/C - Brackets SPOJ - BRCKTS.cpp | #include<bits/stdc++.h>
#define pii pair<int,int>
#define mkp make_pair
#define fs first
#define sc second
#define pb push_back
#define ppb pop_back()
#define pcase(x) cout<<"Case "<<x<<": ";
#define hi cout<<"hi"<<endl;
... | ALGO | 0.999968 | 3.604902 |
f4226bb7-9463-41c6-b781-ed90f8679f55 | aditya28301/Core-Programming | C++ Programming/Repeatithon/DSA/Revision/check_if_array_sorted.cpp | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <climits>
#include <vector>
class isSorted_array{
private:
std::vector<int> vec;
public:
isSorted_array(std::vector<int>& ref_vec) : vec(ref_vec) { }
bool isSort_brute_approach(){
for(size_t i = 0; i < vec.size(); ++i){
for(size_t... | ALGO | 0.999776 | 5.191299 |
12f4f418-1387-4212-a8a9-c4fef3e5f064 | Arsitatw/Praktikum-4 | praktikum 4/unguided3.cpp | #include <iostream>
using namespace std;
int main() {
int data[] = {9, 4, 1, 4, 7, 10, 5, 4, 12, 4};
int target = 4;
int count = 0;
for (int i = 0; i < 10; i++) {
if (data[i] == target) {
count++;
}
}
cout << "jumlah kemunculan angka 4 dalam data adalah: " << co... | ALGO | 0.999589 | 6.213758 |
7abc85ff-1864-49f2-9666-0fabce50598e | sprkrd/adventofcode | 2022/09/part1.cpp | #include <cassert>
#include <iostream>
#include <set>
#include <utility>
using namespace std;
typedef pair<int,int> Point2i;
int sign(int x) {
if (x > 0) return 1;
else if (x < 0) return -1;
return 0;
}
struct System {
Point2i head, tail;
System() : head(0,0), tail(0,0) {}
void step(char di... | ALGO | 0.999493 | 4.877071 |
eba7374c-b89a-4ad5-8b26-d4b913f2d21a | agustinmoretti/UTN | AEDD - Algoritmo y Estructura de Datos/Guias Campus AEDD/Guia 7/Ejercicio 5 - Guia 7.cpp | #include <iostream>
using namespace std;
float menorMayor(float& a, float& b, float& c, float& menor, float& mayor){
if(a==b and b==c) return -1;
if(a==b or b==c or a==c){
if(a>b and a>c){
mayor=a;
}else if(b>a and b>c){
mayor=b;
}else{
mayor=c;
}
if(a<b and a<c){
menor=a;
}else if(b<a and b<... | ALGO | 0.99997 | 3.602726 |
f60d6828-8e84-4feb-aba8-b2bac5b2396f | LunaAlmeida/Beecrowd_solutions | Begineer/1047/main.cpp | #include <iostream>
using namespace std;
int main()
{
int startH, endH, startM, endM, totalH, totalM, total;
cin >> startH >> startM >> endH >> endM;
totalH = endH - startH;
if(totalH >= 0)
{
if((startH == endH) && (startM == endM))
{
totalH = 24;
totalM ... | ALGO | 0.999753 | 4.066952 |
9290a73b-b0ae-4bad-a748-fb2cc365368c | lukasmonk/lucaschess | Engines/Linux64/greko/Src/src/notation.cpp | // GREKO Chess Engine
// (c) 2002-2013 Vladimir Medvedev <<EMAIL>>
// http://greko.110mb.com
// notation.cpp: full and short algebraic notation
// modified: 01-Mar-2013
#include "moves.h"
#include "notation.h"
std::string FldToStr(FLD f)
{
if (f == NF)
return "-";
char buf[3];
buf[0] = static_cast<char>('... | ALGO | 0.89531 | 5.483366 |
4ba1884a-a811-46e9-bd5d-ff3c5d6ba1aa | ianiketkumar7/CPP | CODES/30JunPepClass3.cpp | #include<iostream>
using namespace std;
int main() {
int n, count = 0;
cout << "Enter the num: ";
cin >> n;
// for(int i = 1; i <= n; i++) {
// for(int j = 1; j <= n - i; j++) {
// cout << " ";
// }
// for(int k = 1; k <= 2 * i - 1; k++) {
// cout << count... | ALGO | 0.999944 | 3.812242 |
e9e847df-0c0f-4d0c-a1ba-70f5724d247d | sarvex/leetcode-perl | solution/2100-2199/2131.Longest Palindrome by Concatenating Two Letter Words/Solution.cpp | class Solution {
public:
int longestPalindrome(vector<string>& words) {
unordered_map<string, int> cnt;
for (auto& w : words) cnt[w]++;
int ans = 0, x = 0;
for (auto& [k, v] : cnt) {
string rk = k;
reverse(rk.begin(), rk.end());
if (k[0] == k[1]) {... | ALGO | 0.999994 | 5.917733 |
5de8405f-fa9b-4b0b-a877-8fa9aa676c6e | alexandraback/datacollection | solutions_5708921029263360_0/C++/Treeone/130.cpp | #include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
... | ALGO | 0.997669 | 3.305579 |
f1139c2a-0c48-4b63-9dc6-0b81ef6aed4f | fpelliccioni/Honeycomb | Honeycomb/src/common/Honey/Graph/NspTree.cpp | #include "Honey/Graph/NspTree.h"
#include "Honey/Math/Geom/Intersect.h"
namespace honey
{
template<int Dim>
void NspTree<Dim>::Node::init(const Box& box, vector<Node>& nodes, int depth, int depthOffset)
{
_box = box;
int offset = this - &nodes[depthOffset];
depthOffset += 1 << dim*depth;
depth += 1;
... | ALGO | 0.968182 | 6.410022 |
c8f2db9f-ee8a-4b4c-96a1-4c2eba3ff1c0 | ishtiak-billah-emon/DSA | L09-Array/Pair_sum.cpp | // https://bit.ly/3EwlU6e
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n ,s;
cin>>n>>s;
int arr[n];
for(int i = 0; i<n;i++)
{
cin>>arr[i];
}
sort( arr , arr+n);
for(int i = 0 ; i<n-1;i++)
{
for(int j = i+1 ; j<n ; j++)
{
... | ALGO | 0.999943 | 3.044494 |
abfa9c9f-abd2-439f-932f-f3dc702f2b1d | dinesh-gaire/Data-Structures-and-Algorithm | BinarySearch/01binarySearch.cpp | #include <iostream>
using namespace std;
int binarySearch(int arr[], int size, int key)
{
int start = 0;
int end = size - 1;
while (start <= end)
{
int mid = (start + ((end - start) / 2));
if (key > arr[mid])
{
start = mid + 1;
}
else if (key < arr[m... | ALGO | 0.99998 | 5.720977 |
766cf308-b252-48a5-8f33-2f847875b841 | pksenpai/RPS_game_with_diff_languages | C++/main.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
bool valid_input(char c) {
if (c == 'r' || c == 'p' || c == 's') return true;
else {
cout << "It's Not a valid input!!!" << endl;
return false;
}
}
int find_index(char *arr, char c) {
for (int i = 0; i < 3; i++) {
if (... | TOOL | 0.883129 | 3.707602 |
fc7e03ca-9b69-4c56-b243-5c0b97fe648f | mertpasacukur/riscv_llvm | clang/test/SemaCXX/constexpr-ackermann.cpp | // RUN: %clang_cc1 -std=c++11 -fsyntax-only %s
constexpr unsigned long long A(unsigned long long m, unsigned long long n) {
return m == 0 ? n + 1 : n == 0 ? A(m-1, 1) : A(m - 1, A(m, n - 1));
}
using X = int[A(3,4)];
using X = int[125];
| ALGO | 0.990715 | 3.247344 |
b8ab118b-3f05-4863-acf7-710ddabb2948 | lyccrius/OI-Solution | UOJ/#136. ใUER #3ใๅผๅญฆๅ็ไฝๆ.cpp | #include <iostream>
const int maxT = 1e5;
int T;
int n, m;
void mian() {
bool cross = false;
int ans = 0;
std::cin >> n >> m;
n--;
m--;
if (n >= 1 && m >= 1) {
n -= 1;
m -= 1;
ans += 2;
int t = std::min(n, m);
n -= t;
m -= t;
ans += t;
... | ALGO | 0.999949 | 5.708081 |
ddf44720-fc66-4f6f-903b-16d5bb521159 | ndanilo8/MAI_NumericalMethods | 2/practical2DaniloNascimento.cpp | /*
Numerical Methods
Pratical 2 variant 17 (Danilo Nascimento)
"Gaussian method with pivot element selection"
Description:
Solve the system of linear algebraic equations 'x'
using the Gaussian method with pivot element selection,
calculate the determinant 'y' and the inverse matrix 'z'
Author: Danilo Nascimento, M6O-... | ALGO | 0.999929 | 6.240233 |
3046ca06-bbbf-4f52-8622-6ab53787733e | 113bommy/LogicalErrorFixCodeT5 | logicalErrorFix_CodeT5_no_LineNumber/model/cpp/cpp_source/source_900.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using vi = vector<int>;
vector<int> q;
set<pair<int, int>> S[20];
int n, k;
int a[100000][20];
bool v[3000000];
int dic[600000][12];
int mind[20];
int maxd[20];
int main() {
scanf("%d%d", &n, &k);
int ans = 0;
for (int j = 0; j < k; ... | ALGO | 0.999581 | 3.018424 |
902c3656-9bbc-4a4a-9e8d-cf64902d6107 | parthh1112/cp | A_Way_Too_Long_Words.cpp | #include <bits/stdc++.h>
using namespace std;
int main (){
int t;cin>>t;
while(t--){
string a;cin>>a;
if(a.size() <= 10){
cout<<a<<endl;
}
else{
cout<<a[0]<<a.size()-2<<a[a.size()-1]<<endl;
}
}
} | ALGO | 0.99941 | 4.598608 |
a16a098c-1577-484f-b073-0eb01baafda9 | chinoll/freebsdsrc | contrib/llvm/tools/clang/lib/Driver/Multilib.cpp | #include "clang/Driver/Multilib.h"
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Path.h"
#include "llvm/Supp... | TOOL | 0.904671 | 4.06246 |
48804f77-82ae-414c-aa62-e7ba730a0a50 | nileshwankhede03/basic-cpp-programs | .history/pattern11_20250219113844.cpp | #include "./stdc++.h"
using namespace std;
void print11(int n)
{
int start = 1;
for(int i = 0; i < n; i++)
{
for(int j = 0; j <= i; j++)
{
cout << i;
}
cout << endl;
}
}
int main()
{
// 2 : test cases
// 3 : for 3 *
// 5 : for 5 *
... | ALGO | 0.999839 | 4.973681 |
c4bace42-cec0-413b-a0c0-0e314ad63bf7 | APU160139/Beecrowd | 1040 - Average 3.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
double a, b, c, d, l, m;
scanf("%lf %lf %lf %lf", &a, &b, &c, &d);
m = (a * 2 + b * 3 + c * 4 + d) / 10;
printf("Media: %.1f\n", m);
if (m >= 7.0){
printf("Aluno aprovado.\n");
}
else if (m >= 5.0)
{
printf("Aluno... | ALGO | 0.997715 | 3.650284 |
41272df9-28cc-410d-b513-5c15a6a45d9d | ishandutta2007/codeforces | nikolapesic2802/normal/1204/A.cpp | #include <bits/stdc++.h>
#define ll long long
#define f first
#define s second
#define pb push_back
#define all(x) x.begin(),x.end()
using namespace std;
int main()
{
string s;
cin >> s;
int ima=0;
for(int i=1;i<s.size();i++)
if(s[i]=='1')
ima=1;
cout <<(s.size()+ima)/2;
} | ALGO | 0.999878 | 3.629509 |
09850c36-331f-4118-a52b-e216764e55a2 | mrtechtroid/yt | CPP-2022-P8.cpp | // {CPP-2022-P8}: Finding If a character is UPPERCASE or lowercase
// Source Code: github.com/mrtechtroid/yt
#include <iostream>
using namespace std;
int main(){
char character;
cout << "Character:";
cin >> character;
if (character >= 'A' && character <='Z'){
cout << "Its A Capital(Uppercase) ... | TOOL | 0.896226 | 5.287482 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.