uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
3d1f2f29-d22a-44c0-88a4-dc1e5df4a8ce | everyofflineuser/godotengineplus | thirdparty/icu4c/common/bytestrieiterator.cpp | #include "unicode/utypes.h"
#include "unicode/bytestrie.h"
#include "unicode/stringpiece.h"
#include "charstr.h"
#include "uvectr32.h"
U_NAMESPACE_BEGIN
BytesTrie::Iterator::Iterator(const void *trieBytes, int32_t maxStringLength,
UErrorCode &errorCode)
: bytes_(static_cast<const... | ALGO | 0.931258 | 7.672802 |
e73b0386-8918-4fef-bbc7-9eea5b466e20 | falcaoanderson/CompetitiveProgramming | OBI/obi-2009-numero-de-envelopes.cpp | // 07/08/23 //
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <tuple>
#include <cstring>
#include <stack>
using namespace std;
#define ll long long
#define endl "\n"
#define fast_io ios_base::sync_wit... | ALGO | 0.999889 | 4.059103 |
799b4f25-e6fd-4bc3-836b-2365eda7065c | ishandutta2007/codeforces | popovicirobert/normal/1252/H.cpp | #include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#define uint unsigned int
#if 0
const int MOD = (int) ;
inline int lgput(int a, int b) {
int ans = 1;
while(b > 0) {
if(b & 1) ans = (1LL * ans * a) % MOD;
b >>= 1;
a = (1LL * a * a) ... | ALGO | 0.999962 | 3.434184 |
c765e688-ec59-4dcd-8092-336cffdda678 | raincross7/code-similarity | codes/train_code/problem128/problem128_238.cpp | #include <iostream>
using namespace std;
#define out(v) cout<<v<<"\n"
#define rep(i,n) for(int i=0;i<(n);++i)
const int WHITE = 0, BLACK = 1;
int main() {
cin.tie(0); ios::sync_with_stdio(false);
int A, B; cin >> A >> B;
int board[100][100];
rep(i, 100) rep(j, 100) {
if (i < 50)
board[i][j] = WHIT... | ALGO | 0.999325 | 3.335545 |
ff9ddd6d-5a07-4f24-baf6-6e7bb252e93b | lzshlzsh/test | cplusplus/TICPP-Vol-one/C05/Class.cpp | struct A {
private:
int i, j, k;
public:
int f();
void g();
};
int A::f() {
return i + j + k;
}
void A::g() {
i = j = k = 0;
}
// Identical results are produced with:
class B {
int i, j, k;
public:
int f();
void g();
};
int B::f() {
return i + j + k;
}
void B::g() {
i = j = k = 0;
}
... | ALGO | 0.873678 | 4.171039 |
606fb252-999e-4f25-8c7c-782f3c42c28d | Arin016/DSA | STL/18setoperations.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
int mod = 1e9+7;
void solve(){
int n, m;
cin>>n>>m;
int a[n], b[m];
set<int> st1, st2;
for(int i=0;i<n;i++)cin>>a[i], st1.insert(a[i]);
for(int i=0;i<m;i++)cin>>b[i], st2.insert(b[i]);
set<int> un;
for(int i=0;i<n;i++)un... | ALGO | 0.999978 | 3.730097 |
47ecbfa5-4b30-4360-9eb9-9ef5612c0830 | mrstarx/Demo2048 | 2048Demo.cpp | #include <algorithm>
#include <vector>
#include "2048demo.h"
#include "ProcessRow.cpp"
using std::reverse;
using std::vector;
using std::pair;
//判定游戏是否结束
bool Demo2048::IsGameOver(){
// 检查空位
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (grid[i][j] == 0) return false;
... | ALGO | 0.998446 | 4.343307 |
ded0bf14-1f98-42b2-b7ae-7ca25e047f95 | hjiang13/LLMs-in-IR | POJ-104/65/417.cpp | #include <iostream>
using namespace std;
int main()
{
int n,i,a[N],b[N],c[N],s=0,t=0;
cin >> "%d",&n);
for(i=0; i<n; i++)
{
cin >> "%d %d",&a[i],&b[i]);
if(a[i]==b[i])
c[i]=0;
else if(a[i]==0&&b[i]==1)
c[i]=1;
else if(a[i]==0&&b[i]==2)
c[i]=-1;
else if(a[i]==1&&b[i]==0)
c[i]=-1;
else if(a[i]==1&&b[i]==2)
c[i]=1;
else i... | ALGO | 0.999963 | 3.933376 |
71826303-376d-4d3d-98d7-9118d655d872 | raincross7/code-similarity | codes/train_code/problem059/problem059_362.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, X, T;
cin >> N >> X >> T;
auto cdiv = [&](auto a, auto b) {
return (a + b - 1) / b;
};
cout << cdiv(N, X) * T << "\n";
} | ALGO | 0.999841 | 4.566674 |
86fc38e6-bb34-4727-b1af-f14575363292 | rajendrachy/OOPS-IN-2024-SEP | STL IN C++/5LIST/list.cpp | // List -> Doubly LinkedList
#include<iostream>
#include<vector>
#include<list>
using namespace std;
// int main () {
// list<int> l;
// l.push_back(1); // or, emplace_back(); // result will be same
// l.push_back(2);
// l.push_front(3);
// l.push_front(5);
// // l.pop_back();
// /... | TOOL | 0.855318 | 3.825587 |
a283c46d-41c9-4457-a6ef-b957f3788ad4 | Jaygaur99/DS-Algo-Practice | Coding Minutes/DP/codes/supw.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int n;
cin >> n;
int a[n], dp[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
dp[0] = a[0];
dp[1] = a[1];
dp[2] = a[2];
for (int i = 3; i < n; i++) {
dp[i] = min({dp[i -... | ALGO | 0.99999 | 3.774472 |
c7971d24-71d8-4936-9336-164d48bcc26c | zidn77/UTS_Kelompok_PPB | 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.9988 | 6.76073 |
4cfd133e-6e91-41f7-8a03-44926491bd14 | ishandutta2007/codeforces | nyaan/normal/1305/F.cpp | #include <bits/stdc++.h> // clang-format off
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; ... | ALGO | 0.999963 | 4.546433 |
18291cb0-e6c9-4014-95e6-95137f2a82ad | mfayaq/competitive-programming | longestpaly.cpp | #include <bits/stdc++.h>
using namespace std;
bool isPalindrome(string s){
int size= s.length();
for(int i=0;i<size/2;i++){
if(s[i]!=s[size-i-1])
return false;
}
return true;
}
string longestPalindrome(string s) {
string longestPalYet;
int maxStrLen=0;
for(int i=0;i<s.l... | ALGO | 0.999956 | 5.459497 |
72b28530-dd87-4a6b-a24d-d2645a731aef | Shaf3eii/CP-Templates | SegmentTreeWithLazy.cpp | struct Node {
int sum, lazy = 0;
bool isLazy = false;
Node() : sum(0) { }
Node(int x) : sum(x) {}
void updateNode(int x, int lx, int rx) {
sum += x * (rx - lx);
lazy += x;
isLazy = true;
}
};
struct SagaraWithLazy {
#define leftChild (node * 2 + 1)
#define rightChild (... | ALGO | 0.99989 | 6.046774 |
cf62a7f1-58d2-44fc-acd0-60640daf9827 | pjswarnpath2709/Self-Learning | GFG DSA course/Sorting/NextPermutation 2.cpp | #define pb push_back
#define ppb pop_back
#define ff first
#define ss second
#define mset multiset
#define uset unordered_set
#define umap unordered_map
#define vi vector<int>
#define vll vector<long long>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T>
void in_vector(vector<T> &v... | ALGO | 0.999912 | 3.829556 |
5f28bc66-657a-476d-917e-bd3096e4ffa7 | chrisvaughn/mazegen | driver.cpp | //****************************************************************
//
// Name: Christopher Vaughn
// SL ID: cdv5673
// Date: 10/06/02
// Project: #3 Maze
//
// Filename: driver.cpp
//
// Certificate of Authenticity:
// I Christopher Vaughn hereby state the following code is
// entirely my own work.
//
//*************... | ALGO | 0.924442 | 4.818108 |
fcb5f1a3-a51b-4487-95bb-c7e821e5482c | prakharsinghch/dsa-practice | 2588-maximum-number-of-points-from-grid-queries/2588-maximum-number-of-points-from-grid-queries.cpp | class Solution {
public:
vector<int> maxPoints(vector<vector<int>>& grid, vector<int>& queries) {
int rows = grid.size(), cols = grid[0].size();
vector<pair<int, int>> sortedQueries;
for (int i = 0; i < queries.size(); i++) {
sortedQueries.emplace_back(queries[i], i);
}
... | ALGO | 0.999986 | 6.413408 |
cc6e68bf-362f-4c01-8a1b-e43197f4a343 | Taskupappi/SFML-projects | SFMLProjects/Dependencies/include/Box2D/Collision/Shapes/b2ChainShape.cpp | #include <Box2D/Collision/Shapes/b2ChainShape.h>
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
#include <new>
#include <memory.h>
b2ChainShape::~b2ChainShape()
{
b2Free(m_vertices);
m_vertices = NULL;
m_count = 0;
}
void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count)
{
b2Assert(m_vertices == NULL... | ALGO | 0.973137 | 6.876169 |
899da9ed-e368-48e3-86eb-e556223eabe5 | ishandutta2007/codeforces | 77o/normal/1325/F.cpp | // #pragma GCC optimize("O3")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5 + 5;
vector<int> g[N];
int main() {
// freopen("input.txt", "r", stdin);
ios::sync_with_stdio(false);
cin.tie(0);
... | ALGO | 0.999958 | 4.326065 |
a0297fad-b1fc-450d-98be-39451324c15b | StanleyJo-37/competitive-programming-chatbots-comprasion | submissions/gemini/sub74.cpp | #include <iostream> // Required for input/output operations (std::cin, std::cout, std::endl).
#include <vector> // Required for std::vector, a dynamic array.
#include <string> // Required for std::string.
#include <algorithm> // Required for std::min and std::max.
// Define a constant for the modulo operation.
// ... | ALGO | 0.99989 | 6.273671 |
3af582f9-045b-49aa-985f-47eb9eefefaf | prateek7394/Striver_SDE_sheet_Questions | Arrays/MajorityElement2.cpp | // Problem:
// Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times.
//********** M1: Using unordered_map and only 1 iteration ******
// T.C = O(n)
// S.C. = O(n)
#include<bits/stdc++.h>
using namespace std;
vector<int> majorityElement(vector<int>& nums) {
int n= nums.size(... | ALGO | 0.999977 | 5.516971 |
2c806d0b-9f86-4553-8e8e-00fb532aeb1c | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/09/0914/personal_submission/cf682c_kamtuo.cpp | /*----------------------------------*/
/* Author : KaMtuo */
/* Email : <EMAIL> */
/* Creation_time : 2024-09-14 12:44 */
/* Software : Visual Studio Code */
/*----------------------------------*/
#ifndef KAMTUO_LEETCODE
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nul... | ALGO | 0.999718 | 3.963912 |
8d9ca948-a956-4380-b270-c3e9ed45f6e5 | karthik6516/Leetcode_GFG | Reversing the equation - GFG/reversing-the-equation.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
string reverseEqn (string s)
{
//code here.
string ans;
string temp;
for(int i=s.length()-1;i>=0;i--)
{
if(s[i]=='... | ALGO | 0.999874 | 5.898407 |
1fe29c77-d3c5-433a-9e1e-0bb77b2587a6 | camp-d/Competitive-Programming | finance/EuropeanOption.cpp | #include "EuropeanOption.hpp"
#include <math.h>
| ALGO | 0.953367 | 5.774463 |
bc8e2f04-9d49-4eb4-9d2f-9213941ff1ad | omprakash111/cpp-basic | reverse_And_Palindrome.cpp | #include<iostream>
using namespace std;
int main()
{
int num,r,rev=0;
int storeNum;
cout<<"Enter the number \n";
cin>>num;
storeNum=num;
while(num>0)
{
r=num%10;
rev=rev*10+r;
num=num/10;
}
cout<<"reverse number of "<<storeNum<<" is "<<rev<<endl;
if(rev==storeNum)
{
cout<<storeNum<<" is palind... | ALGO | 0.999731 | 3.657255 |
ba6862dc-0f9d-4a9c-bbe1-f1c1cb4fae58 | PrestoCoder/Data-Structures-and-Algorithms-C- | CodingBlocks-DataStructAndAlgo/LinkedList/addTwoLL.cpp | #include<iostream>
#include<queue>
#include "LLNode.h"
using namespace std;
// Here, the best way is to reverse both LLs and then add.
// Coz otherwise, syncing recursion with the correct nodes to be added gets v. complex unnecessarily.
// Without much impact on Time complexity.
LLNode* addTwoLL(LLNode* head1, LLNode*... | ALGO | 0.999888 | 5.193587 |
8e430de7-71bc-4071-92ac-bae478a7c41a | bdwhst/DeepFacetX | src/asymConductorBsdf.cpp | static RandomDevice device;
AI_BSDF_EXPORT_METHODS(AsymConductorBSDFMtd);
bsdf_init
{
auto fs = GetAtBSDFCustomDataPtr<WithState<AsymConductorBSDF>>(bsdf);
fs->state.SetDirectionsAndRng(sg, false);
static const AtBSDFLobeInfo lobe_info[] = {
{ AI_RAY_SPECULAR_REFLECT, 0, AtString() },
{ AI_RAY_DIFFUSE_REFLECT... | ALGO | 0.968894 | 6.253843 |
5348cd16-86f8-409a-9548-5efd133769a6 | Shubhamp6/CP_Codes_Cpp | codeforces/A_Who_Tested.cpp | #include <bits/stdc++.h>
using namespace std;
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL), cout.tie(NULL);
int n;
cin >> n;
cout << n+1 << endl;
return 0;
} | ALGO | 0.99475 | 3.040463 |
17e070f5-9975-49e9-994d-67860d18970d | PRANAVJARANDE/CodeForces | C_Alice_s_Adventures_in_Cutting_Cake.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int uint64;
typedef long long ll;
typedef long double ld;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef pair<ll, ll> pl;
typedef vector<int... | ALGO | 0.999962 | 4.732753 |
2f7a6393-27c7-484b-8c42-b24fd3119383 | phamphuong97/DSA_Set_Map | Bai24_MapVaString.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n; cin>>n;
cin.ignore();
map<string,int> mp;
for(int i=0;i<n;i++){
string name; getline(cin,name);
mp[name]++;
}
//1.Liet ke danh sach cau thi ghi ban theo thu tu tu dien
for(auto x:mp){
cout<<x.first<<" "<<x.second<<endl;
}
cout<<endl;
}
| ALGO | 0.996701 | 3.925565 |
7dd91c89-0eae-4cb7-bcc3-ed7025994c76 | ayushatindra/Searching-and-sorting | Searching and sorting week4/customOperator.cpp | #include <algorithm>
#include <iostream>
using namespace std;
#include <vector>
void print(vector<int> &v) {
for (int i = 0; i < v.size(); i++) {
cout << v[i] << " ";
}
}
bool mycom2p(int &a, int &b) {
// return a<b; -->yee toh increasing order sorting hai
return a > b;
}
void print2d(vector<vector<int>> ... | ALGO | 0.999671 | 4.125277 |
b0cc5146-a6ec-4b24-ba19-0fa769c6b8b4 | MohamedSayed237/Counter_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.998859 | 6.785645 |
5cdfbef9-08a8-4013-8aca-3c3fb05337fe | yolo0731/Cpp-learning | C++ Prime Plus/课后习题答案/chapter07/exercise7_5.cpp | //
// Created by Shujia Huang on 2/9/22.
//
#include <iostream>
long factorial(int n) {
if (n == 0) {
return 1;
}
return n * factorial(n-1);
}
int main() {
using namespace std;
int n;
cout << "Enter an integer number: ";
while (!(cin >> n)) {
cin.clear();
while ... | ALGO | 0.999248 | 5.930505 |
e97e2081-45d7-42de-b306-2342fc2e1490 | ishandutta2007/codeforces | chemthan/normal/1004/E.cpp | #include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define ... | ALGO | 0.999982 | 4.576402 |
e49d04c9-136c-4591-8c31-26aeff2959a7 | FarihaUpoma/Programming-Codes | basic_ideas/sort/Insertion_Sort.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <ctype.h>
#include <iostream>
#include <map>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
#define eps 1e-10
#define PI acos(-1)
int dirx[8]= {-1, 0, 1, -1, 1, -1, 0, 1};
int diry[8]... | ALGO | 0.999928 | 3.542555 |
e7e9c18d-0138-4e2a-ad98-e7654ecd7cfa | bayren37/beakJoonCodePlus | WEEK_02_DATA_STRUCTURE/SW/1717.cpp | //집합의 표현
#include <bits/stdc++.h>
using namespace std;
int parent[1000001];
int find(int x) {
if (x == parent[x]) {
return x;
}
else {
return parent[x] = find(parent[x]);
}
}
void Union(int x, int y) {
x = find(x);
y = find(y);
if (x > y) {
parent[y] = x;
}
else {
parent[x] = y;
}
}
bool isSameP... | ALGO | 0.99994 | 4.477108 |
38e035f3-4f72-4292-a855-46349af54c23 | Junghs-cloud/Baekjoon | Gold/2/_9576.cpp | #include <iostream>
#include <algorithm>
#include <utility>
using namespace std;
bool cmp(pair<int, int>& p1, pair<int, int>& p2)
{
if (p1.second < p2.second)
{
return true;
}
else if (p1.second == p2.second)
{
return p1.first < p2.first;
}
else
{
return false;
}
}
int main()
{
cin.tie(NULL);
ios::sy... | ALGO | 0.999943 | 4.476331 |
4de24830-c5ad-43c0-9fbf-3aca430ee924 | sswamyn/cpp | docs/Code/c20_code/01_AlgorithmOverview/04_Accumulate.cpp | #include <cmath>
import <numeric>;
import <vector>;
import <iostream>;
import <span>;
import <functional>;
using namespace std;
double arithmeticMean(span<const int> values)
{
double sum{ accumulate(cbegin(values), cend(values), 0.0) };
return sum / values.size();
}
int product(int value1, int value2)
{
return va... | ALGO | 0.993982 | 5.078793 |
fc9544dd-6d93-4cb3-b17a-4941547f6e53 | alishair7071/FlutterProjects | backendFlutter/frontend/call_api/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.996491 | 6.76775 |
a4680ff9-2fd8-4778-90b0-6472f0a09c19 | samuelhm/Webserv | src/Utils/Utils.cpp |
#include "Utils.hpp"
#include "../ConfigFile/ParseConfig.hpp"
#include "../ConfigFile/Server.hpp"
#include "../Utils/Logger.hpp"
#include "../WebSrv.hpp"
#include <algorithm>
#include <cctype>
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <vector>
namespace Utils ... | TOOL | 0.989412 | 4.067619 |
a230dfe9-48e1-4279-820d-f5da81ce49a8 | arya4868/DSA | C++/Pattern/6.cpp | #include<iostream>
using namespace std;
/*
Enter the value of n :- 5
1
2 1
3 2 1
4 3 2 1
5 4 3 2 1
*/
int main()
{
int n;
cout << "Enter the value of n :- ";
cin >> n;
int i =1;
while (i<=n)
{
int j =1;
while (j <= i)
{
cout << (i-j+1) << " ";
j++;
... | ALGO | 0.999844 | 4.247304 |
249dd8ee-2f8c-498e-bf49-479af4009b78 | xccelerator/utm | anul II/sem iii/apa/lab 4/lab4apa.cpp | #include <iostream>
#include <time.h>
using namespace std;
#define max 500 //nr maxim de varfuri
#define inf 99999 // in loc de +00
int phi[3] = {20, 50, 100}; // cat de tare graful sa fie (in procente (20%, 50%, 100%))
int nrVarf[3] = {10, 50, 100}; // nr de varfuri :/
int iterFloyd, iterDij; //nr de iteratii pentr... | ALGO | 0.996826 | 4.157752 |
3562006b-05b0-4990-9dcc-31dfeff7ffa0 | ChandlerWang14/Gem5-archlab | src/systemc/tests/systemc/misc/stars/star108117/star108117.cpp | /*****************************************************************************
star108117.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*************************************************************************... | TOOL | 0.911688 | 4.236513 |
8bf2af81-f180-4168-b8d3-c30b6927611b | sudoker0/cpp-coding-stuff | 2022-09-13/BCAKE.cpp | #include <bits/stdc++.h>
using namespace std;
const float PI = 3.141592653589793;
// pi * r^2 * h
double total = 0, buffer = 0;
int n;
pair<int, int> cake[100001];
void loop(int pos)
{
double e = PI * cake[pos].first * cake[pos].first * cake[pos].second;
buffer += e;
bool found = false;
for (int i = ... | ALGO | 0.999476 | 4.50987 |
23064ddb-499a-4286-8819-6e196ee020af | Prakash-Jha-Dev/SPOJ | GSS1.cpp | #include<bits/stdc++.h>
using namespace std;
typedef struct
{
long long prefix,suffix,middle,sum,best;
}data;
long long A[50005];
data arr[200005];
void cal(data& d, data& a, data& b)
{
d.prefix= max(a.prefix, a.sum+b.prefix);
d.suffix= max(b.suffix, a.suffix+b.sum);
d.middle= a.suffix+b.prefix;
d.sum= a.sum+b... | ALGO | 0.999958 | 4.929798 |
6e0552ed-6ff4-4454-ab94-dc271ec52027 | algorithm-random-defense/algorithm_study | src/AS_23_12_week2/jahoon/boj20291.cpp | #include <iostream>
#include <string>
#include <map>
using namespace std;
//파일 정리
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
map<string, int> m;
string input;
for (int i=0; i<n; i++) {
cin >> input;
m[input.substr(input.find('.')+1)]++;
}
for (auto t : m) {
... | ALGO | 0.994368 | 4.349128 |
6e5b053b-8311-4031-b34b-0f0799ff4a79 | Eagleflag88/MultiModalEvnPercption | src/thirdparty/g2o/g2o/examples/icp/gicp_sba_demo.cpp | #include <Eigen/StdVector>
#include <random>
#include <iostream>
#include <stdint.h>
#include "g2o/core/sparse_optimizer.h"
#include "g2o/core/block_solver.h"
#include "g2o/core/solver.h"
#include "g2o/core/optimization_algorithm_levenberg.h"
#include "g2o/solvers/csparse/linear_solver_csparse.h"
#include "g2o/types/i... | ALGO | 0.999538 | 5.377199 |
73d890ab-e04b-4769-9313-7082e9ebe308 | sarvex/leetcode-free-pascal | solution/1600-1699/1636.Sort Array by Increasing Frequency/Solution.cpp | class Solution {
public:
vector<int> frequencySort(vector<int>& nums) {
vector<int> cnt(201);
for (int v : nums) {
++cnt[v + 100];
}
sort(nums.begin(), nums.end(), [&](const int a, const int b) {
if (cnt[a + 100] == cnt[b + 100]) return a > b;
retu... | ALGO | 0.999988 | 6.07665 |
4e926c04-5507-4c4e-add9-eae7884805f7 | Solybum/PSO-Related-Stuff | Pso_File_Formats-master/xvm/pvrx2png-master/deps/squish/extra/squishgen.cpp | #include <iostream>
struct SourceBlock
{
int start;
int end;
int error;
};
struct TargetValue
{
SourceBlock sources[2];
};
static void GenerateData( std::string const& name, int bits, int colours )
{
TargetValue values[256];
// initialise the data
for( int target = 0; target < 256; ++target )
for( int ind... | ALGO | 0.966548 | 4.90143 |
e4e3605a-0805-46a8-83da-3705fd97ea6f | ishandutta2007/codeforces | generic_placeholder_name/normal/1615/D.cpp | #pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
mt19937 rng(... | ALGO | 0.999972 | 4.980827 |
78655bc1-35cc-4fc8-bb41-7670f352c2da | fughilli/ViveTrackerSolver | main.cpp | #include "solver.hpp"
#include "VectorLib/Vector.h"
#include "VectorLib/Matrix.h"
#include <cstdio>
#include <iostream>
#define DEVICE_SENSOR_COUNT 10
typedef Device<DEVICE_SENSOR_COUNT> Device4;
typedef Lighthouse<DEVICE_SENSOR_COUNT> Lighthouse4;
typedef Solver<DEVICE_SENSOR_COUNT, Device, Lighthouse> Solver4;
u... | ALGO | 0.991736 | 3.861058 |
0927ada1-f054-4ebb-baa9-91ed22ba5dbc | EmmanuelSHS/codebase | langpractice/cpp_pku/cpp_learning/c/VowelCounts.cpp | #include <stdio.h>
#include <stdlib.h>
#define MAX 80
int main() {
char in[MAX];
int na, ne, ni, no, nu;
na = 0; ne = 0; ni = 0; no = 0; nu = 0;
gets(in);
for (int i = 0; i < MAX; ++i) {
if (in[i] == '\0') break;
if (in[i] == 'a') ++na;
else if (in[i] == 'e') ++ne;
... | ALGO | 0.988995 | 3.053149 |
ff7f3148-5b89-4281-8757-8b724d0d3bea | vogel005/HackerRank | AllSubmissions/InterviewPrep/Warmup/sockMerchant.cpp | #include <bits/stdc++.h>
using namespace std;
int sockMerchant(int n, vector<int> ar) {
int pair =0; //amount of pairs
sort(ar.begin(), ar.end()); //sorting the sock values from lowest to highest values. meaning duplicate values will be next to each other.
for(int i=0; i<n-1; i++)
{
if(ar[i] == ar[i+1])... | ALGO | 0.999916 | 5.163686 |
8482738f-7515-4ef4-a0aa-6a0626b9fdde | RawSharkill/leetcode | 32longest.cpp | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
/*
еƣnext ⡣
һЩ
*/
class Solution {
public:
int longestValidParentheses(string s) {
int result = 0;
s = ')' + s;
vector<int> dp(s.length(), 0);
for (int i = 1; i<s.length(); i++)
{
if (s[i] == ')')
{
if (... | ALGO | 0.999334 | 4.915996 |
e380b1bf-6045-4ce9-9904-c5f8fa6ffb44 | Ashish75585/LeetCode_solutions | leetcode_DPP_16-06-24/solution.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int minPatches(vector<int>& nums, int n)
{
long int miss = 1;
int i=0;
int result=0;
vector<int>val;
while(miss <= n)
{
if(i<nums.size() && miss >= nums[i])
... | ALGO | 0.999981 | 5.612847 |
94ddb0f5-4691-498a-a0de-c7527830fdb3 | asim2025/SmartOrderRouter | src/SerialRouter.cpp | #include "SerialRouter.h"
#include "Logger.h"
#include "Venue.h"
#include "VenueManager.h"
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
/*
*
* Serial Router
*
* Split parent order and send orders serially
* to multiple venues.
*
*/
void SerialRouter::route(const Order & p... | ALGO | 0.966202 | 5.195681 |
ca79b536-3658-4b28-8bd7-d0312a5b072a | sanketdisale871/DSA | 1940-maximum-xor-for-each-query/maximum-xor-for-each-query.cpp | class Solution {
public:
vector<int> getMaximumXor(vector<int>& nums, int maximumBit) {
vector<int> ans;
int allXor=0;
for(auto it:nums){
allXor^=it;
}
int n = nums.size();
int j = n-1;
int i=0;
while(i<n){
int k=0;
... | ALGO | 0.999962 | 5.497639 |
021030a4-7edd-4f78-a9ee-30910af2cbd0 | oicatalana/solucions_oicat_2018 | concurs_classificatori1/pb4.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int x, y, n;
cin >> x >> y >> n;
vector<int> a(n + 1);
a[1] = x;
for (int i = 2; i <= n; ++i) a[i] = a[i-1] + y*(i - 1);
cout << a[n] << endl;
}
| ALGO | 0.999907 | 3.554631 |
8da3e857-935f-4ec2-bb1c-4d0927e07b24 | juliznv/k2p-archive | padavan/trunk/tools/lzma/lzma-4.65/CPP/7zip/Compress/LZMA_Alone/LzmaBench.cpp | // LzmaBench.cpp
#include "StdAfx.h"
#include "LzmaBench.h"
#ifndef _WIN32
#define USE_POSIX_TIME
#define USE_POSIX_TIME2
#endif
#ifdef USE_POSIX_TIME
#include <time.h>
#ifdef USE_POSIX_TIME2
#include <sys/time.h>
#endif
#endif
#ifdef _WIN32
#define USE_ALLOCA
#endif
#ifdef USE_ALLOCA
#ifdef _WIN32
#include <mall... | TOOL | 0.864305 | 7.229069 |
9f0a83c1-d111-4b13-a678-40eb372ff0da | jdily/cornucopia-lib | Cornucopia/Solver.cpp | #include "Solver.h"
#include <Eigen/Cholesky>
#include <iostream> //TODO: TMP
using namespace std;
using namespace Eigen;
NAMESPACE_Cornu
LSSolver::LSSolver(LSProblem *problem, const vector<LSBoxConstraint> &constraints)
: _problem(problem), _constraints(constraints), _damping(1.), _maxIter(100),
_increaseDampingAf... | ALGO | 0.999851 | 6.414495 |
e67a2f5a-fee3-424a-ad15-8dac38ccb559 | kowshik24/Codeforces | 1223A.cpp | #include<bits/stdc++.h>
using namespace std;
/// File input & output /////
#define fRead(x) freopen("x.txt","r",stdin)
#define fWrite(x) freopen ("x.txt","w",stdout)
#define ld long double
#define ll long long
#define ull unsigned long long
#define ff fi... | ALGO | 0.999913 | 4.008269 |
9c47ba85-5161-4440-9fb9-ed618d5a0186 | jhasan2026/Road_To_Grandmaster | 2_Data_Structure_and_Algorithm/9_Recursion/10_find_max.cpp | #include "iostream"
using namespace std;
int findMax(int *arr,int i,int n){
if(i==n-1){
return arr[i];
}
return max(arr[i],findMax(arr,i+1,n));
}
int main(){
int arr[] = {5,7,8,99,6,3};
cout<<findMax(arr,0,6);
} | ALGO | 0.999649 | 4.356026 |
aac56d51-9a5f-498c-ae99-4952f2c6c6c9 | dzigaVertov/vertov_blender | extern/bullet2/src/BulletSoftBody/btDeformableBackwardEulerObjective.cpp | #include "btDeformableBackwardEulerObjective.h"
#include "btPreconditioner.h"
#include "LinearMath/btQuickprof.h"
btDeformableBackwardEulerObjective::btDeformableBackwardEulerObjective(btAlignedObjectArray<btSoftBody*>& softBodies, const TVStack& backup_v)
: m_softBodies(softBodies), m_projection(softBodies), m_backu... | ALGO | 0.996619 | 6.035361 |
5e9a99fd-1e9c-4da3-8ad5-146fcb37f86a | ishandutta2007/codeforces | tadijasebez/normal/1276/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define ldb long double
#define mt make_tuple
template<typename T> bool ckmn(T &a, T b){ T c=a;a=min(a,b);return a!=c;}
template<typename T> bool ckmx(T &a, T b){ T c=a;a=max(a,b);return a!=c;}
const int N=20005... | ALGO | 0.99994 | 4.232946 |
1e2ae598-5340-4f33-886e-333a043e2389 | mpfeifer1/Kattis | intersectingrectangles.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct SegmentTree {
vector<ll> tree, lazy;
ll n, root, size;
SegmentTree(int currSize) : n(currSize), root(1) {
ll x = (ll)(ceil(log2(currSize)));
size = 2*(ll)pow(2,x);
tree.resize(size, 0);
lazy.resize(si... | ALGO | 0.999897 | 4.178804 |
baab7e3f-3c67-45c1-9931-97a246dbab69 | sovon1/VS-code | c++ codes/apna_college/function6_2_again.cpp | #include<iostream>
#include<math.h>
using namespace std;
bool isPrime(int num)
{
int i;
for(i=2; i<=sqrt(num); i++)
{
if(num%i==0)
return false;
}
return true;
}
int main()
{
//taking input
int a ;
int b ;
int i;
cin>>a>>b;
//loop to check between the r... | ALGO | 0.999877 | 3.908271 |
3259c606-7b0f-4a69-81be-ada170740663 | PiyuBhai8888/PIYUSH_DSA_CODE | Calculate_N_factorial_code37.cpp | #include<iostream>
using namespace std;
int factorial(int n){
int fact=1;
for(int i=1; i<=n; i++){
fact*=i;
}
return fact;
}
int main(){
cout<<factorial(6)<<endl;
return 0;
} | ALGO | 0.999204 | 4.808451 |
418f40e4-f169-4276-9f26-704309cb43ce | mayankkaushik187/AlgoViser | CSES/Dynamic Programming/Grid Paths.cpp | // ▒▒▒▒▒▒▒▒▒▒▒▄▄▄▄░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
// ▒▒▒▒▒▒▒▒▒▄██████▒▒▒▒▒▄▄▄█▄▒▒▒▒▒▒▒▒▒▒
// ▒▒▒▒▒▒▒▄██▀░░▀██▄▒▒▒▒████████▄▒▒▒▒▒▒
// ▒▒▒▒▒▒███░░░░░░██▒▒▒▒▒▒█▀▀▀▀▀██▄▄▒▒▒
// ▒▒▒▒▒▄██▌░░░░░░░██▒▒▒▒▐▌▒▒▒▒▒▒▒▒▀█▄▒
// ▒▒▒▒▒███░░▐█░█▌░██▒▒▒▒█▌▒▒▒▒▒▒▒▒▒▒▀▌
// ▒▒▒▒████░▐█▌░▐█▌██▒▒▒██▒▒▒▒▒▒▒▒▒▒▒▒▒
// ▒▒▒▐████░▐░░░░░▌██▒▒▒█▌▒▒▒▒▒▒▒▒▒▒▒▒▒
... | ALGO | 0.999976 | 4.883256 |
f9a2437a-62dc-47e7-ba24-1235b54e71b1 | nimec77/cpp_yandex | src/leetcode/leetcode_543.cpp | #include <vector>
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
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, Tree... | ALGO | 0.999589 | 6.407462 |
676fc560-1f70-41b0-aec2-942315298322 | Tianyi-Tang/Poj_Algorithm_Practice | Mixed/solution/1269.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
struct Equation{
bool yValue;
double m;
double c;
};
void calculateEquation(Equation& a,double x1,double y1,double x2,double y2){
if(x1 - x2 == 0){
a.m = 0;
a.yValue = false;
a.c = x1;
}
else if(y1 - y2 ==0){... | ALGO | 0.999516 | 4.105175 |
40493578-3488-4be4-8375-95f629ff4f2d | raincross7/code-similarity | codes/train_code/problem322/problem322_45.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int input;
for(int r = 1; ; r++) {
cin >> input;
if(input == 0) break;
cout << "Case " << r << ": " << input << endl;
}
return 0;
} | ALGO | 0.98908 | 3.793845 |
25d70362-45bd-49c4-b9a5-bab343a4db17 | cpvrlab/SLProject4 | externals/libigl/include/igl/cotmatrix_intrinsic.cpp | template <typename Derivedl, typename DerivedF, typename Scalar>
IGL_INLINE void igl::cotmatrix_intrinsic(
const Eigen::MatrixBase<Derivedl> & l,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::SparseMatrix<Scalar>& L)
{
using namespace Eigen;
using namespace std;
// Cribbed from cotmatrix
const int nver... | ALGO | 0.999182 | 6.266122 |
7edb0493-f375-4b09-a550-1a4d23a54531 | vidalmatheus/codes | Karat/multipleParent.cpp | #include <bits/stdc++.h>
using namespace std;
/*
All nodes have 0, 1, or multiple parent given the realitionship in pairs ((0,1),(1,2),(1,4)).
For example, (0,1) -> 0 is a parent of 1.
Find the node has no parent or exactly 1 parent.
*/
#define BLANK 0
#define DISCOVERED 1
#define VISITED 2
void buildGraph(unorder... | ALGO | 0.999461 | 5.124597 |
4633ae3f-c9b1-48d0-b42f-b0209bcadff2 | JimmyCode2009/leetcode-desktop | Jump Game/main.cpp | #include <iostream>
using namespace std;
/*ʱ
int minstep=INT_MAX;
class Solution {
public:
void jump(int A[], int n,int current, int step)
{
if(step>minstep)
return;
if(current==n)
{
//պ
if(minstep>step)
minstep=step;
return;
}
if(current>n)
return;
//currentѡ1-A[current]
for(int i=1... | ALGO | 0.99996 | 4.380911 |
50da4889-faf2-4de8-a70d-ea03e9415d42 | tuenti/hiphop-php | src/runtime/base/zend/zend_md5.cpp | #include <runtime/base/zend/zend_string.h>
namespace HPHP {
///////////////////////////////////////////////////////////////////////////////
/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
* Reference MD5 code (md5c.c) from rfc1321
*/
/* Constants for MD5Transform routine.
*/
#define S11 7
#defin... | TOOL | 0.930468 | 6.029291 |
6cf0ca08-414e-4c11-a5b9-f2fa3953a631 | BAPGAP/hanyang | Algorithm/백준/28298/main.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int alpha[27] = {0};
int main()
{
string s[502];
int n,m,k;
int sum = 0;
cin >> n >> m >> k;
for(int i=0; i<n; i++){
cin >> s[i];
}
int total = n*m/k;
total /= k;
for(int i=0; i<k; i++){
... | ALGO | 0.999976 | 3.568145 |
960dc6ab-7c48-4e5a-a18a-184a1876fae0 | mstorsjo/platform_frameworks_av | media/libstagefright/codecs/amrnb/common/src/shr.cpp | /*
Filename: /audio/gsm_amr/c/src/shr.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the shr function. Sync'ed up with
the current template and fixed tabs.
Description: 1. Modified code by seperating var2=0 condi... | ALGO | 0.99339 | 6.531946 |
f974556b-bfe8-4661-b319-a0468c630f96 | ESOS-Lab/barrieriostack | applications/mysql-5.7.13/extra/yassl/taocrypt/src/dsa.cpp | #include "runtime.hpp"
#include "dsa.hpp"
#include "sha.hpp"
#include "asn.hpp"
#include "modarith.hpp"
namespace TaoCrypt {
void DSA_PublicKey::Swap(DSA_PublicKey& other)
{
p_.Swap(other.p_);
q_.Swap(other.q_);
g_.Swap(other.g_);
y_.Swap(other.y_);
}
DSA_PublicKey::DSA_PublicKey(const DSA_PublicKey&... | TOOL | 0.979388 | 7.562704 |
e8d268d8-b40d-47a1-a9d7-8fd8d2128eea | nafi103/Solved-Problems | Practice/2025/January - April/B_Binary_Typewriter.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
/****************************************************************/
#define int long long
#define pi acos(-1.0)
const int mod = 998244353;
#defin... | ALGO | 0.999979 | 4.748478 |
a3eb7c5f-b711-4569-91cf-3a0e4649f279 | vladislav36/AppMobileAvancerExercice | Semaine 1/Cours 2/cours2/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.997538 | 6.76073 |
30abdbd9-9edb-4db1-ab98-be040b9cf10c | SGGODE/lettcode-solved | 0290-word-pattern/0290-word-pattern.cpp | class Solution {
public:
bool wordPattern(string pattern, string s) {
string sx,x;
int cnt=0;
map<char,int>mp;
map<string,int>mx;
for(auto&it:pattern){
if(mp.count(it)){
sx.push_back(mp[it]);
}else{
cnt+=1;
... | ALGO | 0.999594 | 6.241982 |
7ff1d2fd-3392-4e18-b1d0-f547a52683ad | neurofreiburg/QuattrocentoLSLApp | extern/boost_1_80_0/libs/graph/example/undirected_dfs.cpp | #include <string>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/undirected_dfs.hpp>
#include <boost/cstdlib.hpp>
#include <iostream>
/*
Example graph from Tarjei Knapstad.
H15
|
H8 C2
\ / \
H9-C0-C1 C3-O7-H14
... | ALGO | 0.999485 | 6.652205 |
17c40e88-4058-4af6-99b5-c1aee974f7b9 | arcogelderblom/AdventOfCode | 2023/Day06/main.cpp | #include <iostream>
#include <cassert>
#include <chrono>
#include <string>
#include <iterator>
#include <algorithm>
#include <map>
#include "FileHandler.hpp"
#include "StringParser.hpp"
long getAmountOfOptions(long timeMax, long distanceMax)
{
long min = 0;
long max = 0;
for (long time = 1; time <= timeM... | ALGO | 0.987955 | 6.106462 |
0923509c-ea66-4df6-9f08-83e16c11dc37 | andr3wmac/Torque6 | lib/bgfx/3rdparty/libsquish/maths.cpp | /*! @file
The symmetric eigensystem solver algorithm is from
http://www.geometrictools.com/Documentation/EigenSymmetric3x3.pdf
*/
#include "maths.h"
#include "simd.h"
#include <cfloat>
namespace squish {
Sym3x3 ComputeWeightedCovariance( int n, Vec3 const* points, float const* weights )
{
// compute the centroi... | ALGO | 0.999941 | 6.393174 |
35b0dd8a-6da1-4c19-b1e7-7c9e7aad6d98 | Sabbir943/Assignment_cpp | problem18.cpp | //18. WAP in C++ to copy all elements of one array to another.
#include<iostream>
using namespace std;
int main()
{
int arr1[]={1,2,3,4,5};
int arr2[]={10,20,30,40,50};
int temp;
for(int i=0;i<5;i++)
{
temp=arr1[i];
arr1[i]=arr2[i];
arr2[i]=temp;
}
cout<<"First Array"... | ALGO | 0.934902 | 3.266604 |
0b758ca9-8b0a-4abe-b291-bd09015e72e1 | gemmatruong/CMPR120 | Truong_Project5_Distance_Traveled/Truong_Project5_Distance_Traveled/Truong_Project5_Distance_Traveled.cpp | // This program calculates and displays the distance a vehicle travels.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
// Define variables.
bool valid;
int time;
double distance, speed;
// Display the program header.
cout << "\n";
cout << "Author's Name, e.g., Th... | ALGO | 0.999402 | 5.186731 |
035043f3-d40f-422f-a5c5-d18f912d8663 | ishandutta2007/codeforces | rfpermen/normal/276/A.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
#define ll long long
#define rep(i,n,N) for(int i=n;i<=N;i++)
#define rap(i,n,N) for(int i=(int)n;i>=(int)N;i--)
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define s... | ALGO | 0.99993 | 3.391436 |
b43eb1b4-e6f7-41fc-9eca-98444b7eaffc | shitcodebykaushik/DSA_Workspace | codechef/500-700/billion-dollar.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int A,B,X;
cin>>A>>B>>X;
int c = (B-A)/X;
cout<<c<<endl;
}
}
| ALGO | 0.999828 | 3.842551 |
d6fd1441-75ef-48f1-8892-b5fe91b58a43 | yk-fujii/nvfc | compiler/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp | #define DEBUG_TYPE "ipconstprop"
#include "llvm/Transforms/IPO.h"
#include "llvm/Constants.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Support/CallSite.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/SmallVector.h"
using... | TOOL | 0.987224 | 7.760043 |
4b418979-19f8-4926-a2e6-d96e5c384287 | sinian666/code_86_8 | cpp_副本8/chapter_computational_complexity/time_complexity.cpp | /**
* File: time_complexity.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 常数阶 */
int constant(int n) {
int count = 0;
int size = 100000;
for (int i = 0; i < size; i++)
count++;
return count;
}
/* 线性阶 */
int linear(int n) {
int count = ... | ALGO | 0.998263 | 4.117926 |
01a19dde-75a6-4817-bc7d-11be87d8f83c | istiak7/CompettiveProgramming | codeforces/1915/C.cpp | ///*BISMILLAHIR RAHMANIR RAHIM*///
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define pb push_back
#define MP make_pair
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define per(i, n) for... | ALGO | 0.998438 | 4.51889 |
6c1715d0-6e78-4244-8c64-64f8e7efa938 | Anushka23ja/C | C++ Fundamental/do, for loop, switch statements/for6.cpp | #include<iostream>
using namespace std;
int main()
{
int i, no,res=1;
cout<<"\nEnter Number: ";
cin>>no;
for(i=no;i>=1;i--)
{
res=res*i;
}
cout<<"\nFactor is l="<<res;
}
//3*2*1=6
//4*3*2*1=24 | ALGO | 0.999928 | 3.948186 |
65d1a806-4f1f-4420-ac0e-8ff313847ee8 | grey0758/marvel_future_fight | tesseract-5.4.0-rc1/src/ccstruct/linlsq.cpp | #include "linlsq.h"
#include <cmath> // for std::sqrt
#include <cstdio>
#include "errcode.h"
namespace tesseract {
constexpr ERRCODE EMPTY_LLSQ("Can't delete from an empty LLSQ");
/**********************************************************************
* LLSQ::clear
*
* Function to initialize a LLSQ.
************... | ALGO | 0.99413 | 6.228981 |
120ae8b6-ced6-4d2d-a8d8-720ba3cbdf8d | Abhisays27/DSA | Array/addarray.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main()
{
int a[3]={4,5,1};
int b[3]={3,4,5};
int n=3;
int m=3;
int num1=0;
for(int i=0;i<n;i++){
int num1= num1+a[i]*pow(10,n-1-i);
}
int num2=0;
for(int i=0;i<m;i++){
int num2= num2+a[i]*pow(10,m-1-i);
}
int num3=num1+num2;
int count=0;
whi... | ALGO | 0.999962 | 3.218946 |
72fe6944-aeba-4c3d-ad85-f8dbb665197e | coding-chez/deck-of-codes | cpp/Queues/q-deque.cpp | //main.cpp
// ALREADY IMPLEMENTED
// Go to arraylist.h's methods.
#include <iostream>
#include "circulardeque.h"
using namespace std;
int main() {
Deque* deque = new CircularDeque();
int input;
char op;
do {
cout << "Enter op: ";
cin >> op;
switch (op) {
case 'f' :
cin >> inpu... | TOOL | 0.979464 | 3.388952 |
6370b027-62b2-4218-950f-3668ff115e95 | Shinmera/ETHZ-NumericalMethods | solutions/1/C++/matPow.cpp | #include <Eigen/Dense>
#include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
#include <math.h>
//! \brief Compute powers of a square matrix using smart binary representation
//! \param[in,out] A matrix for which you want to compute $A^k$. $A^k$ is stored in $A$
//! \param[out] k integer for $A^k$
template <... | ALGO | 0.999558 | 5.70575 |
863b883a-430b-4941-a78a-037db5078ccc | Md-Kais/coding_problem | 350/A.cpp | ///----> bismillahir rahmanir rahim <---- -- { ^ _ ^ }
/// { ^_^ } { ^ _ ^ }
#include<bits/stdc++.h>
#include<bits/stdc++.h>
using namespace std;
//<--------------------------------------------typo section--------------------------------------------->
typedef long long ll;
typedef vector<int> vi;
typedef ... | ALGO | 0.999946 | 3.44803 |
9b84f5f0-7802-41a3-9dda-b34c8d5e16da | Ankaichen/leetcode | cpp/tasks/task_impl/source/leetcode_task541.cpp | /**
******************************************************************************
* @file : leetcode_task541.cpp
* @author : An Kaichen
* @brief : None
* @attention : None
* @date : 25-6-19
*************************************************************************... | ALGO | 0.999866 | 6.308372 |
0d538cd7-87c3-4200-ba82-8b56ea1e0fa4 | xavierbeast68/CodeStudio | Contest/Weekend Contest 81/Stability.cpp | //* https://www.codingninjas.com/studio/contests/weekend-contest-81/8894371/problems/25015
#include <bits/stdc++.h>
using namespace std;
int isPossibleToDivide(int n, int k, vector<int> &a) {
// Write your code here.
unordered_map<int,int> mp;
int maxF = 0;
for(int i = 0; i < n; i++){
mp[a[i]... | ALGO | 0.999833 | 4.994922 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.