1421A. XORwice 题目链接:Click Here // Author : RioTian // Time : 20/10/18 #include <bits/stdc++.h> #define ms(a, b) memset(a, b, sizeof a) using namespace std; typedef long long ll; ll n, m, _; void solve() { cin >> n >> m; cout << (n…
思路:直接暴力判断就OK了 #include<bits/stdc++.h> using namespace std; #define int long long signed main(){ int _;cin>>_; while(_--){ string str; cin>>str; ){ ]!='?'){ cout<<str<<'\n'; }else{ printf("a\n"); } continue; } ; ;i&l…
Codeforces Round #297 (Div. 2)A. Vitaliy and Pie Time Limit: 2 Sec  Memory Limit: 256 MBSubmit: xxx  Solved: 2xx 题目连接 http://codeforces.com/contest/525/problem/A Description After a hard day Vitaly got very hungry and he wants to eat his favorite pot…
题目链接:Codeforces Round #298 (Div. 2) A. Exam An exam for n students will take place in a long and narrow room, so the students will sit in a line in some order. The teacher suspects that students with adjacent numbers (i and i + 1) always studied side…
Codeforces Round #267 (Div. 2) C. George and Job题目链接请点击~ The new ITone 6 has been released recently and George got really keen to buy it. Unfortunately, he didn't have enough money, so George was going to work as a programmer. Now he faced the follow…
比赛链接:https://codeforces.com/contest/1421 A. XORwice 题意 给出两个正整数 \(a.b\),计算 \((a \oplus x) + (b \oplus x)\) 的最小值. 题解 \[\begin{equation} a+b = a \oplus b + ((a\ \&\ b)<<1) \end{equation} \] \[\begin{equation} (a \oplus x) + (b \oplus x) = ((a \oplu…
题目链接:XORwice 题意:给你两个数a.b.求一个数x,使得((a异或x)+(b异或x))这个值最小,输出最小那个x 题解: 输出(a|b)-(a&b)就行(猜了一手 代码: #include<stdio.h> #include<string.h> #include<algorithm> #include<iostream> #include<queue> #include<vector> #define mem(x)…
A. Nicholas and Permutation 题目连接: http://www.codeforces.com/contest/676/problem/A Description Nicholas has an array a that contains n distinct integers from 1 to n. In other words, Nicholas has a permutation of size n. Nicholas want the minimum eleme…
C. Vladik and fractions 题目链接 http://codeforces.com/contest/743/problem/C 题面 Vladik and Chloe decided to determine who of them is better at math. Vladik claimed that for any positive integer n he can represent fraction as a sum of three distinct posit…
A. Vladik and flights 题目链接 http://codeforces.com/contest/743/problem/A 题面 Vladik is a competitive programmer. This year he is going to win the International Olympiad in Informatics. But it is not as easy as it sounds: the question Vladik face now is…