最近的文章
codeforces #317 div2 A. Arrays (水)
应该3分钟过的题。。。
结果花了8分钟。。。ssssad
1/************************************************************************* 2 > File Name: code/cf/#317/A.cpp 3 > Author: 111qqz 4 > Email: rkz2013@126.com 5 > Created Time: 2015年08月23日 星期日 00时29分47秒 6 ************************************************************************/ 7 8#include<iostream> 9#include<iomanip> 10#include<cstdio> 11#include<algorithm> 12#include<cmath> 13#include<cstring> 14#include<string> 15#include<map> 16#include<set> 17#include<queue> 18#include<vector> 19#include<stack> 20#include<cctype> 21#define y1 hust111qqz 22#define yn hez111qqz 23#define j1 cute111qqz 24#define ms(a,x) memset(a,x,sizeof(a)) 25#define lr dying111qqz 26using namespace std; 27#define For(i, n) for (int i=0;i<int(n);++i) 28typedef long long LL; 29typedef double DB; 30const int inf = 0x3f3f3f3f; 31const int N=1E5+7; 32int na,nb,k,m; 33int a[N],b[N]; 34int main() 35{ 36 #ifndef ONLINE_JUDGE 37 freopen("in.txt","r",stdin); 38 #endif 39 cin>>na>>nb; 40 cin>>k>>m; 41 for ( int i = 1 ; i <= na ; i++){ 42 scanf("%d",&a[i]); 43 } 44 for ( int i = 1 ; i<= nb ; i++){ 45 scanf("%d",&b[i]); 46 } 47 if (a[k]<b[nb-m+1]){ 48 puts("YES"); 49 } 50 else 51 { 52 puts("NO"); 53 } 54 55 56 #ifndef ONLINE_JUDGE 57 fclose(stdin); 58 #endif 59 return 0; 60}
bc #52 div 2 A ||hdoj5417 Victor and Machine (模拟)
傻逼模拟题
我做了半小时….
sssssad
1/************************************************************************* 2 > File Name: code/bc/#52/1001.cpp 3 > Author: 111qqz 4 > Email: rkz2013@126.com 5 > Created Time: 2015年08月22日 星期六 18时51分44秒 6 ************************************************************************/ 7#include<iostream> 8#include<iomanip> 9#include<cstdio> 10#include<algorithm> 11#include<cmath> 12#include<cstring> 13#include<string> 14#include<map> 15#include<set> 16#include<queue> 17#include<vector> 18#include<stack> 19#include<cctype> 20#define y1 hust111qqz 21#define yn hez111qqz 22#define j1 cute111qqz 23#define ms(a,x) memset(a,x,sizeof(a)) 24#define lr dying111qqz 25using namespace std; 26#define For(i, n) for (int i=0;i<int(n);++i) 27typedef long long LL; 28typedef double DB; 29const int inf = 0x3f3f3f3f; 30const int N=1E6+7; 31int main() 32{ 33 #ifndef ONLINE_JUDGE 34 freopen("in.txt","r",stdin); 35 #endif 36 int x,y,w,n; 37 while (scanf("%d%d%d%d",&x,&y,&w,&n)!=EOF){ 38 int num = 1; 39 int cnt; 40 int q; 41 bool on = true; 42 bool flag = false; 43 int t = 0; 44 while (t<N&&!flag){ 45 if (num==n) { 46 cout<<t<<endl; 47 flag = true; 48 break; 49 } 50 cnt = t+x; 51 q = 0; 52 while (t<cnt){ 53 q++; 54 t++; 55 if (q%w==0){ 56// cout<<"aaat:"<<t<<endl; 57 num++; 58 } 59 if (num == n){ 60 cout<<t<<endl; 61 flag = true; 62 break; 63 } 64 } 65 on = false; 66 t = t + y; 67 on = true; 68 num++; 69 if (num==n){ 70 cout<<t<<endl; 71 flag = true; 72 } 73 } 74 } 75 #ifndef ONLINE_JUDGE 76 fclose(stdin); 77 #endif 78 return 0; 79}
bc #52 div 2 B || hdoj 5418 Victor and World(tsp问题,状压dp)
比赛的时候一看,tsp么
前些天好像刚写过一个clean robot什么的
acm输出输出技巧(提交oj不需要改变)
1int main() 2 { 3 int a,b; 4 #ifndef ONLINE_JUDGE 5 freopen("in.txt","r",stdin); 6 #endif 7 // int a,b; 8 while (scanf("%d%d",&a,&b)!=EOF){ 9 cout<<a+b<<endl; 10 } 11 #ifndef ONLINE_JUDGE 12 fclose(stdin); 13 #endif 14 return 0; 15 } 这样写比较爽
poj 2909 Goldbach's Conjecture (哥德巴赫猜想)
·1 分钟
水题
写一遍的目的是。。。复习一下快速筛的写法 喵呜
1/************************************************************************* 2 > File Name: code/poj/2909.cpp 3 > Author: 111qqz 4 > Email: rkz2013@126.com 5 > Created Time: 2015年08月22日 星期六 14时25分34秒 6 ************************************************************************/ 7 8#include<iostream> 9#include<iomanip> 10#include<cstdio> 11#include<algorithm> 12#include<cmath> 13#include<cstring> 14#include<string> 15#include<map> 16#include<set> 17#include<queue> 18#include<vector> 19#include<stack> 20#define y0 abc111qqz 21#define y1 hust111qqz 22#define yn hez111qqz 23#define j1 cute111qqz 24#define tm crazy111qqz 25#define lr dying111qqz 26using namespace std; 27#define REP(i, n) for (int i=0;i<int(n);++i) 28typedef long long LL; 29typedef unsigned long long ULL; 30const int inf = 0x3f3f3f3f; 31const int N=1<<16; 32bool not_prime[N]; 33int prime[N]; 34int prime_num; 35int n; 36 37void init(){ 38 not_prime[0] = true; 39 not_prime[1] = true; 40 for ( int i =2 ; i < N ; i++){ 41 if (!not_prime[i]){ 42 prime[++prime_num] = i; 43 } 44 for ( int j = 1 ; j <= prime_num&&i*prime[j]<N ; j++){ 45 not_prime[i*prime[j]] = true; 46 if (i%prime[j]==0) break; 47 } 48 } 49} 50int main() 51{ 52 init(); 53 int n ; 54 while (scanf("%d",&n)&&n){ 55 int ans = 0 ; 56 for ( int i = 2 ; i <= n /2 ; i++){ 57 if (!not_prime[i]&&!not_prime[n-i]){ 58 ans++; 59 } 60 } 61 printf("%d\n",ans); 62 } 63 64 return 0; 65}
HUST team contest #E A Mountain Road||poj 3846 (dp)
比赛的时候以为是贪心…
想了好久.
不过最后没敢写,因为没办法证明正确性,只是直觉==