제출 #234224

#제출 시각아이디문제언어결과실행 시간메모리
234224DanerZein말 (IOI15_horses)C++14
0 / 100
19 ms8448 KiB
#include "horses.h"
#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
typedef unsigned long long ll;
int X1[1010],Y1[1010];
ll t,r=-1;
int init(int N, int X[], int Y[]) {
  t=N;
  //	return 0;
  ll ma=-1;
  ll nm=1;
  for(int i=0;i<N;i++){
    X1[i]=X[i];
    Y1[i]=Y[i];
    nm=(X[i])*(nm);
    ll d=(Y[i]*nm);
    //d%=mod;
    ma=max(ma,d);
  }
  ma%=mod;
  r=ma;
  return r;
}

int updateX(int pos, int val) {	
  X1[pos]=val;
  ll nm=1;
  ll ma=-1;
  for(int i=0;i<t;i++){
    nm=(X1[i])*(nm);
 ll  d=(Y1[i]*nm);
 //d%=mod;
    ma=max(ma,d);
  }
  ma%=mod;
  r=ma;
  return r;
}

int updateY(int pos, int val) {
  Y1[pos]=val;
  ll nm=1;
  ll ma=-1;
  for(int i=0;i<t;i++){
        nm=(X1[i])*(nm);
  ll d=(Y1[i]*nm);
  //d%=mod;
    ma=max(ma,d);
  }
  ma%=mod;
  r=ma;
  return r;
}

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

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:23:10: warning: conversion to 'int' from 'll {aka long long unsigned int}' may alter its value [-Wconversion]
   return r;
          ^
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:30:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=0;i<t;i++){
               ~^~
horses.cpp:38:10: warning: conversion to 'int' from 'll {aka long long unsigned int}' may alter its value [-Wconversion]
   return r;
          ^
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:45:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=0;i<t;i++){
               ~^~
horses.cpp:53:10: warning: conversion to 'int' from 'll {aka long long unsigned int}' may alter its value [-Wconversion]
   return r;
          ^
#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...