source_code stringlengths 26 62k | lang_cluster stringclasses 11
values | src_uid stringlengths 32 32 | code_uid stringlengths 32 32 | difficulty int32 -1 3.5k ⌀ | exec_outcome stringclasses 1
value |
|---|---|---|---|---|---|
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 2e5 + 5;
bool vis[maxn];
int p[maxn], depth[maxn], prv[maxn], pre[maxn];
vector<pii> E[maxn];
vector<int> G[maxn], ans;
void dfs(int u, int pa) {
vis[u] = true;
prv[u] = pa;
depth[u] = de... | C++ | 0da021cfe88c5a333db99064de12acbf | 87e8472faa8218bc4952def5418861c4 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 2e5 + 5;
bool vis[maxn];
int p[maxn], mp[maxn];
vector<int> G[maxn], ans;
vector<pii> E[maxn];
void dfs(int u) {
vis[u] = true;
for(int v : G[u])
if(!vis[v]) dfs(v);
ans.push_back(u);
... | C++ | 0da021cfe88c5a333db99064de12acbf | 7793a3fab4e5ff95fab84307aa54cf74 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 2e5 + 5;
bool vis[maxn];
int p[maxn], mp[maxn];
vector<int> G[maxn], ans;
vector<pii> E[maxn];
void dfs(int u) {
vis[u] = true;
for(int v : G[u])
if(!vis[v]) dfs(v);
ans.push_back(u);
... | C++ | 0da021cfe88c5a333db99064de12acbf | 4f9eeaba8b680b7e92f66ffdb4d1292c | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 2e5 + 5;
bool vis[maxn];
int p[maxn], mp[maxn];
vector<int> G[maxn], ans;
vector<pii> E[maxn];
void dfs(int u) {
vis[u] = true;
for(int v : G[u])
if(!vis[v]) dfs(v);
ans.push_back(u);
... | C++ | 0da021cfe88c5a333db99064de12acbf | 2513863b535e78461622e1deff04c4cc | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 2e5 + 5;
bool vis[maxn];
int p[maxn], mp[maxn];
vector<int> G[maxn], ans;
vector<pii> E[maxn];
void dfs(int u) {
vis[u] = true;
for(int v : G[u])
if(!vis[v]) dfs(v);
ans.push_back(u);
... | C++ | 0da021cfe88c5a333db99064de12acbf | 180dd181d9c1686c07d3023945816550 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 2e5 + 5;
int p[maxn], h[maxn];
bool vis[maxn];
vector<pii> E[maxn];
vector<int> G[maxn], ans;
void dfs(int u) {
vis[u] = true;
for(int i = 0; i < G[u].size(); i++)
if(!vis[G[u][i]]) d... | C++ | 0da021cfe88c5a333db99064de12acbf | cbc5aea498372934f5385605733c114c | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 2e5 + 5;
int p[maxn], h[maxn];
bool vis[maxn];
vector<pii> E[maxn];
vector<int> G[maxn], ans;
void dfs(int u) {
vis[u] = true;
for(int i = 0; i < G[u].size(); i++)
if(!vis[G[u][i]]) d... | C++ | 0da021cfe88c5a333db99064de12acbf | e910b70362242397df3ed525509399cc | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 2e5 + 5;
int p[maxn], h[maxn];
bool vis[maxn];
vector<pii> E[maxn];
vector<int> G[maxn], ans;
void dfs(int u) {
vis[u] = true;
for(int i = 0; i < G[u].size(); i++)
if(!vis[G[u][i]]) d... | C++ | 0da021cfe88c5a333db99064de12acbf | 6f5e89050f891a6c8917ca483b379e50 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int maxn = 2e5 + 20;
int p[maxn], pos[maxn];
bool vis[maxn];
vector<pii> a[maxn];
vector<int> G[maxn], ans;
void dfs(int u) {
vis[u] = true;
for(int i = 0; i < G[u].size(); i++)
if(!vis[G[u][i]]... | C++ | 0da021cfe88c5a333db99064de12acbf | ac3c5e515e0b212db1c8afe7c748ca09 | 2,700 | PASSED |
#include <bits/stdc++.h>
#define N 200005
#define M 1200005
using namespace std;
const int mod = 1e9 + 7;
struct node{
int val,len,lazy;
};
int len[M];
struct SegTree{
vector<node> t;
int n;
SegTree(int size){
n = size;
t.assign(4*n,{0,0,0});
build(1,1,n);
}
... | C++ | 37052429a6baf71aec63c8bca6621986 | 1e64a2278f2582edbb19e1220bfc338b | 2,700 | PASSED |
#include<iostream>
#include<cassert>
#include<vector>
using namespace std;
using it=int;
#define int long long
const int N=2e5+1000;
int a[N],b[N],n,m,d[N];
vector<pair<int,int>> q[N];
const int mod=1e9+7;
const int M=1.5e7;
int pre[N];
it ls[M],rs[M];
int s[M],cnt;
const int LIM=1e15;
struct segt{
... | C++ | 37052429a6baf71aec63c8bca6621986 | 7a8c333843a11f3e6b4b96bb7b6114a2 | 2,700 | PASSED |
#include <bits/stdc++.h>
#define MX 200005
#define mod 1000000007
using namespace std;
typedef long long LL;
LL a[MX], b[MX];
LL v[MX * 4], d[MX * 4];
LL cnt[4 * MX];
int l[MX], r[MX];
int id[MX];
LL B[MX];
vector <int> R[MX];
inline void add(int u, int l, LL dd) {
v[u] = ((v[u] + dd) % mod + mo... | C++ | 37052429a6baf71aec63c8bca6621986 | 3bdbe95772e1f96b2b8475895741483e | 2,700 | PASSED |
#include<bits/stdc++.h>
#define N 400006
#define ll long long
#define mod 1000000007
#define pb push_back
#define eb emplace_back
#define pii pair<int,int>
#define mk make_pair
#define int ll
using namespace std;
int n,q,a[N],b[N];
ll pr[N],an[N];
struct fenwick{
ll c[N];
void Init(){
mem... | C++ | 37052429a6baf71aec63c8bca6621986 | 5d8794c6478dbd7385b29a10c1fcaf56 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
inline int in(){
int x;
scanf("%d",&x);
return x;
}
typedef long long ll;
const int N=2e5+5,mod=1e9+7;
inline int add(int a,int b){return a+b>=mod?a+b-mod:a+b;}
inline int mul(int a,int b){return (ll)a*b%mod;}
int n,q,o;
int a[N],b[N],s1[N],s2[N];
ll s[N],ss[... | C++ | 37052429a6baf71aec63c8bca6621986 | 458c812e6f6e43cae33efde41b242bc3 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
inline int in(){
int x;
scanf("%d",&x);
return x;
}
typedef long long ll;
const int N=2e5+5,mod=1e9+7;
inline int add(int a,int b){return a+b>=mod?a+b-mod:a+b;}
inline int mul(int a,int b){return (ll)a*b%mod;}
int n,q,o;
int a[N],b[N],s1[N],s2[N];
ll s[N],ss[... | C++ | 37052429a6baf71aec63c8bca6621986 | a469062123bfad55acabcdfed3b87e13 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
inline int in(){
int x;
scanf("%d",&x);
return x;
}
typedef long long ll;
const int N=2e5+5,mod=1e9+7;
inline int add(int a,int b){return a+b>=mod?a+b-mod:a+b;}
inline int mul(int a,int b){return (ll)a*b%mod;}
int n,q,o;
int a[N],b[N],s1[N];
ll s[N],ss[N];
i... | C++ | 37052429a6baf71aec63c8bca6621986 | caba116ef9ad9f7930502154ff67849d | 2,700 | PASSED |
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define AquA cin.tie(0);ios_base::sync_with_stdio(0);
#define fs first
#define sc second
#define cd complex<double>
#define p_q priority_queue
#define int long long
using namespace std;
typedef pair<int,int> pii;
const int mod=1e9+7;
int add(int x,int ... | C++ | 37052429a6baf71aec63c8bca6621986 | a4206d40be57822bdffe6d3446fd4802 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5; const __int128 mod = 1e9 + 7;
__int128 ans[N]; __int128 a[N], b[N], sumb[N]; int n, q;
struct BIT{
private:
vector<__int128> val; int n;
int lowbit(int x){return x & (-x);}
void modify(int x, __int128 v){for(int i = x; i <= n; i ... | C++ | 37052429a6baf71aec63c8bca6621986 | 9842c4703df30b3402a7918f8ca03071 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5; const __int128 mod = 1e9 + 7;
__int128 ans[N]; __int128 a[N], b[N], sumb[N]; int n, q;
struct BIT{
private:
vector<__int128> val; int n;
int lowbit(int x){return x & (-x);}
void modify(int x, __int128 v){for(int i = x; i <= n; i ... | C++ | 37052429a6baf71aec63c8bca6621986 | b76ad5fc8bd60d5ec2862d21e119a1d7 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int xxx;
int n,s,t,flag;
struct node{
int t,w;
node(int a,int b)
{
t=a,w=b;
}
};
vector<node> mp[200005];
set<int> et;
int main(){
ios::sync_with_stdio(false);
//freopen("data.txt","r",stdin);
function<void(int,int,int)> dfs=[... | C++ | f690e6008010dfce1238cc2f0379e52c | 46d7dc23b5690dad926dd58fa2abcb04 | 1,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;int S, T;map<int, vector<pair<int, int>>> to;set<int>g;
void dfs1(int u,int f,int x) {
g.insert(x);
for (auto [w, wt]:to[u]) {
if (w!=f && w!=T)
dfs1(w,u,x^wt);}}
int dfs2(int u,int f,int x) {
int suc=0;
for (auto [w,wt]:to[u]) {
if (w==f) continue;
if... | C++ | f690e6008010dfce1238cc2f0379e52c | 1be3891e96629f8bd651074f6474f5b9 | 1,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;int S, T;map<int, vector<pair<int, int>>> to;set<int>g;
void dfs1(int u,int f,int x) {
g.insert(x);
for (auto [w, wt]:to[u]) {
if (w!=f && w!=T)
dfs1(w,u,x^wt);}}
int dfs2(int u,int f,int x) {
int suc=0;
for (auto [w,wt]:to[u]) {
if (w==f) continue;
if... | C++ | f690e6008010dfce1238cc2f0379e52c | 19cc43359a056f7f78b0f8ffb894391e | 1,700 | PASSED |
// Problem: G. SlavicG's Favorite Problem
// Contest: Codeforces - Codeforces Round #835 (Div. 4)
// URL: https://codeforces.com/contest/1760/problem/G
// Memory Limit: 256 MB
// Time Limit: 2000 ms
/*
lengli_QAQ
Hope there are no bugs!!!
*/
#include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(0); c... | C++ | f690e6008010dfce1238cc2f0379e52c | 4126b37e74192bb7ba752b92a2216dc2 | 1,700 | PASSED |
// Problem: G. SlavicG's Favorite Problem
// Contest: Codeforces - Codeforces Round #835 (Div. 4)
// URL: https://codeforces.com/contest/1760/problem/G
// Memory Limit: 256 MB
// Time Limit: 2000 ms
/*
lengli_QAQ
Hope there are no bugs!!!
*/
#include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(0); c... | C++ | f690e6008010dfce1238cc2f0379e52c | 75b7671df811356aaa84aa458d40e1d1 | 1,700 | PASSED |
// Problem: G. SlavicG's Favorite Problem
// Contest: Codeforces - Codeforces Round #835 (Div. 4)
// URL: https://codeforces.com/contest/1760/problem/G
// Memory Limit: 256 MB
// Time Limit: 2000 ms
/*
lengli_QAQ
Hope there are no bugs!!!
*/
#include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(0); c... | C++ | f690e6008010dfce1238cc2f0379e52c | fbecd71e911baa7c20f79e9790794833 | 1,700 | PASSED |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N=100010;
int h[N],e[N*2],ne[N*2],w[N*2],idx;
map<ll,ll>suf;
vector<vector<pair<ll,ll>>>adj;
ll a,b;
void dfs1(ll u,ll p,ll xr){
if(u!=b)
suf[xr]=1;
for(auto&it:adj[u]){
if(it.first!=p){
dfs1(it... | C++ | f690e6008010dfce1238cc2f0379e52c | aad06cfe065d7695b56cfd9b5497bcc4 | 1,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
const int N = 2e5 + 100;
ll n, a, b;
struct node
{
ll s, w;
};
vector<node>arr[N];
set<ll>st;
bool flag;//flag标记有没有这样的路径
void dfsa(ll to, ll fr, ll sum)//to去哪里,fr从哪里去,sum,目前异或和
{
if (to == b)return;//到了b,我不去(包括... | C++ | f690e6008010dfce1238cc2f0379e52c | 6d70f83895813bb34124f56342572710 | 1,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 100;
ll n, a, b;
struct node
{
ll s, w;
};
vector<node>arr[N];
set<ll>st;
bool flag;
void dfsa(ll to, ll fr, ll sum)
{
if (to == b)return;
st.insert(sum);
... | C++ | f690e6008010dfce1238cc2f0379e52c | 072d88298a94b80a91f3ea50e6d04e69 | 1,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 100;
struct note
{
ll s, w;
};
vector<note>arr[N];
map<ll, ll>mp;
bool flag;
ll n, a, b, u, v, w;
void dfsa(ll to, ll fr, ll sum)
{
if (to == b)return;
for (in... | C++ | f690e6008010dfce1238cc2f0379e52c | 8d309ec52269db7ed4087a5eb56297dc | 1,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int a[200005];
int b[200005];
inline int read()
{
int x=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9')
{
if(ch=='-')
f=-1;
ch=getchar();
}
while(ch>='0' && ch<='9')
x=x*10+ch-'0',ch=getchar();
... | C++ | 7b6a3de5ad0975e4c43f097d4648c9c9 | 01bb2c35df35c78ee5ffe7a54212738c | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main()
{
int t;
cin >> t;
while (t--){
int n;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
if (is_sorted(a + 1, a + n + 1))
{
cout << "YES\n";
}
else {int* p = min_element(a + 1, a + n + 1);
if (is_sorted(a + 1, p, gr... | C++ | 7b6a3de5ad0975e4c43f097d4648c9c9 | a74cbd544d8e5e0a321ab8a86358f440 | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int a[200000 + 5];
int main()
{
// ios::sync_with_stdio(0);
// cin.tie(0); cout.tie(0);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
if (is_sorted(a + 1, a + n + 1))
{
cout << "yes\n";
... | C++ | 7b6a3de5ad0975e4c43f097d4648c9c9 | f05275fe2a199dec680638a7fadce811 | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int a[200000 + 5];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
if (is_sorted(a + 1, a + n + 1))
{
cout << "yes\n";
}
... | C++ | 7b6a3de5ad0975e4c43f097d4648c9c9 | 86864ba00ccc1c1f05030d40889e7bba | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int a[200000 + 5];
void solve()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
if (is_sorted(a + 1, a + n + 1))
{
cout << "yes\n";
return;
}
int* p = min_element(a + 1, a + n + 1);
if (is_sorted(a + 1, p, greater<>()) &&... | C++ | 7b6a3de5ad0975e4c43f097d4648c9c9 | 024a83341281a938553c6c2b161fd854 | 1,000 | PASSED |
#include "bits/stdc++.h"
//#include <functional>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
#define PI 2 * acos(0)
#define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#ifndef ONLINE_JUDGE
#define debug(x) cerr <... | C++ | 7b6a3de5ad0975e4c43f097d4648c9c9 | 7bfca91d9a9b224ede41e23474b510c0 | 1,000 | PASSED |
#include "bits/stdc++.h"
using namespace std;
#define ll long long
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
vector<int>v;
for(int i=0;i<n;i++)
{
int x;
cin>>x;
v.push_back(x);
}
vect... | C++ | 7b6a3de5ad0975e4c43f097d4648c9c9 | f5e2d218863c10268a0af069e1b04737 | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof a)
#define PII pair<int,int>
#define ll long long
#define ull unsigned long long
#define IOS ios::sync_with_stdio(false)
#define gcd(a,b) __gcd(a,b)
#define ft first
#define sd second
#define endl '\n'
#define PI acos(-1.0)
#def... | C++ | 7b6a3de5ad0975e4c43f097d4648c9c9 | efbe941c3518f0cf283edc03a6730eb3 | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof a)
#define PII pair<int,int>
#define ll long long
#define ull unsigned long long
#define IOS ios::sync_with_stdio(false)
#define gcd(a,b) __gcd(a,b)
#define ft first
#define sd second
#define endl '\n'
#define PI acos(-1.0)
#def... | C++ | 7b6a3de5ad0975e4c43f097d4648c9c9 | 2b25089fe42236ecf491abb42d7ad482 | 1,000 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof a)
#define PII pair<int,int>
#define ll long long
#define ull unsigned long long
#define IOS ios::sync_with_stdio(false)
#define gcd(a,b) __gcd(a,b)
#define ft first
#define sd second
#define endl '\n'
#define PI acos(-1.0)
#def... | C++ | 7b6a3de5ad0975e4c43f097d4648c9c9 | 16b9c633a53eaed8993c82bafb0693a5 | 1,000 | PASSED |
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 1; i <= t; i++) {
int a[2000005], b[2000005], n;
cin >> n;
for (int j = 1; j <= n; j++) {
cin >> a[j];
b[j] = a[j];
}
sort(b + 1, b + n + 1);
for (int k = 1; k <= n; k++) {
if (a... | C++ | 7965b6ce237b02617b55dc175ffa0451 | 9f14ab0487d0c6326682fba5c512b92f | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for (int i = 0; i < int(n); i++)
int main()
{
int t;
cin >> t;
forn(tt, t) {
int n;
cin >> n;
vector<int> a(n);
forn(i, n)
cin >> a[i];
vector<int> b(a);
sort(b.begin()... | C++ | 7965b6ce237b02617b55dc175ffa0451 | 148dd396a993ef445c58f6bd088a0598 | 800 | PASSED |
#include<iostream>
#include<algorithm>
using namespace std;
const int N=2e5+10;
int a[N];
int main()
{
int t;cin>>t;
while(t--)
{
int n;
cin>>n;
int l1=0,l2=0; //最大 次大
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
if(a[i]... | C++ | 7965b6ce237b02617b55dc175ffa0451 | 08275e2097521e546e66212d75dbf565 | 800 | PASSED |
#include<iostream>
#include<algorithm>
using namespace std;
const int N=2e5+10;
int a[N];
int main()
{
int t;cin>>t;
while(t--)
{
int n;
cin>>n;
int l1=0,l2=0; //最大 次大
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
if(a[i]... | C++ | 7965b6ce237b02617b55dc175ffa0451 | ad138a36d9ed9d0f246060289bde3200 | 800 | PASSED |
#include<iostream>
#include<algorithm>
using namespace std;
const int N=2e5+10;
int a[N];
int n;
void solve()
{
cin >> n;
int d1 = 0, d2 = 0;
for (int i = 1; i <= n; i++ ) {
cin >> a[i];
if(a[i] > d1) d2 = d1, d1 = a[i];
else if(a[i] > d2) d2 = a[i];
... | C++ | 7965b6ce237b02617b55dc175ffa0451 | 3fd4d32e540c5659197eb818eb7a3821 | 800 | PASSED |
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <unordered_map>
#include <string>
#include <cstring>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <ctime>
#include <vector>
#include <fstream>
#include <... | C++ | 7965b6ce237b02617b55dc175ffa0451 | 0a80fdf8b5ff2f154c8f38c7e003dc9d | 800 | PASSED |
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <unordered_map>
#include <string>
#include <cstring>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <ctime>
#include <vector>
#include <fstream>
#include <... | C++ | 7965b6ce237b02617b55dc175ffa0451 | 6ed9c64dd0d55adc36dfbee16f397ea2 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
vector<long long> ar(n);
for(int i=0;i<n;i++)
cin>>ar[i];
vector<long long>v=ar;
sort(ar.begin(),ar.end());
long long re... | C++ | 7965b6ce237b02617b55dc175ffa0451 | 12e4b6654edc1e9228648c3e722ff761 | 800 | PASSED |
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
int n;
LL a[N];
void solve(){
cin >> n;
LL maxn = 0;
int pos = 0;
for (int i = 1; i <= n; i++) {
cin >> a[i];
if (maxn < a[i]) {
maxn ... | C++ | 7965b6ce237b02617b55dc175ffa0451 | 0b54f327cc4fa54e8556a17914e645dd | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int a[200010],b[200010],c[10];
int m;
unordered_map <int,int> t;
int main()
{
int n;
cin >> n;
for(int j = 1;j<=n;j++)
{
memset(b,0,sizeof(b));
memset(c,0,sizeof(c));
cin >> m;
int ma =0;
for(int i = 1;i<=m;i+... | C++ | 7965b6ce237b02617b55dc175ffa0451 | 224ae2a545cffd07b6db075f4ce562a0 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define e '\n'
#define ll long long
#define auto for(auto x : arr)
#define pb push_back
#define pf push_front
#define ff first
#define ss second
#define lb lower_bound
#define loop for(... | C++ | 0657ce4ce00addefc8469381c57294fc | a7823c8b1622df1fc879e4c38821ff5a | 1,100 | PASSED |
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
typedef pair<int,int>PII;
const int N=2e5+10;
int n,t,p,m;
int a[N];
ll s1[N],s0[N];
void slove(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
s1[i]=s1[i-1]+(a[i]==1);
s0[i]=s0[i-1]+(a[i]==0);
}
ll ma=0,sum=0;
... | C++ | 0657ce4ce00addefc8469381c57294fc | 5427e009fb9cb511e8088708bab1fd1d | 1,100 | PASSED |
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
typedef pair<int,int>PII;
const int N=2e5+10;
int n,t,p,m;
int a[N];
ll s1[N],s0[N];
void slove(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
s1[i]=s1[i-1]+(a[i]==1);
s0[i]=s0[i-1]+(a[i]==0);
}
ll ma=0,sum=0;
... | C++ | 0657ce4ce00addefc8469381c57294fc | dfc2a59cb20b7fb3362f1506c84340d1 | 1,100 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+10;
int n,t,p,m;
int a[N];
ll s1[N],s0[N];
void slove(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
s1[i]=s1[i-1]+(a[i]);
s0[i]=s0[i-1]+(!a[i]);
}
ll ma=0,sum=0;
for(int i=1;i<=n;i++)
{
if(a[i]==0)
sum... | C++ | 0657ce4ce00addefc8469381c57294fc | c777f0267ba2d876eb81e7fb51e21c54 | 1,100 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+10;
int n,t,p,m;
int a[N];
ll s1[N],s0[N];
void slove(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
s1[i]=s1[i-1]+(a[i]);
s0[i]=s0[i-1]+(!a[i]);
}
ll ma=0,sum=0;
for(int i=1;i<=n;i++)
{
if(a[i]==0)
sum... | C++ | 0657ce4ce00addefc8469381c57294fc | bfc178708dc659cf7025f957a71683c1 | 1,100 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+10;
int n,t,p,m;
int a[N];
ll s1[N],s0[N];
void slove(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
s1[i]=s1[i-1]+(a[i]==1);
s0[i]=s0[i-1]+(a[i]==0);
}
ll ma=0,sum=0;
for(int i=1;i<=n;i++)
{
if(a[i]==0)
... | C++ | 0657ce4ce00addefc8469381c57294fc | 506a5cbf3c991d4cfb2019be09134f4c | 1,100 | PASSED |
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
typedef pair<int,int>PII;
const int N=2e5+10;
int n,t,p,m;
int a[N];
ll s1[N],s0[N];
void slove(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
s1[i]=s1[i-1]+(a[i]==1);
s0[i]=s0[i-1]+(a[i]==0);
}
ll ma=0,sum=0;
... | C++ | 0657ce4ce00addefc8469381c57294fc | 0ea0f146dc74ac690b442f2dbc46954c | 1,100 | PASSED |
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#define N 200010
using namespace std;
int a[N];
int main()
{
ios::sync_with_stdio(0);
int t;
cin>>t;
while(t--)
{
long long n,sb=0,se=0,sd=0;
cin>>n;
int k=0,kk=0,flag=1;
fo... | C++ | 0657ce4ce00addefc8469381c57294fc | f736eb1beb4f067ff4f81fed1167b2ab | 1,100 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
scanf("%d",&t);
while(t--){
int n;
int a[200005];
int f[200005],d[200005];
long long sum=0;
scanf("%d",&n);
f[0]=0;d[0]=0;
for(int i=1;i<=n;i++){
scanf("%d",&a[i])... | C++ | 0657ce4ce00addefc8469381c57294fc | 44f6ad30d047c9e001924e60cd575471 | 1,100 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
int a[200005];
int f[200005],d[200005];
long long sum=0;
f[0]=0;d[0]=0;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
if(a[i]==... | C++ | 0657ce4ce00addefc8469381c57294fc | e6769fe432396c350a4d31f5871c7dfa | 1,100 | PASSED |
#include <iostream>
using namespace std;
int main(){
int t, n;
cin>>t;
string str;
int max=0;
for(int i=0; i<t; i++){
cin>>n;
cin>>str;
for (int k=0; k<str.length(); k++){
if(int(str[k])>max)max=int(str[k]);
}
cout<<max-'a'+1<<endl;
max=0... | C++ | 4841cbc3d3ef29929690b78e30fbf22e | e853150749fe78c2aa1826be74359db1 | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--){
int n; cin>>n;
string s;
cin>>s;
unordered_map<char,int> ma;
for(int i=0;i<n;i++){
ma.insert(make_pair(s[i],1));
}
char c = 'z';
... | C++ | 4841cbc3d3ef29929690b78e30fbf22e | d8f0fda58e78535367a1250b283ee178 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main(){
long long t;
cin>>t;
while(t--){
int n;
cin>>n;
string s;
cin>>s;
int res=s[0]-96;
for(int i=0;i<n;i++){
if(s[i]-96>=res)
res=s[i]-96;
}
cout<<res<<endl;
}
return 0;
} | C++ | 4841cbc3d3ef29929690b78e30fbf22e | 563e5c4b9ea6ec562e2f8b5523965c5a | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
string s;
cin>>s;
sort(s.begin(), s.end());
cout << s[n-1]-'a'+1<< endl;
}
return 0;
} | C++ | 4841cbc3d3ef29929690b78e30fbf22e | 92582386c7e2a9f58902912363a53c1d | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
string s;
cin>>s;
int max=s[0]-'a'+1;
for (int i=1;i<n;i++)
{
if(s[i]-'a'+1>max)
{
max=s[i]-'a'+1;
}
}
... | C++ | 4841cbc3d3ef29929690b78e30fbf22e | fbc75f9ab086c97b64f3ebaab731d1fb | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int ans(string s,int n){
int m=0;
for(int i=0;i<n;i++){
m=max(m,int(s[i]-'a'));
}
return m+1;
}
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
string s;
cin>>s;
cout<<ans(s,n)... | C++ | 4841cbc3d3ef29929690b78e30fbf22e | 6624ca8accd5669ffb65d9f69119fff9 | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
string s;
cin >> s;
int ans = 0;
for (int i = 0; i < n; i++)
{
ans = max(ans, int(s[i] - 'a'));
}
cout << ans+1 << endl;
... | C++ | 4841cbc3d3ef29929690b78e30fbf22e | e1cbcd7efff925387a57db87771ac4a0 | 800 | PASSED |
// LUOGU_RID: 95305889
#include<bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
using namespace std;
namespace IO {
#define il inline
const int iL = 1 << 25;
char ibuf[iL], *iS = ibuf + iL, *iT = ibuf + iL;
#define GC... | C++ | 4841cbc3d3ef29929690b78e30fbf22e | 45514bc1bcb9d408bf93e080e3394943 | 800 | PASSED |
#include<bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
using namespace std;
namespace IO {
#define il inline
const int iL = 1 << 25;
char ibuf[iL], *iS = ibuf + iL, *iT = ibuf + iL;
#define GC() (iS == iT... | C++ | 4841cbc3d3ef29929690b78e30fbf22e | 0d24fc0fb2cb6a487438626902e13cf3 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve()
{
int n;cin>>n;
string s;cin>>s;
int ans=0;
for(int i=0;i<n;i++){
ans=max(ans,int(s[i]-'a'));
}
cout<<ans+1<<endl;
}
signed main()
{
ios_base::sync_with_stdio(false);cin.tie(NULL);
in... | C++ | 4841cbc3d3ef29929690b78e30fbf22e | b16754161c71348d1aebe27228b761ac | 800 | PASSED |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{ ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
int t;
cin>>t;
while(t--)
{
ll arr[3];
for(int i=0;i<3&&cin>>arr[i];i++);
sort(arr,arr+3);
cout<<arr[1]<<endl;
}
}
| C++ | 63c2142461c93ae4c962eac1ecb5b192 | 3e01a568acf8a2754dc56b69df828586 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main () {
int t;
cin >> t;
int a, b ,c , medium ;
while (t>0) {
cin >> a >> b >> c;
if(((a> b )&&(a < c)) ||((a< b )&&(a> c)))
cout << a << endl;
else if(((b > a )&&(b < c)) || ((b <a )&&(b>c)) )
cout << b... | C++ | 63c2142461c93ae4c962eac1ecb5b192 | 47c148d2fecdc9b20d77f64ea0d5b74b | 800 | PASSED |
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int a[3];
for(int i=0;i<3;i++)
cin>>a[i];
sort(a,a+3);
cout<<a[1]<<endl;
}
return 0;
} | C++ | 63c2142461c93ae4c962eac1ecb5b192 | 4d936a99119922d62cf67d9d7e6c0a9c | 800 | PASSED |
#include <iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
int n;
cin >> n;
while (n--)
{
int a, a1,a2;
cin >> a >> a1 >> a2;
vector<int> f(3);
f[0] = a;
f[1] = a1;
f[2] = a2;
sort(... | C++ | 63c2142461c93ae4c962eac1ecb5b192 | 11e7358cde83234d2c67b809ea6d618e | 800 | PASSED |
#include<stdio.h>
int main()
{
int n;
int arr[1000000];
int i;
scanf("%d", &n);
for (i = 0; i < n; i++)
{
int a,b,c;
scanf("%d %d %d", &a,&b,&c);
if ((a > b && a < c) || (a > c && a < b))
arr[i] = a;
//printf("%d", a);
else if ((b > a && b < c) || (b > c && b < a))
arr[i] = b;
... | C++ | 63c2142461c93ae4c962eac1ecb5b192 | 57bde7d5a87789a8b5d8b227638523e7 | 800 | PASSED |
#include <iostream>
#include<algorithm>
using namespace std;
bool cmp(int A, int B)
{
return A > B;
}
int main()
{
int a[10000];
int t;
cin >> t;
for( int i = 0 ;i<t;i++)
{
for ( int i =0;i < 3;i++)
{
cin >> a[i];
}
sort(a,a+3,cmp);
//cout << a[1]<< endl;
cout << a[1] <... | C++ | 63c2142461c93ae4c962eac1ecb5b192 | 2e5174af06e3a1bc040a47d5c34a85d6 | 800 | PASSED |
#include <iostream>
using namespace std;
int max(int a, int b)
{
if (a > b)
{
return a;
}
else
{
return b;
}
}
int min(int a, int b)
{
if (a < b)
{
return a;
}
else
{
return b;
}
}
int main()
{
in... | C++ | 63c2142461c93ae4c962eac1ecb5b192 | c40511be8128a5c98aa6e2ccd00420b0 | 800 | PASSED |
#include <iostream>
int max(int a, int b)
{
if (a > b)
{
return a;
}
else
{
return b;
}
}
int min(int a, int b)
{
if (a < b)
{
return a;
}
else
{
return b;
}
}
int main()
{
int n, a, b, c;
i... | C++ | 63c2142461c93ae4c962eac1ecb5b192 | 36c954dcecb4f94afc0a1e94823b55eb | 800 | PASSED |
#include<bits\stdc++.h>
using namespace std;
int main()
{
int a,b,c;
int shuru;
cin>>shuru;
int i;
i=0;
for(i;i<shuru;i++)
{
cin>>a>>b>>c;
if(a<b&&a>c)
{
cout<<a<<endl;
}
if(a<c&&a>b)
{
cout<<a<<endl;
}
if(b<a&&b>c)
{
cout<<b<<endl;
}
if(b<c&&b>a)
{
c... | C++ | 63c2142461c93ae4c962eac1ecb5b192 | 405bb13b79200cab501456ab49a7c5c7 | 800 | PASSED |
#include<stdio.h>
int main()
{
int t,a,b,c,i;
scanf("%d", &t);
for(i=1;i<=t;i++)
{
scanf("%d %d %d", &a, &b, &c);
if((b>a && a>c) || (c>a && a>b))
{
printf("\n%d",a);
}
else if((a>b && b>c) || (c>b && b>a))
... | C++ | 63c2142461c93ae4c962eac1ecb5b192 | a2e0d93461d66c36f3642b322aea6421 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long LL;
LL n,m,t,a[200500],c,d;
LL b[200500];
bool check(LL x){
LL sum=0;
if(x+1>=n) sum=b[n]*(d/(x+1));
else sum=b[x+1]*(d/(x+1));
sum+=b[min(n,d%(x+1))];
return sum>=c;
}
void solve(){
LL l=1,r=d,mid,ans=0;
while(l<r){
mid=(... | C++ | f0e2558090f1a307dfd4e2007facfb5e | 785890913ab35080c716a3117db6ddae | 1,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long LL;
LL n,m,t,a[200500],c,d;
LL b[200500];
bool check(LL x){
LL sum=0;
if(x+1>=n) sum=b[n]*(d/(x+1));
else sum=b[x+1]*(d/(x+1));
LL now=d-(d/(x+1))*(x+1);
for(int i=1;i<=now;i++) sum+=a[i];
return sum>=c;
}
void solve(){
LL l=... | C++ | f0e2558090f1a307dfd4e2007facfb5e | 46829949d0acf89fb1ed149a153d2c37 | 1,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long LL;
LL n,m,t,a[200500],c,d;
LL b[200500];
bool check(LL x){
LL sum=0;
for(int i=1;i<=min(x+1,n);i++) sum+=a[i];
sum=sum*(d/(x+1));
// if(x+1>=n) sum=b[n]*(d/(x+1));
// else sum=b[x+1]*(d/(x+1));
LL now=d-(d/(x+1))*(x+1);
for(int ... | C++ | f0e2558090f1a307dfd4e2007facfb5e | 99c2c2645cf8ac5cb01f6ae8d8f56f9f | 1,500 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long LL;
LL n,m,t,a[200500],c,d;
LL b[200500];
bool check(LL x){
LL sum=0;
// if(x+1>=n) sum=b[n]*(d/(x+1));
// else sum=b[x+1]*(d/(x+1));
for(int i=1;i<=min(x+1,n);i++) sum+=a[i];
sum=sum*(d/(x+1));
LL now=d-(d/(x+1))*(x+1);
for(int ... | C++ | f0e2558090f1a307dfd4e2007facfb5e | ac6ec4f93620f39b981147e25a7c6a31 | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAX = 2e5+10;
int a[MAX];
int calc(int mid, int n, int d){
int x = min(n-1,mid);
int y = d/(mid+1);
int total = a[x]*y;
int rem = d%(mid+1);
if(rem){
rem--;
int xx = min(n-1, rem);
... | C++ | f0e2558090f1a307dfd4e2007facfb5e | 0d17ad5b9f69bc651f799bac62d1ac20 | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAX = 2e5+10;
int a[MAX];
int calc(int mid, int n, int d){
int x = min(n-1,mid);
int y = d/(mid+1);
int total = a[x]*y;
int rem = d%(mid+1);
if(rem){
rem--;
int xx = min(n-1, rem);
... | C++ | f0e2558090f1a307dfd4e2007facfb5e | 8e4e439cbef4e805a4c8e7224c78d4d7 | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAX = 2e5+10;
int a[MAX];
int calc(int mid, int n, int d){
int x = min(n-1,mid);
int y = d/(mid+1);
int total = a[x]*y;
int rem = d%(mid+1);
if(rem){
rem--;
int xx = min(n-1, rem);
... | C++ | f0e2558090f1a307dfd4e2007facfb5e | ff75905ab93e67971a4f53211a0018fa | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAX = 2e5+10;
int a[MAX];
int calc(int mid, int n, int d){
int x = min(n-1,mid);
int y = d/(mid+1);
int total = a[x]*y;
int rem = d%(mid+1);
if(rem){
rem--;
int xx = min(n-1, rem);
... | C++ | f0e2558090f1a307dfd4e2007facfb5e | 258d04b9d7f93144c3cfd4f51f4ac43d | 1,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAX = 2e5+10;
int a[MAX];
int calc(int mid, int n, int d){
if(mid == 0)return 1e12;
int x = min(n-1,mid);
int y = d/(mid+1);
int total = a[x]*y;
int rem = d%(mid+1);
if(rem){
rem--;
i... | C++ | f0e2558090f1a307dfd4e2007facfb5e | b2e0dd83311e8bef2cb19514e0362d11 | 1,500 | PASSED |
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define pp pop_back
#define fi first
#define se second
using namespace std;
void solve() {
ll n , c , d ;
cin >> n >> c >> d ;
ll a[n + 1] ;
ll Sum = 0 ;
for(ll i = 1 ; i <= n ; i++) {
... | C++ | f0e2558090f1a307dfd4e2007facfb5e | 4319638556e72f6b0899f57b8692afa5 | 1,500 | PASSED |
// g++ -std=c++17 -O2 -Wall -Wextra -pedantic -Wshadow -Wformat=2 -Wfloat-equal -Wcast-qual -Wcast-align -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -fsanitize=address -fsanitize=undefined -fstack-protector a.cpp
// GET RID OF WARNINGS
#include <bits/stdc++.h>
#define for0(i, n) for (ll i = 0; i < (n); ++i)
#define for1... | C++ | 12c975105a014fb3d9d1ad4794fdb2e8 | b85ee0520d2f2ba017c3251a7a2d00ef | 2,500 | PASSED |
// g++ -std=c++17 -O2 -Wall -Wextra -pedantic -Wshadow -Wformat=2 -Wfloat-equal -Wcast-qual -Wcast-align -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -fsanitize=address -fsanitize=undefined -fstack-protector a.cpp
// GET RID OF WARNINGS
#include <bits/stdc++.h>
#define for0(i, n) for (ll i = 0; i < (n); ++i)
#define for1... | C++ | 12c975105a014fb3d9d1ad4794fdb2e8 | 22c89f25922417e2de588a03c391f0ad | 2,500 | PASSED |
#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 ff first
#define ss second
#define ll int64_t
#define ld long double
#define nl ... | C++ | 12c975105a014fb3d9d1ad4794fdb2e8 | 753d0552e763b4f98366c766c526ec27 | 2,500 | PASSED |
#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 ff first
#define ss second
#define ll int64_t
#define ld long double
#define nl ... | C++ | 12c975105a014fb3d9d1ad4794fdb2e8 | f5e0752829c94723cc979d2b8506ca4d | 2,500 | PASSED |
#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 ff first
#define ss second
#define ll int64_t
#define ld long double
#define nl ... | C++ | 12c975105a014fb3d9d1ad4794fdb2e8 | d697f61dd217a542d29d1f53c114e21b | 2,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int MOD = 998244353;
void solve() {
int n; cin >> n;
vector<int> arr(n); for (int i = 0; i < n; ++i) cin >> arr[i];
if (n == 1) {
cout << "1\n";
return;
}
ll sum = 0, ans = 0, half = arr[0]; for (int num : arr) sum += num;
f... | C++ | 12c975105a014fb3d9d1ad4794fdb2e8 | 5822a586c14337425e8a9d09312e7695 | 2,500 | PASSED |
#include <iostream>
#include <vector>
using namespace std;
#define ll long long
#define null_awe NULL
void solve() {
int n; cin >> n;
vector<int> arr(n); for (int i = 0; i < n; ++i) cin >> arr[i];
if (n == 1) {
cout << "1\n";
return;
}
ll sum = 0; for (int num : arr) sum += num;
ll ans = 0;
ll h... | C++ | 12c975105a014fb3d9d1ad4794fdb2e8 | 1aa6f0f44ecafdcefaf28a0531a66eb6 | 2,500 | PASSED |
#include<bits/stdc++.h>
#define int long long
#define p pair<int, int>
#define endl '\n'
const int INF = 1000000001;
const int C = 998244353;
using namespace std;
int answer(vector<int> &a){
int n = a.size(), sum1 = 0;
for (int q: a){
sum1 += q;
}
sum1 = (sum1-1)/2;
vector<i... | C++ | 12c975105a014fb3d9d1ad4794fdb2e8 | a2215ac95573f2f61358038265f613ee | 2,500 | PASSED |
/*
Author of all code: Pedro BIGMAN Dias
Last edit: 15/02/2021
*/
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_map>
#i... | C++ | 12c975105a014fb3d9d1ad4794fdb2e8 | 9768bd9c7a3d95244b51c8af1beffa02 | 2,500 | PASSED |
/*
Author of all code: Pedro BIGMAN Dias
Last edit: 15/02/2021
*/
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <unordered_map>
#i... | C++ | 12c975105a014fb3d9d1ad4794fdb2e8 | c0d0c003561e524b31e9963e81274867 | 2,500 | PASSED |
#include <iostream>
#include <math.h>
using namespace std;
int main() {
long double n;
long long int aux;
int d2050=0,k=-1,t;
cin >> t;
for (int i=0;i<t;i++){
cin >> n;
d2050=0;
while(n>=2050){
k=-1;
aux=n/2050;
while(aux!=0){
aux/=10;
k++;
}
n-=... | C++ | f3e413954c9c02520fd25bd2cba4747e | 68ee3cb5d47abaebb0154b8b6ceaea79 | 800 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.