QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#778059 | #9548. The Fool | XUAN_# | WA | 5ms | 26996kb | C++14 | 1.4kb | 2024-11-24 12:29:48 | 2024-11-24 12:29:48 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define db double
#define ins push_back
#define mk make_pair
using namespace std;
const int N = 1e6+7;
const ll mod = 1e9+7;
template <typename T> inline void read(T &x){
T ch=getchar(),xx=1;x=0;
while(!isdigit(ch)) xx=ch=='-'?-1:xx,ch=getchar();
while(isdigit(ch)) x=(x<<1)+(x<<3)+ch-'0',ch=getchar();
x*=xx;
}
template <typename T> void print(T x){
if(x<0) putchar('-'),x=-x;
if(x>9) print(x/10);
putchar(x%10+'0');
}
string s;
vector <int> e[N];
int main(){
int n,m,k;
read(n),read(m),read(k);
m=m*k;
for(int i=0;i<n;i++){
cin>>s;
e[i].push_back(0);
for(int j=k;j<m;j+=k){
int l=j-1 -k + 1;
bool f=1;
for(int r=0;r<k;++r)
if(s[l+r]!=s[j+r]) f=0;
if(!f) e[i].push_back(1);
else e[i].push_back(0);
}
}
m=m/k;
// for(int i=0;i<n;++i,cout<<endl)
// for(int j=0;j<m;++j)
// cout<<e[i][j]<<" ";
for(int i=0;i<n;++i){
for(int j=1;j<m-1;++j){
if(e[i][j]==1 && e[i][j+1]==1){
print(i+1),putchar(' ');
print(j+1);return 0;
}
}
}
for(int i=0;i<n;++i){
for(int j=1;j<m-1;++j){
if(e[i][j]==1){
print(i+1),putchar(' ');
print(j);return 0;
}
if(e[i][j+1]==1){
print(i+1),putchar(' ');
print(j+2);return 0;
}
}
}
return 0;
}
/*
3 5 3
QWQQWQQWQQWQQWQ
QWQQWQQWQQWQQWQ
QWQQWQQWQQWQQwQ
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 5ms
memory: 26956kb
input:
3 5 3 QWQQWQQWQQWQQWQ QWQQWQQWQQWQQWQ QWQQWQQWQQWQQwQ
output:
3 5
result:
ok single line: '3 5'
Test #2:
score: -100
Wrong Answer
time: 4ms
memory: 26996kb
input:
2 2 1 LL }L
output:
result:
wrong answer 1st lines differ - expected: '2 1', found: ''