QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#753504#9548. The Foolucup-team059#AC ✓5ms3860kbC++202.2kb2024-11-16 13:06:272024-11-16 13:06:35

Judging History

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

  • [2024-11-16 13:06:35]
  • 评测
  • 测评结果:AC
  • 用时:5ms
  • 内存:3860kb
  • [2024-11-16 13:06:27]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define PII pair<int,int>
#define PIII pair<int,PII>
#define endl '\n'
#define int long long
//#define int __int128
#define i64 long long
#define  lc p<<1
#define  rc p<<1|1
using namespace  std;
const int N = 2e6 + 10, mod = 1e9 + 7;

//bool isprime[N];
//int prime[N];
//int cnt;
//void euler(int n) {
//	memset(isprime, true, sizeof(isprime));
//	isprime[1] = false;
//	for (int i = 2; i <= n; ++i) {
//		if (isprime[i]) prime[++cnt] = i;
//		for (int j = 1; j <= cnt && i * prime[j] <= n; ++j) {
//			isprime[i * prime[j]] = false;
//			if (i % prime[j] == 0) break;
//		}
//	}
//}
int pre[N];
int rk[N];
void init(int n) {
	for (int i = 1; i <= n; i++) {
		pre[i] = i;
		rk[i] = 1;
	}
}
int find(int x) {
	if (pre[x] == x) return x;
	return pre[x] = find(pre[x]);
}
bool isSame(int x, int y) {
	return find(x) == find(y);
}
int ans[N];
bool join(int x, int y) {
	x = find(x);
	y = find(y);
	ans[x]=ans[y]=max(ans[x],ans[y]);
	if (x == y) return false;
	if (rk[x] > rk[y]) pre[y] = x;
	else {
		if (rk[x] == rk[y]) rk[y]++;
		pre[x] = y;
	}
	return true;
}

int qpow(int x, int n) {
	int ans = 1;
	while (n) {
		if (n & 1) {
			ans *= x;
		}
		x *= x;
		n >>= 1;
	}
	return ans;
}

int a[N];
int dp[N];

vector<int>g[N];
int vis[N];

int ls(int x){
	int s=0;
	while(x){
		x/=2;
		s++;
	}
	return s;
}

void dfs(int x){
	int s=0;
	int mx=0;
	for(auto u:g[x]){
		dfs(u);
		mx=max(mx,dp[u]);
		s++;
		
	}
	if(!s){
		dp[x]=0;
		return;
	}
	int t=ls(s);
	dp[x]=mx+t;
}

void solve() {
	int n,m,k;
	cin>>n>>m>>k;
	string ss,ans;
	int f=1;
	int sum=0;
	int mx,my;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			string s;
			for(int l=0;l<k;l++){
				char x;
				cin>>x;
				s+=x;
			}
			if(ss.length()==0){
				ss=s;
			}else{
				if(ss!=s){
					mx=i,my=j;
					sum++;
				}
				if(sum>1){
					f=0;
				}
			}
		}
	}
	if(f){
		cout<<mx<<' '<<my<<endl;
	}else{
		cout<<1<<' '<<1<<endl;
	}
	
}
signed main() {
	ios::sync_with_stdio(false), cin.tie(0);
	ll t = 1;
//	cin >> t;
//	euler(1e6);
	while (t--) {
		solve();
	}
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3548kb

input:

3 5 3
QWQQWQQWQQWQQWQ
QWQQWQQWQQWQQWQ
QWQQWQQWQQWQQwQ

output:

3 5

result:

ok single line: '3 5'

Test #2:

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

input:

2 2 1
LL
}L

output:

2 1

result:

ok single line: '2 1'

Test #3:

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

input:

2 2 10
u+gl<d'a9Bu+gl<d'a9B
)M0wM2_Z8!u+gl<d'a9B

output:

2 1

result:

ok single line: '2 1'

Test #4:

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

input:

2 2 10
ayspaufftvuaaavaaaaa
uaaavaaaaauaaavaaaaa

output:

1 1

result:

ok single line: '1 1'

Test #5:

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

input:

2 2 10
uaaavaaaaauaaavaaaaa
ayspaufftvuaaavaaaaa

output:

2 1

result:

ok single line: '2 1'

Test #6:

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

input:

2 2 10
uaaavaaaaaayspaufftv
uaaavaaaaauaaavaaaaa

output:

1 2

result:

ok single line: '1 2'

Test #7:

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

input:

2 2 10
uaaavaaaaauaaavaaaaa
uaaavaaaaaayspaufftv

output:

2 2

result:

ok single line: '2 2'

Test #8:

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

input:

2 2 10
aaarlaaaghaaaaanisaa
aaaaanisaaaaaaanisaa

output:

1 1

result:

ok single line: '1 1'

Test #9:

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

input:

2 2 10
aaaaanisaaaaaaanisaa
aaarlaaaghaaaaanisaa

output:

2 1

result:

ok single line: '2 1'

Test #10:

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

input:

2 2 10
aaaaanisaaaaarlaaagh
aaaaanisaaaaaaanisaa

output:

1 2

result:

ok single line: '1 2'

Test #11:

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

input:

2 2 10
aaaaanisaaaaaaanisaa
aaaaanisaaaaarlaaagh

output:

2 2

result:

ok single line: '2 2'

Test #12:

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

input:

200 199 1
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooooowooooooooooooooooooooooooooooooooooooooooooooooooooooo...

output:

2 37

result:

ok single line: '2 37'

Test #13:

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

input:

199 200 2
1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p1p...

output:

112 145

result:

ok single line: '112 145'

Test #14:

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

input:

199 199 3
"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-R"-...

output:

46 95

result:

ok single line: '46 95'

Test #15:

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

input:

200 200 4
^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^pm&^p...

output:

113 72

result:

ok single line: '113 72'

Test #16:

score: 0
Accepted
time: 4ms
memory: 3588kb

input:

200 200 5
kk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gAkk$gA...

output:

66 8

result:

ok single line: '66 8'

Test #17:

score: 0
Accepted
time: 4ms
memory: 3548kb

input:

200 200 6
5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q8w[R5Q...

output:

84 106

result:

ok single line: '84 106'

Test #18:

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

input:

200 200 7
N3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&e|5lN3&...

output:

80 103

result:

ok single line: '80 103'

Test #19:

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

input:

200 200 8
82`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482`|)e)482...

output:

5 68

result:

ok single line: '5 68'

Test #20:

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

input:

200 200 9
c[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[RzcCsKBc[...

output:

8 169

result:

ok single line: '8 169'

Test #21:

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

input:

200 200 10
,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@^,O.JYB0m@...

output:

58 91

result:

ok single line: '58 91'

Extra Test:

score: 0
Extra Test Passed