| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1303354 | liangjeremy | Genetics (BOI18_genetics) | C++20 | 265 ms | 19996 KiB |
#include<bits/stdc++.h>
//#include<bits/extc++.h>
#define fi first
#define se second
#define int long long
using namespace std;
//using namespace __gnu_pbds;
using db=double;
using ll=int64_t;
using sll=__int128;
using lb=long double;
mt19937 rng(random_device{}()); uniform_int_distribution<int>gen(-1e18,1e18);
int32_t main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n,m,k; cin>>n>>m>>k; vector<string>a(n); vector<int>w(n); int tot=0;
for(int i=0; i<n; i++){
cin>>a[i]; w[i]=gen(rng); tot+=w[i];
}
auto id=[&](char c){
if(c=='A')return 0;
if(c=='C')return 1;
if(c=='G')return 2;
if(c=='T')return 3;
};
vector<vector<int>>v(4,vector<int>(m));
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
v[id(a[i][j])][j]+=w[i];
}
}
for(int i=0; i<n; i++){
int cur=0;
for(int j=0; j<m; j++){
for(int k=0; k<4; k++){
if(k==id(a[i][j]))continue;
cur+=v[k][j];
}
}
if(k*(tot-w[i])==cur){
cout<<i+1<<'\n'; return 0;
}
}
}
/*
Overhead the albatross hangs motionless upon the air
And deep beneath the rolling waves in labyrinths of coral caves
The echo of a distant time comes willowing across the sand
And everything is green and submarine
And no one showed us to the land
And no one knows the wheres or whys
But something stirs and something tries
And starts to climb towards the light
*/
컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
