# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
888543 |
2023-12-17T17:25:40 Z |
Mr_Ph |
Set (COCI21_set) |
C++17 |
|
202 ms |
348 KB |
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
typedef long long ll;
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<x, null_type,
ll mod=(ll)1e9+7;
ll mod1=998244353;
///the defines :)
#define endl '\n'
#define vi vector<int>
#define ent(arr) for(int i=0;i<arr.size();i++)cin>>arr[i];
#define all(arr) arr.begin(),arr.end()
#define allr(arr) arr.rbegin(),arr.rend()
#define sz size()
#define int long long
void preprocess() {}
void solve()
{
int n,k;
cin>>n>>k;
vector<string>arr(n);
ent(arr);
int cnt=0;
for(int i=0;i<n;i++)
{
for(int j=i+1;j<n;j++)
{
for(int k=j+1;k<n;k++)
{
bool valid=true;
for(int o=0;o<k;o++)
{
set<char>st;
st.insert(arr[i][o]);
st.insert(arr[j][o]);
st.insert(arr[k][o]);
if(st.sz==2)
{
valid=false;
break;
}
}
cnt+=valid;
}
}
}
cout<<cnt<<endl;
}
signed main()
{
// freopen("meta_game_input.txt","r",stdin);
// freopen("otput.txt","w",stdout);
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
preprocess();
int t=1,st;
// cin>>t;
while(t--)
solve();
}
Compilation message
Main.cpp: In function 'void solve()':
Main.cpp:13:31: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
13 | #define ent(arr) for(int i=0;i<arr.size();i++)cin>>arr[i];
| ~^~~~~~~~~~~
Main.cpp:24:5: note: in expansion of macro 'ent'
24 | ent(arr);
| ^~~
Main.cpp: In function 'int main()':
Main.cpp:59:13: warning: unused variable 'st' [-Wunused-variable]
59 | int t=1,st;
| ^~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
202 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
202 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
202 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |