uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
e3434df3-21b8-4fec-a469-4130ca65764b | DysonHoang/Tin-Hoc | ClassTT/Home/TPHN2023_2024/tempCodeRunnerFile.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
bool ktnt(int x)
{
if (x < 2)
return 0;
for (int i = 2; i <= sqrt(x); i++)
if (x % i == 0)
return 0;
return 1;
}
int main()
{
ios_base::sync_with_stdio(NULL);
cin.tie(0);
cout.tie(0);
ll a, b, d... | ALGO | 0.999839 | 4.593933 |
3b54f7a2-56b6-47a2-99e3-4bd3f0cea180 | aeongiing/codetree-TILs | 240205/큰 숫자 자리수의 합/sum-of-large-numeric-digits.cpp | #include <iostream>
using namespace std;
int F(int n){
if(n/10==0){
return n;
}
return F(n/10)+n%10;
}
int main() {
int a, b, c;
cin >> a >> b >> c;
int n=a*b*c;
cout << F(n);
return 0;
} | ALGO | 0.999901 | 4.660388 |
2c44d927-9e1b-43bb-8733-1c4215b7da81 | Douae375/Gestion-Depense | tic_tac_toe/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.99861 | 6.76775 |
6d97f320-578d-40c9-9f40-78115d69d35e | raincross7/code-similarity | codes/train_code/problem021/problem021_167.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
using ll = long long;
int main() {
int a, b;
cin >> a >> b;
if (a + b == 3) {
cout << 3 << endl;
}
else if (a + b == 4) {
cout << 2 << endl;
}
else {
... | ALGO | 0.99995 | 4.294726 |
5f15fc08-5ede-4483-add2-945ff24490da | fleet2005/CPP-Advanced-File-Encrypter | VigenereCipher.cpp | #include "VigenereCipher.h"
#include <fstream>
#include <cctype> //isalpha, toupper
using namespace std;
VigenereCipher::VigenereCipher(const string& key) {
for (char c : key) {
if (isalpha(c)) {
this->key += toupper(c);
}
}
}
bool VigenereCipher::encrypt(const string& text, con... | TOOL | 0.890324 | 6.508308 |
ce7945f6-36d2-4fad-b2d3-4191e40344e3 | Husainbw786/GeeksForGeeks | Stack/Pairwise Consecutive Elements .cpp | // function should return true/false or 1/0
bool pairWiseConsecutive(stack<int> s)
{
//Code here
if(s.size() %2 !=0 && s.size() != 1)
{
s.pop();
}
int x = s.top();
s.pop();
while(!s.empty())
{
if(s.top() != x+1 && s.top() != x-1)
{
return false;
... | ALGO | 0.999721 | 4.334232 |
ffdb8b80-3609-4ed6-bd4e-71829eaf5e55 | travp624/frameworks_base | media/libstagefright/codecs/aacdec/sbr_aliasing_reduction.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#ifdef AAC_PLUS
#include "sbr_aliasing_reduction.h"
#include "pv_sqrt.h"
#include "aac_mem_funcs.h"
#include "pv_div.h"
#include "fx... | ALGO | 0.9999 | 3.864862 |
950e35bf-0d0a-4efb-a8f3-194f4ad20790 | JuYeong98/PS-Algorithm-with-CPP | 프로그래머스 Level2/구명보트.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int solution(vector<int> people, int limit) {
int answer = 0;
int count = people.size() - 1;
sort(people.begin(), people.end(),greater<>());
int sum = 0;
for... | ALGO | 0.999957 | 5.093352 |
8410d694-cc23-498e-952d-eb99e78afaa4 | ddcc/libcxx | test/std/containers/associative/set/find.pass.cpp | // <set>
// class set
// iterator find(const key_type& k);
// const_iterator find(const key_type& k) const;
#include <set>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.h"
int main(int, char**)
{
{
typedef int V;
typedef std::set<int> M;
... | TEST | 0.891311 | 4.233234 |
c4e89160-cff0-4e2b-a83f-63fdde62b6bb | bharath-2025/DataStructures-And-Algorithms | Linked List 1/linkedlist.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(int data){
this->data=data;
next = nullptr;
}
};
Node* deleteNode(Node *head,int pos){
if(head == nullptr){
return head;
}
if(pos == 0){
head = head->next;
... | ALGO | 0.999826 | 4.590613 |
102c5e8d-b4fd-4e01-a15f-8190bc526c7c | Antoshka-Tkachev/Exam | ticket_5/ticket_5/ticket_5.cpp | #include "pch.h"
#include <iostream>
#include "one_array.h"
#include "two_array.h"
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
int k;
cout << "Введите кол-во элементов в одномерном массиве: ";
cin >> k;
one_array first_Massiv(k);
first_Massiv.set_info();
first_Massiv.output();
first_Massi... | ALGO | 0.854558 | 3.718529 |
1d115500-9ef3-4a96-b0f3-12c106478e65 | Guo-lab/LeetCode | 2023_With_Carl/dynamic-programming/1143.最长公共子序列.cpp | /*
* @lc app=leetcode.cn id=1143 lang=cpp
*
* [1143] 最长公共子序列
*
* https://leetcode.cn/problems/longest-common-subsequence/description/
*
* algorithms
* Medium (64.94%)
* Likes: 1315
* Dislikes: 0
* Total Accepted: 335.5K
* Total Submissions: 516.8K
* Testcase Example: '"abcde"\n"ace"'
*
* 给定两个字符串 t... | ALGO | 0.999856 | 6.564589 |
af5ade0f-d23a-4b00-b224-01a61393cc37 | mhunicken/icpc-team-notebook-el-vasito | strings/lcp.cpp | vector<int> computeLCP(string& s, vector<int>& sa){
int n=s.size(),L=0;
vector<int> lcp(n),plcp(n),phi(n);
phi[sa[0]]=-1;
fore(i,1,n)phi[sa[i]]=sa[i-1];
fore(i,0,n){
if(phi[i]<0){plcp[i]=0;continue;}
while(s[i+L]==s[phi[i]+L])L++;
plcp[i]=L;
L=max(L-1,0);
}
fore(i,0,n)lcp[i]=plcp[sa[i]];
return lcp; // ... | ALGO | 0.999984 | 5.024104 |
b22f36c4-81d5-475c-b21c-57aeecf116cb | gem5-X/ALPINE | gem5-X-ALPINE/src/systemc/tests/systemc/misc/user_guide/chpt11.3/mean.cpp | /*****************************************************************************
mean.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.998991 | 4.530694 |
0a72ea2c-5018-4732-92cc-b0b9a1224f63 | vfolunin/archives-solutions | Kattis/delivery.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int coordCount, capacity;
cin >> coordCount >> capacity;
vector<map<int, int>> coords(... | ALGO | 0.999931 | 4.160275 |
ad2a15c7-8096-49e2-9dc9-c561b2c93837 | raincross7/code-similarity | codes/train_code/problem060/problem060_394.cpp | #include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define MAXN 100005
using namespace std;
const int mod = 1e9 + 7;
vector<int> graph[MAXN], g[MAXN];
int dp[MAXN];
bool visited[MAXN];
int add(int a, int b) {
a += b;
if(a >= mod)
a -= mod;
return a;
}
int mul(int a, int b) {
... | ALGO | 0.999594 | 4.562537 |
87022c64-7ef2-4be7-93b0-84b51aec22b9 | krishnenduduttadc/DSA_Master_cpp | StackL1/StackDemo.cpp | #include <iostream>
using namespace std;
#define MAX 1000
int top = -1;
char stackArr[MAX];
bool isEmpty() {
return top < 0;
}
bool isFull() {
return top >= MAX - 1;
}
bool push(char x) {
if (isFull()) {
cout << "Stack Overflow" << endl;
return false;
}
stackArr[++top] = x;
... | ALGO | 0.972125 | 4.533782 |
fbb0f96c-5dba-41b2-b209-5a33970b899e | ducga1998/Codealgorithm | daungoac.cpp | #include<stack>
#include<iostream>
using namespace std;
int main()
{
char x[10000];
printf("Nhap x : "); scanf("%s",x);
stack<char> S;
bool ok=true;
for(char *p=x;*p;p++)
if(*p=='('||*p=='['||*p=='<'||*p=='{') S.push(*p);
else if(*p==')')
{
if(S.empty()||S.top()!='(') {ok=false;break;}
else S.pop();
}
... | ALGO | 0.999507 | 3.049421 |
77013299-16f5-4612-80bf-af4d3eefa7b0 | Seirisiii/programming.in.th | Programming/00/0019.cpp | #include<bits/stdc++.h>
using namespace std;
int n;
int s[15],b[15];
int mn=INT_MAX;
void solve(int idx,int sour,int sharp){
if(idx==n){
if(sharp>0) mn=min(mn,abs(sour-sharp));
}
else{
solve(idx+1,sour*s[idx],sharp+b[idx]);
solve(idx+1,sour,sharp);
}
return ;
}
int main(){
... | ALGO | 0.999832 | 3.88049 |
47824878-4e01-413f-9b39-b9b90138c4e1 | Licee06/Udinus | Strategi Algoritme - Semester 2/minggu4/Latihan2Stak.cpp | #include <iostream>
#include <conio.h>
#include <stdio.h>
#define maxstack 4
using namespace std;
struct STACK
{
int top;
int data[5];
};
int isidata;
STACK tumpukan;
bool isfull()
{
if(tumpukan.top == maxstack)
return true;
else
return false;
}
bo... | ALGO | 0.982192 | 3.9323 |
e674c193-6500-404c-ac46-6b2a9d91c447 | EdwinLeon98/LeonEdwin_CIS5_Spring2017 | Hwrk/Assignment 2/Savitch_9thEd_Chpt2_ProgProj3/main.cpp |
/*
* File: main.cpp
* Author: Edwin Leon
* Created on March 09, 2017, 11:46 AM
* Purpose: Calculate the retroactive pay for n months.
*/
//System Libraries
#include <iostream> //Input - Output Library
using namespace std; //Name-space under which systems libraries exist
//User Libraries
//Global Constants ... | ALGO | 0.998881 | 3.808754 |
0edab836-b265-4bfd-bfad-2d9d6800847a | zetsr/Manual-Map | Manual-Map.cpp | #include <vector>
#include <string>
#include <algorithm>
#define NOMINMAX // Prevents conflicts with min/max macros in windows.h
#include <windows.h>
#include <tlhelp32.h> // For process listing
#include <memory> // For std::unique_ptr
#include <limits>
#include <cstdint>
#include <wininet.h> // For downloading DL... | TOOL | 0.877791 | 5.580946 |
37e0ed3b-568b-4fff-a56b-b24f94b78593 | TengFeiyang01/Algorithm | bishi/8-17美团/a.cpp | #include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
using i64 = long long;
std::vector<int> minp, primes;
void sieve(int n) {
minp.assign(n + 1, 0);
primes.clear();
for (int i = 2; i <= n; i++) {
if (minp[i] == 0) {
minp[i] = i;
primes.push_back(i);
}
... | ALGO | 0.999545 | 4.572802 |
c50d9aa4-a94d-47b4-89dc-50e8965d1ba9 | flyingU-ai/IN203 | TravauxDirige_n.1/Calcul_de_pi.cpp | # include <chrono>
# include <random>
# include <cstdlib>
# include <sstream>
# include <string>
# include <fstream>
# include <iostream>
# include <iomanip>
# include <mpi.h>
# include <time.h>
# include <numeric> // std::accumulate
# include <vector>
using namespace std;
// Attention , ne marche qu'en C++ 11 o... | ALGO | 0.999492 | 4.331543 |
660e4607-2304-48a5-97b0-55fbff76ec0b | celestialxevermore/BaekjoonOnlineJudge | Baekjoon/Baekjoon/가장높은탑쌓기.cpp | //#include<stdio.h>
//#include<iostream>
//#include<vector>
//
//using namespace std;
//
//typedef struct block {
// int space;
// int height;
// int weight;
//}Block;
//
//int dy[101];
//Block blocklist[101];
//
//
//int n;
//int main() {
//
// cin >> n;
//
// for (int i = 1; i <= n; i++) {
// int s, h, w;
// cin >>... | ALGO | 0.999817 | 3.731874 |
710a79b8-634a-42a5-b95d-f928d5b75844 | domob1812/ixcoin | src/utilstrencodings.cpp | #include "utilstrencodings.h"
#include "tinyformat.h"
#include <cstdlib>
#include <cstring>
#include <errno.h>
#include <limits>
using namespace std;
static const string CHARS_ALPHA_NUM = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
static const string SAFE_CHARS[] =
{
CHARS_ALPHA_NUM + " ... | TOOL | 0.96967 | 5.662208 |
fcd341b3-fe8a-4bba-be5e-3caf2cb4e388 | VatsBhatt11/Striver-s-Sheet | A2Z DSA Sheet/Learn The Basics/Learn Basic Recursion/Fibonacci Number.cpp | vector<int> generateFibonacciNumbers(int n) {
if(n==1)return {0};
if(n==2)return {0,1};
vector<int>small=generateFibonacciNumbers(n-1);
small.push_back(small[n-2]+small[n-3]);
return small;
} | ALGO | 0.999839 | 4.895952 |
612524e5-6686-4969-a4aa-b863c2d93462 | ishandutta2007/codeforces | keywet06/normal/1140/G.cpp | #include <bits/stdc++.h>
using int64 = long long;
const int N = 3e5 + 7;
const int64 inf = (int64)(1e18) + 7;
std::vector<int> t[N];
std::vector<std::pair<int, int64> > g[2 * N];
bool die[N];
int sz[N];
void dfs(int v, int pr) {
sz[v] = 1;
for (int to : t[v]) {
if (to != pr && !die[to]) dfs(to, v),... | ALGO | 0.999961 | 4.373174 |
f1325c59-977b-41a2-82fc-72b36f23533a | MatteoCaldana/cpp-playground | pow/main.cpp | #include <chrono>
#include <iostream>
#include <random>
#include <vector>
#include <cmath>
using base_t = double;
base_t myPow(base_t x, unsigned n) {
base_t res = 1;
while (n > 0) {
if (n & 1)
res *= x;
x *= x;
n >>= 1;
}
return res;
}
base_t myPow2(base_t x, unsigned n) {
base_t r = 1;
... | TEST | 0.998764 | 5.893019 |
a7c3144d-df0d-4a4f-99e8-26ddca50c112 | minwoo98/Algorithm-Study | Algorithm basic/브루트 포스/사탕 게임.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int check(vector<string> &a)
{
int n = a.size();
int ans = 1;
for(int i=0; i<n; i++) // Ž
{
int cnt = 1;
for(int j=1; j<n; j++)
{
if(a[i][j] == a[i][j])
{
cnt++;
}
else
{
cnt = 1;
}
if(ans < cnt) ans... | ALGO | 0.999981 | 3.682006 |
5b7f3bd4-6bfb-4c12-81a1-3520914a4271 | Fudanyrd/cql | expr_util.cpp | #include <stack>
#include <unordered_map>
#include "expr_util.h"
namespace cql {
/************************************************
* Backgroud knowledge
*
* (1) in-stack priority(isp) of operators:
* NOTE: function calls usually have very high
* priorities.
* Defined BELOW
**********************************... | ALGO | 0.998317 | 5.939452 |
a8eb1fd9-d6a9-46ae-b79f-7addc44476d6 | Exr0nProjects/learn_cpp | algorithms/linear_sieve/attempt0.cpp | // 16 July 2020
#include <iostream>
const int MX = 1e5;
int sieve[MX], primes[MX], pcnt=0;
int main()
{
for (int i=2; i<MX; ++i)
{
printf("i = %d\n", i);
if (!sieve[i])
{
printf(" prime!\n");
primes[pcnt++] = i;
}
for (int j=0; j<pcnt; ++j)
... | ALGO | 0.996699 | 3.505261 |
7f8821be-cfb3-46c1-b4b6-21bea694c221 | kalex1994/UVA | 11386.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <cstdlib>
using namespace std;
typedef unsigned long ul;
int main()
{
ul n, k;
map<ul, ul> f;
while (scanf("%ul", &n) != EOF)
{
f.clear();
for (int i = 0; i < n; ++i)
{
scanf("%ul", &k)... | ALGO | 0.999585 | 3.43024 |
e75ce036-54ac-48ad-b868-5d5d8b33f178 | SinestroWhite/Introduction-To-Programming | resources/solutions/arrays/task11.cpp | #include <iostream>
#define N 5
int main() {
char arr[N] = {'g', 'f', 'q', 'f', 'g'};
bool flag = true;
for (int i = 0; i < N / 2; i++) {
if (arr[i] != arr[N - i - 1]) {
flag = false;
}
}
std::cout << flag << '\n';
return 0;
}
| ALGO | 0.999423 | 3.842884 |
cec56656-ec99-4029-bc68-188db1ac668d | Rishi2k3/dsa-cpp | prime_no_upto_n.cpp | #include<iostream>
using namespace std;
// time complexity is high that is n^2
// to reduce tc seive of eratosthenes was introduced
bool checkprime( int n )
{
for( int i=2; i<n;i++)
{
if(n%i==0)
{
return 0;
}
}
return 1;
}
int countprime( int n )
{
int count ... | ALGO | 0.999345 | 4.159296 |
66baf2dd-0b52-4aa2-90c1-c57d7ebeb99b | luwei0917/GlpG_Nature_Communication | src/USER-AWPMD/atom_vec_wavepacket.cpp | /* ----------------------------------------------------------------------
Contributing author: Ilya Valuev (JIHT, Moscow, Russia)
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "atom_vec_wavepacket.h"
#include "atom.h"
... | TOOL | 0.855828 | 4.631615 |
c6d9d603-5166-46b1-b68d-84db93edb23a | ishandutta2007/codeforces | alesyaivanova/normal/1515/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define pii pair<int, int>
#define pb emplace_back
#define pf emplace_front
#define mp make_pair
#define ld long double
#define all(x) x.begin(), x.end()
#define uniq(x) sort(all(x)), x.resize(unique(all(x)) - x.beg... | ALGO | 0.999908 | 3.53621 |
3a100680-440e-49f2-bd0f-7dd66ced9969 | cesarozorioa/cesarosorio_1946 | arrays/cadenas/revisar.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
bool esAlfanumerico(char c) {
return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
}
std::string limpiarPalabra(const std::string& palabra) {
std::string limpia;
for (size_t i = 0; i < palabra.lengt... | TOOL | 0.964114 | 5.64321 |
36b5d807-612a-47bd-b644-6d0e19e15ae5 | eclipsezym/Cocos2d-x_studying | projects/cpp_projects/cpp-study/cocos2d/cocos/platform/winrt/sha1.cpp | #include "sha1.h"
/*
* Define the SHA1 circular left shift macro
*/
#define SHA1CircularShift(bits,word) \
(((word) << (bits)) | ((word) >> (32-(bits))))
/* Local Function Prototyptes */
void SHA1PadMessage(SHA1Context *);
void SHA1ProcessMessageBlock(SHA1Context *);
/*
* SHA1Reset
*
* Descri... | ALGO | 0.963265 | 7.002469 |
a0f07fb7-f919-4a50-8d84-56c665fcb85b | Joens-codes/beakjoon_ps | beakjoon_C++/union&find/beakjoon_1976(여행 가자).cpp | #include <iostream>
#include <vector>
using namespace std;
static vector<int> parent; // 각 노드의 부모를 저장하는 Union-Find 구조
// 두 노드를 연결하는 함수 (Union 연산)
void Union(int a, int b);
// 특정 노드의 루트 노드를 찾는 함수 (Find 연산)
int find(int a);
int main() {
cin.tie(nullptr)->ios::sync_with_stdio(false); // 입력 속도 최적화
int N, M;
... | ALGO | 0.999995 | 6.163812 |
f82e9bb0-2735-48eb-99d8-271f2f96a975 | hfukuoka/atcoder | AGC/018/a.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep_up(i, a, n) for (ll i = a; i < n; ++i)
#define rep_down(i, a, n) for (ll i = a; i >= n; --i)
#define P pair<ll, ll>
#define all(v) v.begin(), v.en... | ALGO | 0.999984 | 4.810367 |
7e0715a5-1191-4971-8cb2-3e6d0da7e7f3 | oybek/competitive-programming | uva/11713.cpp |
#include <string>
#include <iostream>
using namespace std;
bool is_vowel(char c) {
switch (c) {
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
case 'y':
return true;
}
return false;
}
int main() {
int tt;
string s1, s2;
cin >> tt;
while (tt--) {
cin >> s1 >> s2;
if (s1.size() != s2.siz... | ALGO | 0.999967 | 5.774402 |
56acad47-7042-4143-9798-4ab9ba9a34b3 | heavenMOJANG/ICPC | .history/2024HDU多校/HDU多校2/1011_20240722150139.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int inf=0x7fffffff;
typedef char chr;
typedef std::deque<int> dic;
const int maxN = 1e5;
const int maxS = 1e5;
const int maxT = 1e5;
int n;
chr s[2][maxS+... | ALGO | 0.999911 | 3.85927 |
89530785-9b3e-40ef-b78a-9127cfc26968 | Buttiyeeppp/Code | AtCoder/ABC314D.cpp | #include<bits/stdc++.h>
using namespace std;
#define clo 1000.*clock()/CLOCKS_PER_SEC
#define xxzx
#ifndef xxzx
#define endl '\n'
#endif
using ll=long long;
using PII=pair<int,int>;
const int N=5e5+10;
bool mem1;
int n,Q,vis[N],pd1=1,pd2=1; // big/small
char ans[N];
string s;
struct option { int t,x; char c; }q[N];
boo... | ALGO | 0.999969 | 3.970181 |
0b365083-1c50-4a71-be67-f0570a11d269 | tiankonguse/ACM | contest/sgu/369.cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <stack>
#include <cmath>
using namespace std;
typedef long long LL;
#define N 200005
struct Point {
int x , y , id;
}a[N];
bool cmpx(Point A , Point B) {
retur... | ALGO | 0.999577 | 4.549775 |
11f6ccb2-239b-4521-8d6e-2a464aca3c64 | Rajatsinha05/DSA-C-- | lecture4/condition.cpp | #include <iostream>
using namespace std;
int main()
{
// string course_a = "Full Stack";
// string course_b = "Frontend";
// string course_c = "Backend";
// char selected;
// cout << "enter course, (a,b,c)" << endl;
// cin >> selected;
// if (selected == 'a')
// {
// cout << "y... | ALGO | 0.999355 | 4.155795 |
926b4eb0-b6b4-4ee7-99af-fb719695b0c1 | VillaKeth/Competitive-Programming | 1000/Card-Game.cpp | #include <cstdlib>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <iostream>
#include <string>
#include <deque>
#include <queue>
#include <stack>
#include <cmath>
#include <climits>
#include <algorithm>
#include <chrono>
#include <cstdint>
#include <fstream>
#include <numeric>
#defin... | ALGO | 0.999602 | 3.982985 |
d7130782-ac36-406a-96ca-9fdaa612b880 | strategist614/ACM-Code | 刷题比赛/LUOGU/P2085最小函数值.cpp | /*
#include<bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x)
{
x = 0;
char c = getchar();
int sgn = 1;
while(c<'0'||c>'9'){if(c=='-')sgn=-1;c=getchar();}
while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();
x*=sgn;
}
template <typename T>
void out(T x)
{
if(x<0){putchar('-... | ALGO | 0.999978 | 3.223751 |
a30c7ef7-1aa2-4caa-8e5e-865dc15bef4b | siedex/OpenMP | Lab 3/MPI_Sample/MPI_Sample/Task6.cpp | #include "stdafx.h"
double** reateMatrix(int n);
void ClearMatrix(double** matrix, int n);
double* MatrixMultiplyVector(double** matrix, int n, int m, double* vector);
void ShowMatrix(double** matrix, int n, int m);
void ShowVector(double* vector, int n);
void Task6(int argc, char* argv[], int n)
{
int numtasks, ran... | ALGO | 0.999129 | 3.671097 |
63680f9b-f141-4743-abcd-83d2c10cbbee | KanishAnand/CompetitiveCoding | Atcoder/contest#172/3.cpp | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
#define lli long long int
#define llu unsigned long long int
#define pb push_back
#define rt return 0
#define endln "\n"
#define all(x) x.begin(), x.end()
#def... | ALGO | 0.999941 | 4.137838 |
887ef924-04c9-47c6-b529-9732357a808b | Polidea/SiriusObfuscator | SymbolExtractorAndRenamer/llvm/lib/Analysis/CFG.cpp | #include "llvm/Analysis/CFG.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/Dominators.h"
using namespace llvm;
/// FindFunctionBackedges - Analyze the specified function to find all of the
/// loop backedges in the function and return them. This is a relatively cheap
/// (com... | ALGO | 0.999813 | 7.515771 |
49c33519-f025-445e-a317-83a26df04fa1 | AntennaeVY/CP | CodeForces/1600/Welfare State.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for(auto &ai : a) cin >> ai;
int q;
cin >> q;
vector<int> last_receipt_index(n, -1), suffix(q+1, 0);
for(int i=0; i < q; i++) {
int t;
cin >> t;
if (t == 1) {
int p, x;
cin >> p >> x;
a[p-... | ALGO | 0.999959 | 3.936368 |
10f3d3eb-6518-40f4-a638-39b01fc8d44d | MahfuzLinkon/Phitron_CS | C++ for DA/Module_7_5_Practice_Day_02/F_Equation.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, x;
cin >> x >> n;
double res = 0;
for (int i = 2; i <= n; i = i + 2)
{
res += pow(x * 1.0, i * 1.0);
}
cout << (long long int)(res);
return 0;
} | ALGO | 0.999883 | 3.831024 |
f89f68fc-4c26-4e5c-80da-2a95c9de81b9 | abhihacker02/Competitive-Coding | codechef/CHEFTRVL author sol.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mt make_tuple
#define f first
#define s second
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define rep... | ALGO | 0.999862 | 4.576336 |
7ffedeb3-2474-4001-9d9d-023d59756605 | km-git007/DSA | 816-design-hashset/design-hashset.cpp | class MyHashSet {
private:
int CAP;
vector<list<int>> buckets;
public:
MyHashSet(){
CAP = 10000;
buckets = vector<list<int>>(CAP, list<int>{});
}
void add(int key){
int index = key % CAP;
auto& list = buckets[index];
auto itr = find(list.begin(), list.end... | ALGO | 0.999289 | 5.72109 |
8aab6a3b-23ce-4ccd-9686-9b1a1dedd452 | LukaSteven/Lab-Tasks---COM221 | lab three tasks/commaoperator.cpp.cpp | #include <iostream>
using namespace std;
int main() {
int i, j;
j = 10;
i = (j++, j + 100, 999 + j);
cout << i;
return 0;
}
| ALGO | 0.995552 | 3.189503 |
af075944-7ac5-4cd9-9ab6-a2a0ab30b720 | miiitomi/atcoder | mayocon/20240510/6.cpp | // https://atcoder.jp/contests/abc305/tasks/abc305_g
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 998244353;
vector<vector<ll>> matrix_prod(vector<vector<ll>> &A, vector<vector<ll>> &B, ll mod) {
int l = A.size();
int m = B.size();
int n = B[0].size();
vector<vect... | ALGO | 0.999918 | 5.331506 |
c3072426-c83f-4f6a-92e6-c7406dcd37a5 | Aaanchalsingh/Leetcode | 169-majority-element/majority-element.cpp | class Solution {
public:
int majorityElement(vector<int>& nums) {
map<int,int> mp;int n=nums.size();
for(auto x:nums) mp[x]++;
for(int i=0;i<n;i++){
if(mp[nums[i]]>n/2) return nums[i];
}
return -1;
}
}; | ALGO | 0.999943 | 5.511283 |
aecc39b1-d95b-4776-875d-a9c25122a2b9 | kiranmuddam/datastructures-and-algorithms | Graphs/graphCycle.cpp | #include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <queue>
using namespace std;
class Graph {
private:
int vertices;
vector<list<int> > array;
vector<bool> visited;
queue<int> dfsQueue;
public:
Graph(int v) {
array.resize(v);
vertices = v;
v... | ALGO | 0.99938 | 5.575568 |
978196e0-5ec4-4f7a-b597-1b0c4ce1c92a | PrabhatSharma001/DSA_C- | leetcode.cpp | #include <iostream>
using namespace std;
// #1 you are given an integer find it's digits product - sum.
// int main(){
// int product=1;
// int sum=0;
// int n;
// cin>>n;
// while(n>0){
// product*=n%10;
// sum+=n%10;
// n=n/10;
// ... | ALGO | 0.999762 | 4.61745 |
d0944195-50c2-40e1-8e05-bf6bc5793740 | nsccpccoe/test-case-generator | distributing-fruits/medium.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
ll NfactorialDivisibleByK(ll n, ll k)
{
for (ll i = 1; i <= n; i++)
{
k /= gcd(i, k);
if (k == 1)
break;
}
return (k == 1);... | ALGO | 0.99988 | 5.490707 |
03a1e086-b5cf-40bc-a0ae-9289d0a2d4f8 | Yuriel849/WaferDefectDetection | Refactored_WaferDefectDetection/thirdparty/opencv_481/sources/modules/features2d/src/affine_feature.cpp | /*
Guoshen Yu, Jean-Michel Morel, ASIFT: An Algorithm for Fully Affine
Invariant Comparison, Image Processing On Line, 1 (2011), pp. 11-38.
https://doi.org/10.5201/ipol.2011.my-asift
*/
#include "precomp.hpp"
#include <iostream>
namespace cv {
class AffineFeature_Impl CV_FINAL : public AffineFeature
{
public:
... | ALGO | 0.990176 | 6.87281 |
ac7175a5-6008-467c-b55f-844d947baac7 | chinmayajha/Code | 1369B.cpp |
#include "bits/stdc++.h"
#pragma GCC optimize "trapv"
using i64 = long long int;
using namespace std;
int nxt(){int x; cin >> x; return x;}
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define inarr(a,n) for(int i = 0; i < n; ++i) cin >> a[i];
//
#ifndef ONLINE_JUDGE
#include "debug.hpp"
... | ALGO | 0.999984 | 4.297607 |
62201bf6-bbc8-403b-8fe3-3c0aab9b222c | chapuni/llvm | lib/CodeGen/ProcessImplicitDefs.cpp | #include "llvm/ADT/SetVector.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llv... | TOOL | 0.923026 | 7.766385 |
d529cc6a-7065-4167-9def-4bb05e54310a | btorgerson/CodeChallenge | boost_1_63_0/libs/spirit/example/qi/compiler_tutorial/conjure2/compiler.cpp | #include "config.hpp"
#include "compiler.hpp"
#include "vm.hpp"
#include <boost/foreach.hpp>
#include <boost/variant/apply_visitor.hpp>
#include <boost/assert.hpp>
#include <boost/lexical_cast.hpp>
#include <set>
namespace client { namespace code_gen
{
void function::op(int a)
{
code.push_back(a);
... | TOOL | 0.878301 | 7.038341 |
d3fa3c37-ff46-444a-860e-032b6503b9ff | Tasmia-Hossain/Data-Structures-Lab | BFS_CycleCheck.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> Node_Vec[11];
int level[11];
int parent[11];
bool BFS(int source)
{
for (int i = 0; i < 11; i++)
{
level[i] = INT_MAX;
parent[i] = -1;
}
queue<int> Q;
Q.push(source);
level[source] = 0;
while (!Q.empty())
{
... | ALGO | 0.999968 | 5.62649 |
ab98907b-1d1d-466e-933b-773325986154 | ishandutta2007/codeforces | andrew/normal/1033/D.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define p_b push_back
#define pll pair<ll,ll>
#define endl "\n"
#define m_p make_pair
#define all(x) x.begin(),x.end()
#define ld long double
using namespace std;
typedef long long ll;
const ll MAXN = 1123456;
template <typename T>
T sqr(T x){
return x ... | ALGO | 0.999878 | 4.834889 |
97398a9a-4b49-4c72-9230-31c722b48949 | Tobiasloch/developable-gauss-stylization | libigl/include/igl/facet_components.cpp | template <typename DerivedF, typename DerivedC>
IGL_INLINE int igl::facet_components(
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedC> & C)
{
typedef typename DerivedF::Scalar Index;
Eigen::SparseMatrix<Index> A;
igl::facet_adjacency_matrix(F,A);
Eigen::Matrix<Index,Eigen::Dynamic,1> ... | ALGO | 0.972029 | 6.943933 |
fa5c6d20-3e14-4250-932b-d35b6fddb51d | cjyjy6666/our-hust-aia-cks | DISK_C/BORLANDC/CLASSLIB/SOURCE/SORTARRY.CPP | /*------------------------------------------------------------------------*/
/* */
/* SORTARRY.CPP */
/* */
/* ... | ALGO | 0.995445 | 5.882981 |
a1b7190c-139f-4f58-83b6-5f2f1e32f271 | ishandutta2007/codeforces | 01191020csl/normal/1439/C.cpp | #include<bits/stdc++.h>
using namespace std;
struct node {
long long sum;
int maxn, minn, tag;
}nd[800001];
int a[200001];
void update(int p) {
nd[p].sum = nd[p*2].sum + nd[p*2+1].sum;
nd[p].maxn = nd[p*2].maxn;
nd[p].minn = nd[p*2+1].minn;
}
void pushdown(int p, int l, int r) {
if (!nd[p].tag) return;
int mid =... | ALGO | 0.999931 | 4.226305 |
6bfc5229-abeb-4e4f-91e9-8ea766d0d900 | markm812/Coding-Challenge-Chronicles | LC4-findMedianSortedArrays.cpp | #include <vector>
#include <iterator>
#include <algorithm>
/**
* https://leetcode.com/problems/median-of-two-sorted-arrays/editorial
* The findMedianSortedArrays method finds the median of two sorted arrays using a binary search approach.
* The method ensures that the time complexity is O(log(min(n, m))), where n a... | ALGO | 1 | 7.225047 |
d3e93792-dd53-4658-b66a-2b03a89c694c | sency90/boj | 1094.cpp | #include <stdio.h>
int main() {
int n, x=0;
scanf("%d", &n);
while(n!=0) {
if(n%2) x++;
n/=2;
}
printf("%d", x);
return 0;
}
| ALGO | 0.99967 | 4.183353 |
4a7138d9-c9be-4579-8bb6-e383d8072f3b | eaindra-wp/OOP-2-In-Class-Assignments | Assignment 4/4-5.cpp | /*
CH08-320143
a4-p5.cpp
Eaindra Wun Pyae
<EMAIL>
*/
#include <map>
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
int main()
{
ifstream in;
in.open("data.txt");
//check the file status
if(!in.good())
{
cout << "Error opening file" << endl;
... | TOOL | 0.866264 | 4.129472 |
2c57f954-30bb-402c-a249-977dbf2c3896 | tr1ten/DNA | codechef/Trial_of_the_Conqueror.cpp | #include <cstdio>
#include <bits/stdc++.h>
using namespace std;
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
using namespace __gnu_pbds;
template<class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update> ;
template<typename T>
using order... | ALGO | 0.999965 | 5.18794 |
3b41ed18-cb79-43b3-9346-ab9191b2e680 | n1ckfg/latk_ml_003 | SynDraw/SynDraw/src/ContourExtractor/CrossValueContoursExtractor.cpp | #include "CrossValueContoursExtractor.h"
#include "../ViewGraph/VertexNode.h"
CrossValueContoursExtractor::~CrossValueContoursExtractor() {
_edge_cross_vertices.clear();
_face_centroid_vertices.clear();
_crossVertices.clear();
}
void CrossValueContoursExtractor::add_crossVertex(unsigned int index_edge, co... | ALGO | 0.992713 | 4.148162 |
51a4dc6f-a955-4eda-8caf-afc76db82995 | halogenOS/android_packages_apps_OTAUpdates | jni/boost_1_57_0/libs/interprocess/example/doc_vectorstream.cpp | using namespace boost::interprocess;
typedef allocator<int, managed_shared_memory::segment_manager>
IntAllocator;
typedef allocator<char, managed_shared_memory::segment_manager>
CharAllocator;
typedef vector<int, IntAllocator> MyVector;
typedef basic_string
<char, std::char_traits<char>, CharAllocator> My... | TEST | 0.875484 | 3.918953 |
c279a16a-c990-45be-b2ae-77ec213d727c | rikingurditta/csc417-tilt-paint | src/grad_grid_to_vel_grid_2d.cpp | #include "grad_grid_to_vel_grid_2d.h"
void grad_grid_to_vel_grid_2d(int nx, int ny, Eigen::SparseMatrix<double> &D_to_vel) {
// grad grid is between grid cells
int grad_x_size = (nx - 1) * ny;
int grad_y_size = nx * (ny - 1);
// velocity grid is around grid cells
int vel_x_size = (nx + 1) * ny;
... | ALGO | 0.965981 | 5.076478 |
26984f42-656b-4d63-8772-45fd9e258a57 | lukaogrinc/Napredna-racunalniska-orodja | DN4/main.cpp | #include <iostream>
#include <fstream>
#include <vector>
double forwardDifference(std::vector<std::pair<double, double>>& data, int idx, double dx) {
return (-3 * data[idx].second + 4 * data[idx + 1].second - data[idx + 2].second) / (2 * dx);
}
double backwardDifference(std::vector<std::pair<double, double>>& dat... | ALGO | 0.999614 | 5.404884 |
35f6dc97-2ca2-4277-bba4-187f390da9d5 | zivyou/labofziv | leetcode-cn-cpp/leetcode-cn-57.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Interval {
int start;
int end;
Interval() : start(0), end(0) {}
Interval(int s, int e) : start(s), end(e) {}
};
class Solution {
public:
Interval rawCombine(Interval &a, Interval &b){
Interval re;
... | ALGO | 0.999931 | 5.35257 |
31c04368-501f-4d65-bcb4-133c93af3ac2 | Mulab11/cntt2016-hw1 | TC-SRM-559-div1-500/immortalCO/HatRack.cpp | #include <cmath>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
vector<int> e[60];
ll cur;
int c[60], m, l;
void dfs(int i, int d, int f)
{
++c[d];
m = max(m, d);
int s = 0;
for(int k = 0; k != (int) e[i].size(); ++k)
{
if(e[i][k] == f) con... | ALGO | 0.999882 | 4.098742 |
588aba0d-0023-4c82-aa9f-3d3f2f71dbda | Chitransh1234/DSA-practice | OOPs Concepts/abstraction_in_header_files.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
vector<int> v={3,4,1,2};
sort(v.begin(),v.end());
for(auto i:v){
cout<<i<<endl;
}
return 0;
} | ALGO | 0.999499 | 4.123132 |
de88e61a-5bb9-4796-9d3f-6068f7b4ffe3 | yuankong11/Clang-elementWise | test/SemaCXX/constexpr-turing.cpp | // RUN: %clang_cc1 -verify -std=c++11 %s
// expected-no-diagnostics
// A direct proof that constexpr is Turing-complete, once DR1454 is implemented.
const unsigned halt = (unsigned)-1;
enum Dir { L, R };
struct Action {
bool tape;
Dir dir;
unsigned next;
};
using State = Action[2];
// An infinite tape!
struct... | TEST | 0.977231 | 7.75981 |
d3fad596-74d8-44d9-b54c-4179fe287d08 | Shell-Wataru/AtCoder | Codeforces/785/C2.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <numeric>
using namespace std;
using ll = long long;
const ll BASE_NUM = 1000000007;
int solve()
{
ll n, k;
scanf("%lld", &n);
scanf("%lld", &k);
ll re... | ALGO | 0.999731 | 3.609786 |
b71f7e79-db59-49df-8e3e-69b81c67d17a | ImMasterSam/SCIST-Solutions | 三章:資料結構與演算法/第四節:貪心與分治/貪心法/Inflation/Inflation.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int gas[n];
for(int i=0;i<n;i++)
cin >> gas[i];
sort(gas, gas+n);
double f = 1.0;
for(int i=0;i<n;i++){
if(gas[i] > i+1){
cout << "impossible";
return 0;
}
else if(gas[i]/(double)(i+1) < f)
f ... | ALGO | 0.999879 | 3.545088 |
c8b07c4b-e22c-4739-b147-a1d79f15da1d | ishandutta2007/codeforces | marckess/normal/1732/A.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % abs(k)) + abs(k) ) % abs(k))
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forr(i,a,b) for (int i = int(a); i <= int(b); i++)
#define all(v) v.begin(), v.end()
#define pb push_back
using namespace st... | ALGO | 0.999961 | 3.972194 |
b69574c3-a0cd-44f9-ad0f-26db068ca262 | KimW00Sung/baekjoon | boj1138.cpp | #include <iostream>
using namespace std;
int main(){
int N; cin>>N;
int arr[N];
int ans[N];
for(int i=1;i<=N;i++){
cin>>arr[i];
ans[i]=99;
}
int tmp,j;
for(int i=1;i<=N;i++){
tmp=0;
for(j=1; tmp<arr[i];j++){
if(ans[j]>=i) { tmp++;}
}
... | ALGO | 0.999994 | 3.491562 |
87fc2cd9-f03b-4cc1-9d7a-40ebadc1996c | deva777m/c-cpp | 21335/Assignents/10sorting/a/selectionsort.cpp | #include<iostream>
void print(double *a, int length)
{
for(int i = 0; i < length; ++i)
{
std::cout << a[i] << " ";
}
std::cout << "\n";
}
void swap(double &x, double &y)
{
double temp = x;
x = y;
y = temp;
}
void selSort(double *a, int length)
{
for(int i = 0; i < length; ++i)
{
int k = i;
for(i... | ALGO | 0.999855 | 4.288505 |
dd180b5f-4e28-45c4-afa3-3cd636d8bb0a | ishandutta2007/codeforces | suiseiseki/normal/1257/A.cpp | #include <cstdio>
#define Maxn 100
int n,x,a,b;
int mn(int a,int b){
return a<b?a:b;
}
int main(){
int t;
scanf("%d",&t);
while(t--){
scanf("%d%d%d%d",&n,&x,&a,&b);
if(a>b){
a^=b^=a^=b;
}
printf("%d\n",mn(n-1,b-a+x));
}
return 0;
} | ALGO | 0.999676 | 3.509048 |
cc392d39-2f3e-4f75-9ef5-d76da9c14e01 | siddharthgowd000/CC- | Pointers-Malloc/Pointers.cpp | #include<stdio.h>
int main()
{
int a=10;
int *ptr;
ptr = &a;
printf("\nAddress of a=%u",&a);
printf("\nAddress of ptr=%u",&ptr);
printf("\nContents of ptr=%u",ptr);
printf("\nValues of a=%d",a);
printf("\nValue of using ptr=%d", *ptr);
return 0;
}
| ALGO | 0.99278 | 3.106324 |
378cdded-094d-4535-a747-f3d3c16a8913 | tearsofphoenix/Box2DiOS | Box2D/Box2D/Dynamics/Joints/b2WheelJoint.cpp | #include <Box2D/Dynamics/Joints/b2WheelJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Linear constraint (point-to-line)
// d = pB - pA = xB + rB - xA - rA
// C = dot(ay, d)
// Cdot = dot(d, cross(wA, ay)) + dot(ay, vB + cross(wB, rB) - vA - cross(wA, rA))
// = -dot(ay, vA) -... | ALGO | 0.969466 | 6.963577 |
33d69d5f-9ff0-4787-8aea-186c19601e21 | sejalrai23/DSA-Practise | 2375-construct-smallest-number-from-di-string/2375-construct-smallest-number-from-di-string.cpp |
class Solution {
public:
string smallestNumber(string pattern) {
int n = pattern.size();
string num = "";
int prev = 0;
for(int i=0; i<=n; i++) {
num += (i + '1');
if(i == n || pattern[i] == 'I') {
reverse(num.begi... | ALGO | 0.999983 | 6.120229 |
a6e22c76-b6cd-471c-96d5-a3c968a4551d | gordnzhou/AOC | 2023/1b.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <fstream>
#include <bits/stdc++.h>
#include <regex>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
ifstream infile("input.txt");
string line;
map<string, string> rep = {
... | ALGO | 0.999063 | 5.170111 |
af3e360c-c2e2-4bab-95bc-26c1304f6726 | neetishborkar/cpp16 | ifelse.cpp | #include<iostream>
using namespace std;
class Control
{
public:
int x;
void ifelseDemo()
{
cout<<"Enter the value Number :"<<endl;
cin>>x;
if (x%2==0) //"=="is to compare two numbers value "=" is used to assign the value to a variable
{
cout<<"num : "<< x << " is even number"<<endl;
}
else
{... | ALGO | 0.919739 | 3.114461 |
5806f88d-c09a-440d-b3ce-e85e8a0746d2 | rohan-0202/rohan-s-enigma-machine- | enigma2.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <random>
#include <algorithm>
#include <array>
using namespace std;
class Rotor {
private:
array<int, 26> wiring;
array<int, 26> reverse_wiring;
int position = 0;
int notch_position; // Position where next rotor will turn... | ALGO | 0.999305 | 6.816012 |
8f5eb0cf-9a4e-4001-861a-725961612676 | joaoriverd/IGen | third-party/llvm-project-11.0.1/clang/lib/StaticAnalyzer/Core/WorkList.cpp | #include "clang/StaticAnalyzer/Core/PathSensitive/WorkList.h"
#include "llvm/ADT/PriorityQueue.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Statistic.h"
#include <deque>
#include <vector>
using namespace clang;
using namespace ento;
#define DEBUG_... | ALGO | 0.977061 | 7.635231 |
9814cb82-1229-43ff-921b-580f41bec677 | XiangZi0028/GAMES101_CODE_FRAMEWORK | 3party/eigen3/doc/examples/tut_matrix_coefficient_accessors.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,2);
m(0,0) = 3;
m(1,0) = 2.5;
m(0,1) = -1;
m(1,1) = m(1,0) + m(0,1);
std::cout << "Here is the matrix m:\n" << m << std::endl;
VectorXd v(2);
v(0) = 4;
v(1) = v(0) - 1;
std::cout << "Here is the vector v:\n... | ALGO | 0.998338 | 3.687909 |
62f6dfe8-5359-4dec-8e02-0c1f2fe3ca80 | selhatinenc/Algo | Algo/cpp_algo/magic_square.cpp | //
// Created by selhatin on 17.1.2023.
//
#include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
int findzero(int pInt[11]);
/*
* Complete the 'formingMagicSquare' function below.
*
* The function is expected to return an ... | ALGO | 0.999882 | 5.524598 |
4fddbf60-5951-411e-9cf0-f94bf90e8566 | kamyu104/LintCode | C++/super-ugly-number.cpp | // Time: O(n * logk) ~ O(n * k)
// Space: O(n + k)
// Heap solution. (308ms)
class Solution {
public:
/**
* @param n a positive integer
* @param primes the given prime list
* @return the nth super ugly number
*/
int nthSuperUglyNumber(int n, vector<int>& primes) {
priority_queue<pa... | ALGO | 0.999986 | 6.217055 |
1d492d6f-8496-47f7-8e57-49961d962ed4 | raincross7/code-similarity | codes/train_code/problem046/problem046_427.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()
template <class T> inline bool chmin(T &a, T b) {if (a > b){a = b;return true;}return false;}
template <class T> inline bool chmax(T &a,... | ALGO | 0.999869 | 3.031714 |
c93e4ed8-c4c0-4c5c-b6ff-7f933a2266f7 | Andy87877/Kattis | Thanos.cpp | // https://open.kattis.com/problems/thanos
#include <bits/stdc++.h>
using namespace std;
int main() {
long long t,p,r,f, ans;
cin >> t;
while (t--) {
cin >> p >> r >> f;
ans = 0;
while (p <= f) {
p *= r;
ans++;
}
cout << ans << endl;
}
} | ALGO | 0.9997 | 4.291903 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.