- 博客(16)
- 收藏
- 关注
转载 Codeforces Beta Round #7 E Defining Macros
一道关于表达式的题目。。。 思路参考了xhr大大的题解,在此贴上: 算法讨论我们考虑一个宏是否是“安全”的,经过观察和一些实验,可以发现,只有以下4种状态:•状态1(s1):这个宏完全安全,以任何方式使用该宏都没问题。•状态2(s2):这个宏不安全,只要表达式中出现该宏,都会导致表达式不安全。•状态3(s3):这个宏部分安全,仅当这个宏与’*’,’/’连接时,或出现在’-’后面时,才...
2016-02-16 15:10:00
148
转载 小型矩阵库
一套矩阵库,主要实现功能有求特征值&特征向量,求合同标准型。 定义了实矩阵,多项式,多项式矩阵,向量四个类 注释比较详尽 /* Copyright © 2016 by dhd All Right Reserved. */ #include<bits/stdc++.h> #define rep(i, j, k) for(int i = j;i &...
2016-02-14 20:56:00
164
转载 Codeforces #340 div2
A: #include<iostream> using namespace std; int main() { int n; cin>>n; cout<<(n-1)/5+1; } B: #include<iostream> using namespace std; int n; ...
2016-01-28 12:15:00
141
转载 34:最大公约数
#include<iostream> #include<algorithm> using namespace std; int a,b; int gcd(int a,int b) { if(a%b==0) return b; else return gcd(b,a%b); } int main() { while...
2016-01-28 12:12:00
289
转载 14:Flip Game
#include<iostream> #include<string> using namespace std; int a[5][5];int b[5][5]; #define rep(i,j,k) for(int i=j;i<=k;i++) int n=4; string s[20]; void update(int i,int j) ...
2016-01-28 12:11:00
103
转载 10:古代密码
#include<iostream> #include<string> #include<algorithm> using namespace std; int a[30],b[30]; string sa,sb; #define rep(i,j,k) for(int i=j;i<=k;i++) bool cmp(int a,i...
2016-01-28 12:10:00
197
转载 12:求平均年龄
#include<iostream> #include<cstdio> using namespace std; int n; #define rep(i,j,k) for(int i=j;i<=k;i++) int main() { int sum=0; cin>>n; int tmp; ...
2016-01-28 12:10:00
140
转载 07:画家问题
#include<iostream> #include<string> using namespace std; int a[20][20];int b[20][20]; #define rep(i,j,k) for(int i=j;i<=k;i++) int n; string s[20]; void update(int i,int j...
2016-01-28 12:09:00
370
转载 09:放苹果
#include<iostream> using namespace std; int recur(int m,int n) { if(n==1) return 1; if(m==0) return 1; int sum=0; if(m>=n) sum+=recur(m-n,n); sum+=recu...
2016-01-28 12:09:00
114
转载 04:判断闰年
#include<iostream> using namespace std; int a; int main() { cin>>a; if((a%100!=0&&a%4==0)||(a%400==0)) cout<<"Y"; else cout<<"N"; }...
2016-01-28 12:08:00
125
转载 02:Integer Inquiry
#include<iostream> #include<string> using namespace std; int sum[201]; string s; int main() { while(cin>>s&&!(s.length()==1&&s[0]=='0')) { ...
2016-01-28 12:08:00
110
转载 01:浮点数求高精度幂
#include<iostream> #include<string> #include<cstring> using namespace std; int a[201]; string s;int n; #define rep(i,j,k) for(int i=j;i<=k;i++) #define repm(i,j,k) f...
2016-01-28 12:07:00
180
转载 同分异构体个数计数
#include <iostream> #include <cstring> #define DIGIT 4 #define DEPTH 10000 #define MAX 100 using namespace std; typedef int bignum_t[MAX+1]; int read(bignum_t a,i...
2015-10-05 11:49:00
413
转载 控制台小游戏——贪吃蛇
网上看到的一个贪吃蛇程序,修复了一些bug(如可以直接转反方向,苹果与蛇重叠,撞到自身不会死亡等),下面是源代码。 -------------------------------------------------------------------------------------------------- 1 #include<iostream>...
2015-06-02 17:42:00
154
转载 codeforces 548A
A. Mike and Fax time limit per test: 1 second memory limit per test: 256 megabytes input: standard input output :standard output While Mike was walking in the subway, all t...
2015-06-02 17:05:00
121
转载 codeforces 548B
B. Mike and Fun time limit per test: 2 seconds memory limit per test: 256 megabytes input: standard input output: standard output Mike and some bears are playing a game jus...
2015-06-02 11:45:00
112
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅