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 |
|---|---|---|---|---|---|
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int h = scan.nextInt();
int a = scan.nextInt();
int b = scan.nextInt();
int k = scan.nextInt();
for(int ... | Java | bdce4761496c88a3de00aa863ba7308d | ef9e665c8a9b426891d4a2619fbb16ef | 1,000 | PASSED |
import java.io.*;
public class A3 {
public static void main(String[] args) throws IOException{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String[] s = br.readLine().split(" ");
int n = Integer.parseInt(s[0]);
int h = Integer.parseInt(s[1]);
int ... | Java | bdce4761496c88a3de00aa863ba7308d | 8b76c20285240e4f72d17f93b86e37f5 | 1,000 | PASSED |
//package pack;
import java.util.*;
public class second
{
public static void main(String[] args)
{ Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int h=sc.nextInt();
int a=sc.nextInt();
int b=sc.nextInt();
int k=sc.nextInt();
for(int rep=0;rep<k;rep++)
{
int ta=sc.nextInt();
int fa... | Java | bdce4761496c88a3de00aa863ba7308d | bb283a2e8248772d72384bcd7c62985b | 1,000 | PASSED |
import java.util.Scanner;
public class NewBuildingInSIS {
private int n;
private int h;
private int a;
private int b;
public NewBuildingInSIS(int n,int h,int a, int b){
this.n=n;
this.h=h;
this.a=a;
this.b=b;
}
public static void main(String[] args) {
... | Java | bdce4761496c88a3de00aa863ba7308d | 41219da85ad4b133b7ea2d8b51e948fa | 1,000 | PASSED |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class A1020 {
public static void main(String[] args) throws IOException {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
PrintWriter printWrit... | Java | bdce4761496c88a3de00aa863ba7308d | e1cd629e576612a5b40d32e07d9c396e | 1,000 | PASSED |
import java.util.*;
import java.io.*;
public class programA {
public static void main(String[] args)throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int n = Integer.parseInt(st.nextToken());
int h = Intege... | Java | bdce4761496c88a3de00aa863ba7308d | 89b2f44343888668c241f2eb64bea730 | 1,000 | PASSED |
import java.util.Scanner;
public class ReceiveInput {
public static int abs(int a)
{
return a>=0? a:-a;
}
public static int min(int a,int b)
{
return a>b?b:a;
}
public static void main(String[]args)
{
Scanner input=new Scanner(System.in);
int n=input.nextInt();
... | Java | bdce4761496c88a3de00aa863ba7308d | 7085421e4cabda988f69d139413f3bdc | 1,000 | PASSED |
/*
* Remember a 7.0 student can know more than a 10.0 student.
* Grades don't determine intelligence, they test obedience.
* I Never Give Up.
*/
import java.util.*;
import java.util.Map.Entry;
import java.io.*;
import static java.lang.System.out;
import static java.util.Arrays.*;
import static java.lang.Math.*;
... | Java | bdce4761496c88a3de00aa863ba7308d | 93bcd94c8de4bd808589d52c12f95a00 | 1,000 | PASSED |
import java.util.*;
import java.io.*;
public class building {
public void run() throws Exception {
Scanner file = new Scanner(System.in);
int n = file.nextInt(), h = file.nextInt(), low = file.nextInt(), high = file.nextInt(), k = file.nextInt();
for (int i= 0; i < k; i++) {
long a = file.nextInt(), b = file... | Java | bdce4761496c88a3de00aa863ba7308d | 69bda8a6a28dff3c02c56d8cceb8cb7d | 1,000 | PASSED |
/* به نام خدا */
#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<limits>
#include <list>
#include <stack>
#include<vector>
#include<string>
#include<sstream>
#include<iostream>
#include<algorithm>
#include <cassert>
using namespace std;
# define MEM(arrdoone,w) memse... | C++ | c31fed523230af1f904218b2fe0d663d | 69b350e5259737ec915da0715d48f7db | 1,200 | PASSED |
#include<iostream>
#include<stdlib.h>
using namespace std;
int main()
{
int n,k,j,i,m,p;
long int c=0;
float t;
int a[1001],b[1001];
cin >> n >> k;
for (i=0;i<n;i++)
{
cin >> a[i] >> b[i];
}
for (i=0;i<n-1;i++)
{
for (j=0;j<n-i-1;j++)
{
if (a[j... | C++ | c31fed523230af1f904218b2fe0d663d | a75e9b62c1dd83cad706eeb8b1b1625f | 1,200 | PASSED |
#include<iostream>
#include<algorithm>
#define INF 0x3f3f3f3f
using namespace std;
struct node
{
double l;
double r;
}house[10005];
bool cmp(const node &x,const node &y)
{
return x.l<y.l;
}
int main()
{
int n;
double t;
while(cin>>n>>t)
{
for(int i=1;i<=n;i++)
{
d... | C++ | c31fed523230af1f904218b2fe0d663d | 72c2006d5d2867787c188d8ab658acf3 | 1,200 | PASSED |
#include<iostream>
#include<algorithm>
#define INF 0x3f3f3f3f
using namespace std;
struct node
{
double left;
double right;
}house[10005];
bool cmp(const node &x,const node &y)
{
return x.left<y.left;
}
int main()
{
int n;
double t;
while(cin>>n>>t)
{
for(int i=1;i<=n;i++)
{
... | C++ | c31fed523230af1f904218b2fe0d663d | e450a96e378d4b4e9f3087f252cf344f | 1,200 | PASSED |
#include<iostream>
#include<vector>
#include<algorithm>
int main()
{
unsigned int n, t, x, a;
std::cin >> n >> t;
std::vector<std::pair<int, int>> v;
while (n-- > 0)
{
std::cin >> x >> a;
v.push_back(std::make_pair(x, a));
}
std::sort(v.begin(), v.end());
int p = 2;
for (unsigned int i = 0; i < (v.size() ... | C++ | c31fed523230af1f904218b2fe0d663d | 5b1bbe85e3d7f11360ca3149a06075c9 | 1,200 | PASSED |
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
struct s
{
int x,a;
bool operator<(const s & second)
{
return x < second.x;
}
s(){};
s(int _x, int _a) {x = _x; a = _a;};
};
vector<s> points;
int len;
int n;
void input()
{
cin >> n >>... | C++ | c31fed523230af1f904218b2fe0d663d | 79dd4df44ede24b7d6c07c38e23b57de | 1,200 | PASSED |
#include<iostream>
#include<algorithm>
using namespace std;
struct PH
{
int x,y;
bool operator<(const PH &h)const
{return x<h.x;}
}ph[10000];
int main()
{
int n,t,x,y,i;
scanf("%d%d",&n,&t);
t*=2;
for(i=0;i<n;i++)
{
scanf("%d%d",&x,&y);
x*=2;
ph[i].x=x-y;
... | C++ | c31fed523230af1f904218b2fe0d663d | 28ed41fd2e8bf2f76afcb1498f53c54b | 1,200 | PASSED |
#include <iostream>
using namespace std;
//ifstream cin("input.txt");
//ofstream cout("output.txt");
struct dom
{
float left;
float right;
};
dom a[1000],tmp;
int sum;
int storona, center;
int n,t;
const float E=0.0001F;
int main()
{
cin >> n >> t;
for (int i=0; i<n; i++)
{
cin >> center >> storona;
a[i]... | C++ | c31fed523230af1f904218b2fe0d663d | ded8e4b2066a58b45e14a57091b92c4d | 1,200 | PASSED |
#include <iostream>
#include <vector>
#include <map>
using namespace std;
map<int, double> ville;
int PeterLength;
int Search() {
double length;
int center;
int count = 0;
double t;
map<int, double>::iterator it;
while( cin >> center >> length ) {
ville[center] = length;
}
count = 2;
for( it = ville.beg... | C++ | c31fed523230af1f904218b2fe0d663d | 6ff219638f3efc06d94505be5e4ead27 | 1,200 | PASSED |
#include <iostream>;
using namespace std;
struct house {
int x;
double a;
};
int main () {
int n,t,res=2;
cin >> n >> t;
house*m = new house[n];
for (int i=0; i<n; i++) {
cin >> m[i].x >> m[i].a;
}
for (int i=0; i<n; i++) {
for (int j=0; j<n-1-i; j++) {
if (m[j].x > m[j+1].x) {
house tmp = m[j];
... | C++ | c31fed523230af1f904218b2fe0d663d | 1cb2961ad561dc6a61c3022889341dc6 | 1,200 | PASSED |
#include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <iostream>
#define MAX 310
#define MAXT 100010
using namespace std;
typedef long long int ll;
const ll MOD=1000000007;
int n,q,t,c,d;
int a[MAX];
vector<int> lista[MAX];
vector<int> in[... | C++ | e077e9dd8d82bad597e6ecc51fb744c6 | d85a164a980f88712efea700d15e573a | 2,100 | PASSED |
#include <cstdio>
typedef long long ll;
const ll maxn = 310;
const ll maxd = 110000;
const ll p = 1000000007;
ll a[maxn], ind[maxn], nxt[maxn], b[maxn], sta[maxn], twp[maxn], subs[maxn];
ll dp[maxd];
ll n, q, t, u, v, st, ed, lsta, ltwp;
int main()
{
// freopen("e.in", "r", stdin);
// freopen("e.out", "w", stdout);
sc... | C++ | e077e9dd8d82bad597e6ecc51fb744c6 | 83ab7a44800e88dc0bf54008f58c7229 | 2,100 | PASSED |
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
using namespace std;
struct point
{
set<int> s;
};
point d[305];
int n, q, wart[305], tab[305][305], x, y, a, pocz, kon, k, odw[305], kolejka[100005], tabk[305], nowe[305];
long long dyn[100005], t;
void rob()
{
set<int>::itera... | C++ | e077e9dd8d82bad597e6ecc51fb744c6 | ae67f6991995a78229cfee064993fc00 | 2,100 | PASSED |
#include<iostream>
#include<cmath>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<algorithm>
#define LL long long
using namespace std;
const int INF=0x3f3f3f3f;
const int MOD=1000000007;
const int N=305;
const int M=100005;
in... | C++ | e077e9dd8d82bad597e6ecc51fb744c6 | f85e3b102edd1a7f6a9b5d9c75374ab7 | 2,100 | PASSED |
#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
const int Maxn = 100009, mod = 1e9 + 7, inf = 0x7fffffff;
int a[Maxn];
int dp[Maxn];
int inDeg[309];
bool next[309];
bool map[309][309];
bool vis[309];
int n, q, t;
int main()
{
// freopen("in.txt", "r", stdin);
// f... | C++ | e077e9dd8d82bad597e6ecc51fb744c6 | ae4b34d845e2a03bdb5cfa38cbd68a5f | 2,100 | PASSED |
#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
const int Maxn = 100009, mod = 1e9 + 7, inf = 0x7fffffff;
int a[Maxn];
int dp[Maxn];
int inDeg[309];
bool next[309];
bool map[309][309];
bool vis[309];
int n, q, t;
int main()
{
// freopen("in.txt", "r", stdin);
whi... | C++ | e077e9dd8d82bad597e6ecc51fb744c6 | b091809acea2d21f0a269dc9113d04b5 | 2,100 | PASSED |
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<vector>
#define REP(i,m) for(int i=0;i<m;++i)
#define REPN(i,m,in) for(int i=in;i<m;++i)
#define ALL(t) (t).begin(),(t).end()
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define dump(x) cerr << #x << " =... | C++ | e077e9dd8d82bad597e6ecc51fb744c6 | 2d925bf5b1f316f0597727168e8201e5 | 2,100 | PASSED |
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <cassert>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
#include <iomanip>
#include <f... | C++ | e077e9dd8d82bad597e6ecc51fb744c6 | 8c6bb215637d2f301dd63de131d58644 | 2,100 | PASSED |
#include <cmath>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <ctime>
#include <cassert>
#include <queue>
#include <vector>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
#include <sstream>
#include <numeri... | C++ | e077e9dd8d82bad597e6ecc51fb744c6 | 9c474c5e412803d6f11d19e2d005fc6e | 2,100 | PASSED |
#include <cmath>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <ctime>
#include <cassert>
#include <queue>
#include <vector>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
#include <sstream>
#include <numeri... | C++ | e077e9dd8d82bad597e6ecc51fb744c6 | 53df8e155807b112defbf20b4c976929 | 2,100 | PASSED |
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
namespace zuiyt
{
const int N = 2e5 + 10, M = 2e5 + 10, B = 20, INF = 0x3f3f3f3f;
int n, m;
struct ed
{
int u, v, w, id;
bool in_tree;
bool operator < (const ed &b) const
{
return w < b.w... | C++ | ab9cc058dc8855e93df365ecb06ccfb6 | 3c43afc31bf63329ed74c9b214c22c23 | 2,700 | PASSED |
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
namespace zyt
{
const int N = 2e5 + 10, M = 2e5 + 10, B = 20, INF = 0x3f3f3f3f;
int n, m;
struct ed
{
int u, v, w, id;
bool in_tree;
bool operator < (const ed &b) const
{
return w < b.w; ... | C++ | ab9cc058dc8855e93df365ecb06ccfb6 | ccac17f4679c2baed14229ada607e7e1 | 2,700 | PASSED |
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <ctime>
#include <map>
#include <queue>
#include <cstdlib>
#include <string>
#include <climits>
#include <set>
#include <vector>
#include <complex>
using namespace std;
inline int read(){
int k=0,f=1;char ch=getchar... | C++ | ab9cc058dc8855e93df365ecb06ccfb6 | 52565d6791a5af27f3c124dac1c375cc | 2,700 | PASSED |
#include <iostream>
#include <algorithm>
#include <bitset>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <iomanip>
#include <queue>
#include <utility>
using namespace std;
typedef long long ll;
typedef unsigned long... | C++ | ab9cc058dc8855e93df365ecb06ccfb6 | f42e1471a117a78ca1379a32248c3603 | 2,700 | PASSED |
#include <iostream>
#include <algorithm>
#include <bitset>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <iomanip>
#include <queue>
#include <utility>
using namespace std;
typedef long long ll;
typedef unsigned long... | C++ | ab9cc058dc8855e93df365ecb06ccfb6 | 0e3554c47607f45fc55ba941957cc358 | 2,700 | PASSED |
#include <iostream>
#include <algorithm>
#include <bitset>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <iomanip>
#include <queue>
#include <utility>
using namespace std;
typedef long long ll;
typedef unsigned long... | C++ | ab9cc058dc8855e93df365ecb06ccfb6 | 4effc66e787efc54701a4354cb3d114d | 2,700 | PASSED |
#include <iostream>
#include <algorithm>
#include <bitset>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <iomanip>
#include <queue>
#include <utility>
using namespace std;
typedef long long ll;
typedef unsigned long... | C++ | ab9cc058dc8855e93df365ecb06ccfb6 | 2ab057b2c5350e7b113e19cd1017f8da | 2,700 | PASSED |
#include <iostream>
#include <algorithm>
#include <bitset>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <iomanip>
#include <queue>
#include <utility>
using namespace std;
typedef long long ll;
typedef unsigned long... | C++ | ab9cc058dc8855e93df365ecb06ccfb6 | 07643f36de53c91b26f37444eca2a945 | 2,700 | PASSED |
#include <iostream>
#include <algorithm>
#include <bitset>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <iomanip>
#include <queue>
#include <utility>
using namespace std;
typedef long long ll;
typedef unsigned long... | C++ | ab9cc058dc8855e93df365ecb06ccfb6 | 67308190312c94bf95dce18b50da2d5d | 2,700 | PASSED |
#include <iostream>
#include <algorithm>
#include <bitset>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <iomanip>
#include <queue>
#include <utility>
using namespace std;
typedef long long ll;
typedef unsigned long... | C++ | ab9cc058dc8855e93df365ecb06ccfb6 | 3270d1f91e5b6bf00137e8eaa861bb1b | 2,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e2 + 1;
const int MAXV = 1e9 + 1;
int a[MAXN];
int Count = 0;
int check(int x) {
printf("> %d\n", x);
Count++;
fflush(stdout);
int result;
scanf("%d", &result);
return result;
}
int BinarySearch(int l, int r) {
if(l == r) ret... | C++ | 36619f520ea5a523a94347ffd3dc2c70 | 3fb320370186e5b060dd82b85eff6370 | 2,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 1;
const int MAXV = 1e9 + 1;
int a[MAXN];
int Count = 0;
int check(int x) {
printf("> %d\n", x);
Count++;
fflush(stdout);
int result;
scanf("%d", &result);
return result;
}
int BinarySearch(int l, int r) {
if(l == r) re... | C++ | 36619f520ea5a523a94347ffd3dc2c70 | 5e01eb198818fac2eb3df673969bd6ec | 2,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define mem(a,b) memset(a,b,sizeof(a))
#define per(i,a,b) for(int i=(a);i<=(b);i++)
#define rep(i,a,b) for(int i=(a);i>=(b);i--)
#define pi acos(-1.0)
#define inf 0x3f3f3f3f
typedef long long ll;
template <class T> inline void read(T &x) {
x = ... | C++ | 36619f520ea5a523a94347ffd3dc2c70 | 167e46ce79a85d70621ae20ae58277a2 | 2,200 | PASSED |
#pragma comment(linker, "/stack:247474112")
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define mem(a,b) memset(a,b,sizeof(a))
#define per(i,a,b) for(int i=(a);i<=(b);i++)
#define rep(i,a,b) for(int i=(a);i>=(b);i--)
#define pi acos(-1.0)
#define inf 0x3f3f3f... | C++ | 36619f520ea5a523a94347ffd3dc2c70 | 830828615e26cddd1e939a128795667b | 2,200 | PASSED |
#pragma comment(linker, "/stack:247474112")
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define mem(a,b) memset(a,b,sizeof(a))
#define per(i,a,b) for(int i=(a);i<=(b);i++)
#define rep(i,a,b) for(int i=(a);i>=(b);i--)
#define pi acos(-1.0)
#define inf 0x3f3f3f... | C++ | 36619f520ea5a523a94347ffd3dc2c70 | cc6fead54619fcbc74992e30d05ebd4c | 2,200 | PASSED |
#pragma comment(linker, "/stack:247474112")
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define mem(a,b) memset(a,b,sizeof(a))
#define per(i,a,b) for(int i=(a);i<=(b);i++)
#define rep(i,a,b) for(int i=(a);i>=(b);i--)
#define pi acos(-1.0)
#define inf 0x3f3f3f... | C++ | 36619f520ea5a523a94347ffd3dc2c70 | 5b834c6673ad35b1ccbb95b47e06c842 | 2,200 | PASSED |
#pragma comment(linker, "/stack:247474112")
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define mem(a,b) memset(a,b,sizeof(a))
#define per(i,a,b) for(int i=(a);i<=(b);i++)
#define rep(i,a,b) for(int i=(a);i>=(b);i--)
#define pi acos(-1.0)
#define inf 0x3f3f3f... | C++ | 36619f520ea5a523a94347ffd3dc2c70 | dc629e0be0b17fe540f46b263e7dd51d | 2,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
int main()
{
srand(int(time(0)));
int n;
cin>>n;
int times=60;
int l=0,r=1e9;
bool big;
int ans;
while(l<=r)
{
int t=(l+r)/2;
cout<<"> "<<t<<endl;
times--;
cin>>big;
if(big) l=t+1;
else r=t-1,ans=t;
}
vector<int> arr;
int i=1;
i... | C++ | 36619f520ea5a523a94347ffd3dc2c70 | 6b4183453f82dab5b1af19414d063361 | 2,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define random(a,b) ((a)+rand()%((b)-(a)+1))
stringstream ss;
int main( int argc, char *argv[] )
{
int seed=time(NULL);
if(argc)
{
ss.clear();
ss<<argv[1];
ss>>seed;
}
srand(seed);
int n;
cin>>n;
int times=60;
int l=0,r=1e9;
bool big;
int ans;
while(l<=r)
... | C++ | 36619f520ea5a523a94347ffd3dc2c70 | 94d83b18f1c5c7d632f1262e966f6f35 | 2,200 | PASSED |
#include <iostream>
#include <cstdlib>
#include <math.h>
#include <algorithm>
#include <set>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <cstring>
#include <stack>
#include <time.h>
#include <vector>
using namespace std;
typedef long long ll;
const ll INF = 1e18, MOD = 1e9 + 7;
ll n... | C++ | 36619f520ea5a523a94347ffd3dc2c70 | f96b7108250f95f38f6f14e1c8907f6e | 2,200 | PASSED |
#include <cstdio>
using namespace std;
typedef long long ll;
const ll Inf = 1000000000000ll;
int a, b, n;
int l, t, m;
int main()
{
scanf("%d %d %d", &a, &b, &n);
while (n--) {
scanf("%d %d %d", &l, &t, &m);
ll mult = ll(t) * m;
ll r = l - 1;
ll L = l, R = Inf;
while (L <= R) {
ll M = L + R >> 1ll;
... | C++ | 89c97b6c302bbb51e9d5328c680a7ea7 | f346e1585fdad2509c3e6f5fe1b80f7c | 1,900 | PASSED |
#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
long long n,a,b,l,t,m;
long long solve(long long levo,long long desno){
long long pok=levo;
long long curr1=a+pok*b;
while(desno-levo>1){
long long mid=(desno+levo)/2;
long long temp=a+(mid-1)*b;
long long temp1=... | C++ | 89c97b6c302bbb51e9d5328c680a7ea7 | 396624a1d7c942d2dcd1a4dbae4038a5 | 1,900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
struct FastIO{
FastIO(){
cin.tie(0);
ios::sync_with_stdio(0);
}
}fastio_beet;
//I... | C++ | 89c97b6c302bbb51e9d5328c680a7ea7 | 8f92ecbde8b550e1692cd40b4dd6464d | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#ifdef NeverBeRed
#include "debug.h"
#else
#define debug(...) 9715
#endif
typedef long long ll;
typedef long double ld;
typedef complex<ll> point;
#define F first
#define S second
int main()
{
#ifdef TurnRed
//freopen("a.in", "r", stdin);
//freopen("a.out", "w", s... | C++ | 89c97b6c302bbb51e9d5328c680a7ea7 | bff1ef651ea417c9c11adc519581dd87 | 1,900 | PASSED |
#include<bits/stdc++.h>
#include<stdlib.h>
#include<time.h>
using namespace std;
long long mod=1000000007;
long long INF=1e9;
typedef long long int ll;
#define bitcnt(x) __builtin_popcountll(x)
#define forl(i,a,n) for(long long int i = (a); i < (n); ++i)
#define fori(i,a,n) for(int i = (a); i < (n); ++i)
#define forl... | C++ | 89c97b6c302bbb51e9d5328c680a7ea7 | 8147fa5d04c68918232569da0891695d | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define pb push_back
#define fi first
#define se second
#define mp make_pair
int mo = 1e9 + 7;
void ib(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
LL A,B;
int n;
LL s[2000005];
LL P[2000005];
int main(){
ib();
cin >> A >> B >>... | C++ | 89c97b6c302bbb51e9d5328c680a7ea7 | 489d8c664cbb6e99f7f197e28bf9e7a1 | 1,900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
template<typename A,typename B>inline ... | C++ | 89c97b6c302bbb51e9d5328c680a7ea7 | 27295508b0d170f1275d9d92679ec1be | 1,900 | PASSED |
#pragma comment(linker, "/STACK:10000000000")
#define _CRT_SECURE_NO_WARNINGS
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <math.h>
#include <map>
#include <chrono>
#include <set>
#include <stack>
#include <vector>
#include <time.h>
#include <random>
#include... | C++ | 89c97b6c302bbb51e9d5328c680a7ea7 | 6d57252469085aecbce3fc16ba9d545b | 1,900 | PASSED |
#include <bits/stdc++.h>
#define X first
#define Y second
using namespace std;
typedef long long ll;
typedef pair <int, int> pi;
int main()
{
ll A, B, n;
cin >> A >> B >> n;
ll l, t, m, a0;
for (int i = 0; i < n; i++)
{
cin >> l >> t >> m;
a0 = A + B*(l - 1);
if (a0 > t)... | C++ | 89c97b6c302bbb51e9d5328c680a7ea7 | 8bf3406028aa9b085333881cf30b48e0 | 1,900 | PASSED |
#define others
#ifdef poj
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#endif // poj
#ifdef others
#include <bits/stdc++.h>
#endif // others
//#define file
#define all(x) x.begin(), x.end()
using namespace std;
const double eps = 1e-8... | C++ | 89c97b6c302bbb51e9d5328c680a7ea7 | b443443b39108673bf42397bfbb18ae8 | 1,900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define ii pair<int, int>
int a[2][60][60];
int memo[2][51][51][51][51];
int n;
bool ask(int a, int b, int c, int d){
cout << "? " << a << " " << b << " " << c << " " << d;
cout << endl;
int r; cin >> r;
return r;
}
int dx[3] = {0, 1, 2};
int dy[3] = {2, 1, 0};
int solv... | C++ | 0d37339ba85957f9b6cde4f254457196 | a6f5d35728462989b639c75cd9c27adb | 2,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
const int N = 52, INF = (int)1e9;
struct edge {
int ti, tj;
int c;
};
int n;
int res[N][N];
int vis[N][N];
vector<edge> G[N][N];
int dp[2][N][N][N][N];
void dfs(int vi, int vj, int color) {
vis[vi][vj] = 1;
res[vi][vj] = color;
for(auto e : G[vi][vj]... | C++ | 0d37339ba85957f9b6cde4f254457196 | 8437fb7ab154dce365516203f7159f5f | 2,400 | PASSED |
// Problem : C. Palindromic Paths
// Contest : Codeforces - Codeforces Round #580 (Div. 1)
// URL : https://codeforces.com/contest/1205/problem/C
// Memory Limit : 256 MB
// Time Limit : 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>
using namespace std;
int query(in... | C++ | 0d37339ba85957f9b6cde4f254457196 | 29e3c4c6e8c7b669065c212d8181bde7 | 2,400 | PASSED |
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define LL long long
#define SZ(x) ((int)x.size())
#define ALL(x) (x).begin(), (x).end()
#define MP(x, y) std::make_pair(x, y)
#define DE(x) cout << #x << " = " << x << endl
#define DEBUG(...) fprintf(stderr, __VA_ARGS__... | C++ | 0d37339ba85957f9b6cde4f254457196 | 5b5c9addc9b508093639c98ed4c2dd53 | 2,400 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int n;
int a[100][100];
int ak(int x,int y,int tx,int ty)
{
if(x>tx)
swap(x,tx);
if(y>ty)
swap(y,ty);
printf("? %d %d %d %d\n",x,y,tx,ty);
fflush(stdout);
int c;
scanf("%d",&c);
return c;
}
void ask(int x,int y,int tx,int ty)
{... | C++ | 0d37339ba85957f9b6cde4f254457196 | fb133e26f988180d483c55a12ccd9ffd | 2,400 | PASSED |
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
#define int long long
#define inf 1000000007
#define pa pair<int,int>
#define ll long long
#define pal pair<double,double>
#define ppap pair<pa,int>
#define PI 3.14159265358979323846
#define paa pair<int,char>
#define mp make_... | C++ | 0d37339ba85957f9b6cde4f254457196 | dec93fb2976f1e11b742cd175be621e8 | 2,400 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int N=60;
int n,b[N*2],ans[N][N],tot,dx[6]={0,1,2,0,-1,-2},dy[6]={2,1,0,-2,-1,0},p;bool flag[N][N];
struct node{int x,y;}a[N*2],c[N*N];
bool ask(int x1,int y1,int x2,int y2){
printf("? %d %d %d %d\n",x1,y1,x2,y2);
cout.flush();int ret;
scanf("%d",&ret);
return ret^... | C++ | 0d37339ba85957f9b6cde4f254457196 | f6588efa678dcb6131c8ea43fcdeba94 | 2,400 | PASSED |
#include<bits/stdc++.h>
const int N=55;
int n,a[N][N];
int query(int x1,int y1,int x2,int y2){
printf("? %d %d %d %d\n",x1,y1,x2,y2);
fflush(stdout);
int res;
scanf("%d",&res);
return res;
}
int main(){
scanf("%d",&n);
a[1][1]=1;
a[1][3]=query(1,1,1,3);
a[2][2]=query(1,1,2,2);
a[2][3]=query(1,2,2,3)^1;
... | C++ | 0d37339ba85957f9b6cde4f254457196 | a6909dbec377994f5c8bbc4bf6c737f8 | 2,400 | PASSED |
#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
int n;
int query(int x1, int y1, int x2, int y2)
{
printf("? %d %d %d %d\n", x1 + 1, y1 + 1, x2 + 1, y2 + 1);
fflush(stdout);
int res;
scanf("%d", &res);
if (res == -1) exit(0);
return res ^ 1;
}
const int N = 50;
... | C++ | 0d37339ba85957f9b6cde4f254457196 | 26cfda8e27e131c9daeae840c0d4adf2 | 2,400 | PASSED |
#include<cstdio>
#include<cstring>
#define MAXN 51
using namespace std;
int v[MAXN][MAXN];
int n;
inline int chk(int a){
return a >= 1 && a <= n;
}
inline int chk(int x1,int y1,int x2,int y2){
return chk(x1) && chk(y1) && chk(x2) && chk(y2) && x1 <= x2 && y1 <= y2;
}
inline int act(int x1,int y1,int x2,int y2)... | C++ | 0d37339ba85957f9b6cde4f254457196 | de810a36a11f8cdb3d2a45c4ee5cd4f7 | 2,400 | PASSED |
#include<iostream>
#include<cstdio>
using namespace std;
char s[5*100000+100];
int change;
int main()
{
int n,k;
cin>>n>>k;
cin>>s;
if(k==2)
{
int change1=0,change2=0;
for(int i=0;s[i];i++)
{
if(i%2==0)
{
if(s[i]!='A')
change1++;
}
else
{
if(s[i]!='B')
change1++;
}
if(i... | C++ | 0ecf60ea733eba71ef1cc1e736296d96 | adae85064b831d27870ca91ebd2459a7 | 1,600 | PASSED |
#include<iostream>
#include<cstdio>
using namespace std;
char s[500000+100];
int change;
int main()
{
int n,k;
cin>>n>>k;
cin>>s;
if(k==2)
{
int change1=0,change2=0;
for(int i=0;s[i];i++)
{
if(i%2==0)
{
if(s[i]!='A')
change1++;
}
else
{
if(s[i]!='B')
change1++;
}
if(i%2... | C++ | 0ecf60ea733eba71ef1cc1e736296d96 | 6d1dd487e67724757ef0750909e934b1 | 1,600 | PASSED |
#include<bits/stdc++.h>
#define NN 555555
using namespace std;
char s[NN],cpy[NN];
int main(){
// freopen("in.in","r",stdin);
// freopen("out.out","w",stdout);
int n,k,ans=0;
scanf("%d %d %s",&n,&k,s+1);
for(int i=1;i<=n;i++) cpy[i]=s[i];
if(k==2){
int a=0,b=0;
for(int i=1;i<=n;i++){
if... | C++ | 0ecf60ea733eba71ef1cc1e736296d96 | 79d2fee23c69e731300981dbd2a812ab | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
char s[1000000];
int v[1000000];
int main(){
int n,k;
scanf("%d%d",&n,&k);
scanf("%s",s);
for(int i=1; i<=n; i++) v[i]=s[i-1]-64;
v[n+1]=0;
int ans=0;
if(k==2){
int o=0;
for(int i=1; i<=n; i++){
if(v[i]%2==i%2) {
v[i]=3-v[i];
o++... | C++ | 0ecf60ea733eba71ef1cc1e736296d96 | 2d34aec478cf437d8d01c575bcf68ac3 | 1,600 | PASSED |
#include<bits/stdc++.h>
#define NN 500005
using namespace std;
typedef long long INT;
char str[500005];
void at_middle(char &a,char &b,char &c){
if(a==b) for(int i=65;i<70;i++){
if(i!=a&&i!=c) {b=i;break;}
}
}
void at_end(char &a,char &b){
if(a==b) for(int i='A';i<'C';i++) {
if(i != a) {b = i;b... | C++ | 0ecf60ea733eba71ef1cc1e736296d96 | 3342a84694642c22b88102aa92005411 | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
char s[500010];
char t[500010];
int main (){
int n,k;
scanf("%d %d %s", &n, &k, s+1);
if(k==2){
int sum=0, num=0;
for(int i=1;i<=n;i++){
if(i%2!=0 && s[i]!='A') sum++;
if(i%2==0 && s[i]!='B') sum++;
if(i%2!=0 && s[i]!='B') num++;
... | C++ | 0ecf60ea733eba71ef1cc1e736296d96 | 03d3ab603132e0e136f8f2d6ae701d68 | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
void f(char &a,char &b,char &c){
if(a==b) for(int i=65;i<70;i++){
if(i!=a&&i!=c) {b=i;break;}
}
}
void g(char &a,char &b){
if(a==b) for(int i='A';i<'C';i++) {
if(i != a) {b = i;break;}
}
}
char c[600000];
int main() {
#ifndef ONLINE_JUDGE
... | C++ | 0ecf60ea733eba71ef1cc1e736296d96 | 2e03e2302bc4c537aaf7e445667aef39 | 1,600 | PASSED |
using namespace std;
#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define FORE(i, a, b) for (int i = a; i <= b; i++)
#define FORD(i, a, b) for (int i = a; i >= b; i--)
const int MAXN = 6*1e5;
const int INF = 1e9 + 7;
int n, k, f[MAXN][50];
string s;
int L[500], R[500];
int i;
int main()
... | C++ | 0ecf60ea733eba71ef1cc1e736296d96 | a5e809ef619dda194c381c3043a72f6f | 1,600 | PASSED |
//#pragma comment(linker, "/STACK:16777216")
//#include<iostream>
#include<cstdio>
//#include<cmath>
//#include<algorithm>
#include<vector>
#include<cstring>
#include<string>
//#include<queue>
#define pb push_back
#define NAME "a"
#define fop freopen(NAME ".in", "r", stdin); freopen(NAME ".out", "w", stdout);
const u... | C++ | 0ecf60ea733eba71ef1cc1e736296d96 | 61e3f0506519efa9181c1965ff5169d9 | 1,600 | PASSED |
//Tornike Mandzulashvili
//#pragma comment(linker, "/STACK:16777216")
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#define PI 3.14159265
#define INF 2000000000
#defin... | C++ | 0ecf60ea733eba71ef1cc1e736296d96 | a2bd9bd5a27f0d6de639c8f56a81606c | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, i, j, k, c, m=0, flag=0;
int a[100001];
cin>>n;
for(i=0; i<n; i++)
{
cin>>a[i];
{
if(a[i]>=m&&flag==0)
{
m=a[i];
c=i;
}
else
{
... | C++ | c647e36495fb931ac72702a12c6bfe58 | e1a0d917c732d81adb874927b27745da | 1,200 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x , k=1 , c=0;
cin >>x;
int arr[x];
for(int i=0; i<x; i++)
{
cin>>arr[i];
if(i!=0&&arr[i]>=arr[i-1])
k++;
else if (i!=0&&arr[i]<arr[i-1])
{
k=1;
c++;
}
}
... | C++ | c647e36495fb931ac72702a12c6bfe58 | e696929b037040378bca2fb6f30444b7 | 1,200 | PASSED |
#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<iomanip>
#include<stack>
#include<map>
#include<set>
#include<time.h>
#include<cmath>
#define debug(x) cerr<<#x<<"="<<x<<endl
#define INF 0x7f7f7f7f
using namespace std;
typedef pair<int,int> pii;
typede... | C++ | c647e36495fb931ac72702a12c6bfe58 | 563a9340f667c8759c585ed6247708cb | 1,200 | PASSED |
#include<cstdio>
int a[100010];
int main()
{
int n,p=0;
bool f=1;
scanf("%d",&n);
for(int i=0;i<n;i++) scanf("%d",&a[i]);
for(int i=1;i<n;i++)
{
if(a[i]<a[i-1]) {p=i;break;}
}
// printf("%d\n",p);
for(int i=0;i<n-1;i++) if(a[(i+p)%n]>a[(i+p+1)%n]) {f=0;break;}
if(f==0) printf("-1");
else printf("%d",(n-p... | C++ | c647e36495fb931ac72702a12c6bfe58 | c3801f750b146aeef52cf3891b1e24e9 | 1,200 | PASSED |
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#define N 210000
int a[N],b[N],i,j,n,m,k,l,o,p;
int main()
{
scanf("%d",&n);
for (i=1;i<=n;i++)
{
scanf("%d",&a[i]);
b[i]=a[i];
a[i+n]=a[i];
}
std::sort(b+1,b+n+1);
for (i=n;i>=1;i--)
if (a[i]==b[1]&&a[i-1]!=b[1]... | C++ | c647e36495fb931ac72702a12c6bfe58 | da1eb2cb7c1f0cdb2201ae1ad98f4f09 | 1,200 | PASSED |
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define maxn 1001
#define N 1000005
using namespace std;
int n,a[N],f[N];
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
a[i+n]=a[i];
}
for(int i=1;i<=2*n;i++)
{
if(a[i]>=a[i-1])
{
f[i]=f[i-1]+1;
}
else
{
... | C++ | c647e36495fb931ac72702a12c6bfe58 | 8ec4dbd3424c7d67222da3ea40b36fce | 1,200 | PASSED |
#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<iomanip>
#include<stack>
#include<map>
#include<set>
#include<time.h>
#include<cmath>
#define debug(x) cerr<<#x<<"="<<x<<endl
#define INF 0x7f7f7f7f
using namespace std;
typedef pair<int,int> pii;
typede... | C++ | c647e36495fb931ac72702a12c6bfe58 | 46596e56382ef73df4f07954299011e5 | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int n,a[200002],n2,cnt;
int main(){
scanf("%d",&n);
for(int i=1;i<=n;++i){
scanf("%d",&a[i]);
a[n+i]=a[i];
}
n2=2*n;
//2for(int i=1;i<=n2;++i) printf("%d ",a[i]);
for(int i=1;i<=n2-1;++i){
if(a[i]<=a[i+1]){
++cnt;
}
else{
cnt=0;
}
if(cnt==n-1){... | C++ | c647e36495fb931ac72702a12c6bfe58 | b4ec510b353234b6bc27c1120d476fb5 | 1,200 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
int a[maxn],n;
int main(){
for(int i,j;~scanf("%d",&n);){
for(i=0;i<n;++i)scanf("%d",a+i);
for(i=1;i<n&&a[i-1]<=a[i];++i);
for(
j=n-1;j>0&&a[j]>=a[j-1];--j);
if(i==n&&j==0)puts("0");
else if(i==j&&a[i]<=a[0]&&a[n-1]<=a[0])
printf("%d\n"... | C++ | c647e36495fb931ac72702a12c6bfe58 | 012ef1a16783dd74485c0d5a1042ce0f | 1,200 | PASSED |
#include<stdio.h>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<queue>
#include<cstring>
using namespace std;
const int maxn=100100;
int a[maxn*2];
int n,ans=0x7f7f7f7f;
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;++i)
{
scanf("%d",&a[i]);
a[n+i]=a[i];
}
int tot=0;
for(int i=1;i<=2*n;++i... | C++ | c647e36495fb931ac72702a12c6bfe58 | 20df4a80b6e8c56cfca59cf97849ea8b | 1,200 | PASSED |
t = int(input())
for i in range(t):
canPrintLength = True
summends = []
num = int(input())
if num in range(1,11):
print(1)
print(num)
else:
a = 10
g = str(num)
length = len(g)
while num!=0:
rem = num%a
if rem !=0:
... | Python | cd2519f4a7888b2c292f05c64a9db13a | 52a2313fac7f87cb6696ab7b8e4dc447 | 800 | PASSED |
n = int(input())
for i in range(n):
k=0
num = int(input())
dezm = num//10000
if dezm != 0:
k+=1
unim = num//1000 - dezm * 10
if unim != 0:
k+=1
cen = num//100 - dezm*100 - unim*10
if cen != 0:
k+=1
dez = num//10 - dezm*1000 - unim*100 - cen*10
if dez != 0... | Python | cd2519f4a7888b2c292f05c64a9db13a | 332d0f4d165bad7c27021eb48a628396 | 800 | PASSED |
n = int(input())
for i in range(n):
a = 0
num = int(input())
lista = [0,0,0,0,0]
lista[0] = num%10
if lista[0] != 0:
a += 1
lista[1] = (num//10)%10 *10
if lista[1] != 0:
a += 1
lista[2] = (num//100)%10 *100
if lista[2] != 0:
a += 1
lista[3] = (num//1000)%... | Python | cd2519f4a7888b2c292f05c64a9db13a | 2369a1a5d8bee628cd49ffef84dc3557 | 800 | PASSED |
t=int(input())
for _ in range(t):
n=int(input())
p=10
num=0
l=[]
while n>0:
r=n%p
if r>0:
l.append(r)
num+=1
n-=r
p*=10
else:
p*=10
print(num)
for i in range(len(l)):
print(l[i],end=" ") | Python | cd2519f4a7888b2c292f05c64a9db13a | 54a913ba687a2d1bd15a992a9ef72c95 | 800 | PASSED |
def solution():
n = int(input())
i = 1
result = []
while n > 0 and n >= 10:
if n % 10 != 0:
result.append(str((n % 10) * i))
n //= 10
i *= 10
if n > 0:
result.append(str(n * i))
print(len(result))
print(" ".join(result))
if __name__ == "__main__"... | Python | cd2519f4a7888b2c292f05c64a9db13a | e9856f2a569386df6ba2abeab09a4bf7 | 800 | PASSED |
def create_el(t,lll):
el = t+""
for i in range(lll-1):
el+="0"
return el
n = int(input())
a = list()
for i in range(n):
a.append(input())
for tmp in a:
if len(tmp) == 1:
print("1")
print(tmp)
continue
lll = len(tmp)
t = list()
for i in tmp:
if i... | Python | cd2519f4a7888b2c292f05c64a9db13a | 995cc6f708a0d3a049792c7350693867 | 800 | PASSED |
t = int(input())
for i in range(t):
l = list(input())
l = [int(x) for x in l]
l.reverse()
ans = []
for i in range(0,len(l)):
a = l[i]*(10**(i))
w = 0
for j in l:
if j!=0:
w+=1
if a!=0:
ans.append(a)
print(w)
for i in an... | Python | cd2519f4a7888b2c292f05c64a9db13a | 3535303cc535bdd9c7ec5797f2dcdf0c | 800 | PASSED |
t = int(input())
for _ in range(t):
n = int(input())
ans = []
mul = 1
while n:
n,r = divmod(n,10)
if r:
ans.append(r*mul)
mul *= 10
print(len(ans))
print(*ans) | Python | cd2519f4a7888b2c292f05c64a9db13a | 8f1bb1c780fe6d38138029a67254dd60 | 800 | PASSED |
t=int(input())
for i in range(t):
n=str(input())
a=[]
for i in range(0,len(n)):
if n[i]!='0':
a.append(n[i]+'0'*(len(n)-i-1))
print(len(a))
for i in a:
print(i,end=' ')
print() | Python | cd2519f4a7888b2c292f05c64a9db13a | 519461a3ef6d46dcb5f1d9ff0c9d47b2 | 800 | PASSED |
t = int(input())
ans = list()
for i in range(0,t,1):
num = int(input())
k=0
if (num >= 1 and num <= 9):
print(1)
print(num)
else:
while True:
r = num%10
j = pow(10,k)*int(r)
#print("**",j,"**")
if j != 0:
ans.appe... | Python | cd2519f4a7888b2c292f05c64a9db13a | e366479137d2aa932bdb86eba32f0d84 | 800 | PASSED |
# include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
char s[100000];
cin>>s;
int flag=0,flag1=0;
for(int i=0; i<n; i++)
{
if(s[i]=='z')
flag++;
if(s[i]=='n')
flag1++;
}
if(flag1!=0)
{
for(int i=0; i<flag1; i++)
cout<<"1"<... | C++ | 5e5dbd70c7fcedf0f965aed5bafeb06c | 9b5fa0192a502804b3bc0f1d85a7a744 | 800 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.