2022/6/24
作者:
史一帆
,
2022-06-24 08:32:48
,
所有人可见
,
阅读 214
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 110;
int main()
{
int T;
cin >> T;
while (T -- ){
int ha, ma, sa, hb, mb, sb;
cin >> ha >> ma >> sa >> hb >> mb >> sb;
int hour = ha + hb;
int minute = ma + mb;
int second = sa + sb;
minute += second / 60, second %= 60;
hour += minute / 60, minute %= 60;
cout << hour << ' ' << minute << ' ' << second << endl;
}
return 0;
}
#include <iostream>
#include <cstring>
#include <algorithm>
#include <set>
using namespace std;
const int N = 110;
int arr[N];
int n, m;
set<int> st;
int main()
{
while (cin >> n >> m){
if (!n && !m) break;
st.clear();
for (int i = 1; i <= n; i ++ ) cin >> arr[i];
sort(arr+1, arr+1+n);
while (m -- ){
int x;
cin >> x;
st.insert(x);
}
bool flag = false;
for (int i = 1; i <= n; i ++ )
if (!st.count(arr[i])){
cout << arr[i] << ' ';
flag = true;
}
if (!flag) puts("NULL");
else cout << endl;
}
return 0;
}
#include <iostream>
#include <cstring>
#include <algorithm>
#include <set>
using namespace std;
const int N = 110;
typedef long long LL;
int a, b;
int qmi(int a, int k){
int res = 1 % 1000;
while (k){
if (k & 1) res = (LL)res * a % 1000;
a = (LL)a * a % 1000;
k >>= 1;
}
return res;
}
int main()
{
while (cin >> a >> b){
if (!a && !b) break;
cout << qmi(a, b) << endl;
}
return 0;
}