#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
#define inf 1000000007
#define llmax LLONG_MAX
#define pi 3.141592653589793238462643383279502884197169399
long long binpow(long long a, long long b) {
long long res = 1;
while (b > 0) {
if (b & 1)
res = res * a;
a = a * a;
b >>= 1;
}
return res;
}
ll ncr(int n, int r)
{
if (n < r) return 0;
long long p = 1, k = 1;
if (n - r < r)
r = n - r;
if (r != 0) {
while (r) {
p *= n;
k *= r;
long long m = __gcd(p, k);
p /= m;
k /= m;
n--;
r--;
}
}
else
p = 1;
return p;
}
vector <ll> vcreate(int n){
vector <ll> v(n);
for (int i = 0; i < n; i++)
{
cin>>v[i];
}
return v;
}
const int MOD=998244353;
ll ModExp(ll x, ll n, ll m) {
assert(n >= 0);
x %= m; // note: m * m must be less than 2^63 to avoid ll overflow
ll res = 1;
while (n > 0) {
if (n % 2 == 1) { res = res * x % m; }
x = x * x % m;
n /= 2;
}
return res;
}
char grid[4500][4500];
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
/* ll T; cin>>T;
for(ll i=0; i<T; i++)
{
} */
int n{},m{};
cin>>n>>m;
int ans{0};
set<char> s;
for(int i{0}; i<n; i++)
{
for(int j{0}; j<m; j++)
{
cin>>grid[i][j];
s.insert(grid[i][j]);
}
}
if(s.size()==3) cout<<2<<endl;
else cout<<1<<endl;
}
Compilation message
tracks.cpp: In function 'int main()':
tracks.cpp:88:9: warning: unused variable 'ans' [-Wunused-variable]
88 | int ans{0};
| ^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
2904 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
2652 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
2652 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
2524 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
2652 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
2512 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
2648 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
2652 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
2652 KB |
Output isn't correct |
12 |
Incorrect |
3 ms |
2652 KB |
Output isn't correct |
13 |
Incorrect |
2 ms |
2648 KB |
Output isn't correct |
14 |
Incorrect |
2 ms |
2652 KB |
Output isn't correct |
15 |
Incorrect |
5 ms |
2932 KB |
Output isn't correct |
16 |
Incorrect |
6 ms |
2908 KB |
Output isn't correct |
17 |
Incorrect |
4 ms |
2928 KB |
Output isn't correct |
18 |
Incorrect |
3 ms |
2776 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
19036 KB |
Output isn't correct |
2 |
Incorrect |
30 ms |
8284 KB |
Output isn't correct |
3 |
Incorrect |
209 ms |
33360 KB |
Output isn't correct |
4 |
Incorrect |
49 ms |
12384 KB |
Output isn't correct |
5 |
Incorrect |
110 ms |
23120 KB |
Output isn't correct |
6 |
Incorrect |
199 ms |
33380 KB |
Output isn't correct |
7 |
Incorrect |
4 ms |
19032 KB |
Output isn't correct |
8 |
Incorrect |
4 ms |
19032 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
11 |
Incorrect |
4 ms |
19036 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
2652 KB |
Output isn't correct |
13 |
Incorrect |
24 ms |
8176 KB |
Output isn't correct |
14 |
Incorrect |
14 ms |
5464 KB |
Output isn't correct |
15 |
Incorrect |
17 ms |
7516 KB |
Output isn't correct |
16 |
Incorrect |
12 ms |
3160 KB |
Output isn't correct |
17 |
Incorrect |
68 ms |
14684 KB |
Output isn't correct |
18 |
Incorrect |
55 ms |
14676 KB |
Output isn't correct |
19 |
Incorrect |
46 ms |
12372 KB |
Output isn't correct |
20 |
Incorrect |
47 ms |
12112 KB |
Output isn't correct |
21 |
Incorrect |
121 ms |
23404 KB |
Output isn't correct |
22 |
Incorrect |
105 ms |
23008 KB |
Output isn't correct |
23 |
Incorrect |
117 ms |
19936 KB |
Output isn't correct |
24 |
Incorrect |
127 ms |
23124 KB |
Output isn't correct |
25 |
Incorrect |
212 ms |
33380 KB |
Output isn't correct |
26 |
Correct |
118 ms |
27752 KB |
Output is correct |
27 |
Incorrect |
244 ms |
33412 KB |
Output isn't correct |
28 |
Incorrect |
196 ms |
33360 KB |
Output isn't correct |
29 |
Incorrect |
193 ms |
33416 KB |
Output isn't correct |
30 |
Incorrect |
208 ms |
32848 KB |
Output isn't correct |
31 |
Incorrect |
203 ms |
24044 KB |
Output isn't correct |
32 |
Incorrect |
222 ms |
33492 KB |
Output isn't correct |