君はまるで砂漠に咲く、一輪の花。

僕はその花に引き寄せられる蝶。

School Personal Contest #1 (Winter Computer School 2010/11)Codeforces Beta Round #38 (ACM-ICPC Rules)

はい。
http://codeforces.com/contest/38

A. Army

implementation

ざっくりと大意

・Berlandの軍隊は最低1から最高nでランク付けしている。
・ランク1から2へ上がるのにはdの1番目のコストが、2から3に上がるのには2番目のコストが?

方針のようなもの

・ランク上げのコストをリストにしておいて、3行目のデータの何番目から何番目に上がりたいのかをその部分のだけsumを取る?

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys, io
import re, math
#start = time.clock()
n=int(raw_input())
l=[int(x) for x in raw_input().split()]
(a,b)=map(int, raw_input().split())
print sum(l[(a-1):(b-1)])