uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
6f847aeb-ffe2-46e0-826c-7e53fd13aa17 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_13289_6.cpp | #include <bits/stdc++.h>
using namespace std;
int len;
string s;
int main() {
cin >> s;
len = (int)s.size();
if (len % 2 == 1) {
cout << string(len / 2 + 1, '4') << string(len / 2 + 1, '7') << endl;
return 0;
}
bool lucky = true;
int cnt40 = 0, cnt70 = 0;
for (int i = 0; i < (int)s.size(); i++) {
... | ALGO | 0.999925 | 4.194109 |
fb6cc5a9-31d3-4e38-a82f-030b3592faa9 | sinian666/codes_102_3 | cpp_副本35/chapter_graph/graph_dfs.cpp | /**
* File: graph_dfs.cpp
* Created Time: 2023-03-02
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
#include "./graph_adjacency_list.cpp"
/* 深度优先遍历 DFS 辅助函数 */
void dfs(GraphAdjList &graph, unordered_set<Vertex *> &visited, vector<Vertex *> &res, Vertex *vet) {
res.push_back(vet); // 记录访问顶点
... | ALGO | 0.999938 | 6.036538 |
f5746c6b-b591-459a-8a2c-d17b7e229b69 | hamasurrab/Data-Structure | CharacterArrayString/2string_class.cpp | #include<iostream>
#include<cstring>
#include<vector>
using namespace std;
int main(){
int n;
cin>>n;
string temp;
vector<string> sarr; // dynamic array
while(n--){
getline(cin,temp);
sarr.push_back(temp);
}
for(string x:sarr)
cout<<x<<","<<endl;
} | ALGO | 0.979161 | 3.655568 |
6fa02983-165a-4367-8903-ea5d8ab13118 | smh997/Problem-Solving | Online Judges/Kattis/PhoneList.cpp | /*
* https://open.kattis.com/problems/phonelist
* Author: https://github.com/smh997/
*/
#include <bits/stdc++.h>
using namespace std;
struct node{
char digit;
bool leaf = 0;
set<node> children;
node(char digit){
this->digit = digit;
}
bool operator<(const node & other) const{
... | ALGO | 0.999824 | 5.761269 |
25e01550-497e-4ee1-941c-93027cb20694 | evearwen/BeeKeepr | bee_keepr_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.998287 | 6.776823 |
abcf58af-ce2b-48fd-a528-52f5c0336068 | anurag-sketch/Practice-Questions | 2540-minimum-common-value/2540-minimum-common-value.cpp | class Solution {
public:
int getCommon(vector<int>& nums1, vector<int>& nums2) {
// map<int,int> mp1;
// map<int,int> mp2;
// for(int i=0;i<nums1.size();i++) mp1[nums1[i]]++;
// for(int i=0;i<nums2.size();i++) mp2[nums2[i]]++;
// map<int,int> :: iterator itr... | ALGO | 0.999979 | 5.528427 |
6e5a8193-8130-4571-b687-90015742646d | AJinks28/LeetCode | 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlin... | class Solution {
public:
long long countSubarrays(vector<int>& nums, int minK, int maxK) {
long long ans=0;
int n=nums.size();
int minPos=-1;
int maxPos=-1;
int culpritIdx=-1;
for(int i=0;i<n;i++){
if(nums[i]<minK || nums[i]>... | ALGO | 0.999927 | 5.691642 |
afe806df-24aa-44d9-887a-356d77e74337 | Coach-Academy/Fall-1-2024 | Level 1/CPU - Standard - L1 - C107/Practice G4/Week 06/J.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 15;
int per[N], p[N], q[N];
int main()
{
int n; cin>>n;
for(int i = 0 ; i < n ; i++){
per[i] = i+1;
}
for(int i = 0 ; i < n ; i++){
cin>>p[i];
}
for(int i = 0 ; i < n ; i++){
cin>>q[i];
}
int first, seco... | ALGO | 0.999953 | 3.517956 |
87793048-f87d-4472-aaf0-f28c497b03cd | darnoceloc/Algorithms | Competitive Programming/sherlock_anagrams.cpp | #include <bits/stdc++.h>
using namespace std;
int sherlockAndAnagrams(string s) {
int N = s.length();
map<vector<int>, int> mp;
for (int i=0; i<N; i++) {
vector<int> freq(26, 0);
for (int j=i; j<N; j++) {
freq[s[j]-'a']++;
mp[freq]++;
}
... | ALGO | 0.999995 | 5.830606 |
a93fbc0f-c51c-4e7f-acc2-6cc69ec76e14 | alexandraback/datacollection | solutions_2463486_1/C++/DBZX/C.cpp | // C.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <fstream>
#include <string>
#include <vector>
#include <cassert>
#include <map>
#include <set>
#include <iostream>
using namespace std;
ifstream in("C-large-1.in");
ofstream out("out.txt");
#define FOR(i,a,b) for(int i=(a)... | ALGO | 0.997811 | 4.970552 |
4ad32ad7-1d72-4a5a-92cc-bd6c83a5e1b8 | code-fans/books-source | 动态规划/03_完全背包问题/3.2储钱罐/Piggy.cpp | //Ǯ-ȫСֵ
#include <bits/stdc++.h>
using namespace std;
int dp[10002], w[502], v[502];
int main()
{
//freopen("Piggy.in","r",stdin);
//freopen("Piggy.out","w",stdout);
int T,E,F,N,W;
for(cin>>T; T; T--)
{
cin>>E>>F>>N;
W=F-E;
for (int i=0; i<N; i++)
cin>>v[i]>>w[i];
dp[0] = 0;
for (i... | ALGO | 0.999829 | 3.35153 |
475365c2-ecce-4626-bc8c-a8c4d1683ec7 | andersonjwan/readings | stroustrup2018tour/ch11/sec04/main.cpp | #include <iostream>
#include <map>
#include <string>
using std::map;
int
main() {
map<std::string, int> book = {
{"David Hume", 12345},
{"Karl Popper", 234567},
{"Bertrand Arthur William Russell", 345678}
};
std::cout << "David Hume's number is... " << book["David Hume"] << "\n";
std::cout << "Jo... | TOOL | 0.909404 | 5.387318 |
395f3c98-6734-4ed0-8fec-9fb80f366cbe | kirbydyson/Intro-to-Computer-Science-1 | Program 16/myFuntions.cpp | /*
*Author: Kirby Dyson
*Assignment Title: My Functions
*Assignment Description: This program will implement a number of useful
functions using a header file and an implementation file. It will place
the prototypes of the functions in a .h file, and implement these functions
in a .cpp file.
*Due Date: 10/28/2022
*Date ... | TOOL | 0.99582 | 5.125046 |
a1aac5e3-5690-493d-bc8a-208e093cda40 | YichuanSun/hihocoder | 2018.9.30/3/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[100],cnt;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin>>n;
if (n==1) {cout<<1<<endl;return 0;}
for (int i=9;i>=2;i--) {
while (n%i==0) {
n/=i;
a[cnt++]=i;
}
... | ALGO | 0.999635 | 5.042479 |
8a494f8b-82ad-4570-a208-f61be02452fa | cholewa-p/Optimisation_AGH_IMiIP | solution.cpp | //Ten plik nie powinien by edytowany
#include"solution.h"
int solution::f_calls = 0;
int solution::g_calls = 0;
int solution::H_calls = 0;
void solution::clear_calls()
{
f_calls = 0;
g_calls = 0;
H_calls = 0;
}
solution::solution(double L)
{
x = L;
g = NAN;
H = NAN;
y = NAN;
ud = NAN;
flag = -1;
}
solutio... | ALGO | 0.999584 | 4.834143 |
6f8ae60e-023e-4359-b3dd-33d13749a289 | Arshjeet-Singh/DSASheet2022 | Word Search.cpp | class Solution {
public:
bool dfs(int i,int j,vector<vector<char>>& board,vector<vector<bool>>& visited,string check,int idx)
{
if(idx==check.size())
{
return true;
}
if(i<0 || j<0 || i>=board.size() || j>=board[0].size() || visited[i][j]==1)
{
ret... | ALGO | 0.999951 | 6.23339 |
c704a5fd-6c3f-44b3-a658-f1c59ccea1a9 | StolasIn/data_structure_and_algorithm | data structure/trie.cpp | #include<iostream>
using namespace std;
struct TrieNode{
bool is_end=0;
TrieNode *children[26];
TrieNode() {
is_end = false;
for (int i = 0; i < 26; i++)
children[i] = NULL;
}
};
TrieNode* root;
class Trie {
public:
/** Initialize your data structure here.... | ALGO | 0.999546 | 4.925853 |
5311467d-a0d9-49a2-b16a-3bc7957e4e7d | FrancPS/Xngine | Xngine/externalLibs/MathGeoLib-master/Geometry/LineSegment2D.cpp | /** @file LineSegment2D.cpp
@author Jukka Jylnki
@brief Implementation for the LineSegment2D geometry object. */
#include "LineSegment2D.h"
#include "../Math/MathFunc.h"
#include "AABB2D.h"
#include "../Math/float3x3.h"
#include "../Math/float3x4.h"
#include "../Math/float4x4.h"
#include "OBB2D.h"
#include "../Math/Q... | ALGO | 0.99591 | 6.561459 |
4fa14631-9b09-4afa-a6c3-ce94a8000624 | thegamer1907/Code_Analysis | Implementation/1760.cpp | #include <bits/stdc++.h>
using namespace std;
int main (){
int i;
int ans = 1;
string player;
cin >> player;
for (i=1; i<player.length(); i++){
if (player[i]==player[i-1]){
ans++;
} else ans = 1;
if (ans==7){
break;
}
}
i... | ALGO | 0.99998 | 3.564918 |
156830d4-21ed-449f-9c70-9883b9d4341c | EthanKim8683/High-School-Competitive-Programming | Codeforces/Problemset/DP/489c.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<vector>
using namespace std;
using I=int;
const I M=100;
const I S=900;
I movs1[M+1][S+1],movs2[M+1][S+1];
queue<pair<I,I>>que1,que2;
vector<I>ress1,ress2;
void add1(I i,I j,I k){
if(j<0||movs1[i][j]!=-1)return;
movs1[i][j]=k;
q... | ALGO | 0.999941 | 3.250662 |
264e54bd-36d1-40b0-9092-75df38bba694 | CoinBlack/blackcoin-more | src/wallet/test/fuzz/coinselection.cpp | #include <policy/feerate.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <test/util/setup_common.h>
#include <wallet/coinselection.h>
#include <vector>
namespace wallet {
static void AddCoin(c... | TEST | 0.993973 | 6.083307 |
63d83aa2-b352-4a2c-9c49-89620cd4a7d1 | aminjonshermatov/competitive_programming | codeforces/div2/856/B.cpp | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#ifdef LOC... | ALGO | 0.999127 | 4.797736 |
a64bdd6a-57db-492d-a59d-9338c4dcab10 | i-Sa3ed/Algorithms | Backtracking/rat-in-maze.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstring> // memset
using namespace std;
/// https://practice.geeksforgeeks.org/problems/rat-in-a-maze-problem/1?utm_source=geeksforgeeks&utm_medium=article_practice_tab&utm_campaign=article_practice_tab
// why can't be solved with DP?
// because we ... | ALGO | 0.999947 | 5.648024 |
185585b2-c899-48d4-9dbe-c5de312e16d3 | kuailedeguisu/GeneralKnowledgeSummary | sourceCode/Cpp_Primer_5th-master/Cpp_Primer_5th-master/C++Primer第五版课本源代码/1/add_item.cpp | #include <iostream>
#include "Sales_item.h"
int main()
{
Sales_item item1, item2;
std::cin >> item1 >> item2; //read a pair of transactions
std::cout << item1 + item2 << std::endl; //print their sum
return 0;
}
| ALGO | 0.891207 | 5.018082 |
82eb9276-7fd8-439f-a608-c038d616a8a3 | vicwer/leetcode2020 | 863.cpp | #include <queue>
#include <vector>
#include <map>
#include <set>
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
void dfs(TreeNode* root, std::map<TreeNode*, TreeNode*>& umap)
{
if(!root)
... | ALGO | 0.999996 | 5.857896 |
ad801818-171d-4f7b-9043-d2f8b97c6295 | Soham2020/CodeForces | 959A.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
ll n;
cin >> n;
if(n%2 == 0)
cout << "Mahmoud";
else
cout << "Ehab";
}
| ALGO | 0.99994 | 3.585237 |
335d1c65-139a-4576-bc25-11b5a478c9e1 | cola-cod/my-cod | 交换字符串倒叙/c.cpp | #define _CRT_SECURE_NO_WARNINGS 1
//úͷǺַеַҲʹcеĿ⺯
// char i="abc"
// cba
//1.ǵݹ
#include<stdio.h>
int m_strlen(char* str)
{
int count = 0;
while (*str != '\0')
{
count++;
str++;
}
return count;
}
void r_string(char* str)
{
int left = 0;
int right = m_strlen(str) - 1;
while (left < right)
{
char ... | ALGO | 0.999939 | 3.807881 |
e9fcd3bd-9662-4b6e-b500-3718861d9ddf | andyli029/mysql-server-mysql-8.0.30 | storage/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp | #define DBTUX_TREE_CPP
#include "Dbtux.hpp"
#define JAM_FILE_ID 375
/*
* Add entry. Handle the case when there is room for one more. This
* is the common case given slack in nodes.
*
* Can be called from MT-build of ordered indexes.
*/
void
Dbtux::treeAdd(TuxCtx& ctx, Frag& frag, TreePos treePos, TreeEnt ent)
... | ALGO | 0.997875 | 7.19655 |
d730863d-59cd-4b4e-9478-3a8044721d00 | kljadsl/cpp | algorithm/活动选择问题.cpp | #include <iostream>
#include <vector>
using namespace std;
void swap(int* a, int* b) {
int tmp = *a;
*a = *b;
*b = tmp;
}
int Adjust_Arr(int* a, int* b, int start, int end) {
int p = start;
int q = end;
int i = p - 1;
int j = p;
int key = a[q];
while (j < q) {
if (a[j] >= key) {
j++;
contin... | ALGO | 0.999991 | 3.465358 |
aa0c89a8-faa1-44a5-a471-5e2eaf3c7eed | SupremeWarrior108/Competitive-Programming | CSES/2SS1DistinctNumbers.cpp | // https://cses.fi/problemset/task/1621
#include <bits/stdc++.h>
using namespace std;
// Macros
#define pb push_back
#define pf push_front
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define up(v) upper_bo... | ALGO | 0.998925 | 4.825317 |
0759be2a-d1fd-4671-a4cc-84214e7d8626 | Teino1978-Corp/Teino1978-Corp-hhvm | hphp/tools/hfsort/hfsort.cpp | #include "hphp/tools/hfsort/hfutil.h"
#include <stdio.h>
#include <assert.h>
#include <zlib.h>
#include <ctype.h>
#include <stdarg.h>
#include <cxxabi.h>
#include <folly/Format.h>
#include "hphp/util/text-util.h"
namespace HPHP { namespace hfsort {
void error(const char* msg) {
printf("ERROR: %s\n", msg);
exit(... | ALGO | 0.993308 | 4.970522 |
141eadcf-8ec8-4bb1-a5c6-a577bc4f3888 | Kadan19/Internet-of-things | Lab_6/Library/PackageCache/com.unity.ide.visualstudio@2.0.11/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.946005 | 6.947423 |
ccd96309-0ffa-4756-a08b-baecc0e7a4cd | amanjain44/DSA | 4)Recursion/sum1Ton.cpp | #include<iostream>
using namespace std;
int SUM(int s , int n){
if(n==0) return s;
SUM(s+n,n-1);
}
int SUM1(int n){
if(n==0) return 0;
return n+SUM1(n-1);
}
int main(){
int n;
cin>>n;
int x = SUM(0,n);
cout<<x<<endl;
int y = SUM1(n);
cout<<y;
return 0;
} | ALGO | 0.999976 | 3.49254 |
1ba0cdc8-7874-44d1-b585-59f7c436efec | aosp-mirror/platform_external_skia | docs/examples/SkPath_arcto_conic_parametric2.cpp | REG_FIDDLE(SkPath_arcto_conic_parametric2, 512, 512, false, 0) {
/** Add a weighted quadratic bezier from the last point, approaching control point
(x1,y1), and ending at (x2,y2). If no moveTo() call has been made for
this contour, the first point is automatically set to (0,0).
If the starting point is (x0,... | ALGO | 0.998797 | 6.494619 |
f7b6a9ed-71a0-4828-898b-86cd5df90de6 | moo1o/AlgorithmPractice | Baekjoon/1009.cpp | #include <cstdio>
#include <math.h>
#define ll long long
using namespace std;
int T;
ll a, b;
void init() { a = 0, b = 0; }
ll func() {
ll ret = 1;
for (int i = 0; i < b; i++) {
ret = (ret*a) % 10;
}
if (ret == 0)
ret = 10;
return ret;
}
int main(void) {
scanf("%d", &T);
while (T--) {
init();
sca... | ALGO | 0.999701 | 4.313359 |
5a4465ac-ffbb-44c9-8b9a-78c17649a2b7 | moinulshaon/UVa-Problems | vol 110/11059__Completed/11059.cpp | #include <cstdio>
using namespace std;
long long arr[20];
int main()
{
int cnt;
for (int m=1;scanf("%d",&cnt)==1;++m)
{
for (int i=0;i<cnt;++i)
scanf("%lld",&arr[i]);
long long result=0;
for (int i=0;i<cnt;++i)
{
long long tmp=1;
for (in... | ALGO | 0.999085 | 3.556851 |
6fc4e8fd-c5b9-4871-a735-4a94438a085a | Oct4Pie/lib-openjdk-9-ios | hotspot/test/native/utilities/test_quicksort.cpp | #include "precompiled.hpp"
#include "memory/allocation.inline.hpp"
#include "runtime/os.hpp"
#include "utilities/quickSort.hpp"
#include "unittest.hpp"
static int test_comparator(int a, int b) {
if (a == b) {
return 0;
}
if (a < b) {
return -1;
}
return 1;
}
static bool compare_arrays(int* actual, i... | TEST | 0.883208 | 6.495815 |
2364c3fc-e838-425c-b1e8-b511986fd17b | zwshen/notes-learning | skills/Acm/參考解答/Solve1/p444.cpp | /* @JUDGE_ID: xxxxxx 444 C++ */
#include <stdio.h>
#include <assert.h>
#include <string.h>
char message[10000];
char result[10000];
int valid[128];
int count;
void init() {
int i;
for (i = 0; i < 128; i++)
valid[i] = 0;
for (i = (int)'a'; i <= (int)'z'; i++)
valid[i] = 1;
for (i = (int)'A'; i <= (int... | ALGO | 0.99812 | 3.896353 |
006b9a5f-7126-49c1-83b8-0376c1b0bc97 | Nishad0123/DataStructure | linkedlistbyclass.cpp | #include<iostream>
using namespace std;
class Node //class node is defined which will be used for 1 single node of the list
{
public:
int data; //2 elements are included in the class
Node *link;
public:
Node() //constructor inititialises the Node class elements, we can also make a parameterised con... | ALGO | 0.996155 | 4.035603 |
46fb9ba8-a87d-4807-9b90-aa811123406b | Bhavin2502/All_HTML_Files | array.cc++.cpp | #include<stdio.h>
int main()
{
int a[2][2], i, j;
long determinant;
printf("\n\nEnter the 4 elements of the array\n");
for(i = 0; i < 2; i++)
for(j = 0; j < 2; j++)
scanf("%d", &a[i][j]);
printf("\n\nThe entered matrix is: \n\n");
for(i = 0; i < 2; i++)
{
for(j = 0; j < 2... | ALGO | 0.999792 | 3.442492 |
fe048f55-e84f-415c-9860-2cf0ead66724 | jodoldar/AdventOfCode | 2021/Day 1/part2.cpp | /**
* @file part2.cpp
* @author Josep Dols (<EMAIL>)
* @brief Day 1 - Part 2 of the Advent of Code 2021
* @version 0.1
* @date 2021-12-04
*
* @copyright Copyright (c) 2021
*
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
vector<int> vGetNumbersInFile(str... | ALGO | 0.999059 | 6.289087 |
b86f5364-418c-4754-93f2-a10caaaa5c7b | ai-techsystems/dnnc-operators | packages/eigen-eigen-323c052e1731/doc/examples/DenseBase_middleRows_int.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(2..3,:) =\n" << A.middleRows(2,2) << endl;
return 0;
}
| ALGO | 0.961097 | 3.312439 |
e2966480-0524-4e96-a43b-7fcf6f7f18e3 | parentoni/CP | cp4/probsolving/complete/lotto/lotto.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
using ll = long long;
using vl = vector<ll>;
using pll = pair<ll,ll>;
// functions
void setIO(string s) {freopen((s + ".in").c_str(), "r", stdin);freopen((s + ".out").c_str(), "w", stdout);}
void yes() { cout<<"YES\n"; }
void no() { ... | ALGO | 0.999398 | 3.234581 |
3ab6e4e8-3f27-4505-abcc-0a56b385925d | jawadalidakhan/C-Programme | C++ Pro/Rectangle Pattern.cpp | #include<iostream>
using namespace std;
int main(){
//Hollow Rectangle Pattern:
system("color 9e");
cout<<"\n\n\n\n";
cout<<"Enter Rows And Columns:";
int row,col;
cin>>row>>col;
for(int i=1;i<=row;i++){
for(int j=1;j<=col;j++){
if(i==1 || i==row ||j==1 || j==col){
cout<<"*";
}
else{
cout<<"*"... | ALGO | 0.985761 | 3.571975 |
aed2173b-d86a-4fa0-8353-3e6dd985b715 | PanTomko/ProffesionaCppTest | Zadanie_18/main.cpp | #include <vector>
#include <set>
#include <algorithm>
#include <iostream>
using namespace std;
void print(int v) {
cout << " " << v;
}
struct Sequence
{
int start;
Sequence(int start) : start(start) {}
int operator()() { return start++; }
};
bool predicate(int v) {
return v % 2 == 0;
}
int main()
{
vector<in... | ALGO | 0.991676 | 4.253963 |
9f4b546e-8d00-4f88-be1c-ef8fa8e65824 | Michalewicz/AtividadesFATEC | Functions-ENG-DE-SOFTWARE-II - 11-05-24.cpp | #include <iostream>
using namespace std;
// NOME: Rafael Michalewicz Rodrigues
// CICLO: 3º
// CURSO: Análise e Desenvolvimento de Sistemas
// DATA: 10/05/2024
bool detectarPrimo(int num) {
if (num > 2) {
for (int i = 2; i < num; i++) {
if (num % i == 0) return false;
}
return... | ALGO | 0.996808 | 4.131589 |
ced21213-96ef-4e12-b9ce-f7b4fa730dc7 | sahil-mehra/kattis | sibice.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main(){
int n; // Number of matches on the floor
int w,h; // dimensions of the box
int m; // length of the match;
int i; // for loop
cin >> n >> w >> h;
for( i = 0; i < n; ++i){
cin >> m;
if( (pow(w,2) + pow(h,2)) >= pow(m,2)){
cout << "DA" <<... | ALGO | 0.999883 | 3.908797 |
ea0778e8-6ff8-45a9-aacb-e7bb3e508554 | Rizwansheik666/owl | 807-custom-sort-string/custom-sort-string.cpp | class Solution {
public:
string customSortString(string order, string s) {
map<char,int>mp;
for(int i=0;i<s.size();i++){
mp[s[i]]++;
}
string ans="";
for(int i=0;i<order.size();i++){
int temp=mp[order[i]];
while(temp>0){
... | ALGO | 0.999994 | 6.069263 |
a089106d-f26e-4b13-80e8-df608b4d5bee | yyj-me/my-study | PS/etc/sort-stl-practice.cpp | /*
cpp sort stl 연습
*/
#include <algorithm>
using namespace std;
int arr[10] = {10, 9, 8, 7, 6, 5, 4, 1, 2, 3};
int compare(int a, int b) {
return a > b;
}
int compare2(int a, int b) {
return a < b;
}
bool print() {
for(int i = 0; i < 10; i++) {
printf("%d ", arr[i]);
}
printf("\n");
}
int main() {
... | ALGO | 0.998966 | 4.873773 |
6e6cd0f0-4669-4840-b656-80b4d567ea6a | yyhaos/Competitions | ACM-ICPC 2018 南京赛区现场赛/An Olympian Math Problem.cpp | #include<bits/stdc++.h>
using namespace std;
int main ()
{
long long n;
int t;
scanf("%d",&t);
while(t--)
{
scanf("%lld",&n);
printf("%lld\n",n-1);
}
/*
for(n=1;n<=10;n++)
{
long long ans=0;
for(int i=1;i<n;i++)
{
int tem=i;
for(int j=1... | ALGO | 0.999615 | 3.341258 |
f3533ad3-d46c-4509-99d0-1a55e33fe8a4 | gnaggnoyil/VAutoDeint | externalfilters/IsCombedTIVTCport.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "VapourSynth.h"
#include "VSHelper.h"
#define CTHRESH_DEFAULT 9
#define MI_DEFAULT 80
#define CHROMA_DEFAULT 0
#define BLOCKX_DEFAULT 16
#define BLOCKY_DEFAULT 16
#define METRIC_DEFAULT 0
#define OPT_DEFAULT 0
#define PIXEL_COMBED ... | TOOL | 0.9779 | 4.765179 |
390b5cd3-1ace-4293-8adc-84a323a3dd76 | WANDOKING/BOJ | C++/01703 생장점.cpp | #include <iostream>
int main(void)
{
std::cin.tie(nullptr);
std::ios_base::sync_with_stdio(false);
while (true)
{
int a;
std::cin >> a;
if (a == 0)
{
break;
}
int result = 1;
for (int i = 0; i < a; ++i)
{
int sp... | ALGO | 0.999112 | 4.160745 |
564fde2a-0520-4193-ac0f-bf4c356d4936 | Mr-Python-in-China/LuoguProblem | ABC345C.cpp | #include <bits/extc++.h>
using namespace std;
namespace pbds = __gnu_pbds;
using ui = unsigned int;
using uli = unsigned long long int;
using li = long long int;
int main(void) {
ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
string s;
cin >> s;
array<ui, 128> cnt = {};
uli ans = 0;
for (... | ALGO | 0.999623 | 4.226628 |
35ddff75-4226-4885-973a-0a9ff818903b | hussainabbas2000/Pacman | Project1/Source.cpp | #include<iostream>
#include<stdlib.h>
#include<time.h>
using namespace std;
void print(char array[18][32]) {
for (int i = 0; i < 18;i++) {
for (int j = 0; j < 32;j++) {
cout << array[i][j];
}
cout << endl;
}
}
void moveright(char array[18][32],int &hindX,int &vindX,int &score) {
if (array[vindX][hindX+1]=... | ALGO | 0.989269 | 3.116022 |
3c324b13-0601-4f4a-b249-1955c0e40727 | TechTonicShift/Mast-Programs | IntersectionOfTwoArrays.cpp | #include <iostream>
using namespace std;
void findintersection(int a[],int b[],int m,int n){
int i=0;
int j=0;
while(i<m && j<n){
if(i>0 && a[i]==a[i-1]){
i++;
continue;
}
else if(a[i]<b[j]){
i++;
}
else if(a[i]>b[j]){
... | ALGO | 0.999861 | 4.362948 |
905bb7f0-b702-47d3-80ba-d288af287ba6 | Minsteams/MergesortPractice | Mergesort/Mergesort/mergesort.cpp | #include <iostream>
#include<vector>
#include "Mergesort.h"
#include <conio.h>
using namespace std;
void main() {
FILE *in;
fopen_s(&in,"in_mergesort.txt", "r");
vector<int> a;
if (in != NULL) {
while (!feof(in)) {
int temp;
fscanf_s(in, "%d", &temp);
a.push_back(temp);
}
fclose(in);
mergeSort(a);... | ALGO | 0.999439 | 4.033094 |
a25983ae-d543-4953-af7f-18660eaee40b | aboubakr-jelloulat/problem-solving | Codeforces/ICPC Assiut University Community/Sheet#4/A.cpp | #include <iostream>
using namespace std;
int main(void)
{
string s1, s2;
cin >> s1;
cin >> s2;
cout << s1.length() << " " << s2.length() << endl;
cout << s1 << " " << s2 << endl;
return (0);
}
| ALGO | 0.987368 | 3.454512 |
152be09e-e100-4f1e-a0c2-b987b7056b71 | AbuHorairaTarif/UvaProject | UVA/11287.cpp | #include <cstdio>
long long int mod;
int num;
int v[3]={2,7,61};
long long int ans[100000];
long long int mod_exp(long long int a,long long int b)
{
long long int res=1;
while(b){
if(b&1) res=res*a%mod;
a=a*a%mod;
b>>=1;
}
return res;
}
int ck(int b,long long int n)
{
if(n%2=... | ALGO | 0.999915 | 3.995768 |
799e074f-ee0c-47a3-b369-88c7259d4524 | ruyisdk/riscv-gcc | libsanitizer/tsan/tsan_md5.cpp | namespace __tsan {
#define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z))))
#define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y))))
#define H(x, y, z) ((x) ^ (y) ^ (z))
#define I(x, y, z) ((y) ^ ((x) | ~(z)))
#define STEP(f, a, b, c, d, x, t, s) \
(a) += f((b), (c), (d)) + (x) + (t); \
(a) = (((a) << (s)) | (((a... | ALGO | 0.996757 | 6.849437 |
8bd2d57b-1cca-41dc-9e63-1afbbbb2beae | Ivan-71-ua/Competitive-Programming | LeetCode/1409.cpp | #include <bits/stdc++.h>
class Solution {
public:
std::vector<int> processQueries(std::vector<int>& queries, int m) {
std::list<int> permut;
std::vector<int> ans;
for (int i = 1; i <= m; i++)
{
permut.push_back(i);
}
for (int i = 0; i < queries.size(); i++)
{
int id = 0;
for (auto it = permut.b... | ALGO | 0.999981 | 5.057687 |
0b4fd865-1f45-46bb-971e-6420373cc2ac | ishandutta2007/codeforces | piob/normal/466/E.cpp | #include <bits/stdc++.h>
#define REP(a,b) for(int a=0; a<(b); ++a)
#define FWD(a,b,c) for(int a=(b); a<(c); ++a)
#define FWDS(a,b,c,d) for(int a=(b); a<(c); a+=d)
#define BCK(a,b,c) for(int a=(b); a>(c); --a)
#define x first
#define y second
#define pb push_back
#define re real()
#define im imag()
using namespace std;... | ALGO | 0.99998 | 4.083018 |
ab17aad9-1c71-492b-b808-5b610708c8c4 | Saad-Mahmud/2K18-S1-MSGA2000S | MExpo/LOJ_1268_Unlucky_Strings.cpp | #include<bits/stdc++.h>
using namespace std;
#define loop(i,L,R) for(int i=(L);i<=(R);i++)
#define rept(i,L,R) for(int i=(L);i<(R);i++)
#define isc(n) scanf("%d",&n)
#define llsc(n) scanf("%lld",&n)
#define dsc(n) scanf("%lf",&n)
#define enl cout<<endl
#define PB(x) push_back(x)
#define MP(x,y) make_pair(x,y)
#define x... | ALGO | 0.999887 | 3.548111 |
6bfdf0b7-d038-4fb2-9571-871e01a9b39a | novpeter/Parallel-programming | MPI/MPI Task 1-5/Task5.cpp | #include<mpi.h>
#include<stdio.h>
#include<iostream>
using namespace std;
int main(int argc, char **argv)
{
int current_process, processes;
MPI_Status status;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &processes);
MPI_Comm_rank(MPI_COMM_WORLD, ¤t_process);
int count_of_elements = 0;
if (... | ALGO | 0.999323 | 3.330632 |
d2890c1d-60c1-48ba-870f-c006cb4c5c93 | ishandutta2007/codeforces | anz/normal/1284/B.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <list>
#include <bitset>
#include <cmath>
#include <climits>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;... | ALGO | 0.999724 | 3.017326 |
ce6e3614-eaf2-45f7-8c9b-0963a745960e | ishandutta2007/codeforces | vladprog/normal/1223/A.cpp | #pragma GCC optimize("O3")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
#define mp make_pair
#define all(c) (c).begin() , (c).end()
#define sz(c) ((long long)((c).size()))
#define phb push_back
#define ppb pop_back
#define phf push_front
#define ppf pop_front
... | ALGO | 0.999699 | 4.524492 |
1a42c856-e657-4feb-8fbd-4984fc82d089 | GaisaiYuno/OI-Record-exe-deleted | Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day2程序包/answers/GD-0241/game/game.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cassert>
#define ll long long
#include<vector>
#define MOD 1000000007
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<... | ALGO | 0.999976 | 3.745261 |
e2c892b2-b556-45d9-a7aa-91394d6b5a8e | vasaniyakush/myCodingSpace | DSA&Competitive/Competetive/CFPractice/WordCapitalization.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string s1;
cin>>s1;
s1[0] = toupper(s1[0]);
cout<<s1;
return 0;
} | ALGO | 0.995907 | 3.669011 |
72f77585-fe92-4218-b2c0-18ea68d35b5f | Lotuses-robot/Codes | Contest/Luogu/NOIp2023/20231019/A/A.cpp | template<typename T>
void read(T &r) { r = 0; static char ch, last; ch = getchar(), last = 'z'; while (ch < '0' || ch > '9') last = ch, ch = getchar(); while (ch >= '0' && ch <= '9') r = (r << 1) + (r << 3) + (ch ^ 48), ch = getchar(); r = (last == '-') ? -r : r; }
template<typename T, typename...Ts>
void read(T &arg, ... | ALGO | 0.999971 | 3.623396 |
94152d60-f2e5-440e-b6cd-65eabffdc5b7 | zasonwong/Fighter | Bullet/cocos2d/cocos/platform/winrt/CCFileUtilsWinRT.cpp | #include "CCFileUtilsWinRT.h"
#include <regex>
#include "CCWinRTUtils.h"
#include "platform/CCCommon.h"
using namespace std;
NS_CC_BEGIN
static std::string s_pszResourcePath;
// D:\aaa\bbb\ccc\ddd\abc.txt --> D:/aaa/bbb/ccc/ddd/abc.txt
static inline std::string convertPathFormatToUnixStyle(const std::string& path)
{... | TOOL | 0.909371 | 6.4534 |
64ba8f3f-0250-4fdc-b9ab-b59f4a0ffbb3 | svanshuu/vanshika-local-repo | switchcal.cpp | #include<iostream>
using namespace std;
void even(int i)
{
int r=2;
while(r<=i)
{
cout<<r;
r=r+2;
}
}
void odd(int n){
int i;
for(i=1;i<=n;i++)
{
cout<<i;
i=i+1;
}
}
int main()
{
int n,f;
cout<<"enter even no";
cin>>n;
even(n);
... | ALGO | 0.995832 | 3.622127 |
2ec365f2-bb67-4a58-a17a-dbcaaca128d3 | deb8192/DeadlyDanceDeb | OpenGL_Tutoriales/GettingStarted/13-Clase_Camara/librerias/reactphysics3d/src/collision/shapes/HeightFieldShape.cpp | // Libraries
#include "HeightFieldShape.h"
#include "collision/RaycastInfo.h"
#include "utils/Profiler.h"
using namespace reactphysics3d;
// Constructor
/**
* @param nbGridColumns Number of columns in the grid of the height field
* @param nbGridRows Number of rows in the grid of the height field
* @param minHeight... | TOOL | 0.961613 | 7.690314 |
04be2f69-6dd0-4699-a6bb-36d24420a9a6 | torrvision/spaint | modules/tvgutil/src/persistence/LineUtil.cpp | #include "persistence/LineUtil.h"
#include <stdexcept>
#include <boost/algorithm/string.hpp>
#include <boost/tokenizer.hpp>
namespace tvgutil {
//#################### PUBLIC STATIC MEMBER FUNCTIONS ####################
std::vector<std::string> LineUtil::extract_lines(std::istream& is)
{
std::vector<std::string> ... | TOOL | 0.915329 | 6.791311 |
08ac0ad6-5c64-4de5-8252-376f43d48d39 | MichValwin/Advent-of-code-2022 | day 18/main.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <cmath>
#include <unordered_set>
#include <vector>
#include <deque>
#include <algorithm>
#include <queue>
#include <set>
#include <cstdlib>
static const char* INPUT_FILE = "input.txt";
struct Position{
int32_t x;
int32_t y;
int32_t z;
... | ALGO | 0.972429 | 5.07952 |
5e2701ca-7ab2-4e45-a4d1-8d545ca43479 | Xuula/tape-sorter | config.cpp | #include "config.h"
#include <exception>
void Config::load_config(const std::string& file_path){
std::ifstream config_file(file_path);
if (!config_file.is_open()) {
std::stringstream err;
err << "Config file '" << file_path << "' not found." << std::endl;
throw std::runtime_error(err.st... | CONFIG | 0.884258 | 6.214944 |
9215387f-5ad8-4dff-b373-f155914a07b3 | tic40/atcoder | abc/abc308/a/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define endl '\n'
int main() {
vector<int> s(8);
REP(i,8) cin >> s[i];
bool ok = true;
REP(i,7) if (s[i] > s[i+1]) ok = false;
REP(i,8) if (s[i] < 100 || 675 < s[i]) ok = false;
REP(i,8) if (s[i] % 25 != 0) ok = false;
... | ALGO | 0.999198 | 3.227985 |
a3cc2921-3435-4ba4-839d-191bc4b3587c | mwang98/leetcode-practice | 2008-maximum-earnings-from-taxi/2008-maximum-earnings-from-taxi.cpp | class Solution {
public:
long long maxTaxiEarnings(int n, vector<vector<int>>& rides) {
/* DP
Sort the rides by start time
Def: dp[i]: the maximum earnings given rides[i:]
Transition
Not to take: dp[i+1]
Take the ride: dp[k] + (rides[i].end - rides[i].start +... | ALGO | 0.999497 | 6.340672 |
acbca1fe-a227-4778-b90e-3c9fcb52aef7 | bishopfunc/AtCoder | tessoku-book/chap08/51a.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++) // rep(i, 0, N) cin >> D[i]
#define rep2(i, s, n) for (int i = (s) - 1; i >= (int)(n); i--) // rep(i, 0, N) cin >> D[i]
#define all(v) v.begin(), v.end() // sort(all(v));
template<class T> inline bool chmin(T& a, ... | ALGO | 0.998957 | 4.982395 |
0dd5f1fd-87dc-4520-b412-f1fb8debe29a | AyushMishra98/Practise_LeetCode | 2706-buy-two-chocolates/2706-buy-two-chocolates.cpp | class Solution {
public:
int buyChoco(vector<int>& p, int money) {
int i1=0,i2=-1;
for(int i=1;i<p.size();i++){
if(p[i]<p[i1]){
i2=i1;
i1=i;
}
else if(i2==-1 || p[i]<p[i2] || i==i1)
i2=i;
}
return (p[... | ALGO | 0.999847 | 5.260091 |
ec51bc41-4c07-45a8-8870-ac5da3f86a0f | naiksuyog2004/C-Programming | pattern/p22.cpp | /*
print:
1234
234
34
4
*/
#include <iostream>
using namespace std;
int main()
{
int number;
cin >> number;
int row = 1;
while (row <= number)
{
int sample = row;
int col = 1;
int space = row - 1;
while (space > 0)
{
cou... | ALGO | 0.999958 | 4.699852 |
8183f352-4933-40f1-859e-3cb6c72b5cf8 | makio93/competitive-othersites | LeetCode/Problems/DCC/2023/Apr/W3/D17/main0.cpp | // 自力AC
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<bool> kidsWithCandies(vector<int>& candies, int extraCandies) {
int n = candies.size(), mval = *max_element(candies.begin(), candies.end());
vector<bool> res(n);
for (int i=0; i<n; ++i) res[i] = candies[i... | ALGO | 0.999842 | 5.475907 |
2312dff0-00a4-485a-b2d0-a96b8f717fb9 | takaakiaoki/my-lammps | src/MOLECULE/bond_fene.cpp | #include "math.h"
#include "stdlib.h"
#include "bond_fene.h"
#include "atom.h"
#include "neighbor.h"
#include "domain.h"
#include "comm.h"
#include "update.h"
#include "force.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- ... | ALGO | 0.999481 | 5.683812 |
36346069-d533-489a-81fe-347854900d99 | phumipatc/C_Competitive_Programming | C++ - 2560/2_5_Camp/Test_1/AP_Bar_Chart.cpp | /*
Task :
Author : Phumipat C.
School : RYW
Language: C++
*/
#include<bits/stdc++.h>
using namespace std;
long long a[100005],l[100005],r[100005];
int main(){
long long q,n,maxx;
cin >> q;
while(q--){
maxx=-1;
cin >> n;
for(long long i=1;i<=n;i++)
cin... | ALGO | 0.999808 | 3.378411 |
d8c9bb73-5479-40f1-ab70-8e840f8e0241 | ExcuseMeee/DataStructures | playground/graph.cpp | #include <iostream>
#include <vector>
template<typename T>
class Vertex {
public:
Vertex(const T& val) : data(val), visited(false) {}
T data;
bool visited;
};
class Edge {
public:
Edge(int src, int dest, int w) : srcIndex(src), destIndex(dest), weight(w) {}
int srcIndex;
int destIndex;
int weight;
};
... | ALGO | 0.999255 | 5.604838 |
2b425279-4e59-4212-85a9-77052dbb101a | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/ChefAndAnts_20210112175702.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 collisions make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#defin... | ALGO | 0.999949 | 3.745074 |
c36e2087-3a90-43db-8dd1-525fcc2cce80 | preyansraval/cp_journey | A_Beautiful_Year.cpp | #include <bits/stdc++.h>
using namespace std;
bool isMidValid(int year) {
vector<int> freq(10,0);
while(year > 0) {
int rem = year % 10;
year /= 10;
freq[rem]++;
if(freq[rem] > 1)
return false;
}
return true;
}
int main() {
int year;
cin >> year;
... | ALGO | 0.999384 | 4.977312 |
7f3188c4-9053-4b67-9c96-9534bf471c58 | bingps/llvm-project | lldb/test/API/python_api/module_section/c.cpp | int c_function(int input) {
return input * 3;
}
| TOOL | 0.856942 | 3.536473 |
1be3ae24-b7b5-49a6-84f3-717f5d53e27d | SHAHYASHNILESH/Competitive_Programming | BinaryTree_Right View of Binary Tree.cpp | //Right View of Binary Tree
//Link:-https://practice.geeksforgeeks.org/problems/right-view-of-binary-tree/1
public:
void solve(Node *root,vector<int>&ans,int level){
if(root==NULL)return;
if(level==ans.size()){
ans.push_back(root->data);
}
... | ALGO | 0.99997 | 5.771855 |
125a8ba3-4653-4688-a980-170267b36edf | HydraFramework/HydraDependencyBox2D | ThirdParts/Box2D/Dynamics/Contacts/b2Contact.cpp | #include <Box2D/Dynamics/Contacts/b2Contact.h>
#include <Box2D/Dynamics/Contacts/b2CircleContact.h>
#include <Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h>
#include <Box2D/Dynamics/Contacts/b2PolygonContact.h>
#include <Box2D/Dynamics/Contacts/b2EdgeAndCircleContact.h>
#include <Box2D/Dynamics/Contacts/b2EdgeAnd... | ALGO | 0.991694 | 7.741941 |
bacc6b1d-f3b7-4d6e-ba1a-9b1aec1371f6 | LonxunQuantum/Lammps_for_PWMLFF | lammps_neigh_mlff_20230508/src/EXTRA-PAIR/pair_nm_cut.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing Author: Julien Devemy (ICCF)
------------------------------------------------------------------------- */
#include "pair_nm_cut.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neigh_list.... | ALGO | 0.988871 | 5.467815 |
ab94141e-fde7-4703-895f-fd9cc3aa2dac | kormuyang/posn-comp | materials/05-searching/lectures/first_and_last_index-sol2.cpp | #include <bits/stdc++.h>
using namespace std;
// Problem: Find the first and last index of a target in a sorted array
// Time Complexity: O(log n)
// Space Complexity: O(1)
// Input:
// 9 5
// 1 2 3 4 5 5 5 6 7
// Output:
// 4 6
int main()
{
vector<int> arr = {1, 2, 3, 4, 5, 5, 5, 6, 7};
int target = 5;
... | ALGO | 0.999996 | 6.390883 |
1e9c0efb-ce41-4bb0-b46c-36641e566724 | mdarafat1819/CodeChef | FLOW016 - GCD and LCM.cpp | #include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{
return !b ? a : gcd(b , a % b);
}
long long int lcm(long long int a, long long int b)
{
return a * (b / gcd(a, b));
}
int main()
{
int t;
cin>>t;
while(t--)
{
int a, b;
cin>>a>>b;
cout<<gcd(a, b)<<" ... | ALGO | 0.999815 | 5.223405 |
c51e3b6c-33bc-4d0f-b68c-44f0b91f03be | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_1388_3.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 31111;
long long BDD = 3e9;
vector<long long> p;
vector<int> st, ed;
vector<long long> base;
int nb;
int F(char c) {
if (c == '?') return -1;
if (isdigit(c)) return c - '0';
return c - 'A' + 10;
}
int n;
long long a[N];
int nq = 0;
struct Q {
vector<in... | ALGO | 0.999975 | 3.69758 |
e2812116-94cd-4f3d-a427-59f73576ebc4 | KomiMoe/Arkari | llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp | #include "llvm/CodeGen/ResourcePriorityQueue.h"
#include "llvm/CodeGen/DFAPacketizer.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/Co... | ALGO | 0.982683 | 7.460958 |
86c5156c-17fa-4ad3-9d01-af1a51878f37 | JackCharles/c-cpp-projects | 算法基础/剑指offer/31_连续子数组的最大和.cpp | #include <iostream>
#include <vector>
using namespace std;
int FindGreatestSumOfSubArray(vector<int> array)
{
int len = array.size();
if(len == 0)
return 0;
int max_sum = 0x80000000;//最小的负数第32位为1,其余为0
int curr_sum = 0;
for(int i=0;i<len;++i)
{
if(curr_sum<0)//当前和小于0,只会将array[i]拖小,因此直接抛弃前面部分
curr_sum = ar... | ALGO | 0.999845 | 4.514577 |
0fd7bf9f-944f-412a-a599-5b7c39a97915 | fpdjsns/Algorithm | programmers/월간 코드 챌린지 시즌2/2개 이하로 다른 비트.cpp | /**
* problem : https://programmers.co.kr/learn/courses/30/lessons/77885
* time complexity : O(N). N = |numbers|
*/
#include <string>
#include <vector>
#include <iostream>
using namespace std;
vector<long long> solution(vector<long long> numbers) {
int n = numbers.size();
vector<long long> answer(n);
... | ALGO | 0.999977 | 5.387986 |
336bc90d-3182-4172-bb14-7ad8aa04d4d3 | Pickle/Hurrican | Hurrican/src/SDLPort/SDL_port.cpp | #include "SDL_port.h"
#if defined(USE_GL1)
GLenum MatrixMode = 0;
#endif
D3DXMATRIXA16 g_matView;
D3DXMATRIXA16 g_matModelView;
#ifndef __WIN32__
void DeleteFile( const char* filename )
{
}
#endif
void D3DXMatrixIdentity( D3DXMATRIXA16* m )
{
m->identity();
}
void fopen_s( FILE** file, const char* path, const c... | TOOL | 0.892523 | 4.301815 |
8d2e37d3-5c4c-4d6f-9ca0-2b8f1dce0eac | njain794/Mission-SDE | hashing/*Find All Four Sum Numbers.cpp | class Solution{
public:
// arr[] : int input array of integers
// k : the quadruple sum required
vector<vector<int> > fourSum(vector<int> &arr, int k)
{
int n=arr.size();
set<vector<int>>st;
sort(arr.begin(),arr.end());
for(int i=0;i<=n-4;i++)
{
... | ALGO | 0.999971 | 5.691506 |
9c4ea961-3a36-46b4-a0e2-404e040e8e30 | izrail-9/my-important-topics | leadingdigit.cpp | ///Binary Exponentiation
#include <bits/stdc++.h>
using namespace std;
#define INF 1<<30
#define MAX 10005
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
typedef long long ll;
// compute x^n mod m
ll binpow(ll a, ll b, ll m = 1000)
{
a %= m;
ll res = 1;
while(b > 0)
{
... | ALGO | 0.9995 | 3.750113 |
4abc32c8-798f-4857-a880-e3a188dac5be | CMaybe/BOJ | 2668.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int arr[101];
bool visit[101];
int ans = 0;
int n;
bool dfs(int x, int end){
if(arr[x] == end){
visit[x] = true;
return true;
}
if(visit[x]==false){
visit[x] = true;
if(dfs(arr[x],end)){
return true;
... | ALGO | 0.999967 | 3.606781 |
728f4d44-6bc3-4302-879c-b5928dd9f474 | davidedionese/idefix-davide | src/hydro/boundary/hydroboundary.cpp | #include "hydroboundary.hpp"
#include "hydro.hpp"
#include "dataBlock.hpp"
#include "boundaryloop.hpp"
void HydroBoundary::Init(Input & input, Grid &grid, Hydro* hydro) {
idfx::pushRegion("HydroBoundary::Init");
this->hydro = hydro;
this->data = hydro->data;
// This should be required only when shearing box i... | ALGO | 0.923102 | 7.578034 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.