結果
| 問題 | No.18 うーさー暗号 | 
| コンテスト | |
| ユーザー |  y_mazun | 
| 提出日時 | 2015-04-24 17:09:20 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 338 bytes | 
| コンパイル時間 | 192 ms | 
| コンパイル使用メモリ | 34,816 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-07 05:40:16 | 
| 合計ジャッジ時間 | 775 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 13 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |   scanf("%s", buff);
      |   ~~~~~^~~~~~~~~~~~
            
            ソースコード
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#include <cstring>
#include <cstdio>
#include <set>
using namespace std;
int main(){
  char buff[1026];
  scanf("%s", buff);
  const int len = strlen(buff);
  const int n = 'z' - 'a' + 1;
  REP(i,len){ buff[i] = (buff[i] - 'A' + (n - 1) * (i + 1)) % n + 'A'; }
  puts(buff);
  return 0;
}
            
            
            
        