CF 第18场 简单题目一览表
来源:互联网 发布:剑三五毒成女捏脸数据 编辑:程序博客网 时间:2024/06/09 23:28
A:A:#include<iostream>#include<cstdio>#define sqr(x) ((x)*(x))using namespace std;int wx[4] = { -1 , 0 , 1 , 0 };int wy[4] = { 0 , -1 , 0 , 1 };struct point { int x , y;};point P[3];int dist2( point A , point B ) { return sqr( A.x - B.x ) + sqr( A.y - B.y );}bool check() { int a = dist2( P[0] , P[1] ); int b = dist2( P[0] , P[2] ); int c = dist2( P[1] , P[2] ); if ( a == 0 || b == 0 || c == 0 ) return false; if ( a > c ) swap( a , c ); if ( b > c ) swap( b , c ); return ( a + b - c == 0 );}int main() { cin >> P[0].x >> P[0].y >> P[1].x >> P[1].y >> P[2].x >> P[2].y; if ( check() ) { printf( "RIGHT\n" ); return 0; } for ( int i = 0 ; i < 3 ; i++ ) for ( int j = 0 ; j < 4 ; j++ ) { P[i].x += wx[j]; P[i].y += wy[j]; if ( check() ) { printf( "ALMOST\n" ); return 0; } P[i].x -= wx[j]; P[i].y -= wy[j]; } printf( "NEITHER\n" ); return 0;}B:#include<iostream>#include<cstdio>using namespace std;int n,d,m,l;int main(){ //freopen("//media/学习/ACM/input.txt","r",stdin); while(~scanf("%d%d%d%d",&n,&d,&m,&l)) { long long a,b,idx=0,k=1; while(k<=n) { a=k*l+(k-1)*(m-l); b=k*m-1; if(a/d!=b/d)break; k++; } printf("%lld\n",(a/d)*d+d); } return 0;}C
C
#include <iostream>#include <vector>#include <string>#include <math.h>#include <ctype.h>#include <stack>#include <queue>#include <map>#include <set>using namespace std;int main(){int n;cin >> n;vector <int> arr(n);int s1=0,s2=0;int a = 0;for (int i = 0; i < n; i ++){cin >> arr[i];s2 += arr[i];}for (int i = 0; i < n-1; i ++){s1 += arr[i];s2 -= arr[i];if (s1 == s2)a ++;}cout << a;return 0;}
- CF 第18场 简单题目一览表
- CF拉练第一场
- 第一场cf
- CF题目清单
- CF 题目小记sel
- 一些CF题目
- 最近两场cf总结
- 第18周oj平台题目②--帮警长数一数【循环、分支简单综合】
- 第一周CF
- 某场CF B Octagons(模拟)
- cf 教育场4 ,区间交集个数
- 我的第一场CF小结
- ZOJ第1240题 灰常简单的题目
- cf div_124_a(简单博弈)
- CF-18D - Seller Bob(贪心+简单大数)
- hdu 5301 Buildings (2015多校第二场第2题) 简单模拟
- CRF简单随机场
- 各大公司的笔试题目类型一览表
- Swift云存储技术详解:综述与概念
- javaWeb之schema
- acm
- ContentProvider 彩信数据访问
- 2012中国互联网十大雷人雷事
- CF 第18场 简单题目一览表
- SNMPv2协议The InformRequest-PDU
- 01 web开发入门
- 字符串扩展距离问题
- 网站学习备忘008——相关路径备忘
- VisualSVN Server 和 TortoiseSVN的安装
- Java调用Windows批处理或Linux脚本或可执行文件
- java.lang.IllegalStateException: No match found错误
- Freemarker的过滤类