记录编号 |
212192 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[NOIP 2015PJ]金币 |
最终得分 |
100 |
用户昵称 |
OhYee |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.002 s |
提交时间 |
2015-12-05 16:50:28 |
内存使用 |
0.29 MiB |
显示代码纯文本
/*
By:OhYee
Email:oyohyee@oyohyee.com
QQ:896817156
*/
/*
! !!
!!!!!!!!!!
!!!! !
! ! !!II!!! !!
!! !!!! !!!!!!!! !!IIIII!!
! !!!!!!!!! !!IILLLLLII! !!!!III!
!!!!!!!! ! !!! !! !LOLLLLIII!!I! ! !I
!!I!!!! !!!! !!!! !LLI!ILLOOLLI
!I!!! LOI LVVVO!LVI
! !!!! ! LV! LVVVVOLI!!!!!!!!!
!! !!! !!!!!!! IO IOOVVVOI! !!!!!!!!!
!! ! !IIII! !!!!!!!!
!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!
!!! !
!!! !!!!
!! !!!!!! !!! !IOVVVVOOLI!
!! !! !LVVLI! ! !VVVVVOOOOLLI
!!! ! !VVL!IILII !! OVVOLLIIIIIII
!! ! !VV!IVEEEVLLI IVVVLIIIIIIIIII
!!!! LV! !!LEEVIOL !LOVVVLIIIIIIIIIII
!!!! OV IVVOVL IVVVVOIIIIIIIIIIII
III OV! !OVVOOO !!!! !IOVVVLIIIIIIIIIII
!II!! !VVI !III! !!!!!!! ILOOLIIIIIILLI!
!!! !!LOL! !!!!!I!!!!!
賢い 可愛い エリチカ
BUG退散
ラブライブ LOVELIVE!
*/
//#######################################################################
#include <cstdio>
using namespace std;
int main(){
freopen("2015coin.in","r",stdin);
freopen("2015coin.out","w",stdout);
int n;
int a[]={1,2,4,7,11,16,22,29,37,46,56,67,79,92,106,121,137,154,
172,191,211,232,254,277,301,326,352,379,407,436,466,497,
529,562,596,631,667,704,742,781,821,862,904,947,991,1036,
1082,1129,1177,1226,1276,1327,1379,1432,1486,1541,1597,1654,
1712,1771,1831,1892,1954,2017,2081,2146,2212,2279,2347,2416,
2486,2557,2629,2702,2776,2851,2927,3004,3082,3161,3241,3322,
3404,3487,3571,3656,3742,3829,3917,4006,4096,4187,4279,4372,
4466,4561,4657,4754,4852,4951,5051,5152,5254,5357,5461,5566,
5672,5779,5887,5996,6106,6217,6329,6442,6556,6671,6787,6904,
7022,7141,7261,7382,7504,7627,7751,7876,8002,8129,8257,8386,
8516,8647,8779,8912,9046,9181,9317,9454,9592,9731,9871,10012
};
int b[]={1,3,8,18,35,61,98,148,213,295,396,518,663,833,1030,1256,
1513,1803,2128,2490,2891,3333,3818,4348,4925,5551,6228,6958,
7743,8585,9486,10448,11473,12563,13720,14946,16243,17613,19058,
20580,22181,23863,25628,27478,29415,31441,33558,35768,38073,40475,
42976,45578,48283,51093,54010,57036,60173,63423,66788,70270,73871,
77593,81438,85408,89505,93731,98088,102578,107203,111965,116866,
121908,127093,132423,137900,143526,149303,155233,161318,167560,
173961,180523,187248,194138,201195,208421,215818,223388,231133,
239055,247156,255438,263903,272553,281390,290416,299633,309043,
318648,328450,338451,348653,359058,369668,380485,391511,402748,
414198,425863,437745,449846,462168,474713,487483,500480,513706,
527163,540853,554778,568940,583341,597983,612868,627998,643375,
659001,674878,691008,707393,724035,740936,758098,775523,793213,
811170,829396,847893,866663,885708,905030,924631,944513,964678
};
scanf("%d",&n);
int i;
for(i=0;i<=146;i++){
if(a[i]>n){
printf("%d",b[i-1]+(n-a[i-1])*(i));
break;
}
if(a[i]==n){
printf("%d",b[i]);
break;
}
}
return 0;
}