제출 #203414

#제출 시각아이디문제언어결과실행 시간메모리
203414mohammad말 (IOI15_horses)C++14
17 / 100
1575 ms12152 KiB
/* ░░░░██████████████████ ░░▄███████▀▀▀▀▀▀███████▄ ░▐████▀▒mohammad▒▀██████▄ ░███▀▒▒▒▒alaa▒▒▒▒▒▒▀█████ ░▐██▒▒▒alwrawrah▒▒▒▒▒████▌ ░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌ ░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌ ░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌ ░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌ ░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌ ░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█ ░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀ ░░░░▄██████████████▒▒▐▌ ░░░▀███▀▀████▀█████▀▒▌ ░░░░░▌▒▒▒▄▒▒▒▄▒▒▒▒▒▒▐ ░░░░░▌▒▒▒▒▀▀▀▒▒▒▒▒▒▒▐ */ #include<bits/stdc++.h> #include "horses.h" using namespace std; typedef long long ll ; const ll oo = 1e13 ; const double PI = acos(-1) ; const ll M = 1e9 + 7 ; ll x[500010] , y[500010] , n; int init(int N, int X[], int Y[]){ n = N; for(int i = 0 ; i < N ; ++i) x[i] = X[i] , y[i] = Y[i]; ll x = 1 , ans = 0; for(int i = 0 ; i < N ; ++i){ x = (x * X[i]) % M; ans = max(ans , (x * y[i] % M) % M); } return ans; } int updateX(int pos, int val) { int xx = x[pos]; x[pos] = val; ll x1 = 1 , ans = 0; for(int i = 0 ; i < n ; ++i){ x1 = (x1 * x[i]) % M; ans = max(ans , (x1 * y[i] % M) % M); } x[pos] = xx; return ans; } int updateY(int pos, int val) { int xx = y[pos]; y[pos] = val; ll x1 = 1 , ans = 0; for(int i = 0 ; i < n ; ++i){ x1 = (x1 * x[i]) % M; ans = max(ans , (x1 * y[i] % M) % M); } y[pos] = xx; return ans; }

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

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:34:5: warning: declaration of 'x' shadows a global declaration [-Wshadow]
  ll x = 1 , ans = 0;
     ^
horses.cpp:29:4: note: shadowed declaration is here
 ll x[500010] , y[500010] , n;
    ^
horses.cpp:39:9: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  return ans;
         ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:43:16: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  int xx = x[pos];
           ~~~~~^
horses.cpp:51:9: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  return ans;
         ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:55:16: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  int xx = y[pos];
           ~~~~~^
horses.cpp:63:9: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  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...