結果
問題 | No.18 うーさー暗号 |
ユーザー |
![]() |
提出日時 | 2017-08-18 16:01:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 668 bytes |
コンパイル時間 | 1,949 ms |
コンパイル使用メモリ | 191,748 KB |
最終ジャッジ日時 | 2025-01-05 02:23:06 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:19:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | scanf("%s",s); | ~~~~~^~~~~~~~
ソースコード
#include<bits/stdc++.h>typedef long long ll;typedef unsigned long long ull;using namespace std;#define pb push_backint dy[]={0, 0, 1, -1, 1, 1, -1, -1};int dx[]={1, -1, 0, 0, 1, -1, -1, 1};#define FOR(i,a,b) for (int i=(a);i<(b);i++)#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)#define REP(i,n) for (int i=0;i<(n);i++)#define RREP(i,n) for (int i=(n)-1;i>=0;i--)#define mp make_pair#define fi first#define sc secondint main(){char s[2000];scanf("%s",s);int n = strlen(s);REP(i,n){int j = i % 26;s[i] = ((s[i] - 'A') - j - 1 + 26) % 26 + 'A';printf("%c",s[i]);}printf("\n");return 0;}