SMU Spring 2023 Contest Round 2(待补】的更多相关文章

1001 数长方形 题目大意 平面内有N条平行于坐标轴的线段,且不会在端点处相交 问共形成多少个矩形 算法思路 枚举4条线段的全部组合.分别作为矩形四条边.推断是否合法 时间复杂度: O(N4) 代码 /** * Copyright © 2015 Authors. All rights reserved. * * FileName: A.cpp * Author: Beiyu Li <sysulby@gmail.com> * Date: 2015-06-06 */ #include <c…
A I'm bored with life 水题 #include<bits/stdc++.h> using namespace std; typedef long long int LL; const LL N=1,M=1,MOD=1; int main() {//freopen("t.txt","r",stdin); ios::sync_with_stdio(false); LL a,b; scanf("%I64d%I64d",&…
A Mister B and Book Reading  O(n)暴力即可 #include<bits/stdc++.h> using namespace std; typedef long long int LL; const LL N=1,M=1,MOD=1; int main() {//freopen("t.txt","r",stdin); int c,v0,v1,a,l; scanf("%d%d%d%d%d",&c,&…
A Okabe and Future Gadget Laboratory 暴力 #include<bits/stdc++.h> using namespace std; typedef long long int LL; const LL N=51,M=1,MOD=1; int num[N][N]; int main() { ios::sync_with_stdio(false); //freopen("t.txt","r",stdin); int n;…
A Karen and Morning 水题 注意进位即可 #include<bits/stdc++.h> using namespace std; typedef long long int LL; int a,b; bool pal() { if((a%10)==(b/10)&&(a/10)==(b%10))return true; else return false; } void add() { b+=1; while(b>=60)b-=60,a+=1; whil…
A Treasure Hunt 注意负数和0的特殊处理.. 水题.. 然而又被Hack了 吗的智障 #include<bits/stdc++.h> using namespace std; int main() { int sa,sb,da,db,x,y; scanf("%d%d%d%d%d%d",&sa,&sb,&da,&db,&x,&y); sa=da-sa;sb=db-sb; if(sa<0)sa*=-1; if(…
A An abandoned sentiment from past 水题 #include<bits/stdc++.h> using namespace std; int a[300],b[300],n,k; bool cmp(int a,int b) { return a>b; } int main() {//freopen("t.txt","r",stdin); scanf("%d%d",&n,&k); f…
A Sagheer and Crossroads 水题略过(然而被Hack了 以后要更加谨慎) #include<bits/stdc++.h> using namespace std; int main() { //freopen("t.txt","r",stdin); int a[4][4]; //memset(a,0,sizeof(a)); for(int i=0;i<4;i++) for(int j=0;j<4;j++) scanf(&…
A. Thanos Sort time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Thanos sort is a supervillain sorting algorithm, which works as follows: if the array is not sorted, snap your fingers* to rem…
A. Vladik and Courtesy 水题略过 #include<cstdio> #include<cstdlib> #include<cmath> using namespace std; typedef long long int LL; int main() { LL a,b; scanf("%I64d%I64d",&a,&b); LL num=1; while(true) { if(a<num){printf(&…