2014-12-11 01:13:47
小结:嘛,这场据说比较难,该卡的地方都卡了.... 额 这么说也不为过,#1六题,有点低于预期吧,其实题目难度还好,就是时间太短,正常的应该比5小时,没人应该还能过1、2题,所以这个结果还是可以理解的,恩恩,学弟学妹们很给力!^.^ 好了,下面是简单的题目解析。
1001(灰度矩阵)
这题应该 no problem,按行列顺序读入g[i][j],然后按照g[j][i]输出,唯一的 trick 点就是每行最后一个数后面没有空格,这导致了很多人PE。
1 /************************************************************************* 2 > File Name: 1009st.cpp 3 > Author: Nature 4 > Mail: 564374850@qq.com 5 > Created Time: Thu 04 Dec 2014 02:26:16 PM CST 6 ************************************************************************/ 7 8 #include <cstdio> 9 #include <cstring> 10 #include <cstdlib> 11 #include <cmath> 12 #include <vector> 13 #include <map> 14 #include <set> 15 #include <stack> 16 #include <queue> 17 #include <iostream> 18 #include <algorithm> 19 using namespace std; 20 #define lp (p << 1) 21 #define rp (p << 1|1) 22 #define getmid(l,r) (l + (r - l) / 2) 23 #define MP(a,b) make_pair(a,b) 24 typedef long long ll; 25 const int INF = 1 << 30; 26 27 int n; 28 int g[50][50]; 29 30 int main(){ 31 while(scanf("%d",&n) != EOF){ 32 for(int i = 1; i <= n; ++i){ 33 for(int j = 1; j <= n; ++j){ 34 scanf("%d",&g[i][j]); 35 } 36 } 37 for(int i = 1; i <= n; ++i){ 38 printf("%d",g[1][i]); 39 for(int j = 2; j <= n; ++j){ 40 printf(" %d",g[j][i]); 41 } 42 printf("\n"); 43 } 44 } 45 return 0; 46 }