結果
| 問題 | No.18 うーさー暗号 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-13 20:10:52 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 389 bytes |
| コンパイル時間 | 131 ms |
| コンパイル使用メモリ | 22,912 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-23 14:42:52 |
| 合計ジャッジ時間 | 853 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%s",S);
| ~~~~~^~~~~~~~
ソースコード
#include <stdio.h>
int main(){
//input
char S[1024+1];
scanf("%s",S);
//recover S
for (int i = 0;i < 1025;i++){
if (S[i] != '\0'){
int aAlfIndex = S[i]-65;
int bAlfIndex = (26*100-(i+1)+aAlfIndex)%26;
S[i] = bAlfIndex+65;
}else{
break;
}
}
//output
printf("%s\n",S);
return 0;
}