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 |
|---|---|---|---|---|---|
print(*[1+int((int(input())*1.5)**0.5-9**-9)for _ in range(int(input()))]) | Python | fbc8d6564905fbe82f9f612b2da3484d | bcfb79c77c72a56635d625d9abd518c7 | 1,700 | PASSED |
print(*[int((int(input())*1.5)**0.5-9**-9)+1 for _ in range(int(input()))]) | Python | fbc8d6564905fbe82f9f612b2da3484d | 0aa759fd609a1db3b8ee4c27a193c634 | 1,700 | PASSED |
print(*[int((int(input())*1.5)**0.5-1/9**9)+1 for _ in range(int(input()))]) | Python | fbc8d6564905fbe82f9f612b2da3484d | 31ed33866ed17b803f52ab01d2987cd3 | 1,700 | PASSED |
from math import*;print(*[ceil(sqrt(int(input())*1.5))for _ in range(int(input()))]) | Python | fbc8d6564905fbe82f9f612b2da3484d | a590f0e3ca4f61ff3ee95b739ddff275 | 1,700 | PASSED |
from math import *;print(*[ceil(sqrt(int(input())*1.5)) for _ in range(int(input()))]) | Python | fbc8d6564905fbe82f9f612b2da3484d | 60350e9d0153296c8268b453a3472ba0 | 1,700 | PASSED |
import math;print(*[math.ceil(math.sqrt(int(input())*1.5)) for _ in range(int(input()))]) | Python | fbc8d6564905fbe82f9f612b2da3484d | d243887d8d70937a62a1c046622c5e09 | 1,700 | PASSED |
import math;print("".join([str(math.ceil(math.sqrt(int(input())*1.5)))+"\n" for _ in range(int(input()))])) | Python | fbc8d6564905fbe82f9f612b2da3484d | 90f1a9429448b8d775cce165c8207573 | 1,700 | PASSED |
import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
num = int(input())
l = 0
r = 38730
while l <= r :
n = (l + r) // 2
tmp = n*(n-1)
res = (tmp//2 - tmp//6 + n//3)*2
if res < num:
l = n + 1
else :
r = n... | Python | fbc8d6564905fbe82f9f612b2da3484d | 8a3f58d9f489c0d0e604aab9892727c2 | 1,700 | PASSED |
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in file.mode
self.write = self.buffer.write if se... | Python | fbc8d6564905fbe82f9f612b2da3484d | 88595d1ff6ff0dcac03b5aad8470a51c | 1,700 | PASSED |
//�ò��鼯��ά����
#include<cstdio>
#include<iostream>
#include<map>
#include<algorithm>
#include<cmath>
#include<vector>
#include<set>
#include<cmath>
#include<cstring>
using namespace std;
const int INF = 1e9;
typedef long long int ll;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
int p[N];//ά�����鼯
i... | C++ | 15823d23340c845e0c257974390cb69f | 1708c66d404b795e169fc0544254f7b2 | 1,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N =1e5+100;
const int mod=1e9+7;
int a[N],b[N],c[N],p[N],cnt,n;
#define int long long
int t_find(int x)
{
if(p[x]==x)
return x;
else
return p[x]=t_find(p[x]);
}
void t_merge(int x,int y)
{
x=t_find(x);y=t_find(y);
p[x]=y;
}
void init()
{... | C++ | 15823d23340c845e0c257974390cb69f | b90bce3ba6ebe9474f8dd5ccf03a8114 | 1,400 | PASSED |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 100005;
vector<ll> parent(N + 1), siz(N + 1);
vector<ll> flag(N + 1);
void make(ll v, vector<ll> &parent, vector<ll> &siz)
{
parent[v] = v;
siz[v] = 1;
}
ll find(ll x, vector<ll> &parent, vector<ll> &siz)
{
... | C++ | 15823d23340c845e0c257974390cb69f | fa3e6ae2fb984d2617ed47acad85f57d | 1,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int p=1e9+7;
const int maxn=5e5+5;
int t[maxn];bool h[maxn];bool used[maxn];
int32_t main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int t1;cin>>t1;
while(t1--)
{
int n;cin>>n;
int ... | C++ | 15823d23340c845e0c257974390cb69f | 4145e4c74e09ef6081c57c89e2365525 | 1,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 5;
const int M = 1e9 + 7;
int t,n,cnt;
string s;
int a[N],b[N],c[N],a1[N],b1[N];
int c1[N] = {0};
int read()
{
int s = 0, f = 1;
char ch = getchar();
while(!isdigit(ch)) {
if(ch == '-') f = -1;
... | C++ | 15823d23340c845e0c257974390cb69f | bbb2111e2f404bcdee0f82a580de7180 | 1,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 5;
const int M = 1e9 + 7;
int t,n,cnt;
string s;
int a[N],b[N],c[N],a1[N],b1[N],c1[N];
int read()
{
int s = 0, f = 1;
char ch = getchar();
while(!isdigit(ch)) {
if(ch == '-') f = -1;
ch = get... | C++ | 15823d23340c845e0c257974390cb69f | f34a222197216b00b8515b4bf6384604 | 1,400 | PASSED |
///Bismillahir Rahmanir Rahim
//ShzFahad
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define cas... | C++ | 15823d23340c845e0c257974390cb69f | 2b61d3fde44ff992e910ddf25a9813cb | 1,400 | PASSED |
///Bismillahir Rahmanir Rahim
//ShzFahad
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define cas... | C++ | 15823d23340c845e0c257974390cb69f | 4594b3c7e8b2aa169c6ac881a6751f28 | 1,400 | PASSED |
///Bismillahir Rahmanir Rahim
//ShzFahad
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define cas... | C++ | 15823d23340c845e0c257974390cb69f | f6caa61b5a97ce860ec2f0d90bed59fb | 1,400 | PASSED |
///Bismillahir Rahmanir Rahim
//ShzFahad
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define cas... | C++ | 15823d23340c845e0c257974390cb69f | 7b569f402e18f66e9458ebf62aa9ce8f | 1,400 | PASSED |
#include <iostream>
const int N = 1e5;
using namespace std;
main()
{
int t, n, a[N] = {0}, i, cnto, cnt, flag;
cin >> t;
while (t)
{
cnto = 0; cnt = 0; flag = 1;
cin >> n;
for(i = 0; i < n; i++)
{
cin >> a[i];
if (a[i] < 0) {a[i] *= (-1); cnto++;}
}
... | C++ | 430f34fe715b8dcbcadf3b2c3e1e0381 | 248784d750c0c2fcc613861abfbeeeeb | 800 | PASSED |
#include <iostream>
const int N = 1e5;
using namespace std;
main()
{
int t, n, a[N] = {0}, i, cnto, cnt;
cin >> t;
while (t)
{
cin >> n; cnto = 0; cnt = 0;
int f = 0;
int flag = 1;
for(i = 0; i < n; i++)
{
cin >> a[i];
if (a[i] < 0) {a[i] *= (-1); cnto++;}
... | C++ | 430f34fe715b8dcbcadf3b2c3e1e0381 | 36e5ceb857b7dc22cb836ddd03cf6932 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll maxx=0,i,q,j,n,t,k=0,ans=0,sum=0,sum1=0,sum2=0,flag,m;
string x,y;
ll a[1000005]={0},b[1000005]={0};
char ch;
int main()
{
cin>>t;
while(t--)
{
cin>>n;
ll ans=0;
for(i=1;i<=n;i++)
{
cin>>a[i];
if(a[i]<0)
{
a... | C++ | 430f34fe715b8dcbcadf3b2c3e1e0381 | b78281718cfd6d393d6d72c551e64bd6 | 800 | PASSED |
#include <iostream>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n,i;
cin>>n;
int a[n],negatives=0;
for(i=0;i<n;i++){
cin>>a[i];
if(a[i]<0) negatives++;
}
for(i=0;i<negatives;i++) if(a[i]>0) a[i]*=-1;
while(i<n){
if(a[i]<0) a[i]*=-1;
i++;
}
for(i=1;i... | C++ | 430f34fe715b8dcbcadf3b2c3e1e0381 | 166c31f18b1d77eb359c0c23fee1e3b8 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lowbit(x) ((x)&(-x))
#define MAXN
#define MOD
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n],cnt=0;
for(int i=0;i<n;i++){
cin>>a[i];
if(a[i]<0)cnt++,a[i]=-a[i];
}
for(int i=0;i<cnt;i++){
a... | C++ | 430f34fe715b8dcbcadf3b2c3e1e0381 | d40fd79f03f861de9ea68021d1f78e43 | 800 | PASSED |
#include <iostream>
#include <bits/stdc++.h>
#define ll long long int
#include <cstdlib>
using namespace std;
int main()
{
ll t;
cin >> t;
while (t--)
{
ll n;
cin >> n;
ll a[n], neg = 0;
for (ll i = 0; i < n; i++)
{
cin >> a[i];
... | C++ | 430f34fe715b8dcbcadf3b2c3e1e0381 | d61b8e250c94729937c672e7ac9594ac | 800 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
void Omar_Alaraby(){
ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r... | C++ | 430f34fe715b8dcbcadf3b2c3e1e0381 | 5468ae9d45d1740d79e81fbb970ef31a | 800 | PASSED |
#include<bits/stdc++.h>
#define int long long
using namespace std;
void solve(){
int n;
cin>>n;
vector<int> a(n);
int fu = 0;
int l = -1;
int r = n;
for(int i = 0; i < n; i++){
cin>>a[i];
if(a[i]<0){
a[i]*=-1;
fu++;
}
}
if(fu>=1){
for(int i = 1; i < fu; i++){
if(a[i]>a[i-1]){... | C++ | 430f34fe715b8dcbcadf3b2c3e1e0381 | 9a8f4788b6f99e82bce65ada69dfaaf3 | 800 | PASSED |
#include<bits/stdc++.h>
#define int long long
using namespace std;
void solve(){
int n;
cin>>n;
vector<int> a(n);
int fu = 0;
int l = -1;
int r = n;
for(int i = 0; i < n; i++){
cin>>a[i];
if(a[i]<0){
a[i]*=-1;
fu++;
}
}
if(fu>1){
for(int i = 1; i < fu; i++){
if(a[i]>a[i-1]){
... | C++ | 430f34fe715b8dcbcadf3b2c3e1e0381 | f5a14bf54b6b64d639360b8d3473d0f8 | 800 | PASSED |
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#define x first
#define y second
#define endl '\n'
//#define int long long
using namespace std;
typedef long long ... | C++ | 430f34fe715b8dcbcadf3b2c3e1e0381 | 8214dfd79caf812491d89f1cd52791ac | 800 | PASSED |
/*
* @LastEditors: blockche
* @Date: 2022-05-26 13:22:40
* @LastEditTime: 2022-05-26 18:22:04
* @FilePath: \coding\Codeforces\CF #788 div2\F.cpp
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 1e9 + 10;
const int mod = 1e9 + 7;
ll qpow(ll a, int k) {
ll re... | C++ | 915c26f2bc1005d70cc8cc74ce40b9fa | 581e6229a5ec51edfda5fe9f9344bd64 | 2,400 | PASSED |
/*
* @LastEditors: blockche
* @Date: 2022-05-26 13:22:40
* @LastEditTime: 2022-05-26 18:08:18
* @FilePath: \coding\Codeforces\CF #788 div2\F.cpp
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 1e9 + 10;
const int mod = 1e9 + 7;
ll qpow(ll a, int k) {
ll re... | C++ | 915c26f2bc1005d70cc8cc74ce40b9fa | ba964eb509572f90eb3a28db2d0f27b5 | 2,400 | PASSED |
// CF1670F Jee, You See
#define YYF
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <s... | C++ | 915c26f2bc1005d70cc8cc74ce40b9fa | 11bf28ac917787705c4ed27e99ab8d85 | 2,400 | PASSED |
// CF1670F Jee, You See
#define YYF
#include <algorithm>
#include <bit>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <execution>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#includ... | C++ | 915c26f2bc1005d70cc8cc74ce40b9fa | 0e75a441bde70727059c8769cb153975 | 2,400 | PASSED |
// CF1670F Jee, You See
#define YYF
#include <algorithm>
#include <bit>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <execution>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#includ... | C++ | 915c26f2bc1005d70cc8cc74ce40b9fa | c09e64e3f853cc8dea4894a179e9e2bd | 2,400 | PASSED |
// CF1670F Jee, You See
#define YYF
#include <algorithm>
#include <bit>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <execution>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#includ... | C++ | 915c26f2bc1005d70cc8cc74ce40b9fa | 998033f5dcdd1d24fdf781354e0cbbf0 | 2,400 | PASSED |
// CF1670F Jee, You See
#define YYF
#include <unordered_map>
#include <algorithm>
#include <bit>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <execution>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#... | C++ | 915c26f2bc1005d70cc8cc74ce40b9fa | f122bcaab665dbad7646908c9ce42553 | 2,400 | PASSED |
// CF1670F Jee, You See
#define YYF
#include <algorithm>
#include <bit>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <execution>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#includ... | C++ | 915c26f2bc1005d70cc8cc74ce40b9fa | 0bb3e0dfb91df6205110350ad421f89f | 2,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string(string(s)); }
string to_string(bool b) { return to_string(int(b)); }
string to_string(vector<bool>::reference b) { return to_string(int(b)); }
string ... | C++ | 915c26f2bc1005d70cc8cc74ce40b9fa | 93af27ff745bac2155cc42fba8808db0 | 2,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string(string(s)); }
string to_string(bool b) { return to_string(int(b)); }
string to_string(vector<bool>::reference b) { return to_string(int(b)); }
string ... | C++ | 915c26f2bc1005d70cc8cc74ce40b9fa | 1a4d6257e344696ede25bc8558aaf7a8 | 2,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int n, p, st;
vector<pair<int, int>> g[300005];
int ans[300005], w[300005];
void dfs(int x, int fa, int pre) {
for (auto k: g[x]) {
if (k.first == fa)continue;
st++;
if ((st ^ pre) <= n) {
w[k.second] = st;
a... | C++ | b75ec87dcc25fdd04c3388a0051b8719 | 3946bbeb193b9df60613be04a273b408 | 2,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int n, p, st;
vector<pair<int, int>> g[300005];
int ans[300005], w[300005];
void dfs(int x, int fa, bool s) {
for (auto k: g[x]) {
if (k.first == fa)continue;
st++;
if (s == 1) {
w[k.second] = st;
ans[k.first... | C++ | b75ec87dcc25fdd04c3388a0051b8719 | a924d80c98b5f66626cf6865c0fc4de5 | 2,200 | PASSED |
#include <bits/stdc++.h>
#define ll long long
#define all(x) x.begin(),x.end()
#define answer(x) cout << (x ? "YES\n" : "NO\n")
#define test int T; cin >> T; while(T--)
#define go ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define F first
#define S second
using namespace std;
const int N = 131072 + 10;... | C++ | b75ec87dcc25fdd04c3388a0051b8719 | 58a647ddc89c250ab1b4f84995f10a05 | 2,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N=1e6+1e3+7;
int T,n;
typedef pair<int,int> pii;
#define fs first
#define sd second
#define mp make_pair
vector<pii>g[N];
int ans[N];
int dfn;
void dfs(int x,int f,int c)
{
for(auto [v,id]:g[x])
{
if(v==f)
c... | C++ | b75ec87dcc25fdd04c3388a0051b8719 | 4648e49c3d31529425298426cbbf63ba | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
signed main(){
int t;
cin >> t;
for (int i = 0; i < t; i++){
int p;
cin >> p;
int n = 1 << p;
vector<vector<pair<int, int>>> E(n);
for (int j = 0; j < n - 1; j++){
int u, v;
cin >> u >> v;
u--;
v--;
... | C++ | b75ec87dcc25fdd04c3388a0051b8719 | a8d863b0c1aecf601115b9e763a83dfb | 2,200 | PASSED |
#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
int t,n,ans[1000001][2],cnt;
vector<pair<int,int> > v[1000001];
inline int read()
{
int x=0;
char c=getchar();
while(c<'0'||c>'9')
c=getchar();
while(c>='0'&&c<='9')
{
x=(x<<1)+(x<<3)+(c^48);
... | C++ | b75ec87dcc25fdd04c3388a0051b8719 | da682b49058e30e3e00bd973a7d1ed49 | 2,200 | PASSED |
#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
int t,n,ans[1000001][2],cnt;
vector<pair<int,int> > v[1000001];
inline int read()
{
int x=0;
char c=getchar();
while(c<'0'||c>'9')
c=getchar();
while(c>='0'&&c<='9')
{
x=(x<<1)+(x<<3)+(c^48);
... | C++ | b75ec87dcc25fdd04c3388a0051b8719 | 3fe7d462fcb743ecb201ee269f823088 | 2,200 | PASSED |
//#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include ... | C++ | b75ec87dcc25fdd04c3388a0051b8719 | b1effcfadac8097685e25b61284478da | 2,200 | PASSED |
/* Priyansh Agarwal*/
#pragma GCC optimize("O3,unroll-loops")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#de... | C++ | b75ec87dcc25fdd04c3388a0051b8719 | 0913362ad6e565d5d914b85780ca1d0f | 2,200 | PASSED |
#pragma GCC optimize("Ofast")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#define rsrt(v) sort(v.begin(), v.end(), greater<int>())
#define srt(v) sort(v.begin(),v.end())
#define all(x) (x).begin(),(x).end()
#define ll long long
#define int long long
ll md = 1000000007;
int inf = 1e18;
u... | C++ | b75ec87dcc25fdd04c3388a0051b8719 | 1f15f3b6c62ef4e827d8292d936d3ecd | 2,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define FASTIO \
ios::sync_with_stdio(0); \
cin.tie(0)
#define ll long long
const ll mod =1e9+7;
bool sortbysec(const pair<int,int> &a,
const pair<int,int> &b)
{
return (a.second < b.second);
}
// sort(vect.begin(), vect.end(), sort... | C++ | d4f4d6341f52cceb862faa89e85a42a3 | 18c69816bf2b686473f472ba1b84c54c | 900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6;
int main()
{
int t, n;
cin >> t;
while(t --){
cin >> n;
if(!(n % 2)){
cout << n - 3 << ' ' << 2 << ' ' << 1 << '\n';
continue;
}
if(!(((n - 1) / 2) % 2)){
... | C++ | d4f4d6341f52cceb862faa89e85a42a3 | eab2516c308d7b9fc29fc5056f47263c | 900 | PASSED |
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int t;
scanf("%d", &t);
for (int i = 0; i < t; i++)
{
int n,a,b,c;
c = 1;
scanf("%d", &n);
if ((n - 1) % 2 == 1)
{
a = (n - 1) / 2;
}
else if((n-1)/2%2 == 0)
{
a = (n - 1) / 2 - 1;
}
el... | C++ | d4f4d6341f52cceb862faa89e85a42a3 | d35aca812740ed1ba06e633533e8ebce | 900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
n -= 1;
int a = 0, b = 0;
if (n % 2 == 0) {
a = b = n / 2;
a--, b++;
if (a % 2 == 0) {
a--, b++;
}
}
else {
a = b = n / 2;
b++;
}
cout << a << ' ' << b << ' ' << '1' << ... | C++ | d4f4d6341f52cceb862faa89e85a42a3 | 37e84ac6b9087f9fef3803f7e75b32c6 | 900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ff first
#define ss second
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int i, j;
for ( i = 2,j=n-3; i<j; ++i,j--)
{
if(__gcd(i,j)==1)
break;
}
std::vect... | C++ | d4f4d6341f52cceb862faa89e85a42a3 | 2befcdaa10f4dec94a6b72f1c63ca611 | 900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll t; cin>>t;
while (t--) {
ll n; cin>>n;
if (n%2==0)
cout<<n/2<<" "<<(n/2)-1<<" "<<1<<endl;
else if ((n/2)%2==0)
cout<<1+n/2<<" "<<-1+n/2<<" "<<1<<endl;
else
... | C++ | d4f4d6341f52cceb862faa89e85a42a3 | 9e25f24b7e397fe306365362163ee54e | 900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define nline "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define ff first
#define ss second
#define repv(i,m) for(auto (i) = (m).begin();(i) != (m).end();(i)++)
#define FileIO fre... | C++ | d4f4d6341f52cceb862faa89e85a42a3 | 51bd48f63cb0da3646649a7c42bb7ae5 | 900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
int a, b, c;
if (n % 2 == 0) {
a = n / 2;
b = a - 1;
c = 1;
}
else {
c = 1;
n = n - 1;
if (n % 4 == 0) {
b = (n - 2) / 2;
a = b + 2;
}
else {
b = (n / 2) - 2;
... | C++ | d4f4d6341f52cceb862faa89e85a42a3 | 42cab7b3da6012ebaf0a470b2eb9fda3 | 900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
void solve(){
int n;
cin >>n;
if (n % 2 == 0){
printf("%d %d %d\n", n / 2, n / 2 - 1, 1);
}
else {
int h = (n - 1) / 2;
if (h % 2 == 0){
printf("%d %d %d\n", h + 1, h - 1, 1);
... | C++ | d4f4d6341f52cceb862faa89e85a42a3 | 9b5fd98c0d3d043dafb4682bab41453a | 900 | PASSED |
#include <iostream>
#include <vector>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <unordered_map>
//#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
int main() {
ll cases, nu... | C++ | d4f4d6341f52cceb862faa89e85a42a3 | b10f88a761cfae53db5cc78718feab92 | 900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
inline int read(){
int X=0,w=0; char ch=0;
while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
return w?-X:X;
}
inline void write(int x){
if(x<0) putchar('-'),x=-x;
if(x>9) write(x/10);
p... | C++ | 85ad953161bb8841eed7c47a66381688 | 84420fcc533d3e7d5095e587451ae5ba | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
inline int read(){
int X=0,w=0; char ch=0;
while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
return w?-X:X;
}
inline void write(int x){
if(x<0) putchar('-'),x=-x;
if(x>9) write(x/10);
p... | C++ | 85ad953161bb8841eed7c47a66381688 | e068472720f3ed6efd80e5f3bc2dbe39 | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int a[N],b[N];
int main()
{
int t;
cin >> t;
while ( t -- )
{
int n, k = 0, l =0, r = 0, ans = 0;
cin >> n;
for (int i = 1; i <= n; i ++)
{
cin >> a[i];
}
sort(a + 1, a + 1 + n);
for(int i=n;i>=1;i--)... | C++ | 85ad953161bb8841eed7c47a66381688 | 82b7cfc7afb81a8ed20764d7ed8e51c0 | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int a[N],b[N];
int main()
{
int t;
cin >> t;
while ( t -- )
{
int n, k = 0, l =0, r = 0, ans = 0;
cin >> n;
for (int i = 1; i <= n; i ++)
{
cin >> a[i];
}
sort(a + 1, a + 1 + n);
for(int i=n;i>=1;i--)... | C++ | 85ad953161bb8841eed7c47a66381688 | 578d6ab977d5fef6c606dac670d968c8 | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int a[N],b[N];
int main()
{
int t;
cin >> t;
while ( t -- )
{
int n, k = 0, l =0, fl = 0, ans = 0;
cin >> n;
for (int i = 1; i <= n; i ++)
{
cin >> a[i];
}
sort(a + 1, a + 1 + n);
for(int i=n;i>=1;i... | C++ | 85ad953161bb8841eed7c47a66381688 | 3cab081dd8a339b732b6c5424e91b3fb | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
inline int read(){
int X=0,w=0; char ch=0;
while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
return w?-X:X;
}
inline void write(int x){
if(x<0) putchar('-'),x=-x;
if(x>9) write(x/10);
p... | C++ | 85ad953161bb8841eed7c47a66381688 | c38f39638da2595f0f1f552c31b5b380 | 1,300 | PASSED |
#include<bits/stdc++.h>
using namespace std;
inline int read(){
int X=0,w=0; char ch=0;
while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
return w?-X:X;
}
inline void write(int x){
if(x<0) putchar('-'),x=-x;
if(x>9) write(x/10);
p... | C++ | 85ad953161bb8841eed7c47a66381688 | f9309dd2101eef62e65771a467535932 | 1,300 | PASSED |
// Problem: C. Paprika and Permutation
// Contest: Codeforces - Codeforces Round #761 (Div. 2)
// URL: https://codeforces.com/problemset/problem/1617/C
// Memory Limit: 256 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h>
using namespace std;
#define ll lon... | C++ | 85ad953161bb8841eed7c47a66381688 | 8fc5c064ab4f5a63437ee158495c0848 | 1,300 | PASSED |
// Problem: C. Paprika and Permutation
// Contest: Codeforces - Codeforces Round #761 (Div. 2)
// URL: https://codeforces.com/problemset/problem/1617/C
// Memory Limit: 256 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h>
using namespace std;
#define ll lon... | C++ | 85ad953161bb8841eed7c47a66381688 | b88c25833c84c5c76d3a99ff0218a283 | 1,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pb push_back
#define ll long long
#define pii pair < int , int >
const long double E = 2.71828182845904523536;
const long double pi = acos(-1);
const double eps = 1e-9;
const int N=1e5+1000;
int t,n,x;
bool ch[N];
vector... | C++ | 85ad953161bb8841eed7c47a66381688 | 054afc9e0d861ac8b1729e2721480d63 | 1,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int t;
cin>>t;
while(t--){
string s,t;
cin>>s>>t;
sort(s.begin(),s.end());
char temp;
if(t=="abc" && s[0]=='a'){
for(int i=0;i<=s.size();i++){
if(s[i]=='b'){
... | C++ | 419ef3579fe142c295ec4d89ee7becfc | c29505773a8edce517445cea127e40d5 | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int t;
cin>>t;
while(t--){
string s,t;
cin>>s>>t;
sort(s.begin(),s.end());
char temp;
if(t=="abc" && s[0]=='a'){
for(int i=0;i<=s.size();i++){
if(s[i]=='b'){
... | C++ | 419ef3579fe142c295ec4d89ee7becfc | 0889f6a824938b8a4ec3ef9df89c2b3b | 800 | PASSED |
#include <stdio.h>
#include <string.h>
char s[4];
int vis[27];
int main()
{
int _;
scanf("%d", &_);
while (_--)
{
char t[115];
scanf(" %s", t + 1);
scanf(" %s", s + 1);
int len = strlen(t + 1);
for (int i = 1; i <27; i++)
vis[i] = 0;
... | C++ | 419ef3579fe142c295ec4d89ee7becfc | caae3fe410710af6c5e79c4e6a18f13b | 800 | PASSED |
#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
#define fuck 1919810
#define wangxianjun 114514
int main()
{
int T;
cin>>T;
srand(time(0));
while(T--)
{
if(rand()==0)cout<<"error\n";
string s,t;
cin>>s>>t;
if(t!="abc")
{
sort(s.begin(... | C++ | 419ef3579fe142c295ec4d89ee7becfc | 24e5e2ab913b39751ea6f9802df5be5d | 800 | PASSED |
/*
It is code Zhanabergen Abdurroshid :))))
*/
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define m_p make_pair
#define p_b push_back
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define F first
#define S second
#define pre precision
#define n_per next... | C++ | 419ef3579fe142c295ec4d89ee7becfc | 6075ee4ad976e07016e4ee1a4053342e | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t --) {
string s1, t, a = "", b = "", c = "";
cin >> s1 >> t;
sort(s1.begin(), s1.end());
for (int i = 0; i < s1.size(); i ++) {
if (s1[i] == 'a') {
a += 'a';
} else if (s1[i] == 'b') {
b += 'b';
... | C++ | 419ef3579fe142c295ec4d89ee7becfc | 5f38f9913d948772dcfbf5ca87cd9448 | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
void solve()
{
string a,b;
cin >> a >> b;
sort(a.begin(),a.end());
string tmp=b;
sort(tmp.begin(),tmp.end());
if(tmp!=b or a.find("a")==string::npos or a.find("b")==string::npos or a.find("c")==string::npos)
{
cout << a << endl;
return;
... | C++ | 419ef3579fe142c295ec4d89ee7becfc | 6af28632b5a4340cc9ca8853464f413a | 800 | PASSED |
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0);cin.tie(0)
#define endl "\n"
#define int long long
#define fo(i,a,n) for (int i=a;i<=n;i++)
#define ro(i,a,n) for (int i=n;i>=a;i--)
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define fi first
#define se second
#define pb push_back ... | C++ | 419ef3579fe142c295ec4d89ee7becfc | 5a113b73bc6de2b0341ecc5b4c2ede7e | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t; cin >> t;
while (t--)
{
int flag = 0, n = 0, m = 0,p=0;
string z;
cin >> z;
char arr[4];
cin >> arr;
sort(z.begin(), z.end());
for (size_t i = 0; i < z.length(); i++)
{
if (z[i] == arr[0]&&z[i+1]==arr[1])
{
n... | C++ | 419ef3579fe142c295ec4d89ee7becfc | e8f25b79fd3f8131ca8b585d17388abd | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--)
{
string s,t;
cin >> s >> t;
sort(s.begin(),s.end());
int k1 = t.find('a');
int k2 = t.find('b');
int k3 = t.find('c');
int p1,p2,p3;
p1 = s.find('a');
... | C++ | 419ef3579fe142c295ec4d89ee7becfc | a103acb3c9d3a2c4c1bf7bb9db1242b0 | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
void solve() {
int N;
cin >> N;
int res[N];
for(int i=0; i<N; i++) {
cout << "? " << i + 1 << " " << (i+1) % N + 1 << " " << (i+2) % N + 1 << endl;
cin >> res[i];
}
vector<int> imp;
for(int i=0; i<N; i++) {
if... | C++ | 6eac9c487764b9314b1a107720176f30 | abefdcf000d35a12001f8b9081683506 | 1,800 | PASSED |
#include <bits/stdc++.h>
#define ld long double
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define no cout<<"NO\n";
#define yes cout<<"YES\n";
#define nl cout<<"\n";
#define sp <<" "
#define lb lower_bound
#define ub upper_bound
#define ull unsigned lo... | C++ | 6eac9c487764b9314b1a107720176f30 | 91a1384054d35a960811171ff99babd5 | 1,800 | PASSED |
// @author: Harsh_Chugh
#include<bits/stdc++.h>
#include<iostream>
#include<cstring>
#include<unordered_map>
#include<map>
#include<set>
#include<queue>
#include<unordered_set>
#include<algorithm>
#include<math.h>
#include<vector>
#include<climits>
#include<string>
#include<stack>
// #define endl '\n'
/... | C++ | 6eac9c487764b9314b1a107720176f30 | 5bd72560c7cd8904382a4cf16d6a1372 | 1,800 | PASSED |
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <random>
#include <iomanip>
#include <deque>
#include <iterator>
#include <queue>
#include <list>
#include <unordered_map>
using namespace std;
using ll = l... | C++ | 6eac9c487764b9314b1a107720176f30 | d9b0fa7e7fab3355579bdd0391191ce3 | 1,800 | PASSED |
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
//randoms
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long
#define trace(x) cout << #x << " = " << (x) << endl;
#define all(x) x.begin(), (x).end()
#define rall(x) x.rbegin(), (x).rend()
#def... | C++ | 6eac9c487764b9314b1a107720176f30 | ec3b3964c75c8db82cef3431806f95f6 | 1,800 | PASSED |
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
//randoms
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long
#define trace(x) cout << #x << " = " << (x) << endl;
#define all(x) x.begin(), (x).end()
#define rall(x) x.rbegin(), (x).rend()
#def... | C++ | 6eac9c487764b9314b1a107720176f30 | d821cb55906f3abbb15e32a482de7363 | 1,800 | PASSED |
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
//randoms
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long
#define trace(x) cout << #x << " = " << (x) << endl;
#define all(x) x.begin(), (x).end()
#define rall(x) x.rbegin(), (x).rend()
#def... | C++ | 6eac9c487764b9314b1a107720176f30 | e1aed3a50aa8544fe92cf626e13ed7c2 | 1,800 | PASSED |
#pragma GCC optimization ("O3")
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
// #define endl '\n'
const ll N = 2e5 + 7;
const ll M = 1e9 + 7;
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
... | C++ | 6eac9c487764b9314b1a107720176f30 | 188bb7d01bcf3f73179a979d9bbc9aa1 | 1,800 | PASSED |
///LW M4 ACC HAZ3L GAMED
///YARAB WALA...I MEAN YARAB ACC
#include<bits/stdc++.h>
#define ll long long
//#define endl "\n"
const ll mod = (ll) 1e9 + 7;
const ll oo = (ll) 1e18;
using namespace std;
vector<vector<ll>>pos;
ll a=-1,b=-1,c,d,e,f,g,h,k,l,m,o,p,q;
vector<ll>ch(6);
bool nvalid(ll s, ll a)
{
i... | C++ | 6eac9c487764b9314b1a107720176f30 | 6df1252c052a5b2d5e845e71d464a8cf | 1,800 | PASSED |
///LW M4 ACC HAZ3L GAMED
///YARAB WALA...I MEAN YARAB ACC
#include<bits/stdc++.h>
#define ll long long
//#define endl "\n"
const ll mod = (ll) 1e9 + 7;
const ll oo = (ll) 1e18;
using namespace std;
vector<vector<ll>>pos;
ll a=-1,b=-1,c,d,e,f,g,h,k,l,m,o,p,q;
vector<ll>ch(6);
bool nvalid(ll s, ll a)
{
i... | C++ | 6eac9c487764b9314b1a107720176f30 | 64c193e95e3b9323d3688ade7b752a81 | 1,800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int n,cnt,a[200005];
vector<int>g[6000006];
map<int,int>id;
int get(int x) {
for(int i=0; 1; i++) {
if((1<<i)>=x)return (1<<i)-x;
}
}
int find(int x) {
if(x==0)return 0;
if(!id[x]) {
id[x]=++cnt;
int fa=find(get(x));
g[fa].push_back(id[x]);
}
r... | C++ | f3ed9a3d4566cdb04cdc26be51027d44 | bd2867ee0a0371825aeb92d05512b513 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int n,a[200005];
int b[200005][35];
unordered_map<int,pair<int,int>>m[35];
int count(int x) {
int cnt=0;
while(x) {
cnt++;
x-=(x&-x);
}
return cnt;
}
int main() {
scanf("%d",&n);
for(int i=1; i<=n; i++) {
scanf("%d",&a[i]);
int x=a[i],c=2;
f... | C++ | f3ed9a3d4566cdb04cdc26be51027d44 | 889c6330232ea527c7e4185657ea6b67 | 2,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
typedef int ll;
typedef long double ld;
#define benq queue
#define pbenq priority_queue
#define all(x) x.begin(), x.end()
#define sz(x) (ll)x.size()
#define ... | C++ | f3ed9a3d4566cdb04cdc26be51027d44 | 18cf6732872ef1accbf355d790bc148b | 2,700 | PASSED |
// Problem: E. Christmas Chocolates
// Contest: Codeforces Round #761 (Div. 2)
// URL: https://codeforces.com/contest/1617/problem/E
// Memory Limit: 512 MB
// Time Limit: 4000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
// #includ... | C++ | f3ed9a3d4566cdb04cdc26be51027d44 | c6d318326f1277f066d2c75f3e4ec472 | 2,700 | PASSED |
// Problem: E. Christmas Chocolates
// Contest: Codeforces Round #761 (Div. 2)
// URL: https://codeforces.com/contest/1617/problem/E
// Memory Limit: 512 MB
// Time Limit: 4000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
// #includ... | C++ | f3ed9a3d4566cdb04cdc26be51027d44 | 086d885e9c1b204c48ef35856fa3d6b6 | 2,700 | PASSED |
#include <iostream>
#include <cstdio>
#include <map>
using namespace std;
const int N = 200010;
int n, a[N], pos[N * 30], val[N * 30], head[N * 30], ver[N * 60], nex[N * 60], dis[N * 30], tot, cnt, s, e, ans;
map<int, int> id;
inline void add (int x, int y) {
ver[++ tot] = y;
nex[tot] = head[x];
head[x] = ... | C++ | f3ed9a3d4566cdb04cdc26be51027d44 | 8f3685f8f813a678c17db7b21ff4c92c | 2,700 | PASSED |
#include<cstdio>
#include<map>
#include<algorithm>
#define inf 1e9
#define N 8000001
using namespace std;
int n,c,cc,cnt,ans,ansx,ansy,aa[N],f[N],fw[N],g[N],gw[N],b1[2*N],b2[2*N];
int tot,en[N],ne[N],la[N];
map <int,int>bz;
struct node{int x,y;}a[N];
void add(int x,int y){en[++tot]=y,ne[tot]=la[x],la[x]=tot;}... | C++ | f3ed9a3d4566cdb04cdc26be51027d44 | b9d78a454b65d6c4c1df9be42a310030 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
pair<int,pair<int,int> >ans;
pair<int,int>res[2][2];
int n,a[200003];
int dfs(vector<int>v1,vector<int>v2,int dep,int suf){
int A=((1<<dep)-suf)%(1<<dep),B=suf;
vector<int>v;
for(int i=0,j=0;i<v1.size()||j<v2.size();)
if(i==v1.size())
v.push_back(v2[j++]);
... | C++ | f3ed9a3d4566cdb04cdc26be51027d44 | aadf8c6af8ab4e4a89acfe2797e661f8 | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;const int N=2e5+5;int f(int x,int y){auto t=[](int x){return(1<<__lg(x*2-1))-x;};int r=0;while(x!=y)x<y?swap(x,y):void(),x=t(x),++r;return r;}int n,a[N],x,y;int g(int x){int y=1,s=f(x,a[y]);for(int i=2,r;i<=n;++i)if((r=f(x,a[i]))>s)y=i,s=r;return y;}int main(){cin>>n;for(int ... | C++ | f3ed9a3d4566cdb04cdc26be51027d44 | 13ed6d5bf9410037bfa109342260ddac | 2,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
inline int f(int x, int y)
{
const auto &t = [](int x)
{ return (1 << __lg(x * 2 - 1)) - x; };
int ret = 0;
while (x != y)
x < y ? swap(x, y) : void(), x = t(x), ++ret;
return ret;
}
int n, a[N], x, y;
int g(int x)
{
int y = 1, s = f(x, a[y]);... | C++ | f3ed9a3d4566cdb04cdc26be51027d44 | 3c6ebe933f77780bb9fbc1606a5532dc | 2,700 | PASSED |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=1e5+5;
int read(){
int x=0,y=1;
char ch=getchar();
while(ch<48||ch>57){if(ch==45)y=-1;ch=getchar();}
while(ch>=48&&ch<=57)x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
return x*y;
}
int n;
int st[maxn];
int res[maxn];
inline i... | C++ | 98c584b0479eb26d8b0307bd72fc48fd | 76d121f04b0e4d9456c31702fc2aae53 | 2,400 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.