CF-599B - Spongebob and Joke】的更多相关文章

B. Spongebob and Joke time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output While Patrick was gone shopping, Spongebob decided to play a little trick on his friend. The naughty Sponge browsed th…
一道水题WA那么多发,也是醉了.f看成函数的话,其实就是判断一下反函数存不存在. 坑点,只能在定义域内判断,也就是只判断b[i].没扫一遍前不能确定Impossible. #include<bits/stdc++.h> using namespace std; typedef long long ll; ; int f[maxn], b[maxn], a[maxn]; int g[maxn]; bool mul[maxn]; //#define LOCAL int main() { #ifde…
简单题. #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; +; int n,m; int b[maxn],f[maxn]; int cnt[maxn]; int main() { scanf("%d%d",&n,&m); memset(cnt,,sizeof cnt); ;i<=n;…
B. Spongebob and Joke time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output While Patrick was gone shopping, Spongebob decided to play a little trick on his friend. The naughty Sponge browsed th…
B. Spongebob and Joke time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output While Patrick was gone shopping, Spongebob decided to play a little trick on his friend. The naughty Sponge browsed th…
B. Spongebob and Joke Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/599/problem/B Description While Patrick was gone shopping, Spongebob decided to play a little trick on his friend. The naughty Sponge browsed through Pat…
B. Spongebob and Joke time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output While Patrick was gone shopping, Spongebob decided to play a little trick on his friend. The naughty Sponge browsed th…
B. Spongebob and Joke     While Patrick was gone shopping, Spongebob decided to play a little trick on his friend. The naughty Sponge browsed through Patrick's personal stuff and found a sequence a1, a2, ..., am of length m, consisting of integers fr…
Description While Patrick was gone shopping, Spongebob decided to play a little trick on his friend. The naughty Sponge browsed through Patrick's personal stuff and found a sequence a1, a2, ..., am of length m, consisting of integers from 1 to n, not…
题目链接:http://codeforces.com/problemset/problem/599/D 题意:定义F(n,m)为n行m列的矩阵中方阵的个数,比如3行5列的矩阵,3x3的方阵有3个.2x2的方阵有8个.1X1的方阵有15个,所以F(3,5)=3+8+15=26.现在告诉你F(a,b)=x中的x,要你求出所有满足要求的a,b,并按a递增的顺序输出. 思路:找出n行m列的矩阵中方阵数量的表达式即可,有些小细节需要注意... code: #include <iostream> #inc…