이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("avx2,fma,bmi,bmi2,sse4.2")
#include<bits/stdc++.h>
#define all(x) (x).begin() , (x).end()
#define pll pair<long long, long long>
#define fi first
#define se second
#define bit(i,j) ((j >> i) & 1)
#define lowbit(x) (x & (-x))
#define sigma main
using namespace std;
const long long inf = 1e9+1;
const int mod = 998244353;
const int MAXN = 5e4+100;
#define int long long
mt19937_64 rd(chrono::steady_clock::now().time_since_epoch().count());
int Rand(int l , int r){
return uniform_int_distribution<int>(l, r)(rd);
}
int cnt[256];
int32_t sigma(){
//freopen("COLOREDBALLS.inp", "r", stdin);
//freopen("COLOREDBALLS.out", "w", stdout);
ios_base::sync_with_stdio(0); cin.tie(0);
int n , m , k; cin >> n >> m >> k;
vector<string> s(n+1);
for(int i = 1 ; i <= n ; i++) cin >> s[i];
vector<int> v(n+1);
int tot = 0;
for(int i = 1 ; i <= n ; i++) v[i] = Rand(1 , 1e12) , tot += v[i];
vector<int> sum(n + 1);
for(int i = 0 ; i < m ; i++){
cnt['A'] = 0 ; cnt['C'] = 0 ; cnt['G'] = 0 ; cnt['T'] = 0;
for(int j = 1 ; j <= n ; j++) cnt[s[j][i]] += v[j];
for(int j = 1 ; j <= n ; j++){
sum[j] += tot - cnt[s[j][i]];
}
}
for(int i = 1 ; i <= n ; i++){
if(sum[i] == (tot - v[i]) * k){
cout << i << "\n"; return 0;
}
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
genetics.cpp: In function 'int32_t main()':
genetics.cpp:43:44: warning: array subscript has type 'char' [-Wchar-subscripts]
43 | for(int j = 1 ; j <= n ; j++) cnt[s[j][i]] += v[j];
| ^
genetics.cpp:45:31: warning: array subscript has type 'char' [-Wchar-subscripts]
45 | sum[j] += tot - cnt[s[j][i]];
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |