제출 #135306

#제출 시각아이디문제언어결과실행 시간메모리
135306Boxworld말 (IOI15_horses)C++14
0 / 100
1576 ms8568 KiB
#include "horses.h" #include <bits/stdc++.h> using namespace std; const int bigint=1e9+7; struct year{int x,y;}a[500100]; long long ans=0,s=0; int n; void dfs(int i,int h){ int H=h*a[i].x; for (int j=0;j<=H;j++){ s+=a[i].y*j; if (s>ans)ans=s; if (i<n-1)dfs(i+1,H-j); s-=a[i].y*j; } } int init(int N, int X[], int Y[]){ n=N; for (int i=0;i<N;i++){ a[i].x=X[i]; a[i].y=Y[i]; } ans=0; dfs(0,1); return ans%bigint; } int updateX(int pos, int val) { a[pos].x=val; ans=0; dfs(0,1); return ans%bigint; } int updateY(int pos, int val) { a[pos].y=val; ans=0; dfs(0,1); return ans%bigint; }

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

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:25:12: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
  return ans%bigint;
         ~~~^~~~~~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:32:12: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
  return ans%bigint;
         ~~~^~~~~~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:39:12: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
  return ans%bigint;
         ~~~^~~~~~~
#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...