QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#590534#2396. Dimensional AnalysisTenshiAC ✓3ms3956kbC++202.4kb2024-09-26 02:13:382024-09-26 02:13:38

Judging History

你现在查看的是最新测评结果

  • [2024-09-26 02:13:38]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3956kb
  • [2024-09-26 02:13:38]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
 
#define debug(x) cerr << #x << ": " << (x) << endl
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define dwn(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define all(x) (x).begin(), (x).end()
 
#define x first
#define y second
using pii = pair<int, int>;
using ll = long long;
 
#define int ll
 
inline void read(int &x){
    int s=0; x=1;
    char ch=getchar();
    while(ch<'0' || ch>'9') {if(ch=='-')x=-1;ch=getchar();}
    while(ch>='0' && ch<='9') s=(s<<3)+(s<<1)+ch-'0',ch=getchar();
    x*=s;
}

const int N=110, mod=1e9+7;

int n, m;
int f[N][N];
int col[N];

int fpow(int x, int p){
	int res=1;
	for(; p; p>>=1, x=1LL*x*x%mod) if(p&1) res=1LL*res*x%mod;
	return res%mod;
}

int inv(int x){
	return fpow(x, mod-2);
}

int add(int x, int y){
	return (x+y+mod)%mod;
}

int mul(int x, int y){
	return x*y%mod;
}

int dv(int x, int y){
	return mul(x, inv(y));
}

map<string, int> mp;
int get(string &s){
	if(mp.count(s)) return mp[s];
	return mp[s]=++m;
}

// parameter?
bool par(string &s){
	for(auto e: s) if(!isalpha(e)) return false;
	return true;
}

void dbg(){
	rep(i, 1, n){
		rep(j, 1, m) cerr<<f[i][j]<<" ";
		cerr<<endl;
	}
}

bool guass(){
	int rk=0;
	for(int r=1, c=1; r<=n && c<=m; c++){
		int t=r;
		rep(i, r, n) if(f[i][c]){
			t=i;
			break;
		}
		if(!f[t][c]) continue;
		swap(f[t], f[r]);
		col[r]=c;
		++rk;
		
		rep(i, r+1, n) if(f[i][c]){
			int rt=dv(f[i][c], f[r][c]);
			rep(j, c, m) f[i][j]=add(f[i][j], -mul(rt, f[r][j]));
		}
		r++;
	}
	
	dwn(r, rk-1, 1){
		rep(i, r+1, rk){
			int c=col[i];
			int rt=dv(f[r][c], f[i][c]);
			rep(j, c, m) f[r][j]=add(f[r][j], -mul(rt, f[i][j]));
		}
	}
	
	rep(i, 1, n) if(col[i]){
		bool fl=true;
		rep(j, col[i]+1, m) if(f[i][j]) fl=false;
		if(fl) return true;
	}
	return false;
}

signed main(){
	cin>>n;
	getchar();
	
	rep(i, 1, n){
		string s;
		getline(cin, s);
		stringstream ssin(s);
		
		vector<string> buf;
		while(ssin>>s) buf.pb(s);
		
		int sgn=1;
		rep(j, 0, (int)buf.size()-1){
			string cur=buf[j];
			if(cur=="="){
				sgn=-1;
				continue;
			}
			if(par(cur)){
				int fl=1;
				if(j && buf[j-1]=="/") fl=-1;
				int sg=sgn*fl;
				
				int c=get(cur);
				f[i][c]+=sg;
			}
		}
	}
	
	// dbg();
	puts(guass()? "invalid": "valid");
	
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3808kb

input:

1
a = 1

output:

invalid

result:

ok single line: 'invalid'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

2
a = a
1 = 1

output:

valid

result:

ok single line: 'valid'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

10
a = b
b = c
c = d
d = e
e = f
f = g
g = h
h = i
i = j
j = a

output:

valid

result:

ok single line: 'valid'

Test #4:

score: 0
Accepted
time: 3ms
memory: 3956kb

input:

99
last * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a ...

output:

valid

result:

ok single line: 'valid'

Test #5:

score: 0
Accepted
time: 3ms
memory: 3636kb

input:

99
1 * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a...

output:

invalid

result:

ok single line: 'invalid'

Test #6:

score: 0
Accepted
time: 1ms
memory: 3692kb

input:

100
1 / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a = 1 * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a
1 / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a / a = 1 * a * a ...

output:

invalid

result:

ok single line: 'invalid'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3708kb

input:

100
1 * a * a * a * a * a * a * a * a * a * a * a * a / b / b / b / b / b / b / b / b / b / b / b / b / b = 1 * a * a * a * a * a * a * a * a * a * a * a * a * b * b * b * b * b
1 * a * a * a * a * a * a * a * a * a * a / b / b / b / b / b / b / b / b / b / b / b / b = 1 / a / a / a / a / a / a / a ...

output:

invalid

result:

ok single line: 'invalid'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

5
1 / a / a / a / a / a / a / b / b / b / b / b / c / c / c / c / c / c / d / d / d / d / d / d * e * e * e * e * e * e * f * f * f * f * f * f * f * g * g * g * g * g / h / h / h / h / i / i / i / i / i / i / i * j * j * j = 1 / a / a / a / a * b * b * b * b * b * c * c * c * c / d / d / d / d / d ...

output:

valid

result:

ok single line: 'valid'

Test #9:

score: 0
Accepted
time: 1ms
memory: 3828kb

input:

10
1 * a * a * a / b / b / b / b * c * c * c * c * d * d * e / g / g / g / h / h / i / i / i * j / k / k * l * l * l * m / o / o / o / o * p * p * p * p * p * p / q / q / r * s * s * t * t * t * t = 1 / a / b * c / d / d * e * e * e * e * e / f * g * g * g * i * i * j * j * j * k * k * k * k * l * l...

output:

valid

result:

ok single line: 'valid'

Test #10:

score: 0
Accepted
time: 1ms
memory: 3636kb

input:

20
1 * a * b * c * c * c * e * g / h * k * k * m * m * m * m / n * o * o / p / q / q / r * s * t * t / u / w / x * y / z / cb * hb / ib / ib * jb = 1 * a * a * b * b / d * e * f * g * g * g * g * g / h / i / i / i * k * k / l / l / m / m / m / m / n / n / p / q * r * r * r / s / s * u / v / v / v * ...

output:

valid

result:

ok single line: 'valid'

Test #11:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

40
1 * a * a * a / i / i / j / k / k * o * p * p * q / r / r * s * s / t / t / t / t / u / u * w * w * y * z * ab * ab * ab / eb / eb / fb * gb * hb * hb * ib * ib * ib * ib / kb * lb * lb * mb * nb = 1 / a * b * b * c * c * c / e * g * g * h / l / l * m * n * n * n * n * n * p / r / r / s / s * t /...

output:

invalid

result:

ok single line: 'invalid'

Test #12:

score: 0
Accepted
time: 2ms
memory: 3724kb

input:

50
1 / f / m / n / r / r * u / ab / db / gb * ib * jb * mb / qb / qb / sb * yb * zb / ac / gc * jc * kc * mc * nc / oc / qc / cd / ed / hd / id * ld / md / nd * od / rd = 1 * a / c / c * e * f / g / i / j * l * q / r / u / u / z / ab * bb * jb * jb / mb / nb / ob / rb / rb / vb / zb * bc * fc * gc *...

output:

valid

result:

ok single line: 'valid'

Test #13:

score: 0
Accepted
time: 3ms
memory: 3720kb

input:

91
1 * a * a / g / h / i * v / x / x / y * ab * cb * fb / hb / hb * kb / pb * qb * sb * sb * zb / ac / dc * hc / ic / jc / kc / mc / mc * nc / uc / ed * md * nd * qd / rd / ud = 1 * a * a * e * i / l / m * t * z / db * hb / nb / ob * vb * wb * dc * dc * dc / uc * wc / xc / ed * hd * id * id
1 / b * ...

output:

invalid

result:

ok single line: 'invalid'

Test #14:

score: 0
Accepted
time: 2ms
memory: 3796kb

input:

1
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

output:

valid

result:

ok single line: 'valid'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

99
last * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a * a ...

output:

valid

result:

ok single line: 'valid'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

10
1 * a * a * a * a * a * a * a * a * a * a * k * k * k * k * k * k * k * k * k * k = 1
1 / a * b * b * b * b * b * b * b * b * b * b * j * j * j / k * l * l * l * l * l * l * l * l * l * l * t * t * t = 1
1 / b * c * c * c * c * c * c * c * c * c * c * j * j / l * m * m * m * m * m * m * m * m * m...

output:

valid

result:

ok single line: 'valid'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

10
1 * a * a * a * a * a * a * a * a * a * a * j * k * k * k * k * k * k * k * k * k * k * t = 1
1 / a * b * b * b * b * b * b * b * b * b * b * j * j * j * j * j / k * l * l * l * l * l * l * l * l * l * l * t * t * t * t * t = 1
1 / b * c * c * c * c * c * c * c * c * c * c / l * m * m * m * m * m...

output:

valid

result:

ok single line: 'valid'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

11
1 * a * a * a * a * a * a * a * a * a * a * k * l * l * l * l * l * l * l * l * l * l * v = 1
1 / a * b * b * b * b * b * b * b * b * b * b * k * k * k * k * k * k * k * k / l * m * m * m * m * m * m * m * m * m * m * v * v * v * v * v * v * v * v = 1
1 / b * c * c * c * c * c * c * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #19:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

10
1 * a * a * a * a * a * a * a * a * a * a * j * j * j * j * j * j * j * k * k * k * k * k * k * k * k * k * k * t * t * t * t * t * t * t = 1
1 / a * b * b * b * b * b * b * b * b * b * b * j / k * l * l * l * l * l * l * l * l * l * l * t = 1
1 / b * c * c * c * c * c * c * c * c * c * c * j * j...

output:

valid

result:

ok single line: 'valid'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3856kb

input:

11
1 * a * a * a * a * a * a * a * a * a * a * k * k * k * l * l * l * l * l * l * l * l * l * l * v * v * v = 1
1 / a * b * b * b * b * b * b * b * b * b * b / l * m * m * m * m * m * m * m * m * m * m = 1
1 / b * c * c * c * c * c * c * c * c * c * c * k * k * k * k / m * n * n * n * n * n * n * n...

output:

valid

result:

ok single line: 'valid'

Test #21:

score: 0
Accepted
time: 0ms
memory: 3816kb

input:

11
1 * a * a * a * a * a * a * a * a * a * a * k * k * k * k * k * k * k * k * k * l * l * l * l * l * l * l * l * l * l * v * v * v * v * v * v * v * v * v = 1
1 / a * b * b * b * b * b * b * b * b * b * b * k * k * k * k / l * m * m * m * m * m * m * m * m * m * m * v * v * v * v = 1
1 / b * c * c...

output:

valid

result:

ok single line: 'valid'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * l * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x * x * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l * l * l * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x * x * x * x * x = 1
1 / b * c * c...

output:

valid

result:

ok single line: 'valid'

Test #23:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * l * l * l * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x * x * x * x * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l * l * l * l * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x * x * x * x *...

output:

valid

result:

ok single line: 'valid'

Test #24:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l * l * l * l * l * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x * x * x * x * x * x * x = 1
1 / b * c * c * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #25:

score: 0
Accepted
time: 0ms
memory: 3500kb

input:

13
1 * a * a * a * a * a * a * a * a * a * a * m * m * m * m * m * m * m * m * m * n * n * n * n * n * n * n * n * n * n * z * z * z * z * z * z * z * z * z = 1
1 / a * b * b * b * b * b * b * b * b * b * b * m * m * m * m * m * m * m * m / n * o * o * o * o * o * o * o * o * o * o * z * z * z * z *...

output:

valid

result:

ok single line: 'valid'

Test #26:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

10
1 * a * a * a * a * a * a * a * a * a * a * j * k * k * k * k * k * k * k * k * k * k * t = 1
1 / a * b * b * b * b * b * b * b * b * b * b * j * j * j * j / k * l * l * l * l * l * l * l * l * l * l * t * t * t * t = 1
1 / b * c * c * c * c * c * c * c * c * c * c / l * m * m * m * m * m * m * m...

output:

valid

result:

ok single line: 'valid'

Test #27:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

10
1 * a * a * a * a * a * a * a * a * a * a * j * j * j * k * k * k * k * k * k * k * k * k * k * t * t * t = 1
1 / a * b * b * b * b * b * b * b * b * b * b * j * j * j * j * j * j * j * j * j / k * l * l * l * l * l * l * l * l * l * l * t * t * t * t * t * t * t * t * t = 1
1 / b * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #28:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

11
1 * a * a * a * a * a * a * a * a * a * a * k * k * k * l * l * l * l * l * l * l * l * l * l * v * v * v = 1
1 / a * b * b * b * b * b * b * b * b * b * b * k * k * k * k * k / l * m * m * m * m * m * m * m * m * m * m * v * v * v * v * v = 1
1 / b * c * c * c * c * c * c * c * c * c * c * k * k...

output:

valid

result:

ok single line: 'valid'

Test #29:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

11
1 * a * a * a * a * a * a * a * a * a * a * k * l * l * l * l * l * l * l * l * l * l * v = 1
1 / a * b * b * b * b * b * b * b * b * b * b * k * k * k * k / l * m * m * m * m * m * m * m * m * m * m * v * v * v * v = 1
1 / b * c * c * c * c * c * c * c * c * c * c * k * k * k / m * n * n * n * n...

output:

valid

result:

ok single line: 'valid'

Test #30:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

11
1 * a * a * a * a * a * a * a * a * a * a * k * k * k * k * k * k * k * k * k * l * l * l * l * l * l * l * l * l * l * v * v * v * v * v * v * v * v * v = 1
1 / a * b * b * b * b * b * b * b * b * b * b * k * k / l * m * m * m * m * m * m * m * m * m * m * v * v = 1
1 / b * c * c * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #31:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

11
1 * a * a * a * a * a * a * a * a * a * a * k * k * k * k * k * k * k * l * l * l * l * l * l * l * l * l * l * v * v * v * v * v * v * v = 1
1 / a * b * b * b * b * b * b * b * b * b * b * k * k * k * k * k * k * k * k / l * m * m * m * m * m * m * m * m * m * m * v * v * v * v * v * v * v * v =...

output:

valid

result:

ok single line: 'valid'

Test #32:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

11
1 * a * a * a * a * a * a * a * a * a * a * k * k * k * k * k * k * k * l * l * l * l * l * l * l * l * l * l * v * v * v * v * v * v * v = 1
1 / a * b * b * b * b * b * b * b * b * b * b * k * k * k / l * m * m * m * m * m * m * m * m * m * m * v * v * v = 1
1 / b * c * c * c * c * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #33:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

11
1 * a * a * a * a * a * a * a * a * a * a * k * k * k * k * k * k * k * k * k * l * l * l * l * l * l * l * l * l * l * v * v * v * v * v * v * v * v * v = 1
1 / a * b * b * b * b * b * b * b * b * b * b * k * k * k / l * m * m * m * m * m * m * m * m * m * m * v * v * v = 1
1 / b * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #34:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

11
1 * a * a * a * a * a * a * a * a * a * a * k * k * k * l * l * l * l * l * l * l * l * l * l * v * v * v = 1
1 / a * b * b * b * b * b * b * b * b * b * b * k * k * k / l * m * m * m * m * m * m * m * m * m * m * v * v * v = 1
1 / b * c * c * c * c * c * c * c * c * c * c * k * k * k / m * n * n...

output:

valid

result:

ok single line: 'valid'

Test #35:

score: 0
Accepted
time: 0ms
memory: 3864kb

input:

11
1 * a * a * a * a * a * a * a * a * a * a * k * k * k * l * l * l * l * l * l * l * l * l * l * v * v * v = 1
1 / a * b * b * b * b * b * b * b * b * b * b * k * k * k * k / l * m * m * m * m * m * m * m * m * m * m * v * v * v * v = 1
1 / b * c * c * c * c * c * c * c * c * c * c * k * k / m * n...

output:

valid

result:

ok single line: 'valid'

Test #36:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

11
1 * a * a * a * a * a * a * a * a * a * a * k * l * l * l * l * l * l * l * l * l * l * v = 1
1 / a * b * b * b * b * b * b * b * b * b * b * k * k * k * k / l * m * m * m * m * m * m * m * m * m * m * v * v * v * v = 1
1 / b * c * c * c * c * c * c * c * c * c * c * k * k * k * k * k * k * k / m...

output:

valid

result:

ok single line: 'valid'

Test #37:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * l * l * l * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x * x * x * x * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b / m * n * n * n * n * n * n * n * n * n * n = 1
1 / b * c * c * c * c * c * c * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #38:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l * l * l * l * l * l * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x * x * x * x * x * x * x * x = 1
1 / b * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #39:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * l * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x * x * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x * x * x = 1
1 / b * c * c * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #40:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * l * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x * x * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b / m * n * n * n * n * n * n * n * n * n * n = 1
1 / b * c * c * c * c * c * c * c * c * c * c / n * o * o * o...

output:

valid

result:

ok single line: 'valid'

Test #41:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * l * l * l * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x * x * x * x * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b / m * n * n * n * n * n * n * n * n * n * n = 1
1 / b * c * c * c * c * c * c * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #42:

score: 0
Accepted
time: 0ms
memory: 3828kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l / m * n * n * n * n * n * n * n * n * n * n * x = 1
1 / b * c * c * c * c * c * c * c * c * c * c * l * l * l * l * l * l * l * l / n * o...

output:

valid

result:

ok single line: 'valid'

Test #43:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * l * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x * x * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l / m * n * n * n * n * n * n * n * n * n * n * x = 1
1 / b * c * c * c * c * c * c * c * c * c * c * l * l...

output:

valid

result:

ok single line: 'valid'

Test #44:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * m * m * m * m * m * m * m * m * m * m * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l * l * l * l * l * l * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x * x * x * x * x * x * x * x = 1
1 / b * c * c * c * c * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #45:

score: 0
Accepted
time: 0ms
memory: 3668kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * l * l * l * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x * x * x * x * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x * x * x = 1
1 / b * c * c...

output:

valid

result:

ok single line: 'valid'

Test #46:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * m * m * m * m * m * m * m * m * m * m * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l * l * l * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x * x * x * x * x = 1
1 / b * c * c * c * c * c * c * c * c * c * c * l * l * l * l...

output:

valid

result:

ok single line: 'valid'

Test #47:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * l * l * l * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x * x * x * x * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l * l * l * l * l * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x * x * x *...

output:

valid

result:

ok single line: 'valid'

Test #48:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * m * m * m * m * m * m * m * m * m * m * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x = 1
1 / b * c * c * c * c * c * c * c * c * c * c * l * l * l * l * l * l * l / n * o * o * o * o...

output:

valid

result:

ok single line: 'valid'

Test #49:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l * l * l * l * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x * x * x * x * x * x = 1
1 / b * c * c * c * c * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #50:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * m * m * m * m * m * m * m * m * m * m * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l * l * l * l * l * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x * x * x * x * x * x * x = 1
1 / b * c * c * c * c * c * c * c * c * c * c...

output:

valid

result:

ok single line: 'valid'

Test #51:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * m * m * m * m * m * m * m * m * m * m * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l * l * l * l * l * l * l / m * n * n * n * n * n * n * n * n * n * n * x * x * x * x * x * x * x = 1
1 / b * c * c * c * c * c * c * c * c * c * c / n * o...

output:

valid

result:

ok single line: 'valid'

Test #52:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

12
1 * a * a * a * a * a * a * a * a * a * a * l * l * l * l * l * l * l * m * m * m * m * m * m * m * m * m * m * x * x * x * x * x * x * x = 1
1 / a * b * b * b * b * b * b * b * b * b * b * l / m * n * n * n * n * n * n * n * n * n * n * x = 1
1 / b * c * c * c * c * c * c * c * c * c * c * l * l...

output:

valid

result:

ok single line: 'valid'

Test #53:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

9
1 * a * a * a * a * a * a * a * a * a * a * i * j * j * j * j * j * j * j * j * j * j * r = 1
1 / a * b * b * b * b * b * b * b * b * b * b * i * i * i * i / j * k * k * k * k * k * k * k * k * k * k * r * r * r * r = 1
1 / b * c * c * c * c * c * c * c * c * c * c * i * i * i * i * i / k * l * l ...

output:

valid

result:

ok single line: 'valid'