再发1次,10分求助

P5707 【深基2.例12】上学迟到

@[panrong](/user/1044970) @~~$[panrong](/user/1044970)$~~ ```cpp #include <bits/stdc++.h> using namespace std; int main() { int s,v,t=0; cin>>s>>v; t=s/v; if(s%v>=1)t++; t+=10; if(t<=480) { if((8*60-t)/60<10)cout<<0; cout<<(8*60-t)/60<<":"; if((8*60-t)%60<10)cout<<0; cout<<(8*60-t)%60; }else { if((24*60+8*60-t)/60<10)cout<<0; cout<<(24*60+8*60-t)/60<<":"; if((24*60+8*60-t)%60<10)cout<<0; cout<<(24*60+8*60-t)%60; } return 0; } ```
by shb20111113 @ 2023-10-25 17:02:27


@[shb20111113](/user/1003721) ~~不太懂~~
by panrong @ 2023-10-25 17:18:55


先算出时间,分两种情况看,$else$是算超过一天的,$if$是算没超一天的。`if((24*60+8*60-t)/60<10)cout<<0;和if((8*60-t)%60<10)cout<<0;还有其他的等等……` 这些是在算小于十补0的情况 @[panrong](/user/1044970) $@[panrong](/user/1044970)$ ~~抱歉回晚了~~
by shb20111113 @ 2023-10-26 16:50:14


@[panrong](/user/1044970) @[[panrong](/user/1044970)](/user/1044970) @[panrong](/user/1044970) @[[panrong](/user/1044970)](/user/1044970) @[panrong](/user/1044970) @[[panrong](/user/1044970)](/user/1044970) $${[panrong](/user/1044970)}$$ {_**PANRONG**_} ```cpp ```cpp ``` #include<bits/stdc++.h>
by shb20111113 @ 2023-10-27 17:06:00


@[panrong](/user/1044970) $ {\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}} $ $ \text{[panrong](/user/1044970)} $ $ \textcolor{#22AB22}{p +a + n+r+o+n+g} $
by shb20111113 @ 2023-11-03 18:25:49


>报名了比赛 [【LGR-169-Div.2】洛谷 12 月月赛 II & HCOI R1 ](https://www.luogu.com.cn/contest/149175)【LGR-169-Div.2】洛谷 12 月月赛 II & HCOI R1 ,祝Ta在比赛中取得好成绩!
by shb20111113 @ 2023-12-15 15:40:11


$\KaTeX$ $p + \textcolor{#22AB22}{a+}n$ $\begin{aligned} \cos(2 \theta) &= \cos^2(\theta) - \sin^2(\theta) \\ &= 2 \cos^2(\theta) - 1 \end{aligned}$ $\text{对任意的 } x > 0 \text{,有 } f(x) > 0 \text{。}$ $\sum_{k = 1}^{n} \frac{1}{k}$ ``` $\KaTeX$ $a + \textcolor{#22AB22}{a + {}} a$ $\begin{aligned} \cos(2 \theta) &= \cos^2(\theta) - \sin^2(\theta) \\ &= 2 \cos^2(\theta) - 1 \end{aligned}$ $\text{对任意的 } x > 0 \text{,有 } f(x) > 0 \text{。}$ $\sum_{k = 1}^{n} \frac{1}{k}$ ```
by shb20111113 @ 2023-12-15 15:50:21


```cpp ``` #include<iostream> #include<cstring> #include<cstdlib> using namespace std; int n,m,a[123][125],kg,q,w,e,r,v[105][105],xx[]={-1,1,0,0},yy[]={0,0,1,-1},ans; int d[100005],l[100005]; void f(int x,int y){ if(x==n&&y==m){ cout<<1<<" "<<1<<endl; for(int i=1;i<=kg;i++){ cout<<d[i]<<" "<<l[i]<<endl; } ans=1; exit(0); } for(int i=0;i<4;i++){ int dx=x+xx[i],dy=y+yy[i]; if(dx>=1&&dx<=n&&dy>=1&&dy<=m&&!a[dx][dy]&&!v[dx][dy]){ ++kg; d[kg]=dx; l[kg]=dy; v[dx][dy]=1; f(dx,dy); l[kg]=0; d[kg]=0; --kg; } } } int main(){ cin>>n>>m; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ char x; cin>>x; if(x=='.') a[i][j]=0; else {a[i][j]=1;} } } f(1,1); if(!ans) return 0; return 0; }
by shb20111113 @ 2023-12-15 15:52:14


# 「Cfz Round 3」Xor with Gcd ## 题目描述 给定一个整数 $n$。 你需要求出 $\bigoplus\limits_{i=1}^{n} \gcd(i,n)$,即 $\gcd(1,n) \oplus \gcd(2,n) \oplus \cdots \oplus \gcd(n,n)$ 的值。其中 $\gcd(a,b)$ 表示 $a$ 和 $b$ 的**最大公约数**,$\bigoplus$ 表示**按位异或**,即 C++ 中的 `^`。 ## 输入格式 **本题有多组测试数据。** 第一行输入一个整数 $T$,表示测试数据组数。 接下来依次输入每组测试数据。对于每组测试数据,输入一行一个整数 $n$。 ## 输出格式 对于每组测试数据,输出一行一个整数,表示 $\bigoplus\limits_{i=1}^{n} \gcd(i,n)$ 的值。 ## 样例 #1 ### 样例输入 #1 ``` 3 2 3 6 ``` ### 样例输出 #1 ``` 3 3 5 ``` ## 提示 #### 「样例解释 #1」 对于第 $1$ 组数据,$\bigoplus\limits_{i=1}^{2} \gcd(i,2)=\gcd(1,2)\oplus\gcd(2,2)=1\oplus2=3$。 对于第 $2$ 组数据,$\bigoplus\limits_{i=1}^{3} \gcd(i,3)=\gcd(1,3)\oplus\gcd(2,3)\oplus\gcd(3,3)=1\oplus1\oplus3=3$。 #### 「数据范围」 对于所有数据,$1 \le T \le 100$,$1 \le n \le 10^{18}$。 **只有你通过本题的所有测试点,你才能获得本题的分数。**
by shb20111113 @ 2023-12-31 14:55:55


$\equiv$
by shb20111113 @ 2024-01-06 14:56:43


| 下一页