QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#791047 | #5254. Differences | hungeazy | TL | 1467ms | 23292kb | C++20 | 3.4kb | 2024-11-28 16:35:19 | 2024-11-28 16:35:21 |
Judging History
answer
/*
* @Author: hungeazy
* @Date: 2024-11-28 15:21:56
* @Last Modified by: hungeazy
* @Last Modified time: 2024-11-28 15:34:33
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")
using namespace std;
using namespace __gnu_pbds;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
// #define int long long
#define ll long long
#define ull unsigned long long
#define sz(x) x.size()
#define sqr(x) (1LL * (x) * (x))
#define all(x) x.begin(), x.end()
#define fill(f,x) memset(f,x,sizeof(f))
#define FOR(i,l,r) for(int i=l;i<=r;i++)
#define FOD(i,r,l) for(int i=r;i>=l;i--)
#define debug(x) cout << #x << " = " << x << '\n'
#define ii pair<int,int>
#define iii pair<int,ii>
#define di pair<ii,ii>
#define vi vector<int>
#define vii vector<ii>
#define mii map<int,int>
#define fi first
#define se second
#define pb push_back
#define MOD 1000000007
#define __lcm(a,b) (1ll * ((a) / __gcd((a), (b))) * (b))
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define MASK(i) (1LL << (i))
#define c_bit(i) __builtin_popcountll(i)
#define BIT(x,i) ((x) & MASK(i))
#define SET_ON(x,i) ((x) | MASK(i))
#define SET_OFF(x,i) ((x) & ~MASK(i))
#define oo 1e18
#define name ""
#define endl '\n'
// #define time() cerr << endl << "-------------Time:" << 1000.0 * clock() / CLOCKS_PER_SEC << "ms.";
template<typename T> bool maximize(T &res, const T &val) { if (res < val){ res = val; return true; }; return false; }
template<typename T> bool minimize(T &res, const T &val) { if (res > val){ res = val; return true; }; return false; }
template <class T> using ordered_set = tree <T, null_type, less_equal <T>, rb_tree_tag,tree_order_statistics_node_update>;
const int N = (int)1e5+10;
int n,m,k;
string s[N];
namespace hungeazy {
void solve(void)
{
vi v;
FOR(i,1,n) v.pb(i);
shuffle(all(v),default_random_engine(0));
for (int x : v)
{
bool kt = true;
for (int y : v)
{
if (x == y) continue;
int cnt = 0;
FOR(i,1,m)
if (s[x][i] != s[y][i]) cnt++;
if (cnt != k)
{
kt = false;
break;
}
}
if (kt)
{
cout << x;
exit(0);
}
}
}
}
signed main()
{
fast;
if (fopen(name".inp","r"))
{
freopen(name".inp","r",stdin);
freopen(name".out","w",stdout);
}
srand(time(NULL));
cin >> n >> m >> k;
FOR(i,1,n)
{
cin >> s[i];
s[i] = '#'+s[i];
}
hungeazy::solve();
// time();
return 0;
}
// ██░ ██ █ ██ ███▄ █ ▄████
//▓██░ ██▒ ██ ▓██▒ ██ ▀█ █ ██▒ ▀█▒
//▒██▀▀██░▓██ ▒██░▓██ ▀█ ██▒▒██░▄▄▄░
//░▓█ ░██ ▓▓█ ░██░▓██▒ ▐▌██▒░▓█ ██▓
//░▓█▒░██▓▒▒█████▓ ▒██░ ▓██░░▒▓███▀▒
// ▒ ░░▒░▒░▒▓▒ ▒ ▒ ░ ▒░ ▒ ▒ ░▒ ▒
// ▒ ░▒░ ░░░▒░ ░ ░ ░ ░░ ░ ▒░ ░ ░
// ░ ░░ ░ ░░░ ░ ░ ░ ░ ░ ░ ░ ░
// ░ ░ ░ ░ ░ ░
詳細信息
Test #1:
score: 100
Accepted
time: 350ms
memory: 21500kb
input:
3585 4096 2048 ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...
output:
1397
result:
ok single line: '1397'
Test #2:
score: 0
Accepted
time: 690ms
memory: 23292kb
input:
4099 4100 2 ABABBAAABBBABBBAABAAAAABABBBBBAAAAABBABBBBABBAAABBAABAAAAAAAAABBABAABAABBAAABAAAABBAABBBBABAAABAABABBAAABBBBBABABBBBBABBABBAABBBABAAABBABBBBAAAABAABBAABAABABABAAABAAAAABAABABBBAAAABBBBBBBABBBAABABBABABBBABAAAAABBBBABAAABABBBAABBAABBBABBABBBABBAABABBABBBBABBBABAABBBAAABAABAABBABAAABABABAB...
output:
2964
result:
ok single line: '2964'
Test #3:
score: 0
Accepted
time: 1467ms
memory: 22876kb
input:
4002 4096 2048 ABBBAAABAABBBABBBBABBBBBBBAABBABBBAABABBABBABBABBAABABBBBBAAAAABBBBBBAAAAAABAAAABBBABABAABBBABABAAAABBAABAABABBBABBBBABAAAABBBBBBABBBAAABABBABABAABBABAAABABBABABABAAAAAABABAABABAABBAAAABAAAAABBABAABBAAAAAAABBAAAAABABBABABAAAAABBABBBBBABABAABABBBAABBAAABBBBAAAAABBBBBBBABBBAABBAABBAABBB...
output:
3926
result:
ok single line: '3926'
Test #4:
score: 0
Accepted
time: 867ms
memory: 22640kb
input:
3892 4096 3072 CCBACBACABCBBCDBDBBDDABDADCDCCAABAAADADDCBABABACAACCADDDAAACBCDACCBDBCCCACACBBBCADBBDBABDACAABADBBBADADADBAADBCCDBDAADCCBDCBDBAACAABDABDAADBBCDDCADDBBDBDBDDBBDACCCCACBACCBADDCCDCDCCACBCDDCDCCCADCDDAADBBDABAADBDDDACBDBDDDBACDAABBBDDABACAACDAADBBBCDCCCAAAADDCBDBBCBDDADCAACCAABBCCBDBABCB...
output:
2870
result:
ok single line: '2870'
Test #5:
score: -100
Time Limit Exceeded
input:
4099 4100 2 CCCDDBDBBCADADBBACDCDDBACCDABADCDDDDBCDDABABDBCCCBCCCDDDCBAABADABDBCABDBDDDCBBCABCCBBDCDBCDCBCCCBABCCBABCDBBAABADCAACBBDDABBBDDBCBDDCCDCADDDBCBBDABCBDBCCCACCADBBDDDCBDCDACCCBCBBDADAAACDADCDDCAACADDCDBDDBBBBCDAADDAADDDDADDCCDCBDDBAACABDADCACAABCCAAACACBCDCBBAABCAACCCDABBDBCDABBDBCCCADBCAA...