AtCoder Tenka1 Programmer Beginner Contest 解题报告
2018-10-30 22:16
856 查看
赛时写了ABC,D实在没啥思路,然后C又难调...然后就从写完AB时的32名掉到了150+名
T_T
码力不够,思维不行,我还是AFO吧
A - Measure
sb模拟,奇数串倒着输出偶数串正着输出
#include <bits/stdc++.h> #define ll long long #define inf 0x3f3f3f3f #define il inline #define in1(a) a=read() #define in2(a,b) in1(a),in1(b) #define in3(a,b,c) in2(a,b),in1(c) #define in4(a,b,c,d) in2(a,b),in2(c,d) #define out(a) printf( "%d" , a ) #define out_(a) printf( " %d" , a ) #define outn(a) out(a),putchar('\n') #define I_int int inline I_int read() { I_int x = 0 , f = 1 ; char c = getchar() ; while( c < '0' || c > '9' ) { if( c == '-' ) f = -1 ; c = getchar() ; } while( c >= '0' && c <= '9' ) { x = (x << 1) + (x << 3) + c - 48 ; c = getchar() ; } return x * f ; } #undef I_int using namespace std ; #define N 100010 int n , k ; vector<int>s ; int main() { in1( n ) ; k = -1 ; for( int i = 1 ; i < 500 ; i ++ ) if( i * ( i - 1 ) / 2 == n ) { k = i ; break ; } if( k == -1 ) { return puts("No"),0; } int x = 0 ; for( int i = 0 ; i < k ; i ++ ) { for( int j = i + 1 ; j < k ; j ++ ) { x ++ ; s[ i ].push_back( x ) ; s[ j ].push_back( x ) ; } } puts("Yes"); outn(k); for( int i = 0 ; i < k ; i ++ ) { out((int)s[i].size()); int len = s[ i ].size(); for( int j = 0 ; j < len ; j ++ ) { out_(s[i][j]); } putchar('\n'); } return 0 ; }View Code
还是太菜,还是要继续努力啊QAQ
相关文章推荐
- AtCoder Tenka1 Programmer Beginner Contest D IntegerotS 数学
- 【AtCoder】Tenka1 Programmer Contest(C - F)
- Atcoder Grand Contest 012 B - Splatter Painting解题报告
- AtCoder. Tenka1 Programmer Contest C,D
- AtCoder Beginner Contest 085 最后一题
- Atcoder At Beginner Contest 068 C - Cat Snuke and a Voyage
- Atcoder At Beginner Contest 068 D - Decrease (Contestant ver.)
- AtCoder Beginner Contest 081
- AtCoder Beginner Contest 056 题解挖坑
- DP——AtCoder Beginner Contest 050 #D - Xor Sum
- AtCoder Beginner Contest 063
- AtCoder AtCoder Beginner Contest 063 D - Widespread(二分)
- AtCoder Beginner Contest 083 D题
- AtCoder Beginner Contest 071 D - Coloring Dominoes
- AtCoder Beginner Contest 072
- AtCoder AtCoder Beginner Contest 076 C: Dubious Document 2(set与字典序)
- C - Shopping Street(AtCoder Beginner Contest 080)
- 2018.1.29【 AtCoder Beginner Contest 087-D 】解题报告(TLE)(STL,队列)
- AtCoder AtCoder Beginner Contest 076 C: Dubious Document 2(set与字典序)
- AtCoder Beginner Contest 081 C