結果
問題 | No.18 うーさー暗号 |
ユーザー |
![]() |
提出日時 | 2020-02-28 22:36:43 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 464 bytes |
コンパイル時間 | 1,361 ms |
コンパイル使用メモリ | 167,956 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-13 18:28:08 |
合計ジャッジ時間 | 2,063 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n)for(long long i=0;i<(n);i++) using namespace std; typedef long long ll; const int MOD=1e9+7; const int MAX = 510000; const double pi=acos(-1); int main(){ string s; cin >> s; rep(i,s.size()){ int num=(i+1)%26; if('A'<= char(s[i]-num) && char(s[i]-num)<='Z') s[i]=char(s[i]-num); else if(char(s[i]-num)<'A') s[i]=char(s[i]-num+26); else s[i]=char(s[i]-num-26); } cout << s << endl; return 0; }