摘要:
Raucous RockersYou just inherited the rights to N (1 #include
using namespace std;
ifstream cin("rockers.in");
ofstream cout("rockers.out");
const int mm=33;
class node
{ public:int t,c; node(){t=c=0;}
}dp[mm][mm];
int n,t,m;
int s[mm];
int main()
{ while(cin>>n>>t> 阅读全文
摘要:
Electric FenceDon PieleIn this problem, `lattice points' in the plane are points with integer coordinates.In order to contain his cows, Farmer John constructs a triangular electric fence by stringing a "hot" wire from the origin (0,0) to a lattice point [n,m] (00), and then back to the 阅读全文
摘要:
Bracket sequenceGiven stringsmade up with(,),?, count the way to substitude?with(or)to form regular bracket sequence.InputA strings.(1≤|s|≤1000)OuptutAn integer denotes the number of ways modulo(109+7).Sample input????Sample output2思路:dp[x][y]字符串长为x时,左括号还有y个未匹配。#include
#include
using namespace std; 阅读全文
摘要:
E. Ivan the Fool VS Gorynych the Dragontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOnce upon a time in a kingdom far, far away… Okay, let’s start at the point where Ivan the Fool met Gorynych the Dragon. Ivan took out his magic sword and the 阅读全文