uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7dcdbd65-67bc-4a98-a90c-79c3051b3cf2 | Warawreh/CP-Library | Contests/DCPC2022/j.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define fast ios::sync_with_stdio(false);cin.tie(0);
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main(){
fast
int t ; c... | ALGO | 0.999623 | 4.210504 |
fc97567e-e9c2-414a-bb96-3ae9ae3488cb | maliku/CorsixTH_Android | jni/AGG/src/agg_line_aa_basics.cpp | #include <math.h>
#include "agg_line_aa_basics.h"
namespace agg
{
//-------------------------------------------------------------------------
// The number of the octant is determined as a 3-bit value as follows:
// bit 0 = vertical flag
// bit 1 = sx < 0
// bit 2 = sy < 0
//
// [N] shows t... | ALGO | 0.999645 | 5.972741 |
f311eb44-1727-4635-8980-59020391ea90 | Project-Flare/frameworks_av | media/module/codecs/amrnb/common/src/inv_sqrt_tbl.cpp | /*
Filename: /audio/gsm_amr/c/src/inv_sqrt_tbl.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Changed table name to inv_sqrt_tbl
Description: Added #ifdef __cplusplus and removed "extern" from table
definition.
Description: Put "ext... | ALGO | 0.998802 | 3.596707 |
ce20bffe-35db-4587-b996-5e8f8b19a392 | Seungchan0325/nypc | 2024/round 1/c.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
using ll = long long;
ll N, A[MAXN], DP[MAXN];
int main()
{
cin >> N;
for(int i = 1; i <= N; i++) cin >> A[i];
DP[1] = A[1];
for(int i = 2; i <= N; i++) {
DP[i] = min(DP[i-1]+A[i], DP[i-2] + max(A[i-1], A[i]));
}
... | ALGO | 0.999976 | 4.453216 |
9ca863cb-d2db-421e-b2cc-0df548703f2a | noname0310/bullet-rust-wasm | src/wasm_src/cpp_src/BulletDynamics/Dynamics/btDiscreteDynamicsWorldMt.cpp | #include "btDiscreteDynamicsWorldMt.h"
//collision detection
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
#include "BulletCollision/CollisionShapes/btCollisi... | ALGO | 0.991004 | 3.223687 |
9a256191-6283-427e-a547-93bfc777a64d | codestream/algorithms | cpp/FenwicTree.cpp | #include <iostream>
using namespace std;
const int maxn = 200000;
int t[maxn];
void add(int i, int value) {
for (; i < maxn; i += (i + 1) & -(i + 1))
t[i] += value;
}
int sum(int i) {
int res = 0;
for (; i >= 0; i -= (i + 1) & -(i + 1))
res += t[i];
return res;
}
// sum[a,b]
int sum(int a, i... | ALGO | 0.999825 | 4.540678 |
a59d1b23-cb2c-41e2-828d-7c70cc191903 | tinatiansjz/algorithm-learning-2019 | POJ/1804.cpp | //POJ-1804 逆序对-归并排序
//2018/11/1 15:13
#include <iostream>
#include <cstdio>
using namespace std;
const int INF = 1e9;
const int maxn = 500010;
long long t;//s[]序列逆序数
int s[maxn];
void compute_t(int* s, int top, int mid, int end){
//left: s[top]...s[mid]
//right: s[mid+1]...s[end]
int len_L = mid-top+... | ALGO | 0.999783 | 3.848919 |
e56be20d-4467-44cd-878c-5b81ca0e4c17 | koldeen/Sapfor2 | sapfor/experts/Sapfor_2017/_src/Utils/RationalNum.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <limits.h>
#include "RationalNum.h"
using std::vector;
using std::ostream;
static inline void getFactors(int num, vector<int64_t>& factorSet)
{
if (num != 1)
factorSet.push_back(num);
for (int i = 2; i <= sqrt(st... | ALGO | 0.999209 | 3.434748 |
a9d72766-8073-43bd-8677-06d88b8fc955 | tehrengruber/reactive-transport-cuda | ext/eigen/unsupported/bench/bench_svd.cpp | // Bench to compare the efficiency of SVD algorithms
#include <iostream>
#include <bench/BenchTimer.h>
#include <unsupported/Eigen/SVD>
using namespace Eigen;
using namespace std;
// number of computations of each algorithm before the print of the time
#ifndef REPEAT
#define REPEAT 10
#endif
// number of tests of t... | TEST | 0.993284 | 6.22153 |
8a6ff3e0-adef-4091-a121-04cbac55f908 | Gatjuat-Wicteat-Riek/project-files | Files import/cpp projects/Loops/fo.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
//for loops it gives the answer before it increments to the next one
int b;
cin >> b;
for(int i=1; i<b; i++){
cout<<i<<endl;
}
//while loops it increments before it prints the answer
int i=0;
while(i<5){
... | ALGO | 0.997985 | 3.142082 |
10bb7f5b-2e5b-44ed-b0c2-ba32a6cc605c | FreeZoneMods/xray16 | xray/xrGame/EffectorZoomInertion.cpp | // EffectorZoomInertion.cpp: ()
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "EffectorZoomInertion.h"
#define EFFECTOR_ZOOM_SECTION "zoom_inertion_effector"
//////////////////////////////////////////////////////////////////////
// Construction/Dest... | TOOL | 0.976948 | 4.242462 |
1f8bdf3e-6a98-4487-9701-9a601b20dd5e | Vivekrathore2002/DSA-Coding | Longest K unique characters substring - GFG/longest-k-unique-characters-substring.cpp | //{ Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int longestKSubstr(string s, int k) {
// your code here
int i=0,j=0,n=s.size(),maxi=-1;
unordered_map<char,int>m;
... | ALGO | 0.999763 | 6.27913 |
4bee6d7b-bd00-4128-8111-db177897d3bf | Aeonbrk/820 | 820/2016/2FurthestLeafDistance.cpp | /**
* 二叉树用二叉链表结构进行存储。
* 请编写算法求二叉树根节点左右子树相隔最远的叶子节点之间距离。
*/
#include <algorithm>
#include <iostream>
typedef struct TreeNode {
int data;
TreeNode* left;
TreeNode* right;
} TreeNode;
// 求二叉树最大深度
int getDepth(TreeNode* node) {
if (node == nullptr) {
return 0;
}
return std::max(getDepth(node->left), ge... | ALGO | 0.999558 | 5.987867 |
80ab0b65-af0d-4878-b033-d3f98654d44a | Kathleen7474/-leetcode | 344ReverseString.cpp | class Solution {
public:
void reverseString(vector<char>& s) {
auto left_ptr = s.begin();
auto right_ptr = s.end()-1;
cout<<*left_ptr<<endl;
cout<<*right_ptr<<endl;
for (int i = 0; i<size(s)/2;i++){
char tmp = *left_ptr;
*left_ptr = *right_ptr;
... | ALGO | 0.999738 | 5.039172 |
1f28ecba-734d-45dc-9570-ca7174373313 | JumabekNamazbekov/sabak_11_refaktoring | 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 |
84925d01-efd9-471f-98fa-d6164f62b6c8 | raincross7/code-similarity | codes/train_code/problem346/problem346_210.cpp | #include<iostream>
#include<bits/stdc++.h>
#include<vector>
#define vi vector<int>
#define lli long long int
#define fo(i,n) for(int i=1;i<=n;i++)
#define foo(i,n) for(int i=0;i<n;i++)
#define ff first
#define ss second
#define pb push_back
#define vii vector<lli>
#define ok ios_base::sync_with_stdio(false); cin.tie(N... | ALGO | 0.999881 | 3.689146 |
e3df7ca5-19c8-4fbe-b575-8ddf7da9e661 | Deepanshu-Sharma-18/leethub | 1442-number-of-operations-to-make-network-connected/number-of-operations-to-make-network-connected.cpp | class DisjointSet {
public:
vector<int> rank, parent, size;
DisjointSet(int n) {
rank.resize(n + 1, 0);
parent.resize(n + 1);
size.resize(n + 1);
for (int i = 0; i <= n; i++) {
parent[i] = i;
size[i] = 1;
}
}
int findUPar(int node) {
... | ALGO | 0.999938 | 5.86885 |
09fd922d-31c6-479d-8060-1e64f13e0f2e | 1TheBrightOne1/DungeonCrawler | Pathfinder.cpp | #include "Pathfinder.h"
Grid PixelToGrid(sf::Vector2f position)
{
return Grid(position.x / TILE_SIZE, position.y / TILE_SIZE);
}
Tile GetSmallest(std::map<Grid, Tile> list)
{
Grid smallest = list.begin()->first;
for (const auto& x : list)
{
if (x.second.g + x.second.h < list[smallest].g + list[smallest].h)
s... | ALGO | 0.999819 | 4.41875 |
977aa0f4-e22d-48c2-be0b-7017475de5b7 | ishandutta2007/codeforces | natsugiri/normal/1556/D.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("unroll-loops")
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while... | ALGO | 0.999724 | 3.487797 |
30de1cef-c66c-4e84-95c2-fcb6a89b6eb0 | Chaitya-007/LeetCode | 3605-construct-the-minimum-bitwise-array-i/3605-construct-the-minimum-bitwise-array-i.cpp | class Solution {
public:
vector<int> minBitwiseArray(vector<int>& nums) {
vector<int> ans;
for (int n : nums) {
int bit = 0;
while (n & (1 << bit)) // Find the first 0 bit
bit++;
ans.push_back(n > 2 ? n ^ (1 << (bit ... | ALGO | 0.999962 | 6.112973 |
93db163d-8a67-4507-8df8-3ba7b8c038ac | AnhLM027/CPP_PTIT | CPP05092 - TAM GIÁC ĐỀU RỖNG.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define AnhLM027 "Le Minh Anh"
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n; cin >> n;
for (int i = 1; i <= n; i++) {
if (i < n) {
for (int j = 1; j < 2 * n; j++) {
if (j ==... | ALGO | 0.999953 | 3.432426 |
dac7cdf2-3dc1-46f3-a51a-15ff2a636418 | Userfrom1995/Maths-Programs | Taylor.cpp | #include <iostream>
#include <cmath>
#include <vector>
#define e = 2.71828;
using namespace std;
double df(double x , double y) {
return 2*y + 3*pow(2.71828,x);
}
double ddf(double x , double y) {
return 3*pow(2.71828,x) + 2*df(x,y);
}
double dddf(double x , double y) {
return 3*pow(2.71828,x) + 2*ddf(x,... | ALGO | 0.999899 | 3.819211 |
85502bdd-4aea-4e39-9383-276443e6b860 | mortany/xrFOF | src/xrCDB/Frustum.cpp | #include "stdafx.h"
#pragma hdrstop
#include "Frustum.h"
//////////////////////////////////////////////////////////////////////
void CFrustum::fplane::cache()
{
if (positive(n.x))
{
if (positive(n.y))
{
if (positive(n.z))
aabb_overlap_id = 0;
else
... | ALGO | 0.986902 | 4.353462 |
5c8312ab-9ee2-4405-9fc5-39c4fd21064e | dipzza/ETSIIT-FP | Ejercicios/teoríawhile.cpp | #include <iostream>
using namespace std;
int main() {
// Programa que suma los cuadrados de todos los nmeros hasta un milln.
/*int i = 100000, suma = 0;
while (i >= 1){
suma = suma + i*i;
i--;
}
cout << "El resultado de la sumatoria es " << suma;/
*/
// Programa que lee enteros hasta introducir e... | ALGO | 0.930622 | 3.136952 |
8507c9ec-461d-4bd7-83fe-ba9e44e2c76e | chowon986/Study | 프로그래머스 알고리즘/문자열로 변환/문자열로 변환.cpp | // 문자열로 변환.cpp : https://school.programmers.co.kr/learn/courses/30/lessons/181845
#include <string>
#include <vector>
using namespace std;
string solution(int n)
{
return to_string(n);
}
int main()
{
} | ALGO | 0.992325 | 6.031826 |
0d56e657-e2ea-4d88-8451-d175cd9d9d72 | lc-3-2/llvm | lldb/test/API/functionalities/recursion/main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
struct node;
struct node {
int value;
node* next;
node () : value(1),next(NULL) {}
node (int v) : value(v), next(NULL) {}
};
void make_tree(node* root, int count)
{
int countdown=1;
if (!root)
return;
root->value = countdown;
while (count > 0)
{
... | ALGO | 0.999164 | 3.433065 |
4f7184b5-0b70-4739-a1a9-407a5f0f341a | YunDongHwan/baekjoon | String/2908.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
reverse(a.begin(), a.end());
reverse(b.begin(), b.end());
stoi(a);
stoi(b);
cout << max(a, b) << endl;
return 0;
} | ALGO | 0.998953 | 4.352198 |
13d82445-c020-475c-9f60-f67207e4280b | dong-xt/PATtest | PAT basic/1003.cpp | #include <iostream>
#include <string>
using namespace std;
bool all_A(string _s_sub)
{
if(_s_sub != "")
{
for(int i = 0; i < _s_sub.length(); i++)
{
if(_s_sub[i] != 'A')
{
return false;
}
}
}
return true;
}
bool check(string _s)
{
int p_index, t_index;
int l = _s.length();
if(((p_index = _s... | ALGO | 0.999742 | 4.677669 |
46ebedbf-7462-4f3c-af5d-c6c2c50ac688 | shubham4349/Codeforces-solution | 339/A - Helpful Maths/solution.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
int main(){
string s;
cin>>s;
// split the string by +
vector<int> nums;
for(int i =0; i<s.length(); i++){
if(s[i]!='+'){
nums.pb(s[i]-'0');
}
}
sort(nums.begin(), nums.end());
fo... | ALGO | 0.999968 | 4.357885 |
fdbf2dc0-07d3-4f65-a260-3211c2923257 | HCY-ASLEEP/llvm-study | libc/src/math/generic/fdimf16.cpp | #include "src/math/fdimf16.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float16, fdimf16, (float16 x, float16 y)) {
return fputil::fdim(x, y);
}
} // namespace LIBC_NAMESPACE_DECL
| ALGO | 0.968053 | 6.525891 |
5297c7ca-0919-4752-b87c-3109da183bb3 | WilderStill/C-Programs | 洛谷/主题库/P1037 [NOIP2002 普及组] 产生数.cpp | #include<bits/stdc++.h>
using namespace std;
inline int read()
{
int x=0,f=1;
char ch=getchar();
while(!isdigit(ch))
{
if(ch=='-')f=-1;
ch=getchar();
}
while(isdigit(ch))
{
x=(x<<1)+(x<<3)+(ch^48);
ch=getchar();
}
return x*f;
}
inline void write(int x)
{
... | ALGO | 0.999721 | 3.670383 |
c15a6d24-8e1e-4d08-89e3-f2928426f636 | lkv01/cpp_practice_lkv01 | cp_questions_codeforces_codechef/C_Delete_Two_Elements.cpp | // #include <iostream>
// #include <vector>
// #include <map>
// #include <algorithm>
// typedef long long ll;
// using namespace std;
// int main() {
// int t;
// cin>>t;
// while(t--) {
// int n;
// cin>>n;
// vector<ll> v(n);
// map<ll,vector<int>> m;
// ll sum{};
... | ALGO | 0.99981 | 5.069617 |
28b8e976-6333-43b2-a91f-3c7cc3036afd | Subham988/GFG_PotD | May/3rd_May/Make Palindrome.cpp |
class Solution{
public:
bool makePalindrome(int n,vector<string> &arr){
map<string,int> mp;
for(int i = 0;i < arr.size(); i++)
{
string b = arr[i];
reverse(b.begin(),b.end());
if(mp.find(b) == mp.end())
{
mp[arr[i]] ... | ALGO | 0.999879 | 5.271848 |
d4fc7c16-c4df-4ee0-8276-5e7cc2183690 | nikhilij/data-structure-apna-college | ds/maxPathSum.cpp | // wap to find the maximum path sum in a binary tree. The path can start and end at any node, and it must consist of at least one node.
#include <iostream>
#include <algorithm>
#include <climits>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
node(int val)
{
d... | ALGO | 0.999971 | 6.295005 |
735c5bc7-05a0-4b60-bc59-d3421f9ce0c6 | iamgoeldhruv/codes | morningsandwich.cpp | #include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int b,c,h;
cin>>b>>c>>h;
int s=c+h;
if(b>=s+1){
cout<<s+s+1<<endl;
}
else{
cout<<b+b-1<<endl;
}
}
} | ALGO | 0.999894 | 3.223655 |
3bcce370-c579-4a88-aac9-635d8c6e4123 | MounirMahran/Singly-Linked-List | Singly-Linked-List/Singly-Linked-List.cpp | #include <iostream>
using namespace std;
class Node {
public:
int Value;
Node* Next;
};
void PrintList(Node* Head) {
while (Head != NULL) {
cout << Head->Value << endl;
Head = Head->Next;
}
}
void InsertAtBeginning(Node*& Head, int Value) {
Node* Node1;
Node1 = new Node();
... | ALGO | 0.998629 | 4.392868 |
4cb9b028-6379-4d02-86b6-3da7055f3666 | tdeporte/PFE_Gazebo_Simulation | src/lib/controllib/BlockDerivative.cpp | /**
* @file blocks.cpp
*
* Controller library code
*/
#include <math.h>
#include <float.h>
#include "blocks.hpp"
namespace control
{
float BlockDerivative::update(float input)
{
float output;
if (_initialized) {
output = _lowPass.update((input - getU()) / getDt());
} else {
// if this is the first call... | ALGO | 0.968205 | 5.896142 |
78a3c4cb-8c9a-40aa-b246-fcb15c810332 | ishandutta2007/codeforces | peti1234/normal/1514/C.cpp | #include <bits/stdc++.h>
using namespace std;
long long n, pr=1;
vector<int> ans;
int main()
{
cin >> n;
for (long long i=1; i<n; i++) {
if (__gcd(i, n)==1) {
ans.push_back(i);
pr*=i, pr%=n;
}
}
if (pr!=1) {
ans.pop_back();
}
cout << ans.size() <<... | ALGO | 0.999991 | 4.030262 |
f90494be-77f8-4f6c-805f-378fa1c134a7 | raincross7/code-similarity | codes/train_code/problem450/problem450_124.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pb push_back
#define ff first
#define ss second
typedef pair<int,int> pii;
int32_t main()
{
int x , n ;
cin >> x >> n ;
int a[500] ;
memset(a , 0 , sizeof(a)) ;
if(n == 0)
return cout << x , 0 ;
for(int i = 0 ; i < n ; i++){
i... | ALGO | 0.999945 | 3.855989 |
55f806d3-6365-4c67-bfd0-b2a89a9f843c | taatzz/LeetCode | 2959.关闭分部的可行集合数目.cpp | #include <vector>
using namespace std;
class Solution {
public:
int numberOfSets(int n, int mx, vector<vector<int>>& roads) {
vector<vector<int>> g(n, vector<int>(n, INT_MAX / 2));
for(auto& e : roads)
{
int a = e[0], b = e[1], c = e[2];
g[a][b] = min(g[a][b], c);
... | ALGO | 0.999708 | 5.636349 |
ab974cc3-1959-466a-921f-044b36900719 | Rudadadadada/NeetCode-All | Arrays & Hashing/290. Word Pattern.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
bool wordPattern(std::string pattern, std::string s) {
std::vector<std::string> words;
std::unordered_map<char, std::string> d;
std::unordered_set<char> uniq_letters;
std::unordered_set<std::string> uniq_words;
... | ALGO | 0.99886 | 5.943219 |
b682663d-c65a-495f-b4e0-2db9340da001 | kaikaka/OfferTest | 27_ConvertBinarySearchTree/main.cpp | #include <iostream>
#include <stack>
using namespace std;
struct BinaryTreeNode {
int m_nValue;
BinaryTreeNode *m_pLeft;
BinaryTreeNode *m_pRight;
};
void ConvertNode(BinaryTreeNode *pNode,BinaryTreeNode **pLastNodeInList) {
if (pNode == NULL) return;
BinaryTreeNode *pCurrent = pNode;
if (pCu... | ALGO | 0.999973 | 5.096955 |
736d8b9c-0dcd-40c0-af9e-c7e23967e6ca | ishandutta2007/codeforces | nikgaevoy/normal/977/C.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <array>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <functional>
#include <random>
#include <limits>
#include <string>
#i... | ALGO | 0.999961 | 4.227561 |
27a55e19-e121-4400-967c-c852d852b6f7 | hkustDB/Reservoir-Sampling-over-Joins | RSJoin/src/q10/q10_fk_plan2_middle_batch.cpp | #include "reservoir.h"
#include "q10/q10_fk_plan2_middle_batch.h"
#include "q10/q10_rows.h"
void Q10FkPlan2MiddleBatch::init(std::vector<Q10FkPlan2LeftRow*>* left, Q10FkPlan2MiddleRow* middle, std::vector<Q10FkPlan2RightRow*>* right) {
this->left_rows = left;
this->middle_row = middle;
this->right_rows = r... | ALGO | 0.903865 | 3.355335 |
e826a3ec-6c3c-4a78-837c-9b93ffb8692e | Th3Mayar/flutter_app | dev/a11y_assessments/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.998525 | 6.772262 |
9462c18f-4c9c-4398-a817-f811173c8fb8 | technoish/Coding-Practice | Unstop/100 Days Coding Sprint/Day-10/box-ab-pattern.cpp | #include <iostream>
#include <string>
std::string follows_ab_pattern(const std::string& s) {
bool b_encountered = false;
for (char c : s) {
if (c == 'b') {
b_encountered = true;
} else if (c == 'a' && b_encountered) {
return "NO";
}
}
return "YES";
}
int... | ALGO | 0.999747 | 5.404821 |
682109a2-dd5c-4d75-b1bd-fe503fa42889 | Shashuvo/CPP | 800 rating/A_Cowardly_Rooks.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int n,m,x,y;
cin>>n>>m;
for(int i=1;i<=m;i++){
cin>>x>>y;
}
if(n==m){
cout<<"NO"<<endl;
}
else{
cout<<"YES"<<endl;
}
}
... | ALGO | 0.999931 | 3.702315 |
92a21658-6a9c-4c68-b16e-3abbf731e688 | longaadream/OI | 省选后做题集合/Atcoder/dp/t.cpp | #include<bits/stdc++.h>
#define endl '\n'
// #define int long long
using i64=long long;
using u64=unsigned long long;
using u32=unsigned int;
using pii=std::pair<int,int>;
//using i128=__int128;
bool Mbe;
const int N = 3e3 + 5, mod = 1e9 + 7;
i64 dp[N][N];
int n;
char s[N];
bool Med;
template<class T>inline void up(T &... | ALGO | 0.999996 | 3.988206 |
a85510ef-24f5-476b-8022-d9b1d0f71285 | isha060701/ADS_Lab | BinomialHeap1.cpp | #include<bits/stdc++.h>
using namespace std;
// A Binomial Tree node.
struct Node
{
int data, degree;
Node *child, *sibling, *parent;
};
Node* newNode(int key)
{
Node *temp = new Node;
temp->data = key;
temp->degree = 0;
temp->child = temp->parent = temp->sibling = NULL;
... | ALGO | 0.999993 | 5.326972 |
94e9c675-7a5b-40aa-939b-ffc5f703847e | okuraofvegetable/AtCoder | atcoder.jp/joisc2008/joisc2008_fraction/Main.cpp | #include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x)... | ALGO | 0.999987 | 3.468402 |
f93b752c-8f89-4ab6-88f8-b6c8e2dc4c0e | moinulshaon/UVa-Problems | vol 128/12896/12896.cpp | #include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
using namespace std;
using namespace __gnu_pbds;
typedef long long LL;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
//find_by_order
//ord... | ALGO | 0.999984 | 3.364823 |
83eb5897-0574-4c60-b4aa-7ca7fa275427 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_10083_6.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
long long N,A,B,counter=0;
cin>>N>>A>>B;
long long a[100000];
for(int j=0; j<N;j++){
cin>>a[j];}
for(int j=0; j<N;j++){
if((a[j+1]-a[j]*A<=B){
counter+=A*(a[j+1]-a[j]);}
else
counter+=B;
}
cout<<counter<<endl;}
| ALGO | 0.999751 | 3.467861 |
a1c115ea-7715-42cd-94d2-cc0a8b234dd9 | ping-72/DSA-Sheet-Algozenith | Grading system.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n';
void solve(){
int m,f,c;
cin>>m>>f>>c;
if (m==-1||f==-1||m+f<=30)
{cout<<"F"<<endl;}
else if (m+f >=80)
{cout<<"A"<<endl;}
else if (m+f >=65)
{cout<<"B"<<endl;}
else if (m+f >=50)
{cout<<"C"<<endl;}
else if (m+f... | ALGO | 0.999394 | 4.090016 |
af7e1cd3-55fc-49ca-80e3-ce18911fceca | ishandutta2007/codeforces | thescrasse/normal/1367/F1.cpp | #include <bits/stdc++.h>
using namespace std;
long long i, i1, j, k, t, n, m, res, x, f[300010], l[300010], s[300010], dp[300010];
vector<pair<long long, long long>> a;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
//ifstream cin("input.txt");
//ofstream cout("output.txt");
cin >> t;
for (i1 = 0; i1... | ALGO | 0.999927 | 4.317895 |
4a07a621-0c4a-4de7-abfe-79b63f571cf9 | NilayBadjatya/Interview_DS_Algo | Dynamic Programming/LIS & Variants/Longest Increasing Subsequence.cpp | // Most Optimal Approach
Time Complexity - O(NLogN)
class Solution {
public:
int lengthOfLIS(vector<int>& nums) {
int n = nums.size();
vector<int> temp;
temp.push_back(nums[0]);
for(int i = 1; i < n; i++){
if(nums[i] > temp.back()){
temp.push_back(nums[i])... | ALGO | 0.999998 | 6.485221 |
f929b920-d6a0-4659-8743-d8b71a5a1202 | SciCompMod/memilio | cpp/examples/ode_secir_read_graph.cpp | #include "memilio/mobility/metapopulation_mobility_instant.h"
#include "memilio/io/mobility_io.h"
#include "memilio/compartments/parameter_studies.h"
#include "ode_secir/parameter_space.h"
#include "ode_secir/parameters_io.h"
#include <data_dir.h>
#include <iostream>
std::string setup(int argc, char** argv, const std:... | ALGO | 0.929086 | 5.990904 |
ac268b3f-5c57-4c3e-bcfa-5b40020444b0 | ksh7621/summer_acmicpc_study | 1991_vector.cpp | //vector 1
//#include <iostream>
//#include <vector>
//using namespace std;
//
//vector<vector<int>>vt(27);
//
//void preorder(int node) {
// if (node == -1) return;
//
// cout << char(node + 'A');
//
// preorder(vt[node][0]);
// preorder(vt[node][1]);
//
//}
//
//void inorder(int node) {
// if (node == -1) return;
//
... | ALGO | 0.99982 | 4.52969 |
9eb8c95a-c56f-495b-b407-bcf4f1f8c89b | ztchu/boost_1_70_0 | libs/hana/benchmark/fold_left/compile.hana.basic_tuple.erb.cpp | #include <boost/hana/fold_left.hpp>
#include <boost/hana/basic_tuple.hpp>
namespace hana = boost::hana;
struct f {
template <typename State, typename X>
constexpr X operator()(State, X x) const { return x; }
};
struct state { };
template <int i>
struct x { };
int main() {
constexpr auto tuple = hana::ma... | ALGO | 0.914634 | 3.784502 |
9a2217c5-b314-40c9-97f2-5ed8081d7c75 | shiliansheng/leetcode | 154.寻找旋转排序数组中的最小值-ii.cpp | /*
* @lc app=leetcode.cn id=154 lang=cpp
*
* [154] 寻找旋转排序数组中的最小值 II
*/
// @lc code=start
class Solution {
public:
int findMin(vector<int>& nums) {
int high = nums.size() - 1, low = 0, mid;
while (low <= high) {
mid = high + low >> 1;
if (nums[mid] < nums[high]) { // mid ... | ALGO | 0.999986 | 6.614015 |
fe9a892c-5766-4b66-8ff1-d623ecc5dc96 | little-rookie-at-UJS/c | od/cf/1500/cf1956/c.cpp | #include "bits/stdc++.h"
using namespace std;
#ifndef ONLINE_JUDGE
#include "test.h"
#else
#define debug(...) 42
#define debug_assert(...) 42
#endif
#define IOS ios::sync_with_stdio(0),cin.tie(0)
using ll = long long;
using ull = unsigned long long;
#define endl '\n'
#define int ll
using VI = vector<int>;
using... | ALGO | 0.999062 | 4.029365 |
39eed968-a6f5-4168-9499-9f5a18e0f0dc | fightcadeorg/fightcade-snes9x | src/win32/render.cpp | /* Render.CPP
* ----------
* Video output filters for the Windows port.
*/
#include <algorithm>
#include "../port.h"
#include "wsnes9x.h"
#include "../snes9x.h"
#include <memory.h>
#include "render.h"
#include "../ppu.h"
#include "../gfx.h"
#include <math.h>
#include "../gfx.h"
#include "../filter/2xsai.h"
#include... | TOOL | 0.908831 | 3.256591 |
6fe223c6-5c11-4339-967b-7c57c3c03c54 | gleisonsdm/DawnCC-Compiler | AliasInstrumentation/RegionCloneUtil.cpp | // Author: Fabian Gruber and Pericles Alves
#include "RegionCloneUtil.h"
#include <llvm/Transforms/Utils/Cloning.h>
#include <llvm/Analysis/DominanceFrontier.h>
#include <llvm/IR/IRBuilder.h>
#include <set>
using namespace llvm;
typedef std::set<Value*> ValueSet;
typedef std::set<Instruction*> InstrSet;
// Finds v... | ALGO | 0.981712 | 7.450929 |
84f1be53-b800-4af8-95d7-d3a91e2e70cc | ahmad-dev7/Internship-1 | to_do/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.998542 | 6.76073 |
f183e438-b3a6-4201-982b-eacd87b9ceab | sarvex/leetcode-solidity | solution/0100-0199/0169.Majority Element/Solution.cpp | class Solution {
public:
int majorityElement(vector<int>& nums) {
int cnt = 0, m = 0;
for (int& x : nums) {
if (cnt == 0) {
m = x;
cnt = 1;
} else {
cnt += m == x ? 1 : -1;
}
}
return m;
}
}; | ALGO | 0.999984 | 5.76627 |
4fb68174-f732-4661-ac80-4e9a878a92fe | sachin-pandit/Hobby-Projects | Algorithm_implementations/ada_project/mod_mines.cpp | #include<iostream>
#include<cstdlib>
#include<ctime>
#include<math.h>
#include<iomanip>
#include<cstdio>
#include<cstring>
#define BLUE "\033[22;34m"
#define MAGENTA "\033[22;35m"
#define CYAN "\033[22;30m"
#define GREY "\033[22;37m"
#define GREEN "\033[22;32m"
#define YELLOW "\033[22;33m"
#defin... | TOOL | 0.975295 | 3.206651 |
c87761c7-fa93-461f-8162-663f07e30777 | ishandutta2007/codeforces | kirill22/normal/1567/F.cpp | #include<bits/stdc++.h>
using namespace std;
//#define int long long
#define fi first
#define se second
#define pii pair<int, int>
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(a) (int) (a).size()
#define eb emplace_back
#define ld long double
#define v... | ALGO | 0.999974 | 3.960622 |
865278c9-caab-4e68-a5cf-0a1cd802b9e0 | slashingh882/Trabajos-de-progra | ultima unidad/pruebas varias/examen pasado con funciones.cpp | #include <iostream> //Comparacion de cadenas
#include <windows.h>
using namespace std;
void leer(char cad1[],char cad2[]);
int comparar(char cad1[],char cad2[]);
int main()
{
SetConsoleCP(CP_UTF8);
SetConsoleOutputCP(CP_UTF8);
char cad1[100], cad2[100];
int diferentes;
leer(cad1,cad2);
diferen... | TOOL | 0.996802 | 3.108696 |
d8b654af-a006-4e7e-a142-4a6f9af23b12 | ishandutta2007/codeforces | function348/normal/603/C.cpp | #include<cstdio>
#include<iostream>
using namespace std;
const int N=100010;
int n,k;
int a[N];
int main()
{
scanf("%d%d",&n,&k);
k%=2;
for (int i=1;i<=n;i++) scanf("%d",&a[i]);
if (k)
{
int ans=0;
for (int i=1;i<=n;i++)
{
int t=a[i],p=0,res;
while (t%2==0) t/=2,p++;
if (t==1)
{
if (p==0) res... | ALGO | 0.999992 | 3.558619 |
6377c914-4561-485f-b4fc-996dfcc8332a | ROCm-Developer-Tools/llvm-project | libc/src/string/strcmp.cpp | #include "src/string/strcmp.h"
#include "src/__support/common.h"
#include "src/string/memory_utils/inline_strcmp.h"
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(int, strcmp, (const char *left, const char *right)) {
auto comp = [](char l, char r) -> int { return l - r; };
return inline_strcmp(left, right, comp);... | TOOL | 0.956419 | 6.643266 |
7866ee53-4a06-4271-bd90-ce5ab32f9d66 | DeepDasg/gem5_cache_replacement | src/systemc/tests/systemc/misc/unit/data/datawidth_unsigned/lost_carry/datawidth.cpp | /*****************************************************************************
datawidth.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | ALGO | 0.958807 | 5.344794 |
1cfe8348-690e-462b-8f63-bd4839fe5e95 | mrrandom0110/algo | inf.msk170.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 2*100000;
// u, time_begin, v, time_end
struct p{
int u;
int t;
int w;
p(int u, int t, int w) : u(u), t(t), w(w) {}
};
vector<p>g[N];
int ss,f,n,r,d[N];
const int INF = 1000000000;
int main(){
ios_base::sync_with_stdio... | ALGO | 0.99981 | 4.003622 |
d0607de1-d7e1-4571-8dde-7a08ad074b5a | ColonelMicrowave/LearnCpp | Containers/Vectors/ArrayIteration.cpp | #include <iostream>
#include <vector>
#include <limits>
#include <string_view>
template<typename T>
void printArray(const std::vector<T>& arr)
{
for (std::size_t i{ 0 }; i < arr.size(); ++i)
{
std::cout << arr[i] << ' ';
}
std::cout << '\n';
}
template<typename T>
int findIndex(const std::vector<T>& arr, T val... | ALGO | 0.981503 | 5.657593 |
9844f8f4-03e6-4a0e-b60c-5ee4a6ce2ec0 | kei1107/algorithm | problems/Atcoder/Dwango_2018_prelims_C.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream &operator << (ostream& out,const pair<S,T>& o){
out << "(" << o.first << "," << o.second << ")"; return out;
}
/*
<... | ALGO | 0.999991 | 4.807748 |
a98e82f8-a0b5-4263-be16-50446a261d1a | fossenier/fossenier | advent-of-code/day4/day4-2.cpp | #include <fstream>
#include <iostream>
int count_xmas(std::vector<std::vector<char>> array, int row, int col);
int main()
{
std::ifstream infile("day4.txt");
if (!infile)
{
std::cerr << "File not found\n";
return 1;
}
std::vector<std::vector<char>> array;
std::string line{};
... | ALGO | 0.997181 | 6.251942 |
a902a9fc-ad0b-4eb0-827a-f76262632111 | ishandutta2007/codeforces | joisino/normal/459/D.cpp | #include <bits/stdc++.h>
#define FOR(i,a,b) for( int i = (a); i < (int)(b); i++ )
#define REP(i,n) FOR(i,0,n)
#define YYS(x,arr) for(auto& x:arr)
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort( (x).begin(),(x).end() )
#define REVERSE(x) reverse( (x).begin(),(x).end() )
#define UNIQUE(x) (x).erase( unique( ... | ALGO | 0.999985 | 4.063183 |
6ab0c5a3-cbb1-441b-b226-db5f2027717f | 4npg/btap | 75LT1/BAI32.CPP | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define TASK "tenbai"
#define nl cout<<"\n"
#define fast ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define FOR(i,a,b) for(ll (i)=(a);i<=(b);++i)
double fixZero(double x) {
if (abs(x) < 1e-9) return 0.0;
return x;
}
int32_t main() {
... | ALGO | 0.999763 | 3.361418 |
52ad29d3-7eb5-48b8-aa1c-f0f0f0ca3f9e | JeffersonCarvalh0/codeforces-problems | 474B/main.cpp | # include <iostream>
using namespace std;
int search(int *vec, int n, int value) {
int l, r, m, prev_m;
l = 1; r = n; m = (l+r)/2; prev_m = -1;
while (m != prev_m) {
prev_m = m;
if (value == vec[m]) return m;
if (value < vec[m]) r = m;
if (value > vec[m]) l = m;
m ... | ALGO | 0.999931 | 4.02838 |
c2556b6d-fc4b-4401-9d22-b10de3334f3c | lohar-animesh-27112001/LeetCode | 1833-find-the-highest-altitude/1833-find-the-highest-altitude.cpp | class Solution {
public:
int largestAltitude(vector<int>& gain) {
int ans = 0;
int sum = ans;
for(int i : gain) {
sum += i;
ans = max(ans, sum);
}
return ans;
}
}; | ALGO | 0.999936 | 5.956127 |
c6a0f7b5-2c55-44b9-930f-18cdd8a8dd69 | Blackfury7/LeetCode | 0223-rectangle-area/0223-rectangle-area.cpp | class Solution {
public:
int computeArea(int A, int B, int C, int D, int E, int F, int G, int H)
{
int total = (C-A) * (D-B) + (G-E) * (H-F);
if (C<=E || A>=G || B>=H || D<=F )
return total;
else
{
vector <int> h;
h.push_back(A);
h.push_back(C);
h.push_b... | ALGO | 0.999095 | 4.526258 |
5e088227-b736-40fa-ae4d-5cfc271b6175 | koicy-ly/koicy-ly.github.io | assets/code/CF1669F.cpp | #include <cstdint>
#include <iostream>
namespace Anonymous {
bool State = 1;
char re();
void re(char*);
template <typename Typex>
void re(Typex&&);
template <typename Typex, typename... Typey>
void re(Typex&&, Typey&&...);
} // namespace Anonymous
using Anonymous::re;
using namespace std;
using tp = long long;
conste... | ALGO | 0.999976 | 4.978944 |
77de7f4b-c70f-4775-ae02-be669766a183 | SwatiRanjangit/CPP_DSA_PRACTICE | Love_Babbar_DSA_Supreme/Char&Strings/pallindromSubstringCount.cpp | // TIME COMPLEXITY: O(n2) time
//MOST IMPORTANT FOR INTERVIEW
#include <iostream>
using namespace std;
int expandAroundIndex(string s,int i,int j){
int count =0;
//jbtk match ho rha hai substring to count++ and left me jao and right me jao
while(i>=0 && j<s.length() && s[i]==s[j]){
... | ALGO | 0.999906 | 6.284526 |
ab891aa4-5ccb-4c73-8a77-029f3461a4a9 | AhmedEssamYassin/Problem-Solving | Data Structures/Persistent Segment Tree/PersistentSegmentTree.cpp | /*
D-query
PSEGTREE
MKTHNUM
Persistent Bookcase
Kth number
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
struct Node
{
ll Value;
Node *LeftChild, *RightChild; // Pointers to left child and right child
Node(const ll &val = 0)
{
Value = val;
... | ALGO | 0.999518 | 4.728009 |
7b66eec5-5cb5-4556-953c-34d03a42bed1 | sibster146/Chess-with-AI | stockfish/src/timeman.cpp | #include <algorithm>
#include <cfloat>
#include <cmath>
#include "search.h"
#include "timeman.h"
#include "uci.h"
namespace Stockfish {
TimeManagement Time; // Our global time management object
/// TimeManagement::init() is called at the beginning of the search and calculates
/// the bounds of time allowed for the ... | ALGO | 0.996813 | 7.251347 |
9eaf253d-74f6-4380-8369-707731692806 | Raviyadav144/Competitve-Programming | Leetcode/Subsets.cpp | //-----raviyadav144----//
#include<bits/stdc++.h>
using namespace std;
#define forn(i,j,n) for(int i =j; i<n; i++)
#define ll long long
#define all(v) v.begin() , v.end()
#define vi(v,n) vector<int> v(n)
#define fora(e,v) for(auto &e :v)
#define endl "\n"
#define pi acos(-1.0)
#define mod 1000000007
class Solution {... | ALGO | 0.999921 | 5.000543 |
902b6550-91f3-45c4-9e11-514a808410ed | eeyrw/midi-to-hex-qt | qt-project/midifile/tools/midiexcerpt.cpp | //
// Programmer: Craig Stuart Sapp <<EMAIL>>
// Creation Date: Thu Jul 22 18:59:27 PDT 2010
// Last Modified: Thu Jul 22 18:59:30 PDT 2010
// Filename: ...sig/doc/examples/all/midiexcerpt/midiexcerpt.cpp
// Syntax: C++
//
// Description: Extracts a time region from a MIDI file. Notes
// ... | TOOL | 0.850203 | 6.49972 |
4f8149db-9bfa-43c1-8aad-da88cdb5fa50 | psybrg/CPP | force/B63.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(int argc, char const *argv[])
{
ll n,k;
cin>>n>>k;
vector<ll> v(k+1,0);
for (size_t i = 0; i < n; i++)
{
ll t;
cin>>t;
v[t]++;
}
for (size_t j = k-1; j>0; j--)
{
if(v[j]>0)
... | ALGO | 0.999987 | 3.50045 |
fb78f18f-fe57-46e3-b076-90c0472316f9 | WeikunSu/Foundamentals-of-Computer-Engineering | HW1/参考/main.cpp | #include <chrono>
#include <iostream>
#include <iterator>
#include <numeric>
#include <vector>
template <class Iterator, class T>
inline auto populate_numbers(Iterator first, Iterator last, T value,
bool ascending = false) {
while (first != last) {
*first++ = value;
ascending ? v... | ALGO | 0.998571 | 5.702184 |
9aaa599c-82de-4d36-8e3d-d41a38f5eb25 | ishandutta2007/codeforces | thenymphsofdelphi/normal/902/A.cpp | #include<bits/stdc++.h>
using namespace std;
bool ck[200];
int main(){
int n, m;
cin >> n >> m;
int a, b;
for (int i = 0; i < n; i++){
cin >> a >> b;
for (int j = a; j < b; j++){
ck[j] = 1;
}
}
for (int i = 0; i < m; i++){
if (!ck[i]){
co... | ALGO | 0.999987 | 3.688262 |
60649616-dc5c-4e1f-a6fd-b771af554419 | xinlingmidian/Single-Object-Tracking | KCF+PF/ConsoleApplication3/runtracker.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "kcftracker.hpp"
#include <dirent.h>
using namespace std;
using namespace cv;
int main(int argc, char* argv[]){
if (argc > 5) return -1;
bool HOG = tru... | TOOL | 0.918499 | 5.529756 |
6180660e-ba8d-437b-8496-82d0ac2a4ba1 | josipgrgic/Bioinformatics-MutationDetection | src/kmer_index.cpp | // Created by Leon
#include <kmer_index.hpp>
#include <iostream>
KmerIndex::KmerIndex(std::string &input, int k)
{
reference_size = input.size();
generate_kmers(input, k);
}
void KmerIndex::generate_kmers(std::string &input, int k)
{
for (int i = 0; i <= input.length() - k; i++)
{
std::string... | ALGO | 0.97438 | 6.008901 |
903ae45e-bd1d-45b2-984b-162a7aa11f4a | GulSauce/codetree-TILs | 240124/모양대로 숫자 출력하기/print-out-numbers-in-specific-shape.cpp | #include <iostream>
using namespace std;
int main() {
int n; cin >> n;
for(int y = n; y >= 1; y--){
for(int x = n; x >= 1; x--){
if(x > y){
cout << " ";
}
else{
cout << x << ' ';
}
}
cout << '\n';
}
... | ALGO | 0.999881 | 3.922457 |
29b91a85-52b9-4f00-a177-990043b9c64e | DBorello/OpenSeesDev | SRC/reliability/domain/modulatingFunction/KooModulatingFunction.cpp | // $Revision: 1.1 $
// $Date: 2003-10-27 23:04:40 $
// $Source: /usr/local/cvs/OpenSees/SRC/reliability/domain/modulatingFunction/KooModulatingFunction.cpp,v $
//
// Written by Terje Haukaas (<EMAIL>)
//
#include <math.h>
#include <KooModulatingFunction.h>
#include <ModulatingFunction.h>
#include <classTags.h>
KooMod... | TOOL | 0.967258 | 5.473881 |
e26f0cfa-ff98-43f2-a3cc-39d29eaac2ed | ucb-bar/esp-llvm | utils/TableGen/DFAPacketizerEmitter.cpp | #define DEBUG_TYPE "dfa-emitter"
#include "CodeGenTarget.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
#include "llvm/Support/Debug.h"
#include <map>
#include <string>
#include <queue>
u... | TOOL | 0.94384 | 7.693259 |
a61f478f-d5ed-4be4-ba2e-3a830060af97 | maru2213/Competitive-programming | AtCoder/ABC/202/B_20210522.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using ll = long long;
using Pii = pair<int, int>;
int main() {
string s;
cin >> s;
string ans = "";
for (int i = s.size() - 1; i >= 0; i--) {
string... | ALGO | 0.999785 | 5.485288 |
3b75be0d-49a4-4f3c-91d3-075668a0a5fb | parthsarthiprasad/Competitive_Programming | codeforces/693div3/p5fin.cpp | #include<bits/stdc++.h>
using namespace std;
const int nax = 2e5+1;
struct rect{
int x;
int y;
int index;
};
struct dim{
int x;
int y;
};
vector<rect> lquery(nax);
vector<rect> bquery(nax);
vector<dim> vec(nax);
int n;
// vector<rect> segtreex(2*nax);
// vector<rect> segtreey(2*nax);
// void buildx... | ALGO | 0.999967 | 4.861874 |
6da45aa5-77d6-4bb7-9367-61baba767e1c | jvhab/Code2 | Word_Pattern/main.cpp | class Solution {
public:
bool wordPattern(string pattern, string s) {
unordered_map<string, int> mp1;
unordered_map<char, int> mp2;
vector<string> str;
string temp;
for (size_t i = 0; i < s.size(); ++i) {
if (s[i] != ' ') {
temp += s[i];
... | ALGO | 0.999584 | 6.358687 |
23420400-e75e-4b8a-a980-77ef20787912 | duongtrieuelec/LeetSolve | cpp-leetcode/leetcode225-implement-stack-using-queues_two_queues1.cpp | #include<vector>
#include<queue>
#include<algorithm>
#include<iostream>
using namespace std;
class MyStack {
public:
queue<int> q1;
queue<int> q2; // 辅助队列
/** Initialize your data structure here. */
MyStack() {}
/** Push element x onto stack. */
void push(int x) {
q1.push(x);
... | ALGO | 0.987466 | 5.074236 |
b13c4764-a92a-4e99-bed5-99e2aa1541a4 | SwarnadyutiSarkar/Engineering-Math-Calculator | Numerical integration (Simpson's rule).cpp | #include <iostream>
#include <functional>
// Function to be integrated
double function(double x) {
return x * x; // Example function: f(x) = x^2
}
// Simpson's rule for numerical integration
double simpsonsRule(std::function<double(double)> f, double a, double b, int n) {
double h = (b - a) / n;
double s... | ALGO | 0.999936 | 6.096323 |
faeca900-8bd6-42c1-86a0-4fea238707a3 | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/WatchingCpl_20210102144739.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.999998 | 4.199511 |
a3c1ba87-3ec8-417b-ba58-7e95ff9cde63 | ishandutta2007/codeforces | sorting/normal/1637/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> void check_min(T &a, const T &b){ a = (a < b) ? a : b; }
template<class T> void check_max(T &a, const T &b){ a = (a > b) ? a : b; }
#define all(x) (x).begin(), (x).end()
const ll N = 100 + 3;
ll n, a[N], b[N];
ll dp[N][2 * N * N +... | ALGO | 0.99996 | 3.504946 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.