제출 #1117268

#제출 시각아이디문제언어결과실행 시간메모리
1117268ZflopHorses (IOI15_horses)C++14
0 / 100
32 ms15432 KiB
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; #define ll long long const int NMAX = (int)1e5 * 6; const ll MOD = (int)1e9 + 7; ll A[NMAX],B[NMAX],n; ll POW(ll x,int p) { ll res = 1; while (p) { if (p % 2) res = res * x % MOD; p /= 2; x = x * x % MOD; } return res; } int init(int N, int X[], int Y[]) { for (int i = 0; i < N;++i) { A[i] = X[i]; B[i] = Y[i]; } n = N; ll ans = X[0] * Y[0] % MOD; ll x = 1; int ans_i = 0; for (int i = max(1,N - 40); i < N;++i) { x = x * X[i]; if (Y[ans_i] < x || x * Y[i] > Y[ans_i]) { x = 1; ans_i = i; ans = x * Y[i] % MOD; } } return ans; } int updateX(int pos, int val) { A[pos] = val; ll ans = A[0] * B[0] % MOD; ll x = 1; int ans_i = 0; for (int i = max(1ll,n - 40); i < n;++i) { x = x * A[i]; if (B[ans_i] < x || x * B[i] > A[ans_i]) { x = 1; ans_i = i; ans = x * B[i] % MOD; } } return ans; } int updateY(int pos, int val) { B[pos] = val; A[pos] = val; ll ans = A[0] * B[0] % MOD; ll x = 1; int ans_i = 0; for (int i = max(1ll,n - 40); i < n;++i) { x = x * A[i]; if (B[ans_i] < x || x * B[i] > A[ans_i]) { x = 1; ans_i = i; ans = x * B[i] % MOD; } } return ans; }

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

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:38:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   38 |  return ans;
      |         ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:46:18: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   46 |  for (int i = max(1ll,n - 40); i < n;++i) {
      |               ~~~^~~~~~~~~~~~
horses.cpp:54:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   54 |  return ans;
      |         ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:63:18: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   63 |  for (int i = max(1ll,n - 40); i < n;++i) {
      |               ~~~^~~~~~~~~~~~
horses.cpp:71:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   71 |  return ans;
      |         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...