uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
01f4d0da-8cdc-42f3-93a0-35a6d1d16d37 | rituraj0/OtherCompetitions | appera , hackerrank/1.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define sz size()
#define bg begin()
#define en end()
#define Y second
#define X first
typedef long long ll;
#define fi freopen("input.txt","r",stdin)
#define fo freopen("output.txt","w",stdout)
const double pi = acos(-1.0);
c... | ALGO | 0.999974 | 3.523927 |
50286709-6244-4a96-8073-868041e0b984 | shacklettbp/embree-wasm | kernels/common/rtcore_builder.cpp | #define RTC_EXPORT_API
#include "default.h"
#include "device.h"
#include "scene.h"
#include "context.h"
#include "alloc.h"
#include "../builders/bvh_builder_sah.h"
#include "../builders/bvh_builder_morton.h"
namespace embree
{
namespace isa // FIXME: support more ISAs for builders
{
struct BVH : public RefC... | ALGO | 0.962321 | 5.476417 |
f1a6f98f-1a6e-475f-86fa-d9fd460ee402 | heyitzmeaditya/Leetcode | bubblesorting.cpp | #include <iostream>
using namespace std;
#include <iostream>
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; ++i) {
for (int j = 0; j < n - i - 1; ++j) {
if (arr[j] > arr[j + 1]) {
// Swap the elements if they are in the wrong order
std::swap(arr[... | ALGO | 0.999774 | 5.539103 |
0d24e9ab-8f96-41a1-b82c-d48c9d67ad31 | FHead/PhysicsHiggsProperties | CommonCode/source/AngleConversion.cpp | //----------------------------------------------------------------------------
// Conversion of the HZZ angles <==> lepton vectors
// Author: Yi Chen (11223)
//----------------------------------------------------------------------------
#include <ostream>
#include <iostream>
//------------------------------------------... | ALGO | 0.907948 | 4.153462 |
7b89cfcc-7368-4a4a-a700-c4a92d79e390 | LifeIsRightward/Baekjoon | Solved/Bronze/Bronze3_3009.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<pair<int, int>> vec;
pair<int, int> tmp;
for (int i = 0; i < 3; i++) {
cin >> tmp.first >> tmp.second;
// vec.push_back(make_pair(tmp.first, tmp.second));
vec.push_back(tmp);
}
bool flagx = false;
bool... | ALGO | 0.999958 | 3.733017 |
9976b6d4-b85f-4633-98c4-4e3fb63fc6ac | shubhujais15/DSA | array/Basic/largestElem.cpp | #include<bits/stdc++.h>
using namespace std;
int largestElem(vector<int> &arr, int n){
int maxi = arr[0];
for(int i=0;i<n;i++){
if(maxi < arr[i]){
maxi = arr[i];
}
}
return maxi;
}
int main(){
vector<int>arr = {4,1,5,2,3};
int n = arr.size();
int ans = largestEl... | ALGO | 0.999506 | 4.605418 |
71cb44bc-ff39-4736-a703-1b1ee41a645f | clayding/AlgorithmAndDataStructure | cpp/leetcode/00139_words_break.cpp | //看官方的解答写的, 动态规划
/* s 串能否分解为单词表的单词(前 s.length 个字符的 s 串能否分解为单词表单词)
将大问题分解为规模小一点的子问题:
前 i 个字符的子串,能否分解成单词
剩余子串,是否为单个单词。
dp[i]:长度为i的s[0:i-1]子串是否能拆分成单词。题目求:dp[s.length]
状态转移方程
类似的,我们用指针 j 去划分s[0:i] 子串,如下图:
s[0:i] 子串对应 dp[i+1] ,它是否为 true(s[0:i]能否 break),取决于两点:
它的前缀子串 s[0:j-1] 的 dp[j... | ALGO | 0.999252 | 5.263536 |
aa89dbd8-9434-4e5f-a558-7028a2ee4cd0 | guohaoyu110/Self-Learning-DataStructure | 算法竞赛/DFS-part of sums problem/main.cpp | //部分和问题
#include <iostream>
using namespace std;
const int Maxn=10000;
int a[Maxn];
int n,k;
bool dfs(int i,int sum)
{
if(sum>k) return false;
if(i>=n)
{
if(sum==k)
return 1;
else return 0;
}
if(dfs(i+1,sum)) return true;
if(dfs(i+1,sum+a[i])) return true;
return ... | ALGO | 0.999988 | 3.535352 |
cd8e15ee-277d-4a29-a7ee-9faea51dd325 | Imran200216/naveenproject | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
7c78244e-375a-42ec-980a-6f6b68b033a8 | pal-0123/Competitive-Database | Codeforces/Round/round_609_div2_C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
signed main(){
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input.txt", "r", stdin);
// for writing output to output.txt
freopen("output.txt", "w", stdout);
#endif
int n,k;
cin >> n >> k;
string... | ALGO | 0.999984 | 3.59871 |
accefaf4-a88d-4140-8d67-28aefdf2f2e5 | mdshoeb2050/CN-foundation-Cplusplus | ForLoop/Test 1/pattern1.cpp | #include<iostream>
using namespace std;
int main(){
int i,j,n;
cout<<"Enter a number:"<<endl;
cin>>n;
i=1;
while(i<=n){
j=1;
int p=i;
while(j<=2*i-1){
cout<<p<<" ";
/*if(p==1){
p=2;
while(p<=n){
cout<<... | ALGO | 0.999951 | 3.770809 |
bd687067-49e4-44b1-a381-f0348bd69382 | SBidaibek/acm | atcoder/grand4/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define forn(i, x, n) for (int i = int(x); i <= int(n); ++i)
#define for1(i, n, x) for (int i = int(n); i >= int(x); --i)
#define F first
#define S second
#define pb push_back
typedef long long ll;
typedef pair <int, int> pii;
typedef long double ld;
typedef vector <ll> ... | ALGO | 0.999834 | 3.97386 |
52f35655-133d-4a95-b7a2-a71c40b9cd83 | zzhimg/leetcode-problems | easy/#141.cpp | class Solution {
public:
bool hasCycle(ListNode *head) {
if(head == nullptr ||head->next == nullptr) return false;
ListNode *fast = head->next;
ListNode *slow = head;
while(fast != slow){
if(fast == nullptr || fast->next == nullptr)
return false;
... | ALGO | 0.999722 | 5.391447 |
7d5c55a2-dc9c-4d2b-95c5-824eb48d2b1e | itsadityakr/daily-code-challenge | day-08/linked_list_concepts/_SLL_16_update_value.cpp | #include<iostream>
#define endl "\n"
using namespace std;
struct Node {
int data;
Node * next;
Node(int val) {
data = val;
next = nullptr;
}
};
Node* head = nullptr;
void insertAtEnd(int data){
Node* newNode = new Node(data);
if (head == nullptr) {
head = newNode;
... | ALGO | 0.999908 | 4.905287 |
cf5189c3-d8df-4c20-9b4e-6461231155bf | axelu/leetcode | cpp/01500-01999/throneinheritance.cpp |
// 1600. Throne Inheritance
// https://leetcode.com/problems/throne-inheritance/
struct Person {
string name;
bool isAlive;
vector<Person*> children;
Person(string nm) : name(nm), isAlive(true), children({}) {}
};
class ThroneInheritance {
private:
Person * king;
bool done;
unordered_map<... | ALGO | 0.999304 | 6.178557 |
292efb8f-7df0-4292-af89-c235328d406a | krishna306/6Companies30Days | Goldman Sachs/Question3.cpp | int countSubArrayProductLessThanK(const vector<int>& a, int n, long long k) {
int ans = 0;
long long int product = 1;
int right = 0;
int left = 0;
while (right < n) {
product *= a[right];
while (product >= k) {
product /= a[left];
left++;
}
a... | ALGO | 0.999628 | 4.884964 |
39d41e3d-7d4c-4242-8e4b-e2c97df39da7 | msrishu65/codes | codes/discs.cpp | #include <iostream>
#include <cstdio>
#include <climits>
#include <algorithm>
#include <queue>
#include <cstring>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <bitset>
#include <string>
#include <stack>
#include <set>
#include <map>
#include <string>
#include <deque>
#include <ctime>
#de... | ALGO | 0.999817 | 3.775374 |
6ba45f85-2680-41c3-ad48-d217a5186774 | Tomuus/Zadanka | wwi/kanar.cpp | #include <deque>
#include <iostream>
#include <utility>
#include <vector>
using namespace std;
vector<int> graf[200'015];
bool visited[200'015];
int odl[200'015];
void bfs(int s){
visited[s] = true;
odl[s] = 0;
deque<pair<int, bool>> q;
q.push_back({s,true});
while (!q.empty())
{
cout<<"ent"<<q.front... | ALGO | 0.999926 | 3.851978 |
7cf20918-854e-4520-8fd8-0c8e92b42e44 | Trusted-Federal-Learning/libsnark-docker | libsnark/lib/depends/libsnark/depends/libff/depends/xbyak/sample/toyvm.cpp | /*
toy vm
register A, B : 32bit
PC : program counter
mem_ 4byte x 65536
٤Ƥ̿4byte
¨ͤ16bit
R = A or B
vldiR, imm ; R = imm
vldR, idx ; R = mem_[idx]
vstR, idx ; mem_[idx] = R
vaddiR, imm ; R += imm
vsubiR, imm ; R -= imm
vaddR, idx ; R += mem_[idx]
vsubR, idx ; R -= mem_[idx]
vputR ; print... | TOOL | 0.975305 | 6.708421 |
285ad076-962b-45b3-a8b6-9e384c0527e3 | kingkk31/BOJ | source code/9465_스티커.cpp | #include <iostream>
#include <stdio.h>
#include <queue>
#include <vector>
#include <set>
#include <list>
#include <string>
#include <string.h>
#include <math.h>
#include <algorithm>
#pragma warning(disable:4996)
using namespace std;
int main(void)
{
int t;
scanf("%d", &t);
int vt[2][100001];
int score[2][100001]... | ALGO | 0.999836 | 3.245552 |
e5f24bc7-5b8c-47d3-87c7-8e4c93face44 | HafizulHaque/Coding-Problem-Solving | Contests/graph theory long contest/test.cpp |
// An Iterative C++ program to do DFS traversal from
// a given source vertex. DFS(int s) traverses vertices
// reachable from s.
#include<bits/stdc++.h>
using namespace std;
// This class represents a directed graph using adjacency
// list representation
class Graph
{
int V; // No. of vertices
list<int> *... | ALGO | 0.999988 | 5.610835 |
cb91e4a5-fa4f-4425-9472-c3197b05bbe6 | SantiagoP1405/SerpientesYEscaleras2 | tablero2.cpp | /*
Santiago Patricio Gómez Ochoa
A01735171
31/05/2024
Programación orientada a objetos
*/
#include "tablero2.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <numeric>
#include <cmath>
using namespace std;
//CASILLA
Casilla::Casilla(int idCasilla, char iconoCa... | ALGO | 0.988971 | 4.042392 |
fe143b9d-c794-448c-86b0-89a8231b2bbb | Hiyabye/Baekjoon | 05xxx/05692.cpp | #include <iostream>
using namespace std;
bool solve(void) {
int n; cin >> n;
if (n == 0) return false;
int ans = 0, fact = 1;
for (int i=1; i<=5; i++) {
fact *= i;
ans += (n % 10) * fact;
n /= 10;
}
cout << ans << "\n";
return true;
}
int main(void) {
ios::sync_with_stdio(false);
cin.ti... | ALGO | 0.999824 | 4.372358 |
f096410d-2bc7-454b-bf44-8bfeef6f2608 | damianlajara/codeeval-programming-challenges | selfDescribingNumber.cpp | /*
SELF DESCRIBING NUMBERS
CHALLENGE DESCRIPTION:
A number is a self-describing number when (assuming digit positions are labeled 0 to N-1),
the digit in each position is equal to the number of times that that digit appears in the number.
INPUT SAMPLE:
The first argument is the pathname to a file which conta... | ALGO | 0.999949 | 5.258701 |
a48bbe41-5d8f-43ae-a7a5-79d0977b4a3a | Arrowes/C-coding | C++/C++ Primer Plus/源代码文件/Chapter 7/fun_ptr.cpp | // fun_ptr.cpp -- pointers to functions
#include <iostream>
double betsy(int);
double pam(int);
// second argument is pointer to a type double function that
// takes a type int argument
void estimate(int lines, double (*pf)(int));
int main()
{
using namespace std;
int code;
cout << "How many lines of cod... | TOOL | 0.970187 | 6.081777 |
018d12a5-221f-408d-9a46-538fa9df3eab | koushik-00/DSA | striver A2Z/basic_recursion/reverse_array.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> rev(int n, int l, int r, vector<int> &nums) {
if (l>=r) return nums;
swap (nums[l], nums[r]);
return rev(n, l+1, r-1, nums);
}
vector<int> reverseArray(int n, vector<int> &nums)
{
// Write your code here.
return rev(n, 0, n-1, nums);
}
int... | ALGO | 0.999791 | 4.368819 |
598f69b2-7e39-4766-b7ba-e9c0ca3f8e8d | HuyWibu/Source_Code_C_plus_plus | code_PTIT/sap_xep_danh_sach_nhan_vien.cpp | #include <bits/stdc++.h>
using namespace std;
struct NhanVien
{
string ma_nv, ho_ten, gt, ngay_sinh, dc, ngay_ky, mst;
string ngay, thang, nam;
};
void xu_ly(NhanVien &x)
{
if (x.ngay_sinh[1] == '/')
x.ngay_sinh = "0" + x.ngay_sinh;
if (x.ngay_sinh[4] == '/')
x.ngay_sinh.insert(3, "0");
... | ALGO | 0.983856 | 4.012719 |
9240d3f2-de72-4355-ac5c-abf9a57cdf67 | JeevanPurohit11/Data-Structure-and-Algorithm | LC-621. Task Scheduler.cpp | //max heap
class Solution {
public:
int leastInterval(vector<char>& tasks, int n) {
//greedy approach
// int hash[26]={0};
// int chunks=INT_MIN;
// for(auto i : tasks){
// hash[i-'A']++;
// chunks=max(chunks,hash[i-'A']);
// }
// sort(hash,hash+26)... | ALGO | 0.999988 | 6.514607 |
8e8266ed-9fd9-4cef-8732-c79ddd742120 | Abhrajyoti00/Competitive_Programming | CODEFORCES/Contests/Round 925 Div 3/B_Make_Equal.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
vector<int>v;
int n;
cin>>n;
int s = 0;
for(int i = 0; i<n; i++){
int ele;
cin>>ele;
v.push_back(ele);
s+=ele;
}
int eq... | ALGO | 0.999984 | 4.297458 |
c713edb5-2d85-4e46-ac19-4fe7dfc731b1 | NMLT-NTTMK-K18/3-194-array | Bai164/Source.cpp | #include <iostream>
using namespace std;
void Nhap(int[], int&);
bool ktNguyento(int);
void XoaVitri(int[], int&, int);
void XoaNguyento(int[], int&);
int main()
{
int arr[100];
int n;
Nhap(arr, n);
XoaNguyento(arr, n);
return 0;
}
void Nhap(int a[], int& n)
{
cout << "Nhap so phan tu mang: ";
cin >> n;
for ... | ALGO | 0.999545 | 3.721963 |
0d58c271-66b2-4ebc-aa5e-a33eae6d1951 | Geeky-Utkarsh/GFG_Problems | Medium/Longest subarray with sum divisible by K/longest-subarray-with-sum-divisible-by-k.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int longSubarrWthSumDivByK(int arr[], int n, int k)
{
// Complete the function
unordered_map<int,int>f;
int ans=0, sum=0;
for(int i=0; i<n; i... | ALGO | 0.999829 | 5.448745 |
64940ba3-4d98-4414-84d9-8b038e88c347 | Lazy-coder-Hemlock/programs | consecutive_char.cpp | #include<bits/stdc++.h>
using namespace std;
void consecutive_char(string s){
char sub=s[0];
int count=1;
int max_count=0;
for(int i=0;i<s.length();i++){
if(i<s.length()-1 and s[i]==s[i+1])
count++;
else
{
if(count>max_count)
{
max_count=count;
sub=s[i];
}
count=1;
}
}
cout<<sub<<" "... | ALGO | 0.99968 | 3.54388 |
5c05350c-9347-4551-b79d-c989433e512a | theramiway/codes | binarysearch.cpp | #include <iostream>
using namespace std;
int binarySearch(int arr[], int size, int key) {
int low = 0;
int high = size - 1;
while (low <= high) {
int mid = low + (high - low) / 2;
if (arr[mid] == key) {
return mid;
}
if (arr[mid] < key) {
low = mid... | ALGO | 0.999931 | 5.626803 |
822371dc-9a16-420d-901d-fb9eb0dcb589 | yisj/hello-algo | 프로그래머스/1/42576. 완주하지 못한 선수/완주하지 못한 선수.cpp | #include <string>
#include <vector>
#include <map>
using namespace std;
string solution(vector<string> participant, vector<string> completion) {
map<string, int> player;
for(string p : participant){
map<string, int>::iterator it = player.find(p);
if(it == player.end())
player[p] = 1;
else
... | ALGO | 0.999573 | 5.430849 |
41d7c562-e70b-4918-8bcd-82247abfab9c | Licheam/Codes | [HDU]2481.cpp | /*
Coded with Leachim's ACM Template.
No errors. No warnings. ~~
*/
#include <bits/stdc++.h>
#pragma GCC diagnostic ignored "-Wunused-const-variable"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#pragma GCC diagnostic ignored "-Wsign-compare"
#define LL long long
using namespace std;
const int inf=0x3f3f3f3f;
c... | ALGO | 0.99997 | 5.026521 |
72cc1df8-cdcf-4acf-bb6e-a8039167d64a | mplatt8/godot-bitcoin-module | thirdparty/vhacd/src/VHACD-ASYNC.cpp | #include "../public/VHACD.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <thread>
#include <atomic>
#include <mutex>
#include <string>
#include <float.h>
#define ENABLE_ASYNC 1
#define HACD_ALLOC(x) malloc(x)
#define HACD_FREE(x) free(x)
#define HACD_ASSERT(x) assert(x)
namespace VHACD
{
cl... | TOOL | 0.934813 | 5.781607 |
e26185b5-4cfe-43d6-b447-3fcd793cf46d | Deepti675/Competitive_CB | MATHS/DIVSUB.cpp | //QUS LINK --> https://www.codechef.com/problems/DIVSUBS
#include<bits/stdc++.h>
using namespace std;
void find(){
int n;
cin>>n;
vector<int> a(n+1),b(n,-1);
for(int i=1;i<=n;i++)
{
cin>>a[i];
}
int sum=0;
b[0]=0;
for(int i=1; i<=n; i++)
... | ALGO | 0.999312 | 4.129592 |
8b868fd8-a724-419d-878e-9f05ae4e7987 | amritansh22/Data-Structures-and-Algorithms-in-cpp | XORlist.cpp |
// memory efficient version of doubly linked list
#include <iostream>
#include <cstdint>
#include <stdexcept>
using namespace std;
struct Node
{
int data;
Node* npx;
Node(int data)
{
(*this).data = data;
npx = NULL;
}
};
class XORlist
{
private:
Node *head;
public:
XORli... | ALGO | 0.999828 | 5.294723 |
ab02c6e4-1bc0-40b2-b1ab-aca4e44f4830 | chenghui-lee/leetcode | February LeetCoding Challenge(2021)/Day 13 Shortest Path in Binary Matrix.cpp | class Solution {
public:
int shortestPathBinaryMatrix(vector<vector<int>>& grid) {
int n = grid.size(), m = grid[0].size();
int endRow = n-1, endCol = m-1;
int res = 0;
queue<pair<int, int>> q;
q.push({0,0});
int moves[8][2] = {{1,1}, {0,1},{1,0},{0,... | ALGO | 0.999995 | 6.241996 |
4ef862ad-8a41-447f-8a6c-7bad637f6ccf | vBykoff/AADS | aisd3/task2/main.cpp | #include <iostream>
#include <unordered_set>
#include <vector>
#include <cassert>
#include <queue>
#include <functional>
// .
// - .
// .
//: O(V+E).
// .
//v: - (. 50000),
//n: - (. 200000),
//n ,
// u, w .
// .
// u w.
struct IGraph {
virtual ~IGraph() {}
virtual void AddEdge(int ... | ALGO | 0.999877 | 5.219138 |
24cd7b65-46c1-44c3-8ab7-67a13cf5cebc | jeannetoh99/cp | kattis/tornbygge.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
int n; cin >> n;
int ans = 1;
int prev = 1e6 + 1;
while (n--) {
int x; cin >> x;
if (x > prev) ans++;
prev = x;
}
cout << ans << endl;
}
| ALGO | 0.999898 | 3.925077 |
ea526b22-6259-46ac-8162-6c674f8d2897 | ryanlee2014/My-ACM-Template | 05_Computational Geometry/03_Polygon/02_Point in Convex.cpp | // 点形成一个凸包, 而且按逆时针排序(如果是顺时针把里面的<0改为>0)
// 点的编号 : [0,n)
// -1 : 点在凸多边形外
// 0 : 点在凸多边形边界上
// 1 : 点在凸多边形内
int PointInConvex(point a, point p[], int n)
{
for (int i = 0; i < n; i++)
if (sgn((p[i] - a) ^ (p[(i + 1) % n] - a)) < 0)
return -1;
else if (PointOnSeg(a, line(p[i], p[(i + 1) % n])... | ALGO | 0.999811 | 3.665434 |
c7d54cb1-10b2-4880-bbe4-78ed9f552123 | theodore/olympiads | HOJ/2330/candy.cpp | #include <cstdio>
#include <cstring>
#include <stack>
#include <algorithm>
struct Edge
{
int x, a, b;
};
const int maxn = 100003;
const int maxm = 100003;
int n, m;
int start[maxn], to[maxm], next[maxm], type[maxm], edge; // type 0 for >, type 1 for >=
Edge edges[maxm];
int ec;
namespace Set
{
int fa[maxn];
... | ALGO | 0.999876 | 4.026238 |
5ee7e8ec-d77f-42cd-bc70-044ca526979a | ShivanshGupta02/DSA | find-two-non-overlapping-sub-arrays-each-with-target-sum/find-two-non-overlapping-sub-arrays-each-with-target-sum.cpp | class Solution {
public:
int minSumOfLengths(vector<int>& arr, int target) {
int ans=INT_MAX , n=arr.size(), len=INT_MAX, cur_len=INT_MAX;
int start=0,end=0;
int sum=0;
vector<int>min_len(n,INT_MAX);
for(end=0;end<n;end++){
sum+=arr[end];
... | ALGO | 0.999978 | 5.615416 |
4c294e0d-8b62-4837-90b9-f664f6cec7e0 | SoundRabbit/voice-changer | .history/main_20190117013348.cpp | #include "overlapAdd/overlapAdd.hpp"
#include "spectrum/spectrum.hpp"
#include "wavFile/wavFile.cpp"
#include "windowFunction/windowFunction.hpp"
#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
#define _USE_MATH_DEFINES
#include <cmath>
int main(){
using namespace std;
cout << "ファイル名 ... | TOOL | 0.925822 | 4.641817 |
63edfd31-5d6b-45b7-9b2c-46401ea9cde6 | mostafaessayd/codeforces-solutions | 1100/Paint the Array/main.cpp | /**
* created by : cidi mohamed mostepha
* link :https://codeforces.com/contest/1618/problem/C
* rating : 1100
*/
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void answer() {
int n;
cin >> n;
vector<ll> vec(n);
for(ll& val : vec) {
cin >> val;
}
ll x = vec[0];
ll y = vec[... | ALGO | 0.999991 | 4.670157 |
e9c682ec-a8d3-4e3b-bfab-35933f746b49 | fan-ziqi/rl_sar | src/rl_sar/library/thirdparty/Lite3_MotionSDK/lib/eigen3/doc/examples/DenseBase_template_int_middleCols.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
int main(void)
{
int const N = 5;
MatrixXi A(N,N);
A.setRandom();
cout << "A =\n" << A << '\n' << endl;
cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl;
return 0;
}
| ALGO | 0.958728 | 3.137618 |
5f9e27b9-ac02-419b-ab92-3d5b369778f5 | abhitry/LearnADS | assignment_8/s1_q3.cpp | #include<iostream>
using namespace std;
class Node
{
public:
int data;
Node*left,*right;
Node()
{
data=0;
left=right=NULL;
}
Node(int a){
data=a;
left=right=NULL;
}
};
Node*createfrominorder(int preorder[],int &i,int ub)
{
Node*p=NULL;
if(preorder... | ALGO | 0.999977 | 4.793519 |
7304983a-c65a-472d-aced-4c69623f178c | vibhash-singh/online-judges | codechef/kunique.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int n, k;
unsigned long num;
cin >> n >> k;
vector<unsigned long> numVector(n);
int arr[50000];
int pointers[50000] = {0};
for (int i = 0; i < n; i++) {
cin >> num;
numVector.at(i) = num;
}
sort(numVector.... | ALGO | 0.999986 | 3.674848 |
fa67d3b5-018f-4103-9c82-1965d766045e | alaindenzler/llvm | lib/Analysis/ModuleSummaryAnalysis.cpp | #include "llvm/Analysis/ModuleSummaryAnalysis.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Analysis/BlockFrequencyInfo.h"
#include "llvm/Analysis/BlockFrequencyInfoImpl.h"
#include "llvm/Analysis/BranchProbabilityInfo.h"
#include "llvm/Analysis/IndirectC... | TOOL | 0.922815 | 5.051317 |
c2ae873f-8db5-48b7-9912-2820da6cfc77 | Eaglebrave/the-C-repository | 学生排序.cpp | #include <bits/stdc++.h>
using namespace std;
struct stu{
string name;
int heigh;
int num;
void input(){
cin>>name>>heigh>>num;
}
void output(){
cout<<name<<" "<<heigh<<" "<<num<<endl;
}
};
stu a[110];
int main(){
int n;
stu maxn;
maxn.heigh=maxn.num=0;
cin>>n;
for(int i=1;i<=n;i++){
a[i].input();
i... | ALGO | 0.997023 | 3.774902 |
4699fa06-b3c9-44a5-98b0-ef1b87a0b7ed | harishsemwal/CP | 0628-maximum-product-of-three-numbers/0628-maximum-product-of-three-numbers.cpp | class Solution {
public:
int maximumProduct(vector<int>& nums) {
sort(nums.begin(), nums.end());
int n = nums.size();
return max(nums[n - 1] * nums[n - 2] * nums[n - 3], nums[0] * nums[1] * nums[n - 1]);
}
}; | ALGO | 0.999912 | 5.479658 |
9f509b27-d633-43d5-b8a9-1edfdf5258b2 | Navendis/geographiclib | src/TransverseMercatorExact.cpp | #include <GeographicLib/TransverseMercatorExact.hpp>
#if defined(_MSC_VER)
// Squelch warnings about constant conditional expressions
# pragma warning (disable: 4127)
#endif
namespace GeographicLib {
using namespace std;
TransverseMercatorExact::TransverseMercatorExact(real a, real f, real k0,
... | ALGO | 0.999759 | 6.704724 |
8e06d5ee-02c6-4f9e-ba74-242e41243b07 | Silverhorse7/Problem-Solving-Training | codeforces/1659/D.cpp | //#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#include<ext/pb_ds/assoc_container.hpp>
#include <random>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;... | ALGO | 0.999981 | 3.442761 |
3bf68ee7-1c42-4b54-a379-208955a371fb | anmamun0/cp-problem-solving-zone | Week_8/Week8_Practive/Day_2/B_Relatively_Prime_Pairs.cpp | #include <bits/stdc++.h>
typedef long long ll;
#define vl vector<ll>
#define vi vector<int>
#define in_range(i,s,n) for(int i=s; i<=n; i++)
#define in_range(i,s,n) for(int i=s; i<=n; i++)
#define in_range_back(i,s,n) for(int i=n ; i >= s; i--)
#define take_array(v,n) in_range(i,0,n) cin>>v[i]
#define print_array(v) f... | ALGO | 0.999448 | 4.033799 |
5e73c3b0-2a46-484a-96af-877b100dcb3d | fpt-corp/DiRa | DiRa_Software/Reference/Source code final 2018-2019/SQ26-Digital_race_2019/-SQ26-Dai-hoc-thong-tin-lien-lac-Digital_race_2019-master/src/bienbao/src/bien_bao.cpp | #include "bien_bao.h"
#include "Utilities.h"
Mat leftSign = imread("/home/nvidia/Documents/img/trai.png", CV_LOAD_IMAGE_COLOR);
Mat rightSign = imread("/home/nvidia/Documents/img/phai.png", CV_LOAD_IMAGE_COLOR);
Mat truong,manhha;
int bien_bao::bien_b=0;
int kt_tr(0),kt_ph(0),kt_no(0),kq(0);
bien_bao::bien_bao(){
... | ALGO | 0.995109 | 4.024086 |
0c696346-1b32-4dbf-a4e1-70608e627bc0 | Altu-Bitu-2/AltuBitu-Assignment | 04월 12일 - 투 포인터/2531.cpp | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// 슬라이딩 윈도우 사이즈 = k
int n, d, k, c;
cin >> n >> d >> k >> c; // 접시 수, 초밥 종류 갯수, 연속 갯수, 쿠폰 번호
vector <int> v(n+1);
map ... | ALGO | 0.999871 | 3.964731 |
59c3726d-218d-4def-a33e-85277cdfd412 | suhanikalra/practice-problems | 0280-wiggle-sort/0280-wiggle-sort.cpp | class Solution {
public:
void wiggleSort(vector<int>& nums) {
for (int i = 0; i < nums.size() - 1; i++) {
if ((i % 2 == 0 && nums[i] > nums[i + 1]) ||
(i % 2 == 1 && nums[i] < nums[i + 1])) {
swap(nums[i], nums[i + 1]);
}
}
... | ALGO | 0.999999 | 5.913276 |
a3a4d739-e41e-46bf-a4f5-a2068a6aa44d | akshat12345/Coding_Question_and_Solutions | Leetcode_Solutions/983_Minimum_Cost_For_Tickets.cpp | #include<bits/stdc++.h>
using namespace std;
int solve(int ind,int n,vector<int> &days,vector<int>& costs,vector<int> &dp){
if(ind >= n) return 0;
if(dp[ind] != -1) return dp[ind];
int one_day = costs[0] + solve(ind+1,n,days,costs,dp);
int seven_days = INT_MAX;
int temp = ind;
while(temp < n a... | ALGO | 0.999881 | 4.231179 |
e10d5996-a810-4583-b27c-e798c215c9ee | ztchu/boost_1_70_0 | libs/spirit/classic/example/fundamental/subrule_calc.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This calculator example demontrates the use of subrules.
// This is discussed in the "Subrule" chapter in the Spirit User's Guide.
//
// [ JDG 4/11/2002 ]
//
/////////////////////////////////////////////////////////////////////////... | ALGO | 0.991928 | 7.683959 |
4fabe9cd-f142-4e3d-a068-6725cd2b6515 | muscleJoah/Algorithm-Study | Programmers/easy/Programmers 2018kako 튜플(solved).cpp | #include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstring>
#include <set>
using namespace std;
//https://programmers.co.kr/learn/courses/30/lessons/64065?language=cpp
//1.문자열 나누기
//2. 이중벡터에 해당 문자열 int 형으로 치환해서 넣어주기.
//3. 이중벡터의 i번째 벡터와 i-1번재 벡터의 차집합으로 추출.
//stoi... | ALGO | 0.998525 | 3.953583 |
dcf036f8-f146-4b9b-8039-1e413a563c21 | QuestionTokTok/QuizTokTok-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 |
c45b3628-5cc8-4fc7-b4b8-caf1e0408afc | yzy2018YZY/CppCourse1 | 3-22/3-22.cpp | //1850059 1 ־Զ
#include <iostream>
using namespace std;
int main()
{
int num, original = 1;
cout << "ڼΪ1" << endl;
cin >> num;
for (int i = 1; i < num; i++)
{
original = 2 * (original + 1);
}
cout << "" << num << "=" << original << endl;
return 0;
} | ALGO | 0.999125 | 3.06794 |
319698e2-66b2-4760-8951-2c1ca06a664c | TruecoderSri/DSA-ProgramList | Tries/duplicate_folders_deletion.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
struct trieNode
{
string folder;
bool remove = false;
map<string, trieNode *> child;
trieNode(string folder)
{
this->folder = folder;
}
};
// Construct the trieNode
... | ALGO | 0.998837 | 5.320445 |
9708ad53-03cd-4f9f-a955-e8c6c16b84b3 | ronaldtisa/xrigm-master | src/core/Miner.cpp | #include <algorithm>
#include <mutex>
#include <thread>
#include "core/Miner.h"
#include "core/Taskbar.h"
#include "3rdparty/rapidjson/document.h"
#include "backend/common/Hashrate.h"
#include "backend/cpu/Cpu.h"
#include "backend/cpu/CpuBackend.h"
#include "base/io/log/Log.h"
#include "base/io/log/Tags.h"
#include "b... | TOOL | 0.891713 | 6.461803 |
f115b5fb-7608-47dd-854e-06915fb9251f | yancouto/competitive-programming | contests/sub-neerc15/I/I.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N = 60;
int n;
char c;
int u;
struct node {
int u, v;
ll t;
bool operator < (const node & ot) const {
return t > ot.t;
}
};
priority_queue<node> pq;
deque<int> qu;
vector<pair<int, ll> > res;
int pr[N];
int to[N];
int ch[N]... | ALGO | 0.999862 | 3.406183 |
e15cfe26-f07d-4087-97a4-a11d5b457a8f | codershampy/CSVTU-OOPS-2-Sem-DS | public_access_modifier.cpp | #include<iostream>
using namespace std;
class Circle
{
public:
double radius;
double compute_area()
{
return 3.14*radius*radius;
}
};
int main()
{
Circle obj;
obj.radius=5.5;
cout << "Radius is:" << obj.radius << "\n";
cout << "Area is:" << obj... | TOOL | 0.946548 | 4.848165 |
484e77df-176d-474d-9c85-990da356ac15 | CrealityOfficial/fmesh | fmesh/contour/skeleton2polytree.cpp | #include "skeleton2polytree.h"
namespace fmesh
{
void dealSkeleton(ClipperLibXYZ::PolyTree& roofLine, ClipperLibXYZ::Paths* paths)
{
std::vector<ClipperLibXYZ::IntPoint> listPointF;
std::vector<ClipperLibXYZ::IntPoint> listPointE;
for (int i = 0; i < roofLine.Contour.size(); ++i, ++i)
{
listPointF.push_ba... | ALGO | 0.980844 | 3.657619 |
70e0dd91-1f76-4a14-822b-8f9f67046529 | priamm2/TelegramCamera | TMessagesProj/jni/third_party/openh264/src/codec/processing/src/vaacalc/vaacalculation.cpp | #include "vaacalculation.h"
#include "cpu.h"
WELSVP_NAMESPACE_BEGIN
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
CVAACalculation::CVAACalculation (int32_t iCpuFlag) {
m_iCPUFlag = iCpuFlag;
m_eMethod = METHOD_VAA_STATISTICS;
WelsMemset (&m_s... | TOOL | 0.97863 | 6.095364 |
c1190419-753e-48c3-98b8-0a24b97c6326 | Subhasish-Behera/datastructures | maps1.CPP | #include<iostream>
#include<map>
#include<string>
#include <bits/stdc++.h>
using namespace std;
int main()
{int n;
cin>>n;
int arr[n];
map<int, int> marks;
for(int i=0;i<n;i++)////input size
{
cin>>arr[i];
}
for(int i=0;i<n;i++)//input array
{
marks[arr[i]]++;
}
////////////////
int max=0;
map<int,int> ::ite... | ALGO | 0.999919 | 3.726992 |
9e10fa1a-eb44-4025-9d96-77acfd2a3d76 | 15238972953/leetcode | offer48.cpp | #include<iostream>
#include<vector>
#include <string>
#include <algorithm>
using namespace std;
class Solution {
public:
int lengthOfLongestSubstring(string s) {
string str;
int maxlen=0;
for(int i=0;i<s.size();++i){
if(str.find(s[i])!=-1){
str.erase(0,str.find(s... | ALGO | 0.999456 | 5.614724 |
4c618dbf-ca9e-4a99-8f0b-09c7195e5ce4 | Ibbs620/Competitive-Programming | CCC/2013/S2.cpp | #include <iostream>
using namespace std;
int main(){
int w, n;
cin >> w >> n;
int cars[n];
int total = 0;
bool a = false;
for(int i = 0; i < n; i++){
cin >> cars[i];
total += cars[i];
if(i > 3) total -= cars[i-4];
if(total > w && !a) {
cout << i;
... | ALGO | 0.999984 | 4.046069 |
c39243fc-853b-49db-87f1-7adeb840f0ee | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4712_5.cpp | #include <bits/stdc++.h>
using ll = long long;
using ld = long double;
using ull = unsigned long long;
void solve() {
int n, x;
std::cin >> n >> x;
std::vector<int> a(n);
for (int i = 0; i < n; i++) std::cin >> a[i];
std::sort(a.rbegin(), a.rend());
int teams = 0;
int i = 0;
while (i < n) {
int size... | ALGO | 0.999906 | 4.900207 |
8880e737-da04-4209-b1cb-c65203066ee8 | porkallen/leetcode | C++/Source/Tree/104.cpp | #include "common.h"
#define ENABLE_TREE_TEST_CASE 1
class Solution {
public:
int maxNum = 0;
void dfs(TreeNode *node, int num)
{
if(!node){
return;
}
if(!node->left && !node->right){
maxNum = max(maxNum, num);
}
dfs(node->left, num + 1);
... | ALGO | 0.999746 | 6.26219 |
b08a7edf-e243-4547-b98c-f8cb99de2c17 | sindhuri028/LEETCODE | 51-n-queens/n-queens.cpp | class Solution {
public:
vector<vector<string>> solveNQueens(int n) {
vector<int>col(n);
vector<int>dg(n<<1);
vector<int>udg(n<<1);
vector<vector<string>>ans;
vector<string>t(n,string(n,'.'));
function<void(int)>dfs=[&](int i)->void{
if(i==n){
... | ALGO | 0.999783 | 6.024638 |
d9822758-2718-41cc-8a56-fb6a63961be1 | Sohith2007/Competitive-Programming-cpp- | codeforces/110ANearly Lucky Number.cpp | /*
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Unfortunately, not all numbers are lucky. Petya calls a number nearly lucky if the number of luck... | ALGO | 0.999648 | 5.427098 |
30b3d809-5a21-47b6-8351-5e60c423f8c6 | rogueprogrammer/LeetCode2019 | Heaps/KthLargestElementInStream.cpp |
// https://leetcode.com/problems/kth-largest-element-in-a-stream/submissions/
class KthLargest {
public:
priority_queue<int, vector<int>, greater<int>> pq; //min heap
int K;
KthLargest(int k, vector<int>& nums) {
K = k;
for(int i = 0; i < nums.size(); ++i){
add(nums[i]);
... | ALGO | 0.999917 | 6.17218 |
077825da-943e-46e2-a12f-745a956c6b33 | PMR745/Learn-C-Programs | Constructor_in_derived_class.cpp | #include<iostream>
using namespace std;
class Base1 {
int data1;
public:
Base1(int a) {
data1 = a;
cout << "Base1 Class Constructor called!" << endl;
}
void Base1print() {
cout << "The value of data1 is " << data1 << endl;
}
};
class Base2 {
... | TOOL | 0.926794 | 4.87027 |
f3b57d45-da70-4c32-bb1a-38e59e1b5834 | pohlokyee/SECPH-Y1-SEM1 | Programming Technique I/Exercise/Exercise 3 Calculate Active Cases.cpp | #include <iostream>
#include <string>
using namespace std;
void dispStatus(int activecases){
if (activecases>40){
cout << "Red Zone";
}else if (activecases>=21){
cout << "Orange Zone";
}else if (activecases>=1){
cout << "Yellow Zone";
}else{
cout << "Green Zone ";
}
}
void getInput(int& totcases,int& new... | TOOL | 0.970364 | 4.471975 |
2c4e57d7-b05e-40e9-be90-fb5766f2ee0a | AlekseyGeshko/STRATEGY | groupByDistance.cpp | #include "groupByDistance.h"
using namespace group;
double groupByDistance::returnDistanceObj(const object &obj) const{
return std::sqrt(obj.x * obj.x + obj.y * obj.y);
}
void groupByDistance::sortGroups() {
auto comp = [&](const object* lhs, const object* rhs){
return returnDistanceObj(*lhs) < retur... | ALGO | 0.980992 | 4.950845 |
75d6e5ca-fc65-435e-b667-bd3b90332f6a | ishandutta2007/codeforces | gs18115/normal/954/B.cpp | #include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, p, c[123];
int x(int y, int z)
{
int cnt = 0;
int y2 = y;
int z2 = z;
for (k = 0; k < n; k ++)
{
if (y2 == z)
{
return cnt;
}
else if (y2 > z || c[y2] != c[z2])
{
return... | ALGO | 0.999943 | 3.609097 |
a3777b0b-6e2c-437d-bac4-2e61fbc5d79b | Pyaxy/algorithm-practice | Program_Design/NJUPT_ICPC/问题求解综合实践II 热身赛/G-苹果和虫子2.cpp | #include<iostream>
#include<math.h>
using namespace std;
int n, x, y;
int main()
{
cin >> n >> x >> y;
double eat = ceil(y * 1.0 / x);
if(n - eat > 0)
{
cout << n - eat;
}
else
{
cout << '0';
}
return 0;
}
| ALGO | 0.999873 | 3.240222 |
fb146b15-5c44-4887-a669-f6c1767886af | Ekansh1309/CSES | DP/GridPaths.cpp | #define ll long long
#define M 1000000007
#include<bits/stdc++.h>
using namespace std;
int dir[4][2]={{1,0},{0,1}};
ll solve(vector<vector<char>> &grid,int &n,int r,int c,vector<vector<int>> &dp){
if(r<0 || c<0 || r>=n || c>=n || grid[r][c]=='*' ) return 0;
if(r == n-1 && c == n-1) return 1;
if(dp[r][c]!=... | ALGO | 0.999961 | 4.906647 |
880d0b72-1693-4edd-89bd-56c21bcf9e0d | raincross7/code-similarity | codes/train_code/problem106/problem106_42.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define Rep(i, s, n) for (ll i = (ll)s; i < (ll)n; i++)
typedef long long ll;
int main() {
cin.tie(0); cout.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
int d[n];
rep (i, n) cin >> d[i];
... | ALGO | 0.999959 | 4.08897 |
8037a7ca-c292-44ee-b1fa-8dfb9ed99154 | GaisaiYuno/OI-Record-exe-deleted | Grade 10-12/2018 autumn/xsy.gdgzez.com.cn/10.22 contest/t2/t2.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cassert>
using namespace std;
inline int read(){
int re=0,flag=1;char ch=getchar();
while(!isdigit(ch)){
if(ch=='-') flag=-1;
ch=getchar();
}
while(isdigit(ch)) re=(re<<1)+(re<<3)+ch-'0',ch=getchar();
return re*flag;
}
char a[20... | ALGO | 0.999967 | 3.718483 |
162d6c8f-d5a0-486a-a6c1-4ccaf47ddee8 | Kang-il/TIL | sorting/sort_ex05_01.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
struct INFO{
string name;
int kor,eng,math;
};
int N;
vector<INFO> A;
void input(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin>>N;
A.resize(N);
for(int i=0;i<... | ALGO | 0.999915 | 4.905487 |
4029697d-6d22-4a0f-9aac-d14e4de5fe72 | RoseOu/DataStructures | C/linklist/Union_intersection_subtraction_operation/no_head_node/main.cpp | #include <iostream>
#include "func.cpp"
using namespace std;
void InputElement(LinkList &L)
{
int i,num;
printf("num = ");
cin >> num;
printf("elem = ");
for(i = 1; i <= num; i++)
{
LNode *e,*p=L;
e=new LNode;
cin >> e->data;
ListInsert_L(L, p, e);
}
}
void Union(LinkList La, LinkList Lb, LinkLi... | ALGO | 0.999031 | 3.487408 |
66d8b26a-815a-4731-9bae-3a60e1021264 | ishandutta2007/codeforces | square1001/normal/1000/D.cpp | #include <iostream>
using namespace std;
const int mod = 998244353;
int n, a[1009], dp[1009], comb[1009][1009];
int calc_comb(int a, int b) {
return b < 0 || a < b ? 0 : comb[a][b];
}
int main() {
cin >> n;
for (int i = 0; i <= n; ++i) {
comb[i][0] = 1;
for (int j = 1; j <= i; ++j) {
comb[i][j] = comb[i - 1][... | ALGO | 0.999984 | 4.488201 |
b20e5765-7e1e-481a-81b0-3ea316302db1 | 984727216/oj1 | POJ/3087/12870094_AC_0ms_240kB.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <string>
using namespace std;
string Union(string s1, string s2)
{
string s = "";
for(int i = 0; i < s1.size(); ++i)s += s2[i], s+= s1[i];
return s;
}
void Break(string &s1, string &s2, string s, int n)
{
s1 = "";
s2 = "";
for(int i = 0; i < n; ++... | ALGO | 0.99975 | 3.083999 |
b4966180-757f-4d7b-bc02-bd120e385faa | combofish/leetcode-solutions-cpp | src/LeetCode-Random-1/test_20.cpp | /**
*
*/
#include <cctype>
#include <iostream>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using std::cout;
using std::endl;
using std::stack;
using std::string;
using std::stringstream;
using std::unordered_map;
using std::vector;
int main(int argc, char **argv... | ALGO | 0.998739 | 5.785797 |
e48c7b7f-9a77-48ee-ab86-4919ec78757e | In1ecti0n/Cpp_PTIT | KTCOBAN010test2.cpp | #include <bits/stdc++.h>
using namespace std;
const long long prime = 1000000007; //10^9 + 7, ham luu vv 1 gia tri
// tinh luy thua du
//su dung thuat toan modulo (dapan*a)%c = (dapan%c)*(a%c)%c
//thuat toab toi uu hon (tach 3 truong hop b chan, le, = 0)j
//https://vnoi.info/wiki/translate/he/Number-Theory-3
//ham ti... | ALGO | 0.99995 | 5.091094 |
ae2c659c-d3af-4cfd-944d-c0f8ef41e134 | ajoginapally/Algorithmic_Coding | practice2/palin.cpp | #include <bits/stdc++.h>
using namespace std;
string createPalindrome(unordered_map<char, int> freqMap) {
string firstHalf = "", secondHalf = "", middle = "";
for(auto& it : freqMap) {
if(it.second % 2 == 0) {
firstHalf += string(it.second / 2, it.first);
} else {
if(mid... | ALGO | 0.999998 | 6.168026 |
7307715b-db7f-49e5-a921-218e09c209f8 | kamothi/algorithm | BOJ/1927.cpp | #include<iostream>
#include<queue>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
priority_queue<int,vector<int>,greater<>> pq;
int n;
cin >> n;
while(n--){
int tmp;
cin >> tmp;
if(tmp == 0) {
if(pq.emp... | ALGO | 0.999978 | 4.354042 |
fdb2d9a3-f254-496f-9fd5-e3454fad28bc | RahulScripted/LeetCode-Problems | Leetcode POTD/November 2024/_14_2064_MaximizedMaximumOfProductsDistributedToAnyStore.cpp | // You are given an integer n indicating there are n specialty retail stores. There are m product types of varying amounts, which are given as a 0-indexed integer array quantities, where quantities[i] represents the number of products of the ith product type. You need to distribute all products to the retail stores fol... | ALGO | 0.999991 | 6.587448 |
c132d88a-0271-41d8-9d94-e66c3e6ac7a2 | Rostlab/ConSurf | vagrant_ConSurf/rate4site.3.2.source_slow/sourceMar09/bblEM.cpp | // $Id: bblEM.cpp 645 2006-03-20 00:50:44Z eyalprivman $
#include "bblEM.h"
#include "likelihoodComputation.h"
using namespace likelihoodComputation;
#include "computeUpAlg.h"
#include "computeDownAlg.h"
#include "computeCounts.h"
#include "treeIt.h"
#include "fromCountTableComponentToDistance.h"
#include <ctime>
bblE... | ALGO | 0.999915 | 6.586759 |
1a90c020-782e-4151-bd1b-298d3d9a27d5 | RiddMa/AlgorithmCode | 1MaxSubSeq/MaxSubseqAlg.cpp | //
// Created by 马嘉骥 on 2020/9/28.
//
#include "MaxSubseqAlg.h"
int MaxSubsequenceSumN3(int A[], int N)
{
int ThisSum, MaxSum = 0;
for (int i = 0; i < N; i++)
{
for (int j = i; j < N; j++)
{
ThisSum = 0;
for (int k = i; k <= j; k++)
{
if ... | ALGO | 0.999902 | 5.325778 |
8dfd7134-aaf4-46c2-be69-ba8d99e3964f | ishandutta2007/codeforces | tzxydby/normal/1666/J.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=205;
int n,c[N][N],g[N][N][N],fa[N];
long long p[N][N],d[N][N][N],dp[N][N][N];
long long dfs(int l,int r,int h)
{
if(l>r)
return 0;
if(dp[l][r][h]!=-1)
return dp[l][r][h];
if(l==r)
{
g[l][r][h]=l;
dp[l][r][h]=p[l][n]*h;
return dp[l][r][h];
}
dp[l]... | ALGO | 0.999986 | 3.305607 |
bfb19d40-6fda-4a43-abb0-d60db521fd30 | okuraofvegetable/AtCoder | atcoder.jp/abc036/abc036_b/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 int long long
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 1000000000 //1e9
#define LLINF 1000000000000000ll // 1e15
#define fi first
#defin... | ALGO | 0.999967 | 4.392093 |
5a061ae1-4099-47a9-b664-bdb0231c0d4d | mgjdafo/soui | components/skia/src/gpu/GrOvalRenderer.cpp | #include "gl/builders/GrGLProgramBuilder.h"
#include "GrOvalRenderer.h"
#include "GrEffect.h"
#include "gl/GrGLEffect.h"
#include "gl/GrGLSL.h"
#include "gl/GrGLVertexEffect.h"
#include "GrTBackendEffectFactory.h"
#include "GrDrawState.h"
#include "GrDrawTarget.h"
#include "GrGpu.h"
#include "SkRRect.h"
#include "Sk... | TOOL | 0.880935 | 4.964986 |
eee2d762-0229-415f-b374-0a8c1f5a53e8 | Hemanth2001/alumni_admin | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.