제출 #1096444

#제출 시각아이디문제언어결과실행 시간메모리
1096444vjudge1Genetics (BOI18_genetics)C++17
100 / 100
73 ms33748 KiB
#include <bits/stdc++.h> using namespace std; #define int long long mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); int rand(int l, int h){ return uniform_int_distribution <int> (l, h) (rng); } int n, m, k; string s[5000]; int kc[5000][5000], w[5000], vt[40][5000], tong; main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> n >> m >> k; int sum = 0; for (int i = 1; i <= n; i++){ cin >> s[i]; s[i] = " " + s[i]; w[i] = rand(999, 1e11); sum += w[i]; for (int j = 1; j <= m; j++){ vt[s[i][j] - 'A'][j] += w[i]; } } for (int i = 1; i <= n; i++){ tong = 0; for (int j = 1; j <= m; j++){ tong += vt[s[i][j] - 'A'][j] - w[i]; } if (tong == (sum - w[i]) * (m - k)){ cout << i; break; } } }

컴파일 시 표준 에러 (stderr) 메시지

genetics.cpp:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main(){
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...