Submission #00048
ソースコード
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 | #include <bits/stdc++.h> #define ll long long #define gcd(x,y) __gcd(x,y) #define lcm(x,y) x/(__gcd(x,y))*y #define so(a) sort(a.begin(),a.end()) #define sor(a) sort(a.begin(),a.end(),greater<int>()) using namespace std; int main(){ string n, c, s; cin >> n >> c >> s; for ( int i = 0; i < s.size(); i++){ int kaku = n[i] - '0' ; if (c[i] == 'M' ){ if (s[i] + kaku > 90){ s[i] = s[i] + kaku - 90 + 64; } else { s[i] = s[i] + kaku; } } else { if (s[i] - kaku < 65){ s[i] = 91 - (65 - (s[i] - kaku)) ; } else { s[i] = s[i] - kaku; } } } for ( int i = 0; i < s.size(); i++){ cout << s[i]; } cout << "\n" ; return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0001 - Let's Nazotoki! |
ユーザー名 | ei2207 |
投稿日時 | 2023-07-18 16:28:15 |
言語 | C++ |
状態 | Accepted |
得点 | 100 |
ソースコード長 | 846 Byte |
最大実行時間 | 22 ms |
最大メモリ使用量 | 516 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 100 / 100 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in-01.txt | AC | 22 ms | 476 KB |
1
|
in-02.txt | AC | 15 ms | 444 KB |
1
|
in-03.txt | AC | 16 ms | 416 KB |
1
|
in-04.txt | AC | 22 ms | 388 KB |
1
|
in-05.txt | AC | 17 ms | 364 KB |
1
|
in-06.txt | AC | 20 ms | 340 KB |
1
|
in-07.txt | AC | 20 ms | 440 KB |
1
|
in-08.txt | AC | 15 ms | 416 KB |
1
|
in-09.txt | AC | 19 ms | 516 KB |
1
|
in-10.txt | AC | 17 ms | 484 KB |
1
|