Submission #203663

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2036632020-02-21 19:07:56ics0503Naan (JOI19_naan)C++17
0 / 100
76 ms632 KiB
#include<stdio.h>
#include<set>
#include<vector>
using namespace std;
set<long long >people;
struct xy { int x; double y; }L[2121];
double need[2121];
long long v[2121][2121], S[2121][2121];
long long gcd(long long a, long long b) {
if (b == 0)return a;
return gcd(b, a%b);
}
vector<int>ans;
int main() {
freopen("input.txt", "r", stdin);
long long n, l, i, j; scanf("%lld%lld", &n, &l);
for (i = 1; i <= n; i++)people.insert(i);
bool flag = 1;
for (i = 1; i <= n; i++) {
for (j = 1; j <= l; j++)scanf("%lld", &v[i][j]);
long long gg = v[i][1];
for (j = 1; j <= l; j++)gg = gcd(gg, v[i][j]);
for (j = 1; j <= l; j++) {
v[i][j] /= gg; S[i][j] = S[i][j - 1] + v[i][j];
need[i] += v[i][j];
if (v[i][j] != v[1][j])flag = 0;
}
need[i] /= n;
}
if (flag) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

naan.cpp: In function 'int main()':
naan.cpp:34:42: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
   for (i = 1; i <= n; i++)printf("%d ", i);
                                          ^
naan.cpp:75:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < ans.size(); i++)printf("%d ", ans[i]);
                  ~~^~~~~~~~~~~~
naan.cpp:15:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
  freopen("input.txt", "r", stdin);
  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
naan.cpp:16:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  long long n, l, i, j; scanf("%lld%lld", &n, &l);
                        ~~~~~^~~~~~~~~~~~~~~~~~~~
naan.cpp:20:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   for (j = 1; j <= l; j++)scanf("%lld", &v[i][j]);
                           ~~~~~^~~~~~~~~~~~~~~~~~
naan.cpp:65:58: warning: 'mmnw' may be used uninitialized in this function [-Wmaybe-uninitialized]
   befa = (L[mnw].x + L[mmnw].x)/2, p = (L[mnw].y+L[mmnw].y)/2;
                                                  ~~~~~~~~^
naan.cpp:59:44: warning: 'mmny' may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (mmnx > L[who].x || (mmnx == L[who].x&&mmny > L[who].y)) {
                           ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
naan.cpp:51:43: warning: 'mny' may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (mnx > L[who].x || (mnx == L[who].x && mny > L[who].y)) {
                          ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...