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<iostream>
#define ll long long int
using namespace std;
int main(){
int t=1;
cin>>t;
while (t--){
ll n;
cin>>n;
if (n%2050==0){
ll x = n/2050;
ll sum=(ll)0;
while (x!=0){
sum+=(ll)x%10;
x/=10;
}
... | C++ | f3e413954c9c02520fd25bd2cba4747e | 12d7f5a397782b9085987a2bd86e40f3 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve()
{
ll n;
scanf("%lld", &n);
ll k = n;
ll ans = 0;
for (int i = 15; i >= 0; i--)
{
ll mid = pow(10, i)*2050;
ll sum = k / mid;
k = k - sum * mid;
ans += sum;
}
printf(k != 0 ? "-1\n" : "%lld\n", ans);
}
int main()
{
int T = 1... | C++ | f3e413954c9c02520fd25bd2cba4747e | 7a414e61a4fea8b9a8933dae91d6fca6 | 800 | PASSED |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
int t, ans;
ll n;
cin >> t;
while(t--) {
cin >> n;
if (n % 2050 != 0) ans = -1;
else {
n /= 2050;
ans = 0;
while (n != 0) {
ans += n % 10;
... | C++ | f3e413954c9c02520fd25bd2cba4747e | be46c381a7329114140b2ad38c64297a | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int T;
ll n;
ll p[25];
int main(){
p[1]=2050;
for(int i=2;i<=16;i++){
p[i]=p[i-1]*10;
}
cin>>T;
while(T--){
cin>>n;
int ans=0;
for(int i=16;i>=1;i--){
while(n>=p[i]){
ans++;
n-=p[i];
}
}
if(n) ans=-1;
printf("%d\n",ans);
... | C++ | f3e413954c9c02520fd25bd2cba4747e | 895e2b61961f0f8d37f4cf36fb01d734 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define IO ios::sync_with_stdio(false)
#define bug cout << "-----\n"
typedef long long ll;
int Mod = 1000000007;
ll a[25];
int main() {
int T;
cin >> T;
a[0] = 2050;
for(ll i = 1 ; i <= 14 ; i ++) {
a[i] = a[i - 1] * 10;
}
... | C++ | f3e413954c9c02520fd25bd2cba4747e | a82238192d8fd127391f61ce43d7762a | 800 | PASSED |
/*
*
* Author - GreekGiftSacrifice
*
* */
#include "bits/stdc++.h"
using namespace std;
typedef long long int ll;
ll solve(){
ll n;
cin >> n;
if((n%2050))
{
cout << -1 << endl;
return 0;
}
n/=2050;
ll ans = 0;
while(n){
ans+=n%10;
n/=10;
}
... | C++ | f3e413954c9c02520fd25bd2cba4747e | 1e3fe9d7dcd0095291d753c1511635dd | 800 | 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;
using namespace std;
#define pii pair<int,int>
#define vi vector<int>
#define mii map<int,int>
#define pqs priority_queue... | C++ | f3e413954c9c02520fd25bd2cba4747e | 4e42ae7f8b133c563c99aa8ee82275a0 | 800 | PASSED |
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
int main()
{ int t;
cin>>t;
while(t--)
{ long long int n;
cin>>n;
if(n%2050!=0)
{ cout<<"-1"<<"\n"; }
else
{ n=n/2050;
int sum=0;
int r;
... | C++ | f3e413954c9c02520fd25bd2cba4747e | 7da3ad5ee80deda9d54d51e81f2ba09d | 800 | PASSED |
#include <cassert>
#include <random>
#include <algorithm>
#include <map>
#include <queue>
#include <vector>
#include <bits/stdc++.h>
#include <unordered_set>
#include <set>
#include <cmath>
#include <stack>
#include <array>
#include <limits>
#include <utility>
#include <iomanip>
#include <numeric>
#include <unordered_m... | C++ | f3e413954c9c02520fd25bd2cba4747e | 091f2e8df513abbf08ae6651f4c9464b | 800 | PASSED |
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
using namespace std;
const long long inf = 1e15;
const int maxn = 5e2 + 10;
long long dp[maxn][maxn][15];
int h[maxn][maxn];
int v[maxn][maxn];
int n, m, k;
int main()
{
//cout << dp[50][50][0];
scanf("%d%d%d", &n, &m, &k);
... | C++ | 7b13ee633c81abdcf912542ba1779a45 | 1d3a9b0693ffb4e061d63c664c80f5bc | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
const int INF=1e9;
const int maxn=3e5;
const int mod=1e9+7;
#define ok ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define fi first
#define... | C++ | 7b13ee633c81abdcf912542ba1779a45 | ec9802effdbfda8d1e0a82e55bbffe26 | 1,800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n, m, k;
cin >> n >> m >> k;
if (k % 2 == 1){
for (long long i = 1; i <= n; i++) {
for (long long j = 1; j <= m; j++) {
cout << -1 << " ";
}
cout << endl;
}
return 0;
}
long long dis[n+2][m+2][4];
for (long long i = 0; i... | C++ | 7b13ee633c81abdcf912542ba1779a45 | 9bb7b044e5fa1fce0c270053d554070e | 1,800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define int long long
typedef double dd;
typedef vector<int> vi;
typedef vector<char> vc;
typedef list<int> li;
typedef set<int> si;
typedef ... | C++ | 7b13ee633c81abdcf912542ba1779a45 | 1a20f956cd8d6ea2bf608682297e2362 | 1,800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define N 505
#define inf 1003518617
#define A dp[x][y][k]
#define For(i, j, n) for(int i = j ; i <= n ; ++i)
int n, m, k, a[N][N][4], dp[N][N][21];
inline int read(){
int x = 0, ju = 1;
char ch = getchar();
for( ; ch < '0' || ch > '9' ; ch = getchar()) if(ch == '-') ju... | C++ | 7b13ee633c81abdcf912542ba1779a45 | 65e49ca36d99978bb5e6d4be6f1b40f4 | 1,800 | PASSED |
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#in... | C++ | 7b13ee633c81abdcf912542ba1779a45 | 44451e844b6bcfbc8fe627c950ef5694 | 1,800 | PASSED |
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator... | C++ | 7b13ee633c81abdcf912542ba1779a45 | 0f0c4df0880a552351505c69c2200199 | 1,800 | PASSED |
#include <cstdio>
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <queue>
#include <cmath>
#include <stack>
#include <vector>
typedef long long ll;
using namespace std;
const int mod=1e9+7;
const int maxn=5e2+10;
const ll INF=1e14;
#define MAX1 0x3f3f3f3f
int x[maxn][maxn],y[maxn]... | C++ | 7b13ee633c81abdcf912542ba1779a45 | 3edcc074cada7886e599bb4419917d34 | 1,800 | PASSED |
#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <limits>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#define lowbit(x) ( x&(-x) )
#define pi... | C++ | 7b13ee633c81abdcf912542ba1779a45 | 3ad4dbef6896fd9ac60add11c837c1b3 | 1,800 | PASSED |
#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
int n,m,k;
int mp[550][550];
int a[550][550];
int b[550][550];
int f[550][550][25];
int dfs(int x,int y,int now)
{
if(f[x][y][now]) return f[x][y][now];
if(now<=0) return 0;
int tmp=inf;
if(x+1<=n)
tmp=min(dfs(x+1,y,now-1)+b[x][y],tmp);
if(x-... | C++ | 7b13ee633c81abdcf912542ba1779a45 | 7c999417f8eb10415f55ab8767ff53a1 | 1,800 | PASSED |
#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;
typedef long long ll;
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<vector<int>>
#define ephsilon 1e-9
#define int long long int
#define goes(i)... | C++ | 5e95cb608bca3c3e9fc581b97f0dbc65 | 95b5355fb409c89bfe926e9b4c323fd4 | 1,400 | PASSED |
#include <iostream>
using namespace std;
int m[510][510];
bool v[510][510];
void dfs(int x,int y,int c,int t){
if(c==0) return ;
if(!v[x][y]){
//cout<<x<<" "<<y<<" "<<t<<endl;
m[x][y]=t;
v[x][y]=true;
}
else c++;
if(y==1 || v[x][y-1]) dfs(x+1,y,c-1,t);
else dfs(x,y-1,c-1,t);
}
int main()
{
int n;
cin>... | C++ | 5e95cb608bca3c3e9fc581b97f0dbc65 | 187305ab94e733468801885351dcd944 | 1,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
#define IO ios::sync_with_stdio(false)
#define bug cout << "-----\n"
typedef long long ll;
int Mod = 1000000007;
const int N = 600;
const int M = 500010;
int a[N][N];
int main() {
int x;
int n,i,j,m;
cin >> n;
for(i=1;i<=n;i++) {
cin >> a[i][i];
... | C++ | 5e95cb608bca3c3e9fc581b97f0dbc65 | a6477ff5f43566609dfa82b351f541dc | 1,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N=505;
int a[N][N],p[N];
int main(){
int n;scanf("%d",&n);
for(int i=0;i<n;i++)scanf("%d",p+i);
for(int i=1;i<=n;i++){
int x=i,y=1;
for(int j=0;j<n;j++)if(p[j]>=i)a[x][y]=p[j],x++,y++;
}
for(int i=1;i<=n;i++){
for(int j=1;j<=i;j++)printf("%d ",a[i][j]);
... | C++ | 5e95cb608bca3c3e9fc581b97f0dbc65 | edd97ada21b5568e075ee5d30a75f86c | 1,400 | PASSED |
#ifndef AUTO_UTIL_HEADER_HPP
#define AUTO_UTIL_HEADER_HPP
#include <bits/stdc++.h>
#include <cassert>
using std::cin, std::cout, std::bitset, std::complex;
using std::vector, std::array, std::string, std::pair, std::list, std::queue, std::deque;
using std::priority_queue, std::set, std::map, std::unordered_map;
using... | C++ | 5e95cb608bca3c3e9fc581b97f0dbc65 | e0b2cbb37487b07a87cf669ddc2fde5c | 1,400 | PASSED |
//A :- greedy/simple number theory
//B :- greedy/number theory(think as C level problem after 15 min spent)
//C :- greedy/easy DP/number theory/binary search
//D :- DP/Number Theory/Combinatorics/Graphs(DFS/BFS)
#include<bits/stdc++.h>
using namespace std;
#define show(x) cout<< #x << "= " << x << " \n" ;
#define mod ... | C++ | 5e95cb608bca3c3e9fc581b97f0dbc65 | 1cf8d5d38a189c6b981667c70f09f986 | 1,400 | PASSED |
#include<iostream>
using namespace std;
const int N =550;
int a[N],b[N][N],c[N];
int main()
{
int n;
cin>>n;
long long int sum=0;
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
c[i]=a[i];
sum+=a[i];
}
if(sum!=(n*(2+(n-1)))/2)
{
cout<<"-1"<<en... | C++ | 5e95cb608bca3c3e9fc581b97f0dbc65 | 903eb9282a04d1cd43ee70163623d569 | 1,400 | PASSED |
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
using namespace std;
typedef long long LL;
const int N = 510;
LL arr[N][N];
LL brr[N][N];
LL n;
void dfs(LL x,LL y,LL k){
if(brr[k][k]<=1)return;
if(y-1>=1&&!arr[x][y-1]){
arr[x][y-1]=arr[k][k];
brr[k][k]--;
... | C++ | 5e95cb608bca3c3e9fc581b97f0dbc65 | be027b236925298c9c2f148c9eaeed5f | 1,400 | PASSED |
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<stack>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef double db;
const int M=1010;
const int N=2e6+10;
int inf=0x3f3f3f3f;
int a[M],b[M],c[N];
int mp[M][M];
int main(... | C++ | 5e95cb608bca3c3e9fc581b97f0dbc65 | 90042da5d815ad2ed57010a0c1915d43 | 1,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
int32_t main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n; cin >> n;
vector<vector<int>> vec(n, vector<int>(n, 0));
for(int i = 0; i < n; i ++)
cin >> vec[i][i];
function<bool(int, int)> valid = [&] (int ... | C++ | 5e95cb608bca3c3e9fc581b97f0dbc65 | e3b566322552390d171382b86db16cc8 | 1,400 | PASSED |
/*
Author :- Tanay Kulkarni
Date :- 24-4-2021
Time :- 20:26:46.940325
Name :- solve.cpp
*/
#include<bits/stdc++.h>
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) ... | C++ | a9021fed22299e90aaef50c4d0d9f5b2 | 7bb115058d23c1359fa483547b3adb15 | 1,200 | PASSED |
/*
Author :- Tanay Kulkarni
Date :- 24-4-2021
Time :- 12:44:24.590582
Name :- solve.cpp
*/
#include<bits/stdc++.h>
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsig... | C++ | a9021fed22299e90aaef50c4d0d9f5b2 | bfff8a414fc47b7b27a14b698b9defc8 | 1,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3F3F3F3F;
const int N = 100 + 1;
int b[N][N], ans[N][N], l[N], r[N];
int main()
{
int t, n, m;
scanf("%d", &t);
while (t--) {
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++)
... | C++ | a9021fed22299e90aaef50c4d0d9f5b2 | 881cb61a9178709e66e2d1f9c4aeac2b | 1,200 | PASSED |
/**************************************************************************************
* Poet : *
| Arnab048 ... | C++ | a9021fed22299e90aaef50c4d0d9f5b2 | 33462c901b2cc4dfc4260f4d82739bab | 1,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, a, b) for (auto i = (a); i < (b); ++i)
#define per(i, a, b) for (auto i = (b); i-- > (a); )
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
void init() {
ios_base::sync_with_stdio(fal... | C++ | a9021fed22299e90aaef50c4d0d9f5b2 | bb8c37cf9f9f158e41027b74db926e24 | 1,200 | PASSED |
#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;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.ti... | C++ | a9021fed22299e90aaef50c4d0d9f5b2 | a0b0598dd064f5906f9bac9a3c28b8fc | 1,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define mod 1000000007
#define pi (3.141592653589)
#define ii pair<int, int>
#define ci pair<char, int>
#define ic pair<int, char>
#define vii vector<ii>
#define vic vector<ic>
#define vci vector<ci>
#define vi vector<int>
#define vc vector<char>... | C++ | a9021fed22299e90aaef50c4d0d9f5b2 | 99d0816110918baaa271db9f691e10eb | 1,200 | PASSED |
#include<iostream>
#include<algorithm>
#include<cstring>
#include<memory.h>
using namespace std ;
#define bug(a) cout << "*" << a << endl ;
typedef long long ll ;
const int N = 105 ;
ll v[N][N] , b[N][N] , a[N][N] ;
bool vis[N][N] ;
int t , n , m,zz ;
struct node
{
int x , y ;
ll z ;
}mi[10005] ;
bool cmp( node... | C++ | a9021fed22299e90aaef50c4d0d9f5b2 | 7a85d9fa68c1af75ac28a0c94780bcba | 1,200 | PASSED |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int a[111][111];
int c[111];
struct node
{
int num;///value
int x,y;///row column
}b[10010];
bool cmp1(node a,node b)
{
return a.num<b.num;
}
bool cmp2(int x,int y)
{
return x>y;
}
int main() {
ll t;
cin>>t;
while(t--) {
int n,m;
cin>>... | C++ | a9021fed22299e90aaef50c4d0d9f5b2 | a4260ea179f16ad3bd12acf83f4e7bf3 | 1,200 | PASSED |
#ifndef AUTO_UTIL_HEADER_HPP
#define AUTO_UTIL_HEADER_HPP
#include <bits/stdc++.h>
#include <cassert>
using std::cin, std::cout, std::bitset, std::complex;
using std::vector, std::array, std::string, std::pair, std::list, std::queue, std::deque;
using std::priority_queue, std::set, std::map, std::unordered_map;
using... | C++ | a9021fed22299e90aaef50c4d0d9f5b2 | e8a54ec8decb80f8f88af44b7b14ea1a | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define int long long
using ll=long long;
const int N=2e4,M=2e6;
const ll inf=1e16;
int dx[5]={1,0,-1,0,1},dy[5]={0,1,0,-1,0};
int Dx[4]={-1,1,1,-1},Dy[4]={-1,-1,1,1};
int hea[N],cur[N],nxt[M],to[M],d[N],q[N],S,T,tot=1;
ll w[M];
void ins(int a,int b,ll c) {
nxt[+... | C++ | 1777c06783ecd795f855a4e9811da4b2 | a799b38dc15b06d0cbe803c955e8867b | 3,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long i64;
typedef pair <int, int> pii;
const int N = 2505;
const i64 inf = 1e18;
int n, p[N], q[N], val[N], cnt = 1, h[N], s, t;
map <pii, int> id;
i64 ans;
struct Edge {
int to, next;
i64 w;
} e[N*N<<1];
void add_(int u, int v,... | C++ | 1777c06783ecd795f855a4e9811da4b2 | d1b6ba375fb0b3257c6a14e4fac1d49e | 3,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define inf 1e18
#define int long long
#define maxn 2005
queue < int > q;
int s, t, cnt = -1;
int dep[maxn], head[maxn], cur[maxn];
struct node { int to, nxt, flow; }E[maxn << 4];
void addedge( int u, int v, int w ) {
E[++ cnt] = { v, head[u], w };
head[u] = cnt;
... | C++ | 1777c06783ecd795f855a4e9811da4b2 | e7955d15aaad1f3e265f91110a1ab4c1 | 3,300 | PASSED |
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define inf 1e18
const int maxn = 2005, M = 10005;
struct edge
{
int to, flow, nxt;
} E[maxn << 4];
int cnt = -1, n, m, s, t, maxflow, h[maxn], dep[maxn], cur[maxn];
inline void addedge(int u, int v, int w)
{
E[++cnt] = (edge){v, w, h[u]}... | C++ | 1777c06783ecd795f855a4e9811da4b2 | 036a201d975bd8dbcbf4c4a0601047ff | 3,300 | PASSED |
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define inf 1e18
const int maxn = 2005, M = 10005;
struct edge
{
int v, w, nxt;
} E[M << 1];
int cnt = -1, n, m, s, t, maxflow, h[maxn], dep[maxn], cur[maxn];
inline void addedge(int u, int v, int w)
{
E[++cnt] = (edge){v, w, h[u]}; h[u] ... | C++ | 1777c06783ecd795f855a4e9811da4b2 | 0d3f16365aa4e6456a6db84afa669ff1 | 3,300 | PASSED |
#include <bits/stdc++.h>
#define int long long
#define Get(x) ((x % 2 + 2) % 2)
using namespace std;
const int N = 2005, M = 10005;
struct edge
{
int v, w, nxt;
} e[M << 1];
int cnt = -1, n, m, s, t, maxflow, h[N], lev[N], cur[N];
inline void AddEdge(int u, int v, int w)
{
e[++cnt] = (edge){v, w, h[u]}; h... | C++ | 1777c06783ecd795f855a4e9811da4b2 | 2440432875f624ca9888c05b90cd1db9 | 3,300 | PASSED |
#include <bits/stdc++.h>
#define int long long
#define Get(x) ((x % 2 + 2) % 2)
using namespace std;
const int N = 2005, M = 10005;
struct edge
{
int v, w, nxt;
} e[M << 1];
int cnt = -1, n, m, s, t, maxflow, h[N], lev[N], cur[N];
inline void AddEdge(int u, int v, int w)
{
e[++cnt] = (edge){v, w, h[u]}; h... | C++ | 1777c06783ecd795f855a4e9811da4b2 | 03cd9901fbaadbf78c7815399e2d78a1 | 3,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
struct FlowEdge {
int v, u;
long long cap, flow = 0;
FlowEdge(int v, int u, long long cap) : v(v), u(u), cap(cap) {}
};
struct Dinic {
const long long flow_inf = 1e18;
vector<FlowEdge> edges;
vector<vector<int>> adj;
int n, m = 0;
int s, t... | C++ | 1777c06783ecd795f855a4e9811da4b2 | a89c380d7b0b2ea896cce8999f0ab2e3 | 3,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define INF 10000000000
int n;
long long capacity[2005][2005];
vector<vector<int>> adj;
long long bfs(int s, int t, vector<int>& parent) {
fill(parent.begin(), parent.end(), -1);
parent[s] = -2;
queue<pair<int, long long>> q;
q.push({s, INF});
whil... | C++ | 1777c06783ecd795f855a4e9811da4b2 | 2b2654b460ba5eb221fefa398e354b0d | 3,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define INF 10000000000
tuple<int,int,int> a[1005];
vector<int> b;
int x,y,z,w;
int n;
long long capacity[2005][2005];
vector<vector<int>> adj;
long long bfs(int s, int t, vector<int>& parent) {
fill(parent.begin(), parent.end(), -1);
parent[s] = -2;
queue... | C++ | 1777c06783ecd795f855a4e9811da4b2 | e4a87efdb84c6ff5cb81775b603986bc | 3,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = long double; // or double, if TL is tight
using str = string; // yay python!
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<db,db>;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
... | C++ | e24f1e48cd22271d2c3d6b5bc6eefb6b | 742fcae39b0d0cdf75317907f84e287f | 3,500 | PASSED |
// author: xay5421
// created: Tue Oct 26 21:13:01 2021
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
using namespace std;
int T,n;
struct seg{
int l,r;
seg operator&(const seg&k)const{
return (seg){max(l,k.l),min(r,k.r)};
}
void operator&=(const... | C++ | e24f1e48cd22271d2c3d6b5bc6eefb6b | 38ba847c23e9bcef735fe4340da7278b | 3,500 | PASSED |
// author: xay5421
// created: Tue Oct 26 21:13:01 2021
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
using namespace std;
int T,n;
struct seg{
int l,r;
seg operator&(const seg&k)const{
return (seg){max(l,k.l),min(r,k.r)};
}
void operator&=(const... | C++ | e24f1e48cd22271d2c3d6b5bc6eefb6b | 1dbaa56952a2987f0764969a9d6ce1ca | 3,500 | PASSED |
#include <bits/stdc++.h>
template <typename T> void setmax(T& a, T b) { if (b > a) a = b; }
template <typename T> void setmin(T& a, T b) { if (b < a) a = b; }
template <typename T> struct range_val {T lo, hi;range_val() : lo(), hi( ){}
range_val(T lo_, T hi_) : lo(lo_), hi(hi_) {} friend std::istream& operator >> ... | C++ | e24f1e48cd22271d2c3d6b5bc6eefb6b | 5176b389d5ca87169b52bacd524f8753 | 3,500 | PASSED |
#include <bits/stdc++.h>
template <typename T> void setmax(T& a, T b) { if (b > a) a = b; }
template <typename T> void setmin(T& a, T b) { if (b < a) a = b; }
template <typename T> struct range_val {
T lo, hi;
range_val() : lo(), hi( ){}
range_val(T lo_, T hi_) : lo(lo_), hi(hi_) {}
friend std::istr... | C++ | e24f1e48cd22271d2c3d6b5bc6eefb6b | 0f453becd9d657574e7f09194504bcca | 3,500 | PASSED |
#include <bits/stdc++.h>
template <typename T> void setmax(T& a, T b) { if (b > a) a = b; }
template <typename T> void setmin(T& a, T b) { if (b < a) a = b; }
template <typename T> struct range_val {T lo, hi;range_val() : lo(), hi( ){}
range_val(T lo_, T hi_) : lo(lo_), hi(hi_) {} friend std::istream& operator >> ... | C++ | e24f1e48cd22271d2c3d6b5bc6eefb6b | 395b5ce7c3a692992392641eb9a40d6a | 3,500 | PASSED |
#include <bits/stdc++.h>
template <typename T> void setmax(T& a, T b) { if (b > a) a = b; }
template <typename T> void setmin(T& a, T b) { if (b < a) a = b; }
template <typename T> struct range_val {T lo, hi;range_val() : lo(), hi( ){}
range_val(T lo_, T hi_) : lo(lo_), hi(hi_) {} friend std::istream& operator >> ... | C++ | e24f1e48cd22271d2c3d6b5bc6eefb6b | 5a912c3ac7769283ee875557cb1623c4 | 3,500 | PASSED |
// a modification of ecnerwala's solution
#include <bits/stdc++.h>
template <typename T> void setmax(T& a, T b) { if (b > a) a = b; }
template <typename T> void setmin(T& a, T b) { if (b < a) a = b; }
template <typename T> struct range_val {
T lo, hi;
range_val() : lo(), hi( ){}
range_val(T lo_, T hi_) : lo(lo_), ... | C++ | e24f1e48cd22271d2c3d6b5bc6eefb6b | 9149c18d8a06000841b00aa74e068c20 | 3,500 | PASSED |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = long double; // or double, if TL is tight
using str = string; // yay python!
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using pd = pair<db,db>;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
... | C++ | e24f1e48cd22271d2c3d6b5bc6eefb6b | 1eb26de19a62aeadde5334205df25245 | 3,500 | PASSED |
// author: xay5421
// created: Tue Oct 26 21:13:01 2021
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
using namespace std;
int T,n;
struct seg{
int l,r;
seg operator&(const seg&k)const{
return (seg){max(l,k.l),min(r,k.r)};
}
void oper... | C++ | e24f1e48cd22271d2c3d6b5bc6eefb6b | 24f61d93b63f758ae9b643fb203e77d6 | 3,500 | PASSED |
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#define owo(i,a, b) for(int i=(a);i<(b); ++i)
#define uwu(i,a, b) for(int i=(a)-1; i>=(b); --i)
#define senpai push_back
#define ttgl pair<int, int>
#define ayaya cout<<"ayaya~"<<endl
... | C++ | f117efff3cfb98d4be3bcfa89166b6eb | 86a7c896ec0db41832c2e62ca854e606 | 3,200 | PASSED |
#include "bits/stdc++.h"
using namespace std;
#define endl '\n'
#define debug(x) cerr << #x << " == " << (x) << '\n';
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
ll modpow(ll x, ll p, ll mod) {
ll res... | C++ | f117efff3cfb98d4be3bcfa89166b6eb | 875e615ce528c7b41af37d46b8a42189 | 3,200 | PASSED |
#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define infL (1LL<<60)
#define inf (1<<30)
#define inf9 (1000000000)
#define... | C++ | f117efff3cfb98d4be3bcfa89166b6eb | e2deebc311981cf756aa071aee96cde8 | 3,200 | PASSED |
#include <bits/stdc++.h>
#define rep(i, x, y) for (int i = x; i <= y; i++)
#define per(i, x, y) for (int i = x; i >= y; i--)
#define vi vector<int>
#define pb push_back
#define mkp make_pair
#define fi first
#define se second
#define gc getchar
#define db double
#define bs bitset
#define ll long long
#defin... | C++ | f117efff3cfb98d4be3bcfa89166b6eb | 10234c1ea9774dbe07af9f8f9d86ac63 | 3,200 | PASSED |
/*
author: Maksim1744
created: 09.06.2021 02:49:00
*/
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define sum(a) ( accumulate ((a).begin(), (a).end(), 0ll))
#define mine(a) (*min_... | C++ | f117efff3cfb98d4be3bcfa89166b6eb | 330bd3029176708ed8a0ded8bdc20fdf | 3,200 | PASSED |
/*
author: Maksim1744
created: 09.06.2021 02:49:00
*/
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define sum(a) ( accumulate ((a).begin(), (a).end(), 0ll))
#define mine(a) (*min_... | C++ | f117efff3cfb98d4be3bcfa89166b6eb | 7ee233eafb39bdd934c16253b83e5a67 | 3,200 | PASSED |
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int>... | C++ | f117efff3cfb98d4be3bcfa89166b6eb | 7fee78895aca0a9666da6b3df80cb95d | 3,200 | PASSED |
///In the name of GOD
//#pragma GCC optimize("O2")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MXN = 300 + 10;
const ll Mod = 998244353;
ll power(ll a, ll b){
return (!b ? 1 : power(a * a % Mod, b / 2) * (b & 1LL ? a : 1) % Mod);
}
ll inv(ll x){
return power(x, Mod -... | C++ | f117efff3cfb98d4be3bcfa89166b6eb | aac298fc11ec8434abaf0476adb91213 | 3,200 | PASSED |
///In the name of GOD
//#pragma GCC optimize("O2")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MXN = 300 + 10;
const ll Mod = 998244353;
ll power(ll a, ll b){
return (!b ? 1 : power(a * a % Mod, b / 2) * (b & 1LL ? a : 1) % Mod);
}
ll inv(ll x){
return power(x, Mod -... | C++ | f117efff3cfb98d4be3bcfa89166b6eb | b33060d8ef4349c964b39955109a8465 | 3,200 | PASSED |
/* in the name of Anton */
/*
Compete against Yourself.
Author - Aryan (@aryanc403)
Atcoder library - https://atcoder.github.io/ac-library/production/document_en/
*/
#include <cstdlib>
#ifdef ARYANC403
#include <header.h>
#else
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse... | C++ | f117efff3cfb98d4be3bcfa89166b6eb | 55b5a053ccd6069943ef64557691436b | 3,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n,pd=0;
string s;
cin>>n>>s;
char last=s[0];
string v,ans;
v.push_back(last);
for(int i=1;i<s.size();i++){
if(s[i]!=s[0])pd=1;
if(last>s[i]||(last==s[i]&&pd))v.push_bac... | C++ | dd7faacff9f57635f8e00c2f8f5a4650 | 0f60cefa1de766ecf93e3ffc27f11ff0 | 1,100 | PASSED |
#include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
string s;
cin>>s;
if(s[0]==s[1]){
cout<<s[0]<<s[1]<<'\n';
}else{
char now=s[0];
s[n]='z'+1;
for(int i=0; i<=n; i++){
... | C++ | dd7faacff9f57635f8e00c2f8f5a4650 | 54b9524e1d1b1f5a06ad2a08de5141eb | 1,100 | PASSED |
//#define _CRT_SECURE_NO_WARNINGS 1
//#include<bits/stdc++.h>
#include <iostream>
#include<string>
using namespace std;
int main()
{
int t;
cin>>t;
for(int f=0;f<t;f++)
{
int a[100005],n,sum=0,i;
string s;
cin>>n;
cin>>s;
int temp=1;
for(i=1;i<n;i++)
{
if(s[i-1]>s[i])temp++;
el... | C++ | dd7faacff9f57635f8e00c2f8f5a4650 | 6f1addaf20470e6b1681e4ff586ac88e | 1,100 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int T,n;
string s;
int main(){
cin>>T;
while(T--){
cin>>n>>s;
int k=0;
for(int i=1;i<n;++i){
if(s[i]<s[i-1]||(s[i]==s[i-1]&&i!=1))
k=i;
else
break;
}
for(int i=0;i<=k;++i)
putchar(s[i]);
for(int i=k;i>=0;--i)
putchar(s[i]);
puts("... | C++ | dd7faacff9f57635f8e00c2f8f5a4650 | c40e7c168165b97adb5ac5a6e01ad6a7 | 1,100 | PASSED |
# include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--) {
int n;
cin>>n;
string s;
cin>>s;
if(s[0]==s[1]) {
cout<<s[0]<<s[1]<<'\n';
} else {
char now=s[0];
s[n]='z'+1;
for(int i=0; i<=n; i++) {
if(now>=s[i]) {
now=s[i];
} else... | C++ | dd7faacff9f57635f8e00c2f8f5a4650 | ac7dd1bcaf27b49aaa7e5300280799e8 | 1,100 | PASSED |
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
void find(char s[],long n){
int k=1;
long t;
for(long i=1;i<n;i++){
if(1==k){
if(s[i]>=s[i-1]){
t=i-1;
break;
}
k=0;
}
else{
if(s[i]>s[i-1]){
t=i-1;
break;
}
}
if(i==n-1) t=i;
... | C++ | dd7faacff9f57635f8e00c2f8f5a4650 | a9d8701343ab9ca97602a23e2ced4943 | 1,100 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int a[1000];
int main(){
int t;
cin >> t;
while (t --) {
int n;
cin >> n;
string s;
cin >> s;
int k = 0;
for (int i = 0; i < n - 1; i ++) {
if (s[i] > s[i + 1]) {
k = i + 1;
}
else if (s[i] == s[i + 1] && s[i] < s[0]) {
k =... | C++ | dd7faacff9f57635f8e00c2f8f5a4650 | 683f889124cde793b85a798d18502204 | 1,100 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
for(int i=0;i<t;i++){
int n;
cin>>n;
char str[n];
cin>>str;
if(n==1)cout<<str[0]<<str[0]<<endl;
else{
for(int j=1;j<=n;j++){
if(str[j]>str[j-1]||j==n){
for(int k=0;k<j;k++)cout<<str[k];
for(int k=j-1... | C++ | dd7faacff9f57635f8e00c2f8f5a4650 | fa01f8eea6fc86b408577853a90e2870 | 1,100 | PASSED |
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
int n,i,k;
cin >> n;
while (n--)
{
int m;
cin >> m;
string str;
switch (m)
{
case 0:continue;
case 1:cin >> str; cout << str << str << endl; continue;
}
cin >> str;
char x, y;
x = ... | C++ | dd7faacff9f57635f8e00c2f8f5a4650 | 0595e197561d9455099063cbcaece9b1 | 1,100 | PASSED |
#include<bits/stdc++.h>
using namespace std;
char a[100001];
int main()
{
int t,n;
cin >> t;
for(int k=0; k<t; k++) {
cin >> n;
getchar();
scanf("%s",a);
getchar();
if(strlen(a)==1||(strlen(a)!=1)&&(a[0]==a[1])) {
printf("%c%c\n",a[0],a[0]);
} else {
int len=1;
while((len<n&&a[len]<=a[len-1]) ){... | C++ | dd7faacff9f57635f8e00c2f8f5a4650 | c38c0b2740adcd574c6b827cfa5778ce | 1,100 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define int long long
static struct FastInput {
static constexpr int BUF_SIZE = 1 << 20;
char buf[BUF_SIZE];
size_t chars_read = 0;
size_t buf_pos = 0;
FILE *in = stdin;
char cur = 0;
inline char get_char() {
if (buf_pos >= ... | C++ | 71ee54d8881f20ae4b1d8bb9783948c0 | e97c3960a4c6048374af7d0a78c53638 | 2,200 | PASSED |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll N,Q,st[265000],K,res,tren;
string S,T,S2;
queue<int> sled[130];
void update(int gde,int lg,int dg,int lc,int dc){
if(lg==lc and dg==dc){
st[gde]++;
return;
}
int sred=(lc+dc)/2;
if(dg<=sred){
update(gde*2,lg,dg,lc,sred);
retu... | C++ | 71ee54d8881f20ae4b1d8bb9783948c0 | db2f8691615509c8a473bfdfcf684c34 | 2,200 | PASSED |
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll N,Q,st[1000000],K,res,tren;
string S,T,S2;
queue<int> sled[130];
void update(int gde,int lg,int dg,int lc,int dc){
if(lg==lc and dg==dc){
st[gde]++;
return;
}
int sred=(lc+dc)/2;
if(dg<=sred){
update(gde*2,lg,dg,lc,sred);
ret... | C++ | 71ee54d8881f20ae4b1d8bb9783948c0 | ea941f8712c29b9f5cef79f50012dfda | 2,200 | PASSED |
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include<bits//stdc++.h>
using namespace std;
//using namespace __gnu_pbds;
#define mem(a,x) memset(a,x,sizeof(a))
#define pb(i) push_back(i)
#define mod 1000000007
const long ... | C++ | 71ee54d8881f20ae4b1d8bb9783948c0 | 38a3e6a1eec48837b08350d40ef2053e | 2,200 | 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 ll long long
#define fi first
#define se second
#define endl "\n"
#define debug cout << "Masuk" << endl
#define wii cout << endl; cout << ... | C++ | 71ee54d8881f20ae4b1d8bb9783948c0 | ccf622dda6d0703db0a46ed51114d4e3 | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pb push_back
#define fi first
#define se second
#define bust ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const ll INF = INT_MAX * 10000ll;
const int N = 1e5 + 10;
c... | C++ | 71ee54d8881f20ae4b1d8bb9783948c0 | b48cd12f0cdd6afe9c5ccbd6bb2a72c6 | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pb push_back
#define fi first
#define se second
#define bust ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const ll INF = INT_MAX * 10000ll;
const int N = 1e5 + 10;
c... | C++ | 71ee54d8881f20ae4b1d8bb9783948c0 | cb80b492235978b9d4225878ac1d655a | 2,200 | PASSED |
#include<bits/stdc++.h>
#define int long long
#define ld long double
#define lson rt<<1,l,mid
#define rson rt<<1|1,mid+1,r
using namespace std;
constexpr int MAXN=100100;
int d[MAXN<<2],lazy[MAXN<<2];
void pushup(int rt)
{
d[rt]=d[rt<<1]+d[rt<<1|1];
}
void pushdown(int rt,int l,int r)
{
int mid=(l+r)>>1... | C++ | 71ee54d8881f20ae4b1d8bb9783948c0 | 98653cb28758e9fe151e2aed6eb5acf4 | 2,200 | PASSED |
/* Author - Satwik_Tiwari */
#include<bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c>... | C++ | 71ee54d8881f20ae4b1d8bb9783948c0 | ab07ce48e291b6c8a7a7d017198ede08 | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define debug(x) cerr << (#x) << " " << x << "\n";
#define vi vector<long long>;
#define pi pair<long long,long long>;
const long long MOD = 1e9 + 7;
const long long MAXN = 1e5 + 9;
long long INF = 1e9;
long long s[MAXN*4];
long long f[MAXN*4];
void bu... | C++ | 71ee54d8881f20ae4b1d8bb9783948c0 | 9bcd84d1dfdd30f6c6dd4cc1ff39911a | 2,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
map<int,int>mp;
void solve()
{
int ans=0;
mp.clear();
int n;
cin>>n;
while(n--)
{
int s;
cin>>s;
if(mp[s])
{
s*=(-1);
if(mp[s])
continue;
else
{
mp[s]++;
ans++;
}
}
else
{
mp[s]++;
ans++;
}
}
cout<<ans<<endl;
}
int ... | C++ | 23ef311011b381d0ca2e84bc861f0a31 | c4c408fd1adaeeb34c0433cf45f9b470 | 800 | PASSED |
#include <bits/stdc++.h>
#define ll long long
#define str string
#define sc set<char>
#define si set<int>
#define vi vector<int>
#define pb push_back
#define all(x) x.begin(), x.end()
#define kick(x) cout << x << "\n"
#define loop(i, a, b) for (int i = a; i < b; i++)
#define loope(i, a, b) for (int i = a; i <= b; i++)
... | C++ | 23ef311011b381d0ca2e84bc861f0a31 | b48382cc12b63f7dbea78ea0e76003f9 | 800 | PASSED |
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
using namespace std;
int main()
{
int t;
string s;
cin >> t;
while (t--)
{
int ans = 0, n, x;
cin >> n;
map<int, int> a;
while (n--)
{
ci... | C++ | 23ef311011b381d0ca2e84bc861f0a31 | c809013d576baf7d87ce28c3914ee6cc | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,t,total = 0,p;
cin>>t;
while(t--)
{
cin>>n;
int ch[n];
int i,a[100];
for(i = 0 ; i <= 100 ; i++) a[i] = 0;
for(i = 0 ; i < n ; i++)
{
cin>>ch[i];
p = abs(ch[i] );
... | C++ | 23ef311011b381d0ca2e84bc861f0a31 | c8420fa309db3f7d637bdc708912a74a | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
set<int> s;
int n;
cin >> n;
for(int i=0; i<n; i++){
int x;
cin >> x;
if(s.count(x)) s.insert(x*-1);
else s.insert(x);
}
... | C++ | 23ef311011b381d0ca2e84bc861f0a31 | 51aacc60b3426b07c5a0efcc1f120ed3 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--) {
set<int>m;
int size;
cin >> size;
int arr[size];
for (int i = 0; i < size; ++i) {
cin>>arr[i];
if(m.count(arr[i])==0){
m.insert(arr[i]);
... | C++ | 23ef311011b381d0ca2e84bc861f0a31 | e427a2bf43e1af118454c13981805b47 | 800 | PASSED |
#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
const int N = 1007;
int a[N];
int b[N];
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
int ans = 0;
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
for (int i = 0; i < n; i++)
{
cin >> a[i];
b[abs... | C++ | 23ef311011b381d0ca2e84bc861f0a31 | 802a8bc9677d32dfb626894f3d6a8e11 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
map<int,int> a;
for(int i=0;i<n;i++)
{
int b;
cin>>b;
if(a[b]==1)
{
a[-b]=1;
}else{
a[b]=1;
}
}
cout<<a.size()<<endl;
}
}
| C++ | 23ef311011b381d0ca2e84bc861f0a31 | 14b64d6c425bde1a04d2f8357907da4c | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int p;
cin >> p;
while(p--){
int n;
cin >> n;
vector<int> a(n);
set<int> s;
int w= 0;
for(int i = 0; i < n; i++){
cin >> a[i];
if(a[i] == 0)w++;
}
sort(a.begin(), a.en... | C++ | 23ef311011b381d0ca2e84bc861f0a31 | 11171bd5e31534406fa40849a3e0b52a | 800 | PASSED |
#include <iostream>
#include <map>
using namespace std;
int main()
{
int t, n, a;
cin>>t;
while (t--)
{
map<int, int> m;
int cnt = 0;
cin>>n;
for (int i = 1; i <= n; i++)
{
cin>>a;
if (m[a])
{
if (m[-a]);
else... | C++ | 23ef311011b381d0ca2e84bc861f0a31 | 413eabee59b65822c47585602edcba4e | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
long long n;
cin>>n;
int r=0;
int c=2;
double a[n+3];
for(int i=0; i<n; i++)
cin>>a[i];
if(n<=2)
{
cout<<0<<endl;... | C++ | 6aca8c549822adbe96a58aee4b0d4b3f | e899a9c8c7c401c22c3ef2292670ef61 | 1,500 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.