結果
| 問題 | 
                            No.2649 [Cherry 6th Tune C] Anthem Flower
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-03-04 00:11:00 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 395 bytes | 
| コンパイル時間 | 2,045 ms | 
| コンパイル使用メモリ | 192,556 KB | 
| 最終ジャッジ日時 | 2025-02-20 00:39:28 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 9 WA * 26 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int T;
    cin >> T;
    while(T--){
        string s;
        int m;
        cin >> s >> m;
        ll n = 0;
        for(int i = 0; i < s.size(); i++){
            n = (n * 10 + s[i] - '0') % m;
        }
        cout << (n * (n + 1) / 2) % m << '\n';
    }
}