Submission #56948


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define itn int
#define mod 1000000007
#define am 998244353
#define INFi 2147483647
#define INFl 9223372036854775807LL
#define fi first
#define se second
#define be begin()
#define en end()
int abs(int a,int b){
int c=max(a,b)-min(a,b);
return c;
}
int gcd(int a,int b){//最大公約数
int c=a%b;
while(true){
if(c==0) break;
a=b;
b=c;
c=a%b;
}
return b;
}
bool IsPrime(int num){
if (num < 2) return false;
else if (num == 2) return true;
else if (num % 2 == 0) return false;
double sqrtNum = sqrt(num);
for(int i=3;i<=sqrtNum;i+=2){
if(num%i==0){
return false;
}
}
}
int lcm(int a,int b){//最小公倍数
return (a*b)/gcd(a,b);
}
int x[1000000][70];
pair<int,int> pi[2];
signed main(){
// __builtin_ctz(N); Nを2で何回割り切れるかを返す
//(n+1)*n/2; 1からNまでの総和を求める式
cin.tie(0);
ios::sync_with_stdio(false);
int a,b,d;
string c;
cin>>a>>b>>c;
if(c=="&") d=(a&b);
else{
if(c=="|") d=(a|b);
else{
if(c=="^") d=(a^b);
else{
if(c=="<") d=(a<<b);
if(c==">") d=(a>>b);
}
}
}
cout<<d<<"\n";
}

ステータス

項目 データ
問題 0572 - びっとえんざん!!
ユーザー名 ei1941
投稿日時 2019-12-06 16:16:19
言語 C++14
状態 Accepted
得点 1
ソースコード長 1311 Byte
最大実行時間 24 ms
最大メモリ使用量 680 KB

セット

セット 得点 Cases
1 ALL 1 / 1 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input01 AC 23 ms 600 KB
1
input02 AC 24 ms 680 KB
1
input03 AC 19 ms 504 KB
1
input04 AC 18 ms 584 KB
1
input05 AC 22 ms 544 KB
1
input06 AC 18 ms 504 KB
1
input07 AC 20 ms 460 KB
1
input08 AC 20 ms 548 KB
1
input09 AC 21 ms 636 KB
1