제출 #512692

#제출 시각아이디문제언어결과실행 시간메모리
512692lovro_nidogon1Languages (IOI10_languages)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define ll long long #include "lang.h" #include "grader.h" using namespace std; ll freq[56][70001], nocur[56], spac, cfreq[70001]; ll sq(ll x, ll y) {return (x + y) * (x + y);} void excerpt(int *e) { memset(cfreq, 0, sizeof(cfreq)); for(ll i = 0; i < 100; i++) cfreq[e[i]]++; ll exp = 0; ll sd = 1e9; for(ll i = 0; i < 56; i++) { ll csd = 0; for(ll j = 0; j < 100; j++) { csd += sq(cfreq[e[j]] * nocur[i], -freq[i][e[j]]); } if(csd < sd) sd = csd, exp = i; } ll ca = language(rand(0, 56)); for(ll i = 0; i < 65536; i++) freq[ca][i] += cfreq[i]; nocur[ca]++; }

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

lang.cpp: In function 'void excerpt(int*)':
lang.cpp:20:30: error: too many arguments to function 'int rand()'
   20 |   ll ca = language(rand(0, 56));
      |                              ^
In file included from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from lang.cpp:1:
/usr/include/stdlib.h:453:12: note: declared here
  453 | extern int rand (void) __THROW;
      |            ^~~~