結果
| 問題 | No.3823 Make 1 |
| コンテスト | |
| ユーザー |
蜜蜂
|
| 提出日時 | 2026-11-08 10:57:36 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 10 ms / 2,000 ms |
| + 602µs | |
| コード長 | 449 bytes |
| 記録 | |
| コンパイル時間 | 912 ms |
| コンパイル使用メモリ | 151,556 KB |
| 実行使用メモリ | 9,832 KB |
| 最終ジャッジ日時 | 2026-11-22 12:37:26 |
| 合計ジャッジ時間 | 2,360 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
ソースコード
#include <iostream>
using namespace std;
void solve(){
int n, tot = 0, dif = 0;
string s;
cin >> n >> s;
for(int i = 0; i < n; i++){
tot = (tot + (s[i] - '0' + 1)) % 3;
if(i && s[i] == s[i - 1]) dif = 1;
}
if(tot == 2){
if(n == 1 || dif){
cout << "Yes\n";
return;
}
}
cout << "No\n";
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while(t--){
solve();
}
}
蜜蜂