結果
| 問題 | 
                            No.1915 Addition 
                             | 
                    
| コンテスト | |
| ユーザー | 
                             umezo
                         | 
                    
| 提出日時 | 2022-04-29 22:24:49 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 475 bytes | 
| コンパイル時間 | 1,965 ms | 
| コンパイル使用メモリ | 193,272 KB | 
| 最終ジャッジ日時 | 2025-01-28 23:08:15 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | WA * 10 | 
ソースコード
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
int main(){
  int t;
  cin>>t;
  while(t--){
    ll n;
    cin>>n;
    string s=to_string(n);
    int k=s.size();
    bool b=true;
    rep(i,k) if(s[i]!='9') b=false;
    ll m=1;
    rep(i,k) m*=10;
    if(b) m*=9;
    else{
      m--;
      m-=n;
    }
    cout<<m<<endl;
  }
  
  return 0; 
}
            
            
            
        
            
umezo