让对角线的元素为k就行

#include <iostream>
using namespace std; int main() {
int n,k;
cin >> n >> k;
for(int i = ; i < n; ++ i){
for(int j = ; j < n ; ++ j){
if(j != ) cout<<" ";
if( i == j) cout<<k;
else cout<<;
}
cout<<endl;
}
return ;
}

Codeforces Round #210 (Div. 2) A. Levko and Table的更多相关文章

  1. Codeforces Round #210 (Div. 2) C. Levko and Array Recovery

    题目链接 线段树的逆过程,想了老一会,然后发现应该是包含区间对存在有影响,就不知怎么做了...然后尚大神,说,So easy,你要倒着来,然后再正着来,判断是不是合法就行了.然后我乱写了写,就过了.数 ...

  2. 水题 Codeforces Round #308 (Div. 2) A. Vanya and Table

    题目传送门 /* 水题:读懂题目就能做 */ #include <cstdio> #include <iostream> #include <algorithm> ...

  3. CodeForces 360E Levko and Game(Codeforces Round #210 (Div. 1))

    题意:有一些无向边m条权值是给定的k条权值在[l,r]区间可以由你来定,一个点s1 出发一个从s2出发  问s1 出发的能不能先打到f 思路:最短路. 首先检测能不能赢 在更新的时候  如果对于一条边 ...

  4. Codeforces Round #210 (Div. 1).B

    经典的一道DP题. 题目明显是一道DP题,但是比赛的时候一个劲就在想怎么记录状态和转移.最后想到了一种n^3的方法,写了下,不出所料的超时了. 看了别人的代码才发现竟然是先二分然后再进行DP,像这种思 ...

  5. Codeforces Round #311 (Div. 2) C. Arthur and Table Multiset

    C. Arthur and Table Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/p ...

  6. Codeforces Round #308 (Div. 2) A. Vanya and Table 暴力

    A. Vanya and Table Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/552/pr ...

  7. Codeforces Round #710 (Div. 3) Editorial 1506A - Strange Table

    题目链接 https://codeforces.com/contest/1506/problem/A 原题 1506A - Strange Table Example input 5 1 1 1 2 ...

  8. CF Codeforces Round #256 (Div. 2) D (448D) Multiplication Table

    二分!!! AC代码例如以下: #include<iostream> #include<cstring> #include<cstdio> #define ll l ...

  9. Codeforces Round #311 (Div. 2)C. Arthur and Table

    C. Arthur and Table time limit per test 1 second memory limit per test 256 megabytes input standard ...

随机推荐

  1. AOJ673 聪明的输入法(字典树)

    #include<cstdio> #include <cstdlib> #include <cstring> #include <iostream> # ...

  2. golang基础知识之文件操作

    读取文件所有内容以及获得文件操作对象 package mainimport ( "bufio" "fmt" "io" "io/io ...

  3. 1080P、720P、4CIF、CIF所需要的理论带宽

    转自:http://blog.sina.com.cn/s/blog_64684bf30101hdl7.html 在视频监控系统中,对存储空间容量的大小需求是与画面质量的高低.及视频线路等都有很大关系. ...

  4. 11g新特性-概述 (转)

    一.新特性提纲 1.数据库管理部分 ◆数据库重演(Database Replay) 这一特性可以捕捉整个数据的负载,并且传递到一个从备份或者standby数据库中创建的测试数据库上,然后重演负责以测试 ...

  5. ZEALER背后的乐视云视频

    ZEALER是我非常喜欢的一个测评网站,经常访问看看手机.电动牙刷及机械键盘的测试视频,非常欣赏王自如的数据化测评理念.敬畏之心,以及不祛痘的视频. 刚好最近对网络视频应用比较感兴趣,觉得ZEALER ...

  6. DateTime时间格式

    DateTime dt = DateTime.Now; Label1.Text = dt.ToString();//2005-11-5 13:21:25 Label2.Text = dt.ToFile ...

  7. 分布式文件系统FastDFS设计原理(转)

    FastDFS是一个开源的轻量级分布式文件系统,由跟踪服务器(tracker server).存储服务器(storage server)和客户端(client)三个部分组成,主要解决了海量数据存储问题 ...

  8. MOB 短信验证

    工具/原料   Android Studio mob SDK中的jar 和.so文件 方法/步骤   1 把3个jar 放入libs   并添加依赖 在项目的build.gradle里面   在你的项 ...

  9. hdu 1203 概率+01背包

    I NEED A OFFER! Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Sub ...

  10. (转)qsort和sort

    1.qsort函数: 原 型: void qsort(void *base, int nelem, int width, int (*fcmp)(const void *,const void *)) ...