#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
typedef long long LL;
const int maxn = + ;
int a[maxn];
LL sum[maxn]; int main(){
std::ios::sync_with_stdio(false);
int n, k;
cin >> n >> k;
memset(sum, , sizeof(sum));
for (int i = ; i <= n; i++){
cin >> a[i];
sum[i] = sum[i - ] + a[i];
}
bool ok = false;
for (int i = ; i <= n; i++){ //可能只是自己,所以从0开始
for (int j = i; j <= n; j++){
if (sum[j] - sum[i] == k){
cout << i+ << " " << j << endl; //因为从0开始,所以i需要加1
ok = true;
break;
}
}
if (ok)
break;
}
if (!ok)
cout << "No Solution" << endl;
//system("pause");
return ;
}

最新文章

  1. CSS手动改变DIV高宽
  2. 七牛整合PHP上传文件
  3. Lucky and Good Months by Gregorian Calendar - POJ3393模拟
  4. C# 获取本机指定类型指定网卡的Ip地址
  5. Quality Center配置邮箱服务
  6. CF339
  7. iOS 通过个推 推送原理
  8. Android 关于调用系统内已安装的相机问题
  9. Oracle Sql优化之Merge 改写优化Update
  10. 【视频编解码&#183;学习笔记】2. H.264简介
  11. C#学习之接口
  12. MySQL api
  13. 不正常退出vim产生swp文件的解决方法
  14. Dubbo与Zookeeper在Window上的安装与简单使用
  15. float 、double 加减乘除出现小数位多出的问题
  16. 2017/05/03 java 基础 随笔
  17. cf1061D 贪心+multiset 好题!
  18. 12月centos单词
  19. 微信小程序笔记&lt;七&gt;视图层 —— wxml
  20. 第十章&#160;优先级队列 (b4)完全二叉堆:批量建堆

热门文章

  1. 转移iOS App常见问题和回答
  2. eclipse配置android
  3. Please verify that your device’s clock is properly set, and that your signing certificate is not exp
  4. Spark学习笔记:(一)入门 glance
  5. filter、servlet、interceptor的执行顺序
  6. h5 getUserMedia error PermissionDeniedError
  7. [转]GPS经纬度的表示方法及换算
  8. IE8 下背景图标不显示
  9. redis02---对于key的操作命令
  10. SDUT OJ 1221 亲和数 (找出某个数n所有的因子数,只需要暴力:2-&gt;sqrt(n) 即可 )